google_cloud_netapp_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// ListActiveDirectoriesRequest for requesting multiple active directories.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct ListActiveDirectoriesRequest {
42 /// Required. Parent value for ListActiveDirectoriesRequest
43 pub parent: std::string::String,
44
45 /// Requested page size. Server may return fewer items than requested.
46 /// If unspecified, the server will pick an appropriate default.
47 pub page_size: i32,
48
49 /// A token identifying a page of results the server should return.
50 pub page_token: std::string::String,
51
52 /// Filtering results
53 pub filter: std::string::String,
54
55 /// Hint for how to order the results
56 pub order_by: std::string::String,
57
58 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl ListActiveDirectoriesRequest {
62 /// Creates a new default instance.
63 pub fn new() -> Self {
64 std::default::Default::default()
65 }
66
67 /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
68 ///
69 /// # Example
70 /// ```ignore,no_run
71 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
72 /// let x = ListActiveDirectoriesRequest::new().set_parent("example");
73 /// ```
74 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75 self.parent = v.into();
76 self
77 }
78
79 /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
80 ///
81 /// # Example
82 /// ```ignore,no_run
83 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
84 /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
85 /// ```
86 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
87 self.page_size = v.into();
88 self
89 }
90
91 /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
92 ///
93 /// # Example
94 /// ```ignore,no_run
95 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
96 /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
97 /// ```
98 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99 self.page_token = v.into();
100 self
101 }
102
103 /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
104 ///
105 /// # Example
106 /// ```ignore,no_run
107 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
108 /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
109 /// ```
110 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111 self.filter = v.into();
112 self
113 }
114
115 /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
116 ///
117 /// # Example
118 /// ```ignore,no_run
119 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
120 /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
121 /// ```
122 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123 self.order_by = v.into();
124 self
125 }
126}
127
128impl wkt::message::Message for ListActiveDirectoriesRequest {
129 fn typename() -> &'static str {
130 "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
131 }
132}
133
134/// ListActiveDirectoriesResponse contains all the active directories requested.
135#[derive(Clone, Default, PartialEq)]
136#[non_exhaustive]
137pub struct ListActiveDirectoriesResponse {
138 /// The list of active directories.
139 pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
140
141 /// A token identifying a page of results the server should return.
142 pub next_page_token: std::string::String,
143
144 /// Locations that could not be reached.
145 pub unreachable: std::vec::Vec<std::string::String>,
146
147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
148}
149
150impl ListActiveDirectoriesResponse {
151 /// Creates a new default instance.
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 google_cloud_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 /// Creates a new default instance.
240 pub fn new() -> Self {
241 std::default::Default::default()
242 }
243
244 /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
245 ///
246 /// # Example
247 /// ```ignore,no_run
248 /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
249 /// let x = GetActiveDirectoryRequest::new().set_name("example");
250 /// ```
251 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
252 self.name = v.into();
253 self
254 }
255}
256
257impl wkt::message::Message for GetActiveDirectoryRequest {
258 fn typename() -> &'static str {
259 "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
260 }
261}
262
263/// CreateActiveDirectoryRequest for creating an active directory.
264#[derive(Clone, Default, PartialEq)]
265#[non_exhaustive]
266pub struct CreateActiveDirectoryRequest {
267 /// Required. Value for parent.
268 pub parent: std::string::String,
269
270 /// Required. Fields of the to be created active directory.
271 pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
272
273 /// Required. ID of the active directory to create. Must be unique within the
274 /// parent resource. Must contain only letters, numbers and hyphen, with the
275 /// first character a letter , the last a letter or a number, and a 63
276 /// character maximum.
277 pub active_directory_id: std::string::String,
278
279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
280}
281
282impl CreateActiveDirectoryRequest {
283 /// Creates a new default instance.
284 pub fn new() -> Self {
285 std::default::Default::default()
286 }
287
288 /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
289 ///
290 /// # Example
291 /// ```ignore,no_run
292 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
293 /// let x = CreateActiveDirectoryRequest::new().set_parent("example");
294 /// ```
295 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
296 self.parent = v.into();
297 self
298 }
299
300 /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
301 ///
302 /// # Example
303 /// ```ignore,no_run
304 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
305 /// use google_cloud_netapp_v1::model::ActiveDirectory;
306 /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
307 /// ```
308 pub fn set_active_directory<T>(mut self, v: T) -> Self
309 where
310 T: std::convert::Into<crate::model::ActiveDirectory>,
311 {
312 self.active_directory = std::option::Option::Some(v.into());
313 self
314 }
315
316 /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
317 ///
318 /// # Example
319 /// ```ignore,no_run
320 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
321 /// use google_cloud_netapp_v1::model::ActiveDirectory;
322 /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
323 /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
324 /// ```
325 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
326 where
327 T: std::convert::Into<crate::model::ActiveDirectory>,
328 {
329 self.active_directory = v.map(|x| x.into());
330 self
331 }
332
333 /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
334 ///
335 /// # Example
336 /// ```ignore,no_run
337 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
338 /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
339 /// ```
340 pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
341 mut self,
342 v: T,
343 ) -> Self {
344 self.active_directory_id = v.into();
345 self
346 }
347}
348
349impl wkt::message::Message for CreateActiveDirectoryRequest {
350 fn typename() -> &'static str {
351 "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
352 }
353}
354
355/// UpdateActiveDirectoryRequest for updating an active directory.
356#[derive(Clone, Default, PartialEq)]
357#[non_exhaustive]
358pub struct UpdateActiveDirectoryRequest {
359 /// Required. Field mask is used to specify the fields to be overwritten in the
360 /// Active Directory resource by the update.
361 /// The fields specified in the update_mask are relative to the resource, not
362 /// the full request. A field will be overwritten if it is in the mask. If the
363 /// user does not provide a mask then all fields will be overwritten.
364 pub update_mask: std::option::Option<wkt::FieldMask>,
365
366 /// Required. The volume being updated
367 pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
368
369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
370}
371
372impl UpdateActiveDirectoryRequest {
373 /// Creates a new default instance.
374 pub fn new() -> Self {
375 std::default::Default::default()
376 }
377
378 /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
379 ///
380 /// # Example
381 /// ```ignore,no_run
382 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
383 /// use wkt::FieldMask;
384 /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
385 /// ```
386 pub fn set_update_mask<T>(mut self, v: T) -> Self
387 where
388 T: std::convert::Into<wkt::FieldMask>,
389 {
390 self.update_mask = std::option::Option::Some(v.into());
391 self
392 }
393
394 /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
399 /// use wkt::FieldMask;
400 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
401 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
402 /// ```
403 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
404 where
405 T: std::convert::Into<wkt::FieldMask>,
406 {
407 self.update_mask = v.map(|x| x.into());
408 self
409 }
410
411 /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
412 ///
413 /// # Example
414 /// ```ignore,no_run
415 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
416 /// use google_cloud_netapp_v1::model::ActiveDirectory;
417 /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
418 /// ```
419 pub fn set_active_directory<T>(mut self, v: T) -> Self
420 where
421 T: std::convert::Into<crate::model::ActiveDirectory>,
422 {
423 self.active_directory = std::option::Option::Some(v.into());
424 self
425 }
426
427 /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
428 ///
429 /// # Example
430 /// ```ignore,no_run
431 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
432 /// use google_cloud_netapp_v1::model::ActiveDirectory;
433 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
434 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
435 /// ```
436 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
437 where
438 T: std::convert::Into<crate::model::ActiveDirectory>,
439 {
440 self.active_directory = v.map(|x| x.into());
441 self
442 }
443}
444
445impl wkt::message::Message for UpdateActiveDirectoryRequest {
446 fn typename() -> &'static str {
447 "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
448 }
449}
450
451/// DeleteActiveDirectoryRequest for deleting a single active directory.
452#[derive(Clone, Default, PartialEq)]
453#[non_exhaustive]
454pub struct DeleteActiveDirectoryRequest {
455 /// Required. Name of the active directory.
456 pub name: std::string::String,
457
458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
459}
460
461impl DeleteActiveDirectoryRequest {
462 /// Creates a new default instance.
463 pub fn new() -> Self {
464 std::default::Default::default()
465 }
466
467 /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
468 ///
469 /// # Example
470 /// ```ignore,no_run
471 /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
472 /// let x = DeleteActiveDirectoryRequest::new().set_name("example");
473 /// ```
474 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
475 self.name = v.into();
476 self
477 }
478}
479
480impl wkt::message::Message for DeleteActiveDirectoryRequest {
481 fn typename() -> &'static str {
482 "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
483 }
484}
485
486/// ActiveDirectory is the public representation of the active directory config.
487#[derive(Clone, Default, PartialEq)]
488#[non_exhaustive]
489pub struct ActiveDirectory {
490 /// Identifier. The resource name of the active directory.
491 /// Format:
492 /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
493 pub name: std::string::String,
494
495 /// Output only. Create time of the active directory.
496 pub create_time: std::option::Option<wkt::Timestamp>,
497
498 /// Output only. The state of the AD.
499 pub state: crate::model::active_directory::State,
500
501 /// Required. Name of the Active Directory domain
502 pub domain: std::string::String,
503
504 /// The Active Directory site the service will limit Domain Controller
505 /// discovery too.
506 pub site: std::string::String,
507
508 /// Required. Comma separated list of DNS server IP addresses for the Active
509 /// Directory domain.
510 pub dns: std::string::String,
511
512 /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
513 pub net_bios_prefix: std::string::String,
514
515 /// The Organizational Unit (OU) within the Windows Active Directory the user
516 /// belongs to.
517 pub organizational_unit: std::string::String,
518
519 /// If enabled, AES encryption will be enabled for SMB communication.
520 pub aes_encryption: bool,
521
522 /// Required. Username of the Active Directory domain administrator.
523 pub username: std::string::String,
524
525 /// Required. Password of the Active Directory domain administrator.
526 pub password: std::string::String,
527
528 /// Optional. Users to be added to the Built-in Backup Operator active
529 /// directory group.
530 pub backup_operators: std::vec::Vec<std::string::String>,
531
532 /// Optional. Users to be added to the Built-in Admininstrators group.
533 pub administrators: std::vec::Vec<std::string::String>,
534
535 /// Optional. Domain users to be given the SeSecurityPrivilege.
536 pub security_operators: std::vec::Vec<std::string::String>,
537
538 /// Name of the active directory machine. This optional parameter is used only
539 /// while creating kerberos volume
540 pub kdc_hostname: std::string::String,
541
542 /// KDC server IP address for the active directory machine.
543 pub kdc_ip: std::string::String,
544
545 /// If enabled, will allow access to local users and LDAP users. If access is
546 /// needed for only LDAP users, it has to be disabled.
547 pub nfs_users_with_ldap: bool,
548
549 /// Description of the active directory.
550 pub description: std::string::String,
551
552 /// Specifies whether or not the LDAP traffic needs to be signed.
553 pub ldap_signing: bool,
554
555 /// If enabled, traffic between the SMB server to Domain Controller (DC) will
556 /// be encrypted.
557 pub encrypt_dc_connections: bool,
558
559 /// Labels for the active directory.
560 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
561
562 /// Output only. The state details of the Active Directory.
563 pub state_details: std::string::String,
564
565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
566}
567
568impl ActiveDirectory {
569 /// Creates a new default instance.
570 pub fn new() -> Self {
571 std::default::Default::default()
572 }
573
574 /// Sets the value of [name][crate::model::ActiveDirectory::name].
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
579 /// let x = ActiveDirectory::new().set_name("example");
580 /// ```
581 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
582 self.name = v.into();
583 self
584 }
585
586 /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
587 ///
588 /// # Example
589 /// ```ignore,no_run
590 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
591 /// use wkt::Timestamp;
592 /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
593 /// ```
594 pub fn set_create_time<T>(mut self, v: T) -> Self
595 where
596 T: std::convert::Into<wkt::Timestamp>,
597 {
598 self.create_time = std::option::Option::Some(v.into());
599 self
600 }
601
602 /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
603 ///
604 /// # Example
605 /// ```ignore,no_run
606 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
607 /// use wkt::Timestamp;
608 /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
609 /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
610 /// ```
611 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
612 where
613 T: std::convert::Into<wkt::Timestamp>,
614 {
615 self.create_time = v.map(|x| x.into());
616 self
617 }
618
619 /// Sets the value of [state][crate::model::ActiveDirectory::state].
620 ///
621 /// # Example
622 /// ```ignore,no_run
623 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
624 /// use google_cloud_netapp_v1::model::active_directory::State;
625 /// let x0 = ActiveDirectory::new().set_state(State::Creating);
626 /// let x1 = ActiveDirectory::new().set_state(State::Ready);
627 /// let x2 = ActiveDirectory::new().set_state(State::Updating);
628 /// ```
629 pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
630 mut self,
631 v: T,
632 ) -> Self {
633 self.state = v.into();
634 self
635 }
636
637 /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
638 ///
639 /// # Example
640 /// ```ignore,no_run
641 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
642 /// let x = ActiveDirectory::new().set_domain("example");
643 /// ```
644 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
645 self.domain = v.into();
646 self
647 }
648
649 /// Sets the value of [site][crate::model::ActiveDirectory::site].
650 ///
651 /// # Example
652 /// ```ignore,no_run
653 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
654 /// let x = ActiveDirectory::new().set_site("example");
655 /// ```
656 pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
657 self.site = v.into();
658 self
659 }
660
661 /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
662 ///
663 /// # Example
664 /// ```ignore,no_run
665 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
666 /// let x = ActiveDirectory::new().set_dns("example");
667 /// ```
668 pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
669 self.dns = v.into();
670 self
671 }
672
673 /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
674 ///
675 /// # Example
676 /// ```ignore,no_run
677 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
678 /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
679 /// ```
680 pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
681 self.net_bios_prefix = v.into();
682 self
683 }
684
685 /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
686 ///
687 /// # Example
688 /// ```ignore,no_run
689 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
690 /// let x = ActiveDirectory::new().set_organizational_unit("example");
691 /// ```
692 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
693 mut self,
694 v: T,
695 ) -> Self {
696 self.organizational_unit = v.into();
697 self
698 }
699
700 /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
701 ///
702 /// # Example
703 /// ```ignore,no_run
704 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
705 /// let x = ActiveDirectory::new().set_aes_encryption(true);
706 /// ```
707 pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
708 self.aes_encryption = v.into();
709 self
710 }
711
712 /// Sets the value of [username][crate::model::ActiveDirectory::username].
713 ///
714 /// # Example
715 /// ```ignore,no_run
716 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
717 /// let x = ActiveDirectory::new().set_username("example");
718 /// ```
719 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
720 self.username = v.into();
721 self
722 }
723
724 /// Sets the value of [password][crate::model::ActiveDirectory::password].
725 ///
726 /// # Example
727 /// ```ignore,no_run
728 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
729 /// let x = ActiveDirectory::new().set_password("example");
730 /// ```
731 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
732 self.password = v.into();
733 self
734 }
735
736 /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
737 ///
738 /// # Example
739 /// ```ignore,no_run
740 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
741 /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
742 /// ```
743 pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
744 where
745 T: std::iter::IntoIterator<Item = V>,
746 V: std::convert::Into<std::string::String>,
747 {
748 use std::iter::Iterator;
749 self.backup_operators = v.into_iter().map(|i| i.into()).collect();
750 self
751 }
752
753 /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
754 ///
755 /// # Example
756 /// ```ignore,no_run
757 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
758 /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
759 /// ```
760 pub fn set_administrators<T, V>(mut self, v: T) -> Self
761 where
762 T: std::iter::IntoIterator<Item = V>,
763 V: std::convert::Into<std::string::String>,
764 {
765 use std::iter::Iterator;
766 self.administrators = v.into_iter().map(|i| i.into()).collect();
767 self
768 }
769
770 /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
771 ///
772 /// # Example
773 /// ```ignore,no_run
774 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
775 /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
776 /// ```
777 pub fn set_security_operators<T, V>(mut self, v: T) -> Self
778 where
779 T: std::iter::IntoIterator<Item = V>,
780 V: std::convert::Into<std::string::String>,
781 {
782 use std::iter::Iterator;
783 self.security_operators = v.into_iter().map(|i| i.into()).collect();
784 self
785 }
786
787 /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
788 ///
789 /// # Example
790 /// ```ignore,no_run
791 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
792 /// let x = ActiveDirectory::new().set_kdc_hostname("example");
793 /// ```
794 pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
795 self.kdc_hostname = v.into();
796 self
797 }
798
799 /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
800 ///
801 /// # Example
802 /// ```ignore,no_run
803 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
804 /// let x = ActiveDirectory::new().set_kdc_ip("example");
805 /// ```
806 pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
807 self.kdc_ip = v.into();
808 self
809 }
810
811 /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
812 ///
813 /// # Example
814 /// ```ignore,no_run
815 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
816 /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
817 /// ```
818 pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
819 self.nfs_users_with_ldap = v.into();
820 self
821 }
822
823 /// Sets the value of [description][crate::model::ActiveDirectory::description].
824 ///
825 /// # Example
826 /// ```ignore,no_run
827 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
828 /// let x = ActiveDirectory::new().set_description("example");
829 /// ```
830 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
831 self.description = v.into();
832 self
833 }
834
835 /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
836 ///
837 /// # Example
838 /// ```ignore,no_run
839 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
840 /// let x = ActiveDirectory::new().set_ldap_signing(true);
841 /// ```
842 pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
843 self.ldap_signing = v.into();
844 self
845 }
846
847 /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
848 ///
849 /// # Example
850 /// ```ignore,no_run
851 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
852 /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
853 /// ```
854 pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
855 self.encrypt_dc_connections = v.into();
856 self
857 }
858
859 /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
860 ///
861 /// # Example
862 /// ```ignore,no_run
863 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
864 /// let x = ActiveDirectory::new().set_labels([
865 /// ("key0", "abc"),
866 /// ("key1", "xyz"),
867 /// ]);
868 /// ```
869 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
870 where
871 T: std::iter::IntoIterator<Item = (K, V)>,
872 K: std::convert::Into<std::string::String>,
873 V: std::convert::Into<std::string::String>,
874 {
875 use std::iter::Iterator;
876 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
877 self
878 }
879
880 /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
881 ///
882 /// # Example
883 /// ```ignore,no_run
884 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
885 /// let x = ActiveDirectory::new().set_state_details("example");
886 /// ```
887 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
888 self.state_details = v.into();
889 self
890 }
891}
892
893impl wkt::message::Message for ActiveDirectory {
894 fn typename() -> &'static str {
895 "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
896 }
897}
898
899/// Defines additional types related to [ActiveDirectory].
900pub mod active_directory {
901 #[allow(unused_imports)]
902 use super::*;
903
904 /// The Active Directory States
905 ///
906 /// # Working with unknown values
907 ///
908 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
909 /// additional enum variants at any time. Adding new variants is not considered
910 /// a breaking change. Applications should write their code in anticipation of:
911 ///
912 /// - New values appearing in future releases of the client library, **and**
913 /// - New values received dynamically, without application changes.
914 ///
915 /// Please consult the [Working with enums] section in the user guide for some
916 /// guidelines.
917 ///
918 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
919 #[derive(Clone, Debug, PartialEq)]
920 #[non_exhaustive]
921 pub enum State {
922 /// Unspecified Active Directory State
923 Unspecified,
924 /// Active Directory State is Creating
925 Creating,
926 /// Active Directory State is Ready
927 Ready,
928 /// Active Directory State is Updating
929 Updating,
930 /// Active Directory State is In use
931 InUse,
932 /// Active Directory State is Deleting
933 Deleting,
934 /// Active Directory State is Error
935 Error,
936 /// Active Directory State is Diagnosing.
937 Diagnosing,
938 /// If set, the enum was initialized with an unknown value.
939 ///
940 /// Applications can examine the value using [State::value] or
941 /// [State::name].
942 UnknownValue(state::UnknownValue),
943 }
944
945 #[doc(hidden)]
946 pub mod state {
947 #[allow(unused_imports)]
948 use super::*;
949 #[derive(Clone, Debug, PartialEq)]
950 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
951 }
952
953 impl State {
954 /// Gets the enum value.
955 ///
956 /// Returns `None` if the enum contains an unknown value deserialized from
957 /// the string representation of enums.
958 pub fn value(&self) -> std::option::Option<i32> {
959 match self {
960 Self::Unspecified => std::option::Option::Some(0),
961 Self::Creating => std::option::Option::Some(1),
962 Self::Ready => std::option::Option::Some(2),
963 Self::Updating => std::option::Option::Some(3),
964 Self::InUse => std::option::Option::Some(4),
965 Self::Deleting => std::option::Option::Some(5),
966 Self::Error => std::option::Option::Some(6),
967 Self::Diagnosing => std::option::Option::Some(7),
968 Self::UnknownValue(u) => u.0.value(),
969 }
970 }
971
972 /// Gets the enum value as a string.
973 ///
974 /// Returns `None` if the enum contains an unknown value deserialized from
975 /// the integer representation of enums.
976 pub fn name(&self) -> std::option::Option<&str> {
977 match self {
978 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
979 Self::Creating => std::option::Option::Some("CREATING"),
980 Self::Ready => std::option::Option::Some("READY"),
981 Self::Updating => std::option::Option::Some("UPDATING"),
982 Self::InUse => std::option::Option::Some("IN_USE"),
983 Self::Deleting => std::option::Option::Some("DELETING"),
984 Self::Error => std::option::Option::Some("ERROR"),
985 Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
986 Self::UnknownValue(u) => u.0.name(),
987 }
988 }
989 }
990
991 impl std::default::Default for State {
992 fn default() -> Self {
993 use std::convert::From;
994 Self::from(0)
995 }
996 }
997
998 impl std::fmt::Display for State {
999 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1000 wkt::internal::display_enum(f, self.name(), self.value())
1001 }
1002 }
1003
1004 impl std::convert::From<i32> for State {
1005 fn from(value: i32) -> Self {
1006 match value {
1007 0 => Self::Unspecified,
1008 1 => Self::Creating,
1009 2 => Self::Ready,
1010 3 => Self::Updating,
1011 4 => Self::InUse,
1012 5 => Self::Deleting,
1013 6 => Self::Error,
1014 7 => Self::Diagnosing,
1015 _ => Self::UnknownValue(state::UnknownValue(
1016 wkt::internal::UnknownEnumValue::Integer(value),
1017 )),
1018 }
1019 }
1020 }
1021
1022 impl std::convert::From<&str> for State {
1023 fn from(value: &str) -> Self {
1024 use std::string::ToString;
1025 match value {
1026 "STATE_UNSPECIFIED" => Self::Unspecified,
1027 "CREATING" => Self::Creating,
1028 "READY" => Self::Ready,
1029 "UPDATING" => Self::Updating,
1030 "IN_USE" => Self::InUse,
1031 "DELETING" => Self::Deleting,
1032 "ERROR" => Self::Error,
1033 "DIAGNOSING" => Self::Diagnosing,
1034 _ => Self::UnknownValue(state::UnknownValue(
1035 wkt::internal::UnknownEnumValue::String(value.to_string()),
1036 )),
1037 }
1038 }
1039 }
1040
1041 impl serde::ser::Serialize for State {
1042 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1043 where
1044 S: serde::Serializer,
1045 {
1046 match self {
1047 Self::Unspecified => serializer.serialize_i32(0),
1048 Self::Creating => serializer.serialize_i32(1),
1049 Self::Ready => serializer.serialize_i32(2),
1050 Self::Updating => serializer.serialize_i32(3),
1051 Self::InUse => serializer.serialize_i32(4),
1052 Self::Deleting => serializer.serialize_i32(5),
1053 Self::Error => serializer.serialize_i32(6),
1054 Self::Diagnosing => serializer.serialize_i32(7),
1055 Self::UnknownValue(u) => u.0.serialize(serializer),
1056 }
1057 }
1058 }
1059
1060 impl<'de> serde::de::Deserialize<'de> for State {
1061 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1062 where
1063 D: serde::Deserializer<'de>,
1064 {
1065 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1066 ".google.cloud.netapp.v1.ActiveDirectory.State",
1067 ))
1068 }
1069 }
1070}
1071
1072/// A NetApp Backup.
1073#[derive(Clone, Default, PartialEq)]
1074#[non_exhaustive]
1075pub struct Backup {
1076 /// Identifier. The resource name of the backup.
1077 /// Format:
1078 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1079 pub name: std::string::String,
1080
1081 /// Output only. The backup state.
1082 pub state: crate::model::backup::State,
1083
1084 /// A description of the backup with 2048 characters or less.
1085 /// Requests with longer descriptions will be rejected.
1086 pub description: std::string::String,
1087
1088 /// Output only. Size of the file system when the backup was created. When
1089 /// creating a new volume from the backup, the volume capacity will have to be
1090 /// at least as big.
1091 pub volume_usage_bytes: i64,
1092
1093 /// Output only. Type of backup, manually created or created by a backup
1094 /// policy.
1095 pub backup_type: crate::model::backup::Type,
1096
1097 /// Volume full name of this backup belongs to.
1098 /// Either source_volume or ontap_source should be provided.
1099 /// Format:
1100 /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1101 pub source_volume: std::string::String,
1102
1103 /// If specified, backup will be created from the given snapshot.
1104 /// If not specified, there will be a new snapshot taken to initiate the backup
1105 /// creation. Format:
1106 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1107 pub source_snapshot: std::option::Option<std::string::String>,
1108
1109 /// Output only. The time when the backup was created.
1110 pub create_time: std::option::Option<wkt::Timestamp>,
1111
1112 /// Resource labels to represent user provided metadata.
1113 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1114
1115 /// Output only. Total size of all backups in a chain in bytes = baseline
1116 /// backup size + sum(incremental backup size)
1117 pub chain_storage_bytes: i64,
1118
1119 /// Output only. Reserved for future use
1120 pub satisfies_pzs: bool,
1121
1122 /// Output only. Reserved for future use
1123 pub satisfies_pzi: bool,
1124
1125 /// Output only. Region of the volume from which the backup was created.
1126 /// Format: `projects/{project_id}/locations/{location}`
1127 pub volume_region: std::string::String,
1128
1129 /// Output only. Region in which backup is stored.
1130 /// Format: `projects/{project_id}/locations/{location}`
1131 pub backup_region: std::string::String,
1132
1133 /// Output only. The time until which the backup is not deletable.
1134 pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1135
1136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1137}
1138
1139impl Backup {
1140 /// Creates a new default instance.
1141 pub fn new() -> Self {
1142 std::default::Default::default()
1143 }
1144
1145 /// Sets the value of [name][crate::model::Backup::name].
1146 ///
1147 /// # Example
1148 /// ```ignore,no_run
1149 /// # use google_cloud_netapp_v1::model::Backup;
1150 /// let x = Backup::new().set_name("example");
1151 /// ```
1152 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1153 self.name = v.into();
1154 self
1155 }
1156
1157 /// Sets the value of [state][crate::model::Backup::state].
1158 ///
1159 /// # Example
1160 /// ```ignore,no_run
1161 /// # use google_cloud_netapp_v1::model::Backup;
1162 /// use google_cloud_netapp_v1::model::backup::State;
1163 /// let x0 = Backup::new().set_state(State::Creating);
1164 /// let x1 = Backup::new().set_state(State::Uploading);
1165 /// let x2 = Backup::new().set_state(State::Ready);
1166 /// ```
1167 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1168 self.state = v.into();
1169 self
1170 }
1171
1172 /// Sets the value of [description][crate::model::Backup::description].
1173 ///
1174 /// # Example
1175 /// ```ignore,no_run
1176 /// # use google_cloud_netapp_v1::model::Backup;
1177 /// let x = Backup::new().set_description("example");
1178 /// ```
1179 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1180 self.description = v.into();
1181 self
1182 }
1183
1184 /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1185 ///
1186 /// # Example
1187 /// ```ignore,no_run
1188 /// # use google_cloud_netapp_v1::model::Backup;
1189 /// let x = Backup::new().set_volume_usage_bytes(42);
1190 /// ```
1191 pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1192 self.volume_usage_bytes = v.into();
1193 self
1194 }
1195
1196 /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1197 ///
1198 /// # Example
1199 /// ```ignore,no_run
1200 /// # use google_cloud_netapp_v1::model::Backup;
1201 /// use google_cloud_netapp_v1::model::backup::Type;
1202 /// let x0 = Backup::new().set_backup_type(Type::Manual);
1203 /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1204 /// ```
1205 pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1206 mut self,
1207 v: T,
1208 ) -> Self {
1209 self.backup_type = v.into();
1210 self
1211 }
1212
1213 /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1214 ///
1215 /// # Example
1216 /// ```ignore,no_run
1217 /// # use google_cloud_netapp_v1::model::Backup;
1218 /// let x = Backup::new().set_source_volume("example");
1219 /// ```
1220 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1221 self.source_volume = v.into();
1222 self
1223 }
1224
1225 /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1226 ///
1227 /// # Example
1228 /// ```ignore,no_run
1229 /// # use google_cloud_netapp_v1::model::Backup;
1230 /// let x = Backup::new().set_source_snapshot("example");
1231 /// ```
1232 pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1233 where
1234 T: std::convert::Into<std::string::String>,
1235 {
1236 self.source_snapshot = std::option::Option::Some(v.into());
1237 self
1238 }
1239
1240 /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1241 ///
1242 /// # Example
1243 /// ```ignore,no_run
1244 /// # use google_cloud_netapp_v1::model::Backup;
1245 /// let x = Backup::new().set_or_clear_source_snapshot(Some("example"));
1246 /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1247 /// ```
1248 pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1249 where
1250 T: std::convert::Into<std::string::String>,
1251 {
1252 self.source_snapshot = v.map(|x| x.into());
1253 self
1254 }
1255
1256 /// Sets the value of [create_time][crate::model::Backup::create_time].
1257 ///
1258 /// # Example
1259 /// ```ignore,no_run
1260 /// # use google_cloud_netapp_v1::model::Backup;
1261 /// use wkt::Timestamp;
1262 /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1263 /// ```
1264 pub fn set_create_time<T>(mut self, v: T) -> Self
1265 where
1266 T: std::convert::Into<wkt::Timestamp>,
1267 {
1268 self.create_time = std::option::Option::Some(v.into());
1269 self
1270 }
1271
1272 /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1273 ///
1274 /// # Example
1275 /// ```ignore,no_run
1276 /// # use google_cloud_netapp_v1::model::Backup;
1277 /// use wkt::Timestamp;
1278 /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1279 /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1280 /// ```
1281 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1282 where
1283 T: std::convert::Into<wkt::Timestamp>,
1284 {
1285 self.create_time = v.map(|x| x.into());
1286 self
1287 }
1288
1289 /// Sets the value of [labels][crate::model::Backup::labels].
1290 ///
1291 /// # Example
1292 /// ```ignore,no_run
1293 /// # use google_cloud_netapp_v1::model::Backup;
1294 /// let x = Backup::new().set_labels([
1295 /// ("key0", "abc"),
1296 /// ("key1", "xyz"),
1297 /// ]);
1298 /// ```
1299 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1300 where
1301 T: std::iter::IntoIterator<Item = (K, V)>,
1302 K: std::convert::Into<std::string::String>,
1303 V: std::convert::Into<std::string::String>,
1304 {
1305 use std::iter::Iterator;
1306 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1307 self
1308 }
1309
1310 /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1311 ///
1312 /// # Example
1313 /// ```ignore,no_run
1314 /// # use google_cloud_netapp_v1::model::Backup;
1315 /// let x = Backup::new().set_chain_storage_bytes(42);
1316 /// ```
1317 pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1318 self.chain_storage_bytes = v.into();
1319 self
1320 }
1321
1322 /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1323 ///
1324 /// # Example
1325 /// ```ignore,no_run
1326 /// # use google_cloud_netapp_v1::model::Backup;
1327 /// let x = Backup::new().set_satisfies_pzs(true);
1328 /// ```
1329 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1330 self.satisfies_pzs = v.into();
1331 self
1332 }
1333
1334 /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1335 ///
1336 /// # Example
1337 /// ```ignore,no_run
1338 /// # use google_cloud_netapp_v1::model::Backup;
1339 /// let x = Backup::new().set_satisfies_pzi(true);
1340 /// ```
1341 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1342 self.satisfies_pzi = v.into();
1343 self
1344 }
1345
1346 /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1347 ///
1348 /// # Example
1349 /// ```ignore,no_run
1350 /// # use google_cloud_netapp_v1::model::Backup;
1351 /// let x = Backup::new().set_volume_region("example");
1352 /// ```
1353 pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1354 self.volume_region = v.into();
1355 self
1356 }
1357
1358 /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1359 ///
1360 /// # Example
1361 /// ```ignore,no_run
1362 /// # use google_cloud_netapp_v1::model::Backup;
1363 /// let x = Backup::new().set_backup_region("example");
1364 /// ```
1365 pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1366 self.backup_region = v.into();
1367 self
1368 }
1369
1370 /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1371 ///
1372 /// # Example
1373 /// ```ignore,no_run
1374 /// # use google_cloud_netapp_v1::model::Backup;
1375 /// use wkt::Timestamp;
1376 /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1377 /// ```
1378 pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1379 where
1380 T: std::convert::Into<wkt::Timestamp>,
1381 {
1382 self.enforced_retention_end_time = std::option::Option::Some(v.into());
1383 self
1384 }
1385
1386 /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1387 ///
1388 /// # Example
1389 /// ```ignore,no_run
1390 /// # use google_cloud_netapp_v1::model::Backup;
1391 /// use wkt::Timestamp;
1392 /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1393 /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1394 /// ```
1395 pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1396 where
1397 T: std::convert::Into<wkt::Timestamp>,
1398 {
1399 self.enforced_retention_end_time = v.map(|x| x.into());
1400 self
1401 }
1402}
1403
1404impl wkt::message::Message for Backup {
1405 fn typename() -> &'static str {
1406 "type.googleapis.com/google.cloud.netapp.v1.Backup"
1407 }
1408}
1409
1410/// Defines additional types related to [Backup].
1411pub mod backup {
1412 #[allow(unused_imports)]
1413 use super::*;
1414
1415 /// The Backup States
1416 ///
1417 /// # Working with unknown values
1418 ///
1419 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1420 /// additional enum variants at any time. Adding new variants is not considered
1421 /// a breaking change. Applications should write their code in anticipation of:
1422 ///
1423 /// - New values appearing in future releases of the client library, **and**
1424 /// - New values received dynamically, without application changes.
1425 ///
1426 /// Please consult the [Working with enums] section in the user guide for some
1427 /// guidelines.
1428 ///
1429 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1430 #[derive(Clone, Debug, PartialEq)]
1431 #[non_exhaustive]
1432 pub enum State {
1433 /// State not set.
1434 Unspecified,
1435 /// Backup is being created. While in this state, the snapshot for the backup
1436 /// point-in-time may not have been created yet, and so the point-in-time may
1437 /// not have been fixed.
1438 Creating,
1439 /// Backup is being uploaded. While in this state, none of the writes to the
1440 /// volume will be included in the backup.
1441 Uploading,
1442 /// Backup is available for use.
1443 Ready,
1444 /// Backup is being deleted.
1445 Deleting,
1446 /// Backup is not valid and cannot be used for creating new volumes or
1447 /// restoring existing volumes.
1448 Error,
1449 /// Backup is being updated.
1450 Updating,
1451 /// If set, the enum was initialized with an unknown value.
1452 ///
1453 /// Applications can examine the value using [State::value] or
1454 /// [State::name].
1455 UnknownValue(state::UnknownValue),
1456 }
1457
1458 #[doc(hidden)]
1459 pub mod state {
1460 #[allow(unused_imports)]
1461 use super::*;
1462 #[derive(Clone, Debug, PartialEq)]
1463 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1464 }
1465
1466 impl State {
1467 /// Gets the enum value.
1468 ///
1469 /// Returns `None` if the enum contains an unknown value deserialized from
1470 /// the string representation of enums.
1471 pub fn value(&self) -> std::option::Option<i32> {
1472 match self {
1473 Self::Unspecified => std::option::Option::Some(0),
1474 Self::Creating => std::option::Option::Some(1),
1475 Self::Uploading => std::option::Option::Some(2),
1476 Self::Ready => std::option::Option::Some(3),
1477 Self::Deleting => std::option::Option::Some(4),
1478 Self::Error => std::option::Option::Some(5),
1479 Self::Updating => std::option::Option::Some(6),
1480 Self::UnknownValue(u) => u.0.value(),
1481 }
1482 }
1483
1484 /// Gets the enum value as a string.
1485 ///
1486 /// Returns `None` if the enum contains an unknown value deserialized from
1487 /// the integer representation of enums.
1488 pub fn name(&self) -> std::option::Option<&str> {
1489 match self {
1490 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1491 Self::Creating => std::option::Option::Some("CREATING"),
1492 Self::Uploading => std::option::Option::Some("UPLOADING"),
1493 Self::Ready => std::option::Option::Some("READY"),
1494 Self::Deleting => std::option::Option::Some("DELETING"),
1495 Self::Error => std::option::Option::Some("ERROR"),
1496 Self::Updating => std::option::Option::Some("UPDATING"),
1497 Self::UnknownValue(u) => u.0.name(),
1498 }
1499 }
1500 }
1501
1502 impl std::default::Default for State {
1503 fn default() -> Self {
1504 use std::convert::From;
1505 Self::from(0)
1506 }
1507 }
1508
1509 impl std::fmt::Display for State {
1510 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1511 wkt::internal::display_enum(f, self.name(), self.value())
1512 }
1513 }
1514
1515 impl std::convert::From<i32> for State {
1516 fn from(value: i32) -> Self {
1517 match value {
1518 0 => Self::Unspecified,
1519 1 => Self::Creating,
1520 2 => Self::Uploading,
1521 3 => Self::Ready,
1522 4 => Self::Deleting,
1523 5 => Self::Error,
1524 6 => Self::Updating,
1525 _ => Self::UnknownValue(state::UnknownValue(
1526 wkt::internal::UnknownEnumValue::Integer(value),
1527 )),
1528 }
1529 }
1530 }
1531
1532 impl std::convert::From<&str> for State {
1533 fn from(value: &str) -> Self {
1534 use std::string::ToString;
1535 match value {
1536 "STATE_UNSPECIFIED" => Self::Unspecified,
1537 "CREATING" => Self::Creating,
1538 "UPLOADING" => Self::Uploading,
1539 "READY" => Self::Ready,
1540 "DELETING" => Self::Deleting,
1541 "ERROR" => Self::Error,
1542 "UPDATING" => Self::Updating,
1543 _ => Self::UnknownValue(state::UnknownValue(
1544 wkt::internal::UnknownEnumValue::String(value.to_string()),
1545 )),
1546 }
1547 }
1548 }
1549
1550 impl serde::ser::Serialize for State {
1551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1552 where
1553 S: serde::Serializer,
1554 {
1555 match self {
1556 Self::Unspecified => serializer.serialize_i32(0),
1557 Self::Creating => serializer.serialize_i32(1),
1558 Self::Uploading => serializer.serialize_i32(2),
1559 Self::Ready => serializer.serialize_i32(3),
1560 Self::Deleting => serializer.serialize_i32(4),
1561 Self::Error => serializer.serialize_i32(5),
1562 Self::Updating => serializer.serialize_i32(6),
1563 Self::UnknownValue(u) => u.0.serialize(serializer),
1564 }
1565 }
1566 }
1567
1568 impl<'de> serde::de::Deserialize<'de> for State {
1569 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1570 where
1571 D: serde::Deserializer<'de>,
1572 {
1573 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1574 ".google.cloud.netapp.v1.Backup.State",
1575 ))
1576 }
1577 }
1578
1579 /// Backup types.
1580 ///
1581 /// # Working with unknown values
1582 ///
1583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1584 /// additional enum variants at any time. Adding new variants is not considered
1585 /// a breaking change. Applications should write their code in anticipation of:
1586 ///
1587 /// - New values appearing in future releases of the client library, **and**
1588 /// - New values received dynamically, without application changes.
1589 ///
1590 /// Please consult the [Working with enums] section in the user guide for some
1591 /// guidelines.
1592 ///
1593 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1594 #[derive(Clone, Debug, PartialEq)]
1595 #[non_exhaustive]
1596 pub enum Type {
1597 /// Unspecified backup type.
1598 Unspecified,
1599 /// Manual backup type.
1600 Manual,
1601 /// Scheduled backup type.
1602 Scheduled,
1603 /// If set, the enum was initialized with an unknown value.
1604 ///
1605 /// Applications can examine the value using [Type::value] or
1606 /// [Type::name].
1607 UnknownValue(r#type::UnknownValue),
1608 }
1609
1610 #[doc(hidden)]
1611 pub mod r#type {
1612 #[allow(unused_imports)]
1613 use super::*;
1614 #[derive(Clone, Debug, PartialEq)]
1615 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1616 }
1617
1618 impl Type {
1619 /// Gets the enum value.
1620 ///
1621 /// Returns `None` if the enum contains an unknown value deserialized from
1622 /// the string representation of enums.
1623 pub fn value(&self) -> std::option::Option<i32> {
1624 match self {
1625 Self::Unspecified => std::option::Option::Some(0),
1626 Self::Manual => std::option::Option::Some(1),
1627 Self::Scheduled => std::option::Option::Some(2),
1628 Self::UnknownValue(u) => u.0.value(),
1629 }
1630 }
1631
1632 /// Gets the enum value as a string.
1633 ///
1634 /// Returns `None` if the enum contains an unknown value deserialized from
1635 /// the integer representation of enums.
1636 pub fn name(&self) -> std::option::Option<&str> {
1637 match self {
1638 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1639 Self::Manual => std::option::Option::Some("MANUAL"),
1640 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1641 Self::UnknownValue(u) => u.0.name(),
1642 }
1643 }
1644 }
1645
1646 impl std::default::Default for Type {
1647 fn default() -> Self {
1648 use std::convert::From;
1649 Self::from(0)
1650 }
1651 }
1652
1653 impl std::fmt::Display for Type {
1654 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1655 wkt::internal::display_enum(f, self.name(), self.value())
1656 }
1657 }
1658
1659 impl std::convert::From<i32> for Type {
1660 fn from(value: i32) -> Self {
1661 match value {
1662 0 => Self::Unspecified,
1663 1 => Self::Manual,
1664 2 => Self::Scheduled,
1665 _ => Self::UnknownValue(r#type::UnknownValue(
1666 wkt::internal::UnknownEnumValue::Integer(value),
1667 )),
1668 }
1669 }
1670 }
1671
1672 impl std::convert::From<&str> for Type {
1673 fn from(value: &str) -> Self {
1674 use std::string::ToString;
1675 match value {
1676 "TYPE_UNSPECIFIED" => Self::Unspecified,
1677 "MANUAL" => Self::Manual,
1678 "SCHEDULED" => Self::Scheduled,
1679 _ => Self::UnknownValue(r#type::UnknownValue(
1680 wkt::internal::UnknownEnumValue::String(value.to_string()),
1681 )),
1682 }
1683 }
1684 }
1685
1686 impl serde::ser::Serialize for Type {
1687 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1688 where
1689 S: serde::Serializer,
1690 {
1691 match self {
1692 Self::Unspecified => serializer.serialize_i32(0),
1693 Self::Manual => serializer.serialize_i32(1),
1694 Self::Scheduled => serializer.serialize_i32(2),
1695 Self::UnknownValue(u) => u.0.serialize(serializer),
1696 }
1697 }
1698 }
1699
1700 impl<'de> serde::de::Deserialize<'de> for Type {
1701 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1702 where
1703 D: serde::Deserializer<'de>,
1704 {
1705 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1706 ".google.cloud.netapp.v1.Backup.Type",
1707 ))
1708 }
1709 }
1710}
1711
1712/// ListBackupsRequest lists backups.
1713#[derive(Clone, Default, PartialEq)]
1714#[non_exhaustive]
1715pub struct ListBackupsRequest {
1716 /// Required. The backupVault for which to retrieve backup information,
1717 /// in the format
1718 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1719 /// To retrieve backup information for all locations, use "-" for the
1720 /// `{location}` value.
1721 /// To retrieve backup information for all backupVaults, use "-" for the
1722 /// `{backup_vault_id}` value.
1723 /// To retrieve backup information for a volume, use "-" for the
1724 /// `{backup_vault_id}` value and specify volume full name with the filter.
1725 pub parent: std::string::String,
1726
1727 /// The maximum number of items to return. The service may return fewer
1728 /// than this value. The maximum value
1729 /// is 1000; values above 1000 will be coerced to 1000.
1730 pub page_size: i32,
1731
1732 /// The next_page_token value to use if there are additional
1733 /// results to retrieve for this list request.
1734 pub page_token: std::string::String,
1735
1736 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1737 pub order_by: std::string::String,
1738
1739 /// The standard list filter.
1740 /// If specified, backups will be returned based on the attribute name that
1741 /// matches the filter expression. If empty, then no backups are filtered out.
1742 /// See <https://google.aip.dev/160>
1743 pub filter: std::string::String,
1744
1745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1746}
1747
1748impl ListBackupsRequest {
1749 /// Creates a new default instance.
1750 pub fn new() -> Self {
1751 std::default::Default::default()
1752 }
1753
1754 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1755 ///
1756 /// # Example
1757 /// ```ignore,no_run
1758 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1759 /// let x = ListBackupsRequest::new().set_parent("example");
1760 /// ```
1761 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1762 self.parent = v.into();
1763 self
1764 }
1765
1766 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1767 ///
1768 /// # Example
1769 /// ```ignore,no_run
1770 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1771 /// let x = ListBackupsRequest::new().set_page_size(42);
1772 /// ```
1773 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1774 self.page_size = v.into();
1775 self
1776 }
1777
1778 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1779 ///
1780 /// # Example
1781 /// ```ignore,no_run
1782 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1783 /// let x = ListBackupsRequest::new().set_page_token("example");
1784 /// ```
1785 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1786 self.page_token = v.into();
1787 self
1788 }
1789
1790 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1791 ///
1792 /// # Example
1793 /// ```ignore,no_run
1794 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1795 /// let x = ListBackupsRequest::new().set_order_by("example");
1796 /// ```
1797 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1798 self.order_by = v.into();
1799 self
1800 }
1801
1802 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1807 /// let x = ListBackupsRequest::new().set_filter("example");
1808 /// ```
1809 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.filter = v.into();
1811 self
1812 }
1813}
1814
1815impl wkt::message::Message for ListBackupsRequest {
1816 fn typename() -> &'static str {
1817 "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1818 }
1819}
1820
1821/// ListBackupsResponse is the result of ListBackupsRequest.
1822#[derive(Clone, Default, PartialEq)]
1823#[non_exhaustive]
1824pub struct ListBackupsResponse {
1825 /// A list of backups in the project.
1826 pub backups: std::vec::Vec<crate::model::Backup>,
1827
1828 /// The token you can use to retrieve the next page of results. Not returned
1829 /// if there are no more results in the list.
1830 pub next_page_token: std::string::String,
1831
1832 /// Locations that could not be reached.
1833 pub unreachable: std::vec::Vec<std::string::String>,
1834
1835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1836}
1837
1838impl ListBackupsResponse {
1839 /// Creates a new default instance.
1840 pub fn new() -> Self {
1841 std::default::Default::default()
1842 }
1843
1844 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1845 ///
1846 /// # Example
1847 /// ```ignore,no_run
1848 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1849 /// use google_cloud_netapp_v1::model::Backup;
1850 /// let x = ListBackupsResponse::new()
1851 /// .set_backups([
1852 /// Backup::default()/* use setters */,
1853 /// Backup::default()/* use (different) setters */,
1854 /// ]);
1855 /// ```
1856 pub fn set_backups<T, V>(mut self, v: T) -> Self
1857 where
1858 T: std::iter::IntoIterator<Item = V>,
1859 V: std::convert::Into<crate::model::Backup>,
1860 {
1861 use std::iter::Iterator;
1862 self.backups = v.into_iter().map(|i| i.into()).collect();
1863 self
1864 }
1865
1866 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1867 ///
1868 /// # Example
1869 /// ```ignore,no_run
1870 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1871 /// let x = ListBackupsResponse::new().set_next_page_token("example");
1872 /// ```
1873 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1874 self.next_page_token = v.into();
1875 self
1876 }
1877
1878 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1879 ///
1880 /// # Example
1881 /// ```ignore,no_run
1882 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1883 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1884 /// ```
1885 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1886 where
1887 T: std::iter::IntoIterator<Item = V>,
1888 V: std::convert::Into<std::string::String>,
1889 {
1890 use std::iter::Iterator;
1891 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1892 self
1893 }
1894}
1895
1896impl wkt::message::Message for ListBackupsResponse {
1897 fn typename() -> &'static str {
1898 "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1899 }
1900}
1901
1902#[doc(hidden)]
1903impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1904 type PageItem = crate::model::Backup;
1905
1906 fn items(self) -> std::vec::Vec<Self::PageItem> {
1907 self.backups
1908 }
1909
1910 fn next_page_token(&self) -> std::string::String {
1911 use std::clone::Clone;
1912 self.next_page_token.clone()
1913 }
1914}
1915
1916/// GetBackupRequest gets the state of a backup.
1917#[derive(Clone, Default, PartialEq)]
1918#[non_exhaustive]
1919pub struct GetBackupRequest {
1920 /// Required. The backup resource name, in the format
1921 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1922 pub name: std::string::String,
1923
1924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1925}
1926
1927impl GetBackupRequest {
1928 /// Creates a new default instance.
1929 pub fn new() -> Self {
1930 std::default::Default::default()
1931 }
1932
1933 /// Sets the value of [name][crate::model::GetBackupRequest::name].
1934 ///
1935 /// # Example
1936 /// ```ignore,no_run
1937 /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1938 /// let x = GetBackupRequest::new().set_name("example");
1939 /// ```
1940 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1941 self.name = v.into();
1942 self
1943 }
1944}
1945
1946impl wkt::message::Message for GetBackupRequest {
1947 fn typename() -> &'static str {
1948 "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1949 }
1950}
1951
1952/// CreateBackupRequest creates a backup.
1953#[derive(Clone, Default, PartialEq)]
1954#[non_exhaustive]
1955pub struct CreateBackupRequest {
1956 /// Required. The NetApp backupVault to create the backups of, in the format
1957 /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1958 pub parent: std::string::String,
1959
1960 /// Required. The ID to use for the backup.
1961 /// The ID must be unique within the specified backupVault.
1962 /// Must contain only letters, numbers and hyphen, with the first
1963 /// character a letter, the last a letter or a
1964 /// number, and a 63 character maximum.
1965 pub backup_id: std::string::String,
1966
1967 /// Required. A backup resource
1968 pub backup: std::option::Option<crate::model::Backup>,
1969
1970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1971}
1972
1973impl CreateBackupRequest {
1974 /// Creates a new default instance.
1975 pub fn new() -> Self {
1976 std::default::Default::default()
1977 }
1978
1979 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1980 ///
1981 /// # Example
1982 /// ```ignore,no_run
1983 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1984 /// let x = CreateBackupRequest::new().set_parent("example");
1985 /// ```
1986 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1987 self.parent = v.into();
1988 self
1989 }
1990
1991 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1992 ///
1993 /// # Example
1994 /// ```ignore,no_run
1995 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1996 /// let x = CreateBackupRequest::new().set_backup_id("example");
1997 /// ```
1998 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1999 self.backup_id = v.into();
2000 self
2001 }
2002
2003 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
2004 ///
2005 /// # Example
2006 /// ```ignore,no_run
2007 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2008 /// use google_cloud_netapp_v1::model::Backup;
2009 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2010 /// ```
2011 pub fn set_backup<T>(mut self, v: T) -> Self
2012 where
2013 T: std::convert::Into<crate::model::Backup>,
2014 {
2015 self.backup = std::option::Option::Some(v.into());
2016 self
2017 }
2018
2019 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2020 ///
2021 /// # Example
2022 /// ```ignore,no_run
2023 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2024 /// use google_cloud_netapp_v1::model::Backup;
2025 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2026 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2027 /// ```
2028 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2029 where
2030 T: std::convert::Into<crate::model::Backup>,
2031 {
2032 self.backup = v.map(|x| x.into());
2033 self
2034 }
2035}
2036
2037impl wkt::message::Message for CreateBackupRequest {
2038 fn typename() -> &'static str {
2039 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2040 }
2041}
2042
2043/// DeleteBackupRequest deletes a backup.
2044#[derive(Clone, Default, PartialEq)]
2045#[non_exhaustive]
2046pub struct DeleteBackupRequest {
2047 /// Required. The backup resource name, in the format
2048 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2049 pub name: std::string::String,
2050
2051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2052}
2053
2054impl DeleteBackupRequest {
2055 /// Creates a new default instance.
2056 pub fn new() -> Self {
2057 std::default::Default::default()
2058 }
2059
2060 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2061 ///
2062 /// # Example
2063 /// ```ignore,no_run
2064 /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2065 /// let x = DeleteBackupRequest::new().set_name("example");
2066 /// ```
2067 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2068 self.name = v.into();
2069 self
2070 }
2071}
2072
2073impl wkt::message::Message for DeleteBackupRequest {
2074 fn typename() -> &'static str {
2075 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2076 }
2077}
2078
2079/// UpdateBackupRequest updates description and/or labels for a backup.
2080#[derive(Clone, Default, PartialEq)]
2081#[non_exhaustive]
2082pub struct UpdateBackupRequest {
2083 /// Required. Field mask is used to specify the fields to be overwritten in the
2084 /// Backup resource to be updated.
2085 /// The fields specified in the update_mask are relative to the resource, not
2086 /// the full request. A field will be overwritten if it is in the mask. If the
2087 /// user does not provide a mask then all fields will be overwritten.
2088 pub update_mask: std::option::Option<wkt::FieldMask>,
2089
2090 /// Required. The backup being updated
2091 pub backup: std::option::Option<crate::model::Backup>,
2092
2093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2094}
2095
2096impl UpdateBackupRequest {
2097 /// Creates a new default instance.
2098 pub fn new() -> Self {
2099 std::default::Default::default()
2100 }
2101
2102 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2103 ///
2104 /// # Example
2105 /// ```ignore,no_run
2106 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2107 /// use wkt::FieldMask;
2108 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2109 /// ```
2110 pub fn set_update_mask<T>(mut self, v: T) -> Self
2111 where
2112 T: std::convert::Into<wkt::FieldMask>,
2113 {
2114 self.update_mask = std::option::Option::Some(v.into());
2115 self
2116 }
2117
2118 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2119 ///
2120 /// # Example
2121 /// ```ignore,no_run
2122 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2123 /// use wkt::FieldMask;
2124 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2125 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2126 /// ```
2127 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2128 where
2129 T: std::convert::Into<wkt::FieldMask>,
2130 {
2131 self.update_mask = v.map(|x| x.into());
2132 self
2133 }
2134
2135 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2136 ///
2137 /// # Example
2138 /// ```ignore,no_run
2139 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2140 /// use google_cloud_netapp_v1::model::Backup;
2141 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2142 /// ```
2143 pub fn set_backup<T>(mut self, v: T) -> Self
2144 where
2145 T: std::convert::Into<crate::model::Backup>,
2146 {
2147 self.backup = std::option::Option::Some(v.into());
2148 self
2149 }
2150
2151 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2152 ///
2153 /// # Example
2154 /// ```ignore,no_run
2155 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2156 /// use google_cloud_netapp_v1::model::Backup;
2157 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2158 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2159 /// ```
2160 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2161 where
2162 T: std::convert::Into<crate::model::Backup>,
2163 {
2164 self.backup = v.map(|x| x.into());
2165 self
2166 }
2167}
2168
2169impl wkt::message::Message for UpdateBackupRequest {
2170 fn typename() -> &'static str {
2171 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2172 }
2173}
2174
2175/// Backup Policy.
2176#[derive(Clone, Default, PartialEq)]
2177#[non_exhaustive]
2178pub struct BackupPolicy {
2179 /// Identifier. The resource name of the backup policy.
2180 /// Format:
2181 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2182 pub name: std::string::String,
2183
2184 /// Number of daily backups to keep. Note that the minimum daily backup limit
2185 /// is 2.
2186 pub daily_backup_limit: std::option::Option<i32>,
2187
2188 /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2189 /// monthly backups should be greater than 1.
2190 pub weekly_backup_limit: std::option::Option<i32>,
2191
2192 /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2193 /// monthly backups should be greater than 1.
2194 pub monthly_backup_limit: std::option::Option<i32>,
2195
2196 /// Description of the backup policy.
2197 pub description: std::option::Option<std::string::String>,
2198
2199 /// If enabled, make backups automatically according to the schedules.
2200 /// This will be applied to all volumes that have this policy attached and
2201 /// enforced on volume level. If not specified, default is true.
2202 pub enabled: std::option::Option<bool>,
2203
2204 /// Output only. The total number of volumes assigned by this backup policy.
2205 pub assigned_volume_count: std::option::Option<i32>,
2206
2207 /// Output only. The time when the backup policy was created.
2208 pub create_time: std::option::Option<wkt::Timestamp>,
2209
2210 /// Resource labels to represent user provided metadata.
2211 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2212
2213 /// Output only. The backup policy state.
2214 pub state: crate::model::backup_policy::State,
2215
2216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2217}
2218
2219impl BackupPolicy {
2220 /// Creates a new default instance.
2221 pub fn new() -> Self {
2222 std::default::Default::default()
2223 }
2224
2225 /// Sets the value of [name][crate::model::BackupPolicy::name].
2226 ///
2227 /// # Example
2228 /// ```ignore,no_run
2229 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2230 /// let x = BackupPolicy::new().set_name("example");
2231 /// ```
2232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2233 self.name = v.into();
2234 self
2235 }
2236
2237 /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2238 ///
2239 /// # Example
2240 /// ```ignore,no_run
2241 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2242 /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2243 /// ```
2244 pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2245 where
2246 T: std::convert::Into<i32>,
2247 {
2248 self.daily_backup_limit = std::option::Option::Some(v.into());
2249 self
2250 }
2251
2252 /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2253 ///
2254 /// # Example
2255 /// ```ignore,no_run
2256 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2257 /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
2258 /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2259 /// ```
2260 pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2261 where
2262 T: std::convert::Into<i32>,
2263 {
2264 self.daily_backup_limit = v.map(|x| x.into());
2265 self
2266 }
2267
2268 /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2269 ///
2270 /// # Example
2271 /// ```ignore,no_run
2272 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2273 /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2274 /// ```
2275 pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2276 where
2277 T: std::convert::Into<i32>,
2278 {
2279 self.weekly_backup_limit = std::option::Option::Some(v.into());
2280 self
2281 }
2282
2283 /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2284 ///
2285 /// # Example
2286 /// ```ignore,no_run
2287 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2288 /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2289 /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2290 /// ```
2291 pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2292 where
2293 T: std::convert::Into<i32>,
2294 {
2295 self.weekly_backup_limit = v.map(|x| x.into());
2296 self
2297 }
2298
2299 /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2300 ///
2301 /// # Example
2302 /// ```ignore,no_run
2303 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2304 /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2305 /// ```
2306 pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2307 where
2308 T: std::convert::Into<i32>,
2309 {
2310 self.monthly_backup_limit = std::option::Option::Some(v.into());
2311 self
2312 }
2313
2314 /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2315 ///
2316 /// # Example
2317 /// ```ignore,no_run
2318 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2319 /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2320 /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2321 /// ```
2322 pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2323 where
2324 T: std::convert::Into<i32>,
2325 {
2326 self.monthly_backup_limit = v.map(|x| x.into());
2327 self
2328 }
2329
2330 /// Sets the value of [description][crate::model::BackupPolicy::description].
2331 ///
2332 /// # Example
2333 /// ```ignore,no_run
2334 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2335 /// let x = BackupPolicy::new().set_description("example");
2336 /// ```
2337 pub fn set_description<T>(mut self, v: T) -> Self
2338 where
2339 T: std::convert::Into<std::string::String>,
2340 {
2341 self.description = std::option::Option::Some(v.into());
2342 self
2343 }
2344
2345 /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2346 ///
2347 /// # Example
2348 /// ```ignore,no_run
2349 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2350 /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2351 /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2352 /// ```
2353 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2354 where
2355 T: std::convert::Into<std::string::String>,
2356 {
2357 self.description = v.map(|x| x.into());
2358 self
2359 }
2360
2361 /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2362 ///
2363 /// # Example
2364 /// ```ignore,no_run
2365 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2366 /// let x = BackupPolicy::new().set_enabled(true);
2367 /// ```
2368 pub fn set_enabled<T>(mut self, v: T) -> Self
2369 where
2370 T: std::convert::Into<bool>,
2371 {
2372 self.enabled = std::option::Option::Some(v.into());
2373 self
2374 }
2375
2376 /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2377 ///
2378 /// # Example
2379 /// ```ignore,no_run
2380 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2381 /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2382 /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2383 /// ```
2384 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2385 where
2386 T: std::convert::Into<bool>,
2387 {
2388 self.enabled = v.map(|x| x.into());
2389 self
2390 }
2391
2392 /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2393 ///
2394 /// # Example
2395 /// ```ignore,no_run
2396 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2397 /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2398 /// ```
2399 pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2400 where
2401 T: std::convert::Into<i32>,
2402 {
2403 self.assigned_volume_count = std::option::Option::Some(v.into());
2404 self
2405 }
2406
2407 /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2408 ///
2409 /// # Example
2410 /// ```ignore,no_run
2411 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2412 /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2413 /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2414 /// ```
2415 pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2416 where
2417 T: std::convert::Into<i32>,
2418 {
2419 self.assigned_volume_count = v.map(|x| x.into());
2420 self
2421 }
2422
2423 /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2424 ///
2425 /// # Example
2426 /// ```ignore,no_run
2427 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2428 /// use wkt::Timestamp;
2429 /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2430 /// ```
2431 pub fn set_create_time<T>(mut self, v: T) -> Self
2432 where
2433 T: std::convert::Into<wkt::Timestamp>,
2434 {
2435 self.create_time = std::option::Option::Some(v.into());
2436 self
2437 }
2438
2439 /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2440 ///
2441 /// # Example
2442 /// ```ignore,no_run
2443 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2444 /// use wkt::Timestamp;
2445 /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2446 /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2447 /// ```
2448 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2449 where
2450 T: std::convert::Into<wkt::Timestamp>,
2451 {
2452 self.create_time = v.map(|x| x.into());
2453 self
2454 }
2455
2456 /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2457 ///
2458 /// # Example
2459 /// ```ignore,no_run
2460 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2461 /// let x = BackupPolicy::new().set_labels([
2462 /// ("key0", "abc"),
2463 /// ("key1", "xyz"),
2464 /// ]);
2465 /// ```
2466 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2467 where
2468 T: std::iter::IntoIterator<Item = (K, V)>,
2469 K: std::convert::Into<std::string::String>,
2470 V: std::convert::Into<std::string::String>,
2471 {
2472 use std::iter::Iterator;
2473 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2474 self
2475 }
2476
2477 /// Sets the value of [state][crate::model::BackupPolicy::state].
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2482 /// use google_cloud_netapp_v1::model::backup_policy::State;
2483 /// let x0 = BackupPolicy::new().set_state(State::Creating);
2484 /// let x1 = BackupPolicy::new().set_state(State::Ready);
2485 /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2486 /// ```
2487 pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2488 mut self,
2489 v: T,
2490 ) -> Self {
2491 self.state = v.into();
2492 self
2493 }
2494}
2495
2496impl wkt::message::Message for BackupPolicy {
2497 fn typename() -> &'static str {
2498 "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2499 }
2500}
2501
2502/// Defines additional types related to [BackupPolicy].
2503pub mod backup_policy {
2504 #[allow(unused_imports)]
2505 use super::*;
2506
2507 /// Enum for [State].
2508 ///
2509 /// # Working with unknown values
2510 ///
2511 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2512 /// additional enum variants at any time. Adding new variants is not considered
2513 /// a breaking change. Applications should write their code in anticipation of:
2514 ///
2515 /// - New values appearing in future releases of the client library, **and**
2516 /// - New values received dynamically, without application changes.
2517 ///
2518 /// Please consult the [Working with enums] section in the user guide for some
2519 /// guidelines.
2520 ///
2521 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2522 #[derive(Clone, Debug, PartialEq)]
2523 #[non_exhaustive]
2524 pub enum State {
2525 /// State not set.
2526 Unspecified,
2527 /// BackupPolicy is being created.
2528 Creating,
2529 /// BackupPolicy is available for use.
2530 Ready,
2531 /// BackupPolicy is being deleted.
2532 Deleting,
2533 /// BackupPolicy is not valid and cannot be used.
2534 Error,
2535 /// BackupPolicy is being updated.
2536 Updating,
2537 /// If set, the enum was initialized with an unknown value.
2538 ///
2539 /// Applications can examine the value using [State::value] or
2540 /// [State::name].
2541 UnknownValue(state::UnknownValue),
2542 }
2543
2544 #[doc(hidden)]
2545 pub mod state {
2546 #[allow(unused_imports)]
2547 use super::*;
2548 #[derive(Clone, Debug, PartialEq)]
2549 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2550 }
2551
2552 impl State {
2553 /// Gets the enum value.
2554 ///
2555 /// Returns `None` if the enum contains an unknown value deserialized from
2556 /// the string representation of enums.
2557 pub fn value(&self) -> std::option::Option<i32> {
2558 match self {
2559 Self::Unspecified => std::option::Option::Some(0),
2560 Self::Creating => std::option::Option::Some(1),
2561 Self::Ready => std::option::Option::Some(2),
2562 Self::Deleting => std::option::Option::Some(3),
2563 Self::Error => std::option::Option::Some(4),
2564 Self::Updating => std::option::Option::Some(5),
2565 Self::UnknownValue(u) => u.0.value(),
2566 }
2567 }
2568
2569 /// Gets the enum value as a string.
2570 ///
2571 /// Returns `None` if the enum contains an unknown value deserialized from
2572 /// the integer representation of enums.
2573 pub fn name(&self) -> std::option::Option<&str> {
2574 match self {
2575 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2576 Self::Creating => std::option::Option::Some("CREATING"),
2577 Self::Ready => std::option::Option::Some("READY"),
2578 Self::Deleting => std::option::Option::Some("DELETING"),
2579 Self::Error => std::option::Option::Some("ERROR"),
2580 Self::Updating => std::option::Option::Some("UPDATING"),
2581 Self::UnknownValue(u) => u.0.name(),
2582 }
2583 }
2584 }
2585
2586 impl std::default::Default for State {
2587 fn default() -> Self {
2588 use std::convert::From;
2589 Self::from(0)
2590 }
2591 }
2592
2593 impl std::fmt::Display for State {
2594 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2595 wkt::internal::display_enum(f, self.name(), self.value())
2596 }
2597 }
2598
2599 impl std::convert::From<i32> for State {
2600 fn from(value: i32) -> Self {
2601 match value {
2602 0 => Self::Unspecified,
2603 1 => Self::Creating,
2604 2 => Self::Ready,
2605 3 => Self::Deleting,
2606 4 => Self::Error,
2607 5 => Self::Updating,
2608 _ => Self::UnknownValue(state::UnknownValue(
2609 wkt::internal::UnknownEnumValue::Integer(value),
2610 )),
2611 }
2612 }
2613 }
2614
2615 impl std::convert::From<&str> for State {
2616 fn from(value: &str) -> Self {
2617 use std::string::ToString;
2618 match value {
2619 "STATE_UNSPECIFIED" => Self::Unspecified,
2620 "CREATING" => Self::Creating,
2621 "READY" => Self::Ready,
2622 "DELETING" => Self::Deleting,
2623 "ERROR" => Self::Error,
2624 "UPDATING" => Self::Updating,
2625 _ => Self::UnknownValue(state::UnknownValue(
2626 wkt::internal::UnknownEnumValue::String(value.to_string()),
2627 )),
2628 }
2629 }
2630 }
2631
2632 impl serde::ser::Serialize for State {
2633 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2634 where
2635 S: serde::Serializer,
2636 {
2637 match self {
2638 Self::Unspecified => serializer.serialize_i32(0),
2639 Self::Creating => serializer.serialize_i32(1),
2640 Self::Ready => serializer.serialize_i32(2),
2641 Self::Deleting => serializer.serialize_i32(3),
2642 Self::Error => serializer.serialize_i32(4),
2643 Self::Updating => serializer.serialize_i32(5),
2644 Self::UnknownValue(u) => u.0.serialize(serializer),
2645 }
2646 }
2647 }
2648
2649 impl<'de> serde::de::Deserialize<'de> for State {
2650 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2651 where
2652 D: serde::Deserializer<'de>,
2653 {
2654 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2655 ".google.cloud.netapp.v1.BackupPolicy.State",
2656 ))
2657 }
2658 }
2659}
2660
2661/// CreateBackupPolicyRequest creates a backupPolicy.
2662#[derive(Clone, Default, PartialEq)]
2663#[non_exhaustive]
2664pub struct CreateBackupPolicyRequest {
2665 /// Required. The location to create the backup policies of, in the format
2666 /// `projects/{project_id}/locations/{location}`
2667 pub parent: std::string::String,
2668
2669 /// Required. A backupPolicy resource
2670 pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2671
2672 /// Required. The ID to use for the backup policy.
2673 /// The ID must be unique within the specified location.
2674 /// Must contain only letters, numbers and hyphen, with the first
2675 /// character a letter, the last a letter or a
2676 /// number, and a 63 character maximum.
2677 pub backup_policy_id: std::string::String,
2678
2679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2680}
2681
2682impl CreateBackupPolicyRequest {
2683 /// Creates a new default instance.
2684 pub fn new() -> Self {
2685 std::default::Default::default()
2686 }
2687
2688 /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2689 ///
2690 /// # Example
2691 /// ```ignore,no_run
2692 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2693 /// let x = CreateBackupPolicyRequest::new().set_parent("example");
2694 /// ```
2695 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2696 self.parent = v.into();
2697 self
2698 }
2699
2700 /// Sets 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_backup_policy(BackupPolicy::default()/* use setters */);
2707 /// ```
2708 pub fn set_backup_policy<T>(mut self, v: T) -> Self
2709 where
2710 T: std::convert::Into<crate::model::BackupPolicy>,
2711 {
2712 self.backup_policy = std::option::Option::Some(v.into());
2713 self
2714 }
2715
2716 /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2717 ///
2718 /// # Example
2719 /// ```ignore,no_run
2720 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2721 /// use google_cloud_netapp_v1::model::BackupPolicy;
2722 /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2723 /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2724 /// ```
2725 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2726 where
2727 T: std::convert::Into<crate::model::BackupPolicy>,
2728 {
2729 self.backup_policy = v.map(|x| x.into());
2730 self
2731 }
2732
2733 /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2734 ///
2735 /// # Example
2736 /// ```ignore,no_run
2737 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2738 /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2739 /// ```
2740 pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2741 mut self,
2742 v: T,
2743 ) -> Self {
2744 self.backup_policy_id = v.into();
2745 self
2746 }
2747}
2748
2749impl wkt::message::Message for CreateBackupPolicyRequest {
2750 fn typename() -> &'static str {
2751 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2752 }
2753}
2754
2755/// GetBackupPolicyRequest gets the state of a backupPolicy.
2756#[derive(Clone, Default, PartialEq)]
2757#[non_exhaustive]
2758pub struct GetBackupPolicyRequest {
2759 /// Required. The backupPolicy resource name, in the format
2760 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2761 pub name: std::string::String,
2762
2763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2764}
2765
2766impl GetBackupPolicyRequest {
2767 /// Creates a new default instance.
2768 pub fn new() -> Self {
2769 std::default::Default::default()
2770 }
2771
2772 /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2773 ///
2774 /// # Example
2775 /// ```ignore,no_run
2776 /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2777 /// let x = GetBackupPolicyRequest::new().set_name("example");
2778 /// ```
2779 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2780 self.name = v.into();
2781 self
2782 }
2783}
2784
2785impl wkt::message::Message for GetBackupPolicyRequest {
2786 fn typename() -> &'static str {
2787 "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2788 }
2789}
2790
2791/// ListBackupPoliciesRequest for requesting multiple backup policies.
2792#[derive(Clone, Default, PartialEq)]
2793#[non_exhaustive]
2794pub struct ListBackupPoliciesRequest {
2795 /// Required. Parent value for ListBackupPoliciesRequest
2796 pub parent: std::string::String,
2797
2798 /// Requested page size. Server may return fewer items than requested.
2799 /// If unspecified, the server will pick an appropriate default.
2800 pub page_size: i32,
2801
2802 /// A token identifying a page of results the server should return.
2803 pub page_token: std::string::String,
2804
2805 /// Filtering results
2806 pub filter: std::string::String,
2807
2808 /// Hint for how to order the results
2809 pub order_by: std::string::String,
2810
2811 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2812}
2813
2814impl ListBackupPoliciesRequest {
2815 /// Creates a new default instance.
2816 pub fn new() -> Self {
2817 std::default::Default::default()
2818 }
2819
2820 /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2821 ///
2822 /// # Example
2823 /// ```ignore,no_run
2824 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2825 /// let x = ListBackupPoliciesRequest::new().set_parent("example");
2826 /// ```
2827 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2828 self.parent = v.into();
2829 self
2830 }
2831
2832 /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2833 ///
2834 /// # Example
2835 /// ```ignore,no_run
2836 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2837 /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2838 /// ```
2839 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2840 self.page_size = v.into();
2841 self
2842 }
2843
2844 /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2845 ///
2846 /// # Example
2847 /// ```ignore,no_run
2848 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2849 /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2850 /// ```
2851 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2852 self.page_token = v.into();
2853 self
2854 }
2855
2856 /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2857 ///
2858 /// # Example
2859 /// ```ignore,no_run
2860 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2861 /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2862 /// ```
2863 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2864 self.filter = v.into();
2865 self
2866 }
2867
2868 /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2873 /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2874 /// ```
2875 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2876 self.order_by = v.into();
2877 self
2878 }
2879}
2880
2881impl wkt::message::Message for ListBackupPoliciesRequest {
2882 fn typename() -> &'static str {
2883 "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2884 }
2885}
2886
2887/// ListBackupPoliciesResponse contains all the backup policies requested.
2888#[derive(Clone, Default, PartialEq)]
2889#[non_exhaustive]
2890pub struct ListBackupPoliciesResponse {
2891 /// The list of backup policies.
2892 pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2893
2894 /// A token identifying a page of results the server should return.
2895 pub next_page_token: std::string::String,
2896
2897 /// Locations that could not be reached.
2898 pub unreachable: std::vec::Vec<std::string::String>,
2899
2900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2901}
2902
2903impl ListBackupPoliciesResponse {
2904 /// Creates a new default instance.
2905 pub fn new() -> Self {
2906 std::default::Default::default()
2907 }
2908
2909 /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2910 ///
2911 /// # Example
2912 /// ```ignore,no_run
2913 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2914 /// use google_cloud_netapp_v1::model::BackupPolicy;
2915 /// let x = ListBackupPoliciesResponse::new()
2916 /// .set_backup_policies([
2917 /// BackupPolicy::default()/* use setters */,
2918 /// BackupPolicy::default()/* use (different) setters */,
2919 /// ]);
2920 /// ```
2921 pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2922 where
2923 T: std::iter::IntoIterator<Item = V>,
2924 V: std::convert::Into<crate::model::BackupPolicy>,
2925 {
2926 use std::iter::Iterator;
2927 self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2928 self
2929 }
2930
2931 /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2932 ///
2933 /// # Example
2934 /// ```ignore,no_run
2935 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2936 /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2937 /// ```
2938 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.next_page_token = v.into();
2940 self
2941 }
2942
2943 /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2944 ///
2945 /// # Example
2946 /// ```ignore,no_run
2947 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2948 /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
2949 /// ```
2950 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2951 where
2952 T: std::iter::IntoIterator<Item = V>,
2953 V: std::convert::Into<std::string::String>,
2954 {
2955 use std::iter::Iterator;
2956 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2957 self
2958 }
2959}
2960
2961impl wkt::message::Message for ListBackupPoliciesResponse {
2962 fn typename() -> &'static str {
2963 "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
2964 }
2965}
2966
2967#[doc(hidden)]
2968impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
2969 type PageItem = crate::model::BackupPolicy;
2970
2971 fn items(self) -> std::vec::Vec<Self::PageItem> {
2972 self.backup_policies
2973 }
2974
2975 fn next_page_token(&self) -> std::string::String {
2976 use std::clone::Clone;
2977 self.next_page_token.clone()
2978 }
2979}
2980
2981/// UpdateBackupPolicyRequest for updating a backup policy.
2982#[derive(Clone, Default, PartialEq)]
2983#[non_exhaustive]
2984pub struct UpdateBackupPolicyRequest {
2985 /// Required. Field mask is used to specify the fields to be overwritten in the
2986 /// Backup Policy resource by the update.
2987 /// The fields specified in the update_mask are relative to the resource, not
2988 /// the full request. A field will be overwritten if it is in the mask. If the
2989 /// user does not provide a mask then all fields will be overwritten.
2990 pub update_mask: std::option::Option<wkt::FieldMask>,
2991
2992 /// Required. The backup policy being updated
2993 pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2994
2995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2996}
2997
2998impl UpdateBackupPolicyRequest {
2999 /// Creates a new default instance.
3000 pub fn new() -> Self {
3001 std::default::Default::default()
3002 }
3003
3004 /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3005 ///
3006 /// # Example
3007 /// ```ignore,no_run
3008 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3009 /// use wkt::FieldMask;
3010 /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3011 /// ```
3012 pub fn set_update_mask<T>(mut self, v: T) -> Self
3013 where
3014 T: std::convert::Into<wkt::FieldMask>,
3015 {
3016 self.update_mask = std::option::Option::Some(v.into());
3017 self
3018 }
3019
3020 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3021 ///
3022 /// # Example
3023 /// ```ignore,no_run
3024 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3025 /// use wkt::FieldMask;
3026 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3027 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3028 /// ```
3029 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3030 where
3031 T: std::convert::Into<wkt::FieldMask>,
3032 {
3033 self.update_mask = v.map(|x| x.into());
3034 self
3035 }
3036
3037 /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3038 ///
3039 /// # Example
3040 /// ```ignore,no_run
3041 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3042 /// use google_cloud_netapp_v1::model::BackupPolicy;
3043 /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3044 /// ```
3045 pub fn set_backup_policy<T>(mut self, v: T) -> Self
3046 where
3047 T: std::convert::Into<crate::model::BackupPolicy>,
3048 {
3049 self.backup_policy = std::option::Option::Some(v.into());
3050 self
3051 }
3052
3053 /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3054 ///
3055 /// # Example
3056 /// ```ignore,no_run
3057 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3058 /// use google_cloud_netapp_v1::model::BackupPolicy;
3059 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3060 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3061 /// ```
3062 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3063 where
3064 T: std::convert::Into<crate::model::BackupPolicy>,
3065 {
3066 self.backup_policy = v.map(|x| x.into());
3067 self
3068 }
3069}
3070
3071impl wkt::message::Message for UpdateBackupPolicyRequest {
3072 fn typename() -> &'static str {
3073 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3074 }
3075}
3076
3077/// DeleteBackupPolicyRequest deletes a backup policy.
3078#[derive(Clone, Default, PartialEq)]
3079#[non_exhaustive]
3080pub struct DeleteBackupPolicyRequest {
3081 /// Required. The backup policy resource name, in the format
3082 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3083 pub name: std::string::String,
3084
3085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3086}
3087
3088impl DeleteBackupPolicyRequest {
3089 /// Creates a new default instance.
3090 pub fn new() -> Self {
3091 std::default::Default::default()
3092 }
3093
3094 /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3095 ///
3096 /// # Example
3097 /// ```ignore,no_run
3098 /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3099 /// let x = DeleteBackupPolicyRequest::new().set_name("example");
3100 /// ```
3101 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3102 self.name = v.into();
3103 self
3104 }
3105}
3106
3107impl wkt::message::Message for DeleteBackupPolicyRequest {
3108 fn typename() -> &'static str {
3109 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3110 }
3111}
3112
3113/// A NetApp BackupVault.
3114#[derive(Clone, Default, PartialEq)]
3115#[non_exhaustive]
3116pub struct BackupVault {
3117 /// Identifier. The resource name of the backup vault.
3118 /// Format:
3119 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3120 pub name: std::string::String,
3121
3122 /// Output only. The backup vault state.
3123 pub state: crate::model::backup_vault::State,
3124
3125 /// Output only. Create time of the backup vault.
3126 pub create_time: std::option::Option<wkt::Timestamp>,
3127
3128 /// Description of the backup vault.
3129 pub description: std::string::String,
3130
3131 /// Resource labels to represent user provided metadata.
3132 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3133
3134 /// Optional. Type of backup vault to be created.
3135 /// Default is IN_REGION.
3136 pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3137
3138 /// Output only. Region in which the backup vault is created.
3139 /// Format: `projects/{project_id}/locations/{location}`
3140 pub source_region: std::string::String,
3141
3142 /// Optional. Region where the backups are stored.
3143 /// Format: `projects/{project_id}/locations/{location}`
3144 pub backup_region: std::string::String,
3145
3146 /// Output only. Name of the Backup vault created in source region.
3147 /// Format:
3148 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3149 pub source_backup_vault: std::string::String,
3150
3151 /// Output only. Name of the Backup vault created in backup region.
3152 /// Format:
3153 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3154 pub destination_backup_vault: std::string::String,
3155
3156 /// Optional. Backup retention policy defining the retention of backups.
3157 pub backup_retention_policy:
3158 std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3159
3160 /// Optional. Specifies the Key Management System (KMS) configuration to be
3161 /// used for backup encryption. Format:
3162 /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3163 pub kms_config: std::string::String,
3164
3165 /// Output only. Field indicating encryption state of CMEK backups.
3166 pub encryption_state: crate::model::backup_vault::EncryptionState,
3167
3168 /// Output only. The crypto key version used to encrypt the backup vault.
3169 /// Format:
3170 /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3171 pub backups_crypto_key_version: std::string::String,
3172
3173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3174}
3175
3176impl BackupVault {
3177 /// Creates a new default instance.
3178 pub fn new() -> Self {
3179 std::default::Default::default()
3180 }
3181
3182 /// Sets the value of [name][crate::model::BackupVault::name].
3183 ///
3184 /// # Example
3185 /// ```ignore,no_run
3186 /// # use google_cloud_netapp_v1::model::BackupVault;
3187 /// let x = BackupVault::new().set_name("example");
3188 /// ```
3189 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3190 self.name = v.into();
3191 self
3192 }
3193
3194 /// Sets the value of [state][crate::model::BackupVault::state].
3195 ///
3196 /// # Example
3197 /// ```ignore,no_run
3198 /// # use google_cloud_netapp_v1::model::BackupVault;
3199 /// use google_cloud_netapp_v1::model::backup_vault::State;
3200 /// let x0 = BackupVault::new().set_state(State::Creating);
3201 /// let x1 = BackupVault::new().set_state(State::Ready);
3202 /// let x2 = BackupVault::new().set_state(State::Deleting);
3203 /// ```
3204 pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3205 mut self,
3206 v: T,
3207 ) -> Self {
3208 self.state = v.into();
3209 self
3210 }
3211
3212 /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3213 ///
3214 /// # Example
3215 /// ```ignore,no_run
3216 /// # use google_cloud_netapp_v1::model::BackupVault;
3217 /// use wkt::Timestamp;
3218 /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3219 /// ```
3220 pub fn set_create_time<T>(mut self, v: T) -> Self
3221 where
3222 T: std::convert::Into<wkt::Timestamp>,
3223 {
3224 self.create_time = std::option::Option::Some(v.into());
3225 self
3226 }
3227
3228 /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3229 ///
3230 /// # Example
3231 /// ```ignore,no_run
3232 /// # use google_cloud_netapp_v1::model::BackupVault;
3233 /// use wkt::Timestamp;
3234 /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3235 /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3236 /// ```
3237 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3238 where
3239 T: std::convert::Into<wkt::Timestamp>,
3240 {
3241 self.create_time = v.map(|x| x.into());
3242 self
3243 }
3244
3245 /// Sets the value of [description][crate::model::BackupVault::description].
3246 ///
3247 /// # Example
3248 /// ```ignore,no_run
3249 /// # use google_cloud_netapp_v1::model::BackupVault;
3250 /// let x = BackupVault::new().set_description("example");
3251 /// ```
3252 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3253 self.description = v.into();
3254 self
3255 }
3256
3257 /// Sets the value of [labels][crate::model::BackupVault::labels].
3258 ///
3259 /// # Example
3260 /// ```ignore,no_run
3261 /// # use google_cloud_netapp_v1::model::BackupVault;
3262 /// let x = BackupVault::new().set_labels([
3263 /// ("key0", "abc"),
3264 /// ("key1", "xyz"),
3265 /// ]);
3266 /// ```
3267 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3268 where
3269 T: std::iter::IntoIterator<Item = (K, V)>,
3270 K: std::convert::Into<std::string::String>,
3271 V: std::convert::Into<std::string::String>,
3272 {
3273 use std::iter::Iterator;
3274 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3275 self
3276 }
3277
3278 /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3279 ///
3280 /// # Example
3281 /// ```ignore,no_run
3282 /// # use google_cloud_netapp_v1::model::BackupVault;
3283 /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3284 /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3285 /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3286 /// ```
3287 pub fn set_backup_vault_type<
3288 T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3289 >(
3290 mut self,
3291 v: T,
3292 ) -> Self {
3293 self.backup_vault_type = v.into();
3294 self
3295 }
3296
3297 /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3298 ///
3299 /// # Example
3300 /// ```ignore,no_run
3301 /// # use google_cloud_netapp_v1::model::BackupVault;
3302 /// let x = BackupVault::new().set_source_region("example");
3303 /// ```
3304 pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.source_region = v.into();
3306 self
3307 }
3308
3309 /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3310 ///
3311 /// # Example
3312 /// ```ignore,no_run
3313 /// # use google_cloud_netapp_v1::model::BackupVault;
3314 /// let x = BackupVault::new().set_backup_region("example");
3315 /// ```
3316 pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3317 self.backup_region = v.into();
3318 self
3319 }
3320
3321 /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3322 ///
3323 /// # Example
3324 /// ```ignore,no_run
3325 /// # use google_cloud_netapp_v1::model::BackupVault;
3326 /// let x = BackupVault::new().set_source_backup_vault("example");
3327 /// ```
3328 pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3329 mut self,
3330 v: T,
3331 ) -> Self {
3332 self.source_backup_vault = v.into();
3333 self
3334 }
3335
3336 /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3337 ///
3338 /// # Example
3339 /// ```ignore,no_run
3340 /// # use google_cloud_netapp_v1::model::BackupVault;
3341 /// let x = BackupVault::new().set_destination_backup_vault("example");
3342 /// ```
3343 pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3344 mut self,
3345 v: T,
3346 ) -> Self {
3347 self.destination_backup_vault = v.into();
3348 self
3349 }
3350
3351 /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3352 ///
3353 /// # Example
3354 /// ```ignore,no_run
3355 /// # use google_cloud_netapp_v1::model::BackupVault;
3356 /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3357 /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3358 /// ```
3359 pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3360 where
3361 T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3362 {
3363 self.backup_retention_policy = std::option::Option::Some(v.into());
3364 self
3365 }
3366
3367 /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3368 ///
3369 /// # Example
3370 /// ```ignore,no_run
3371 /// # use google_cloud_netapp_v1::model::BackupVault;
3372 /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3373 /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3374 /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3375 /// ```
3376 pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3377 where
3378 T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3379 {
3380 self.backup_retention_policy = v.map(|x| x.into());
3381 self
3382 }
3383
3384 /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3385 ///
3386 /// # Example
3387 /// ```ignore,no_run
3388 /// # use google_cloud_netapp_v1::model::BackupVault;
3389 /// let x = BackupVault::new().set_kms_config("example");
3390 /// ```
3391 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3392 self.kms_config = v.into();
3393 self
3394 }
3395
3396 /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3397 ///
3398 /// # Example
3399 /// ```ignore,no_run
3400 /// # use google_cloud_netapp_v1::model::BackupVault;
3401 /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3402 /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3403 /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3404 /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3405 /// ```
3406 pub fn set_encryption_state<
3407 T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3408 >(
3409 mut self,
3410 v: T,
3411 ) -> Self {
3412 self.encryption_state = v.into();
3413 self
3414 }
3415
3416 /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3417 ///
3418 /// # Example
3419 /// ```ignore,no_run
3420 /// # use google_cloud_netapp_v1::model::BackupVault;
3421 /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3422 /// ```
3423 pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3424 mut self,
3425 v: T,
3426 ) -> Self {
3427 self.backups_crypto_key_version = v.into();
3428 self
3429 }
3430}
3431
3432impl wkt::message::Message for BackupVault {
3433 fn typename() -> &'static str {
3434 "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3435 }
3436}
3437
3438/// Defines additional types related to [BackupVault].
3439pub mod backup_vault {
3440 #[allow(unused_imports)]
3441 use super::*;
3442
3443 /// Retention policy for backups in the backup vault
3444 #[derive(Clone, Default, PartialEq)]
3445 #[non_exhaustive]
3446 pub struct BackupRetentionPolicy {
3447 /// Required. Minimum retention duration in days for backups in the backup
3448 /// vault.
3449 pub backup_minimum_enforced_retention_days: i32,
3450
3451 /// Optional. Indicates if the daily backups are immutable.
3452 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3453 /// monthly_backup_immutable and manual_backup_immutable must be true.
3454 pub daily_backup_immutable: bool,
3455
3456 /// Optional. Indicates if the weekly backups are immutable.
3457 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3458 /// monthly_backup_immutable and manual_backup_immutable must be true.
3459 pub weekly_backup_immutable: bool,
3460
3461 /// Optional. Indicates if the monthly backups are immutable.
3462 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3463 /// monthly_backup_immutable and manual_backup_immutable must be true.
3464 pub monthly_backup_immutable: bool,
3465
3466 /// Optional. Indicates if the manual backups are immutable.
3467 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3468 /// monthly_backup_immutable and manual_backup_immutable must be true.
3469 pub manual_backup_immutable: bool,
3470
3471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3472 }
3473
3474 impl BackupRetentionPolicy {
3475 /// Creates a new default instance.
3476 pub fn new() -> Self {
3477 std::default::Default::default()
3478 }
3479
3480 /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3485 /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3486 /// ```
3487 pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3488 mut self,
3489 v: T,
3490 ) -> Self {
3491 self.backup_minimum_enforced_retention_days = v.into();
3492 self
3493 }
3494
3495 /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3496 ///
3497 /// # Example
3498 /// ```ignore,no_run
3499 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3500 /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3501 /// ```
3502 pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3503 self.daily_backup_immutable = v.into();
3504 self
3505 }
3506
3507 /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3508 ///
3509 /// # Example
3510 /// ```ignore,no_run
3511 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3512 /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3513 /// ```
3514 pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3515 self.weekly_backup_immutable = v.into();
3516 self
3517 }
3518
3519 /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3520 ///
3521 /// # Example
3522 /// ```ignore,no_run
3523 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3524 /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3525 /// ```
3526 pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3527 self.monthly_backup_immutable = v.into();
3528 self
3529 }
3530
3531 /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3532 ///
3533 /// # Example
3534 /// ```ignore,no_run
3535 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3536 /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3537 /// ```
3538 pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3539 self.manual_backup_immutable = v.into();
3540 self
3541 }
3542 }
3543
3544 impl wkt::message::Message for BackupRetentionPolicy {
3545 fn typename() -> &'static str {
3546 "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3547 }
3548 }
3549
3550 /// The Backup Vault States
3551 ///
3552 /// # Working with unknown values
3553 ///
3554 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3555 /// additional enum variants at any time. Adding new variants is not considered
3556 /// a breaking change. Applications should write their code in anticipation of:
3557 ///
3558 /// - New values appearing in future releases of the client library, **and**
3559 /// - New values received dynamically, without application changes.
3560 ///
3561 /// Please consult the [Working with enums] section in the user guide for some
3562 /// guidelines.
3563 ///
3564 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3565 #[derive(Clone, Debug, PartialEq)]
3566 #[non_exhaustive]
3567 pub enum State {
3568 /// State not set.
3569 Unspecified,
3570 /// BackupVault is being created.
3571 Creating,
3572 /// BackupVault is available for use.
3573 Ready,
3574 /// BackupVault is being deleted.
3575 Deleting,
3576 /// BackupVault is not valid and cannot be used.
3577 Error,
3578 /// BackupVault is being updated.
3579 Updating,
3580 /// If set, the enum was initialized with an unknown value.
3581 ///
3582 /// Applications can examine the value using [State::value] or
3583 /// [State::name].
3584 UnknownValue(state::UnknownValue),
3585 }
3586
3587 #[doc(hidden)]
3588 pub mod state {
3589 #[allow(unused_imports)]
3590 use super::*;
3591 #[derive(Clone, Debug, PartialEq)]
3592 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3593 }
3594
3595 impl State {
3596 /// Gets the enum value.
3597 ///
3598 /// Returns `None` if the enum contains an unknown value deserialized from
3599 /// the string representation of enums.
3600 pub fn value(&self) -> std::option::Option<i32> {
3601 match self {
3602 Self::Unspecified => std::option::Option::Some(0),
3603 Self::Creating => std::option::Option::Some(1),
3604 Self::Ready => std::option::Option::Some(2),
3605 Self::Deleting => std::option::Option::Some(3),
3606 Self::Error => std::option::Option::Some(4),
3607 Self::Updating => std::option::Option::Some(5),
3608 Self::UnknownValue(u) => u.0.value(),
3609 }
3610 }
3611
3612 /// Gets the enum value as a string.
3613 ///
3614 /// Returns `None` if the enum contains an unknown value deserialized from
3615 /// the integer representation of enums.
3616 pub fn name(&self) -> std::option::Option<&str> {
3617 match self {
3618 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3619 Self::Creating => std::option::Option::Some("CREATING"),
3620 Self::Ready => std::option::Option::Some("READY"),
3621 Self::Deleting => std::option::Option::Some("DELETING"),
3622 Self::Error => std::option::Option::Some("ERROR"),
3623 Self::Updating => std::option::Option::Some("UPDATING"),
3624 Self::UnknownValue(u) => u.0.name(),
3625 }
3626 }
3627 }
3628
3629 impl std::default::Default for State {
3630 fn default() -> Self {
3631 use std::convert::From;
3632 Self::from(0)
3633 }
3634 }
3635
3636 impl std::fmt::Display for State {
3637 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3638 wkt::internal::display_enum(f, self.name(), self.value())
3639 }
3640 }
3641
3642 impl std::convert::From<i32> for State {
3643 fn from(value: i32) -> Self {
3644 match value {
3645 0 => Self::Unspecified,
3646 1 => Self::Creating,
3647 2 => Self::Ready,
3648 3 => Self::Deleting,
3649 4 => Self::Error,
3650 5 => Self::Updating,
3651 _ => Self::UnknownValue(state::UnknownValue(
3652 wkt::internal::UnknownEnumValue::Integer(value),
3653 )),
3654 }
3655 }
3656 }
3657
3658 impl std::convert::From<&str> for State {
3659 fn from(value: &str) -> Self {
3660 use std::string::ToString;
3661 match value {
3662 "STATE_UNSPECIFIED" => Self::Unspecified,
3663 "CREATING" => Self::Creating,
3664 "READY" => Self::Ready,
3665 "DELETING" => Self::Deleting,
3666 "ERROR" => Self::Error,
3667 "UPDATING" => Self::Updating,
3668 _ => Self::UnknownValue(state::UnknownValue(
3669 wkt::internal::UnknownEnumValue::String(value.to_string()),
3670 )),
3671 }
3672 }
3673 }
3674
3675 impl serde::ser::Serialize for State {
3676 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3677 where
3678 S: serde::Serializer,
3679 {
3680 match self {
3681 Self::Unspecified => serializer.serialize_i32(0),
3682 Self::Creating => serializer.serialize_i32(1),
3683 Self::Ready => serializer.serialize_i32(2),
3684 Self::Deleting => serializer.serialize_i32(3),
3685 Self::Error => serializer.serialize_i32(4),
3686 Self::Updating => serializer.serialize_i32(5),
3687 Self::UnknownValue(u) => u.0.serialize(serializer),
3688 }
3689 }
3690 }
3691
3692 impl<'de> serde::de::Deserialize<'de> for State {
3693 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3694 where
3695 D: serde::Deserializer<'de>,
3696 {
3697 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3698 ".google.cloud.netapp.v1.BackupVault.State",
3699 ))
3700 }
3701 }
3702
3703 /// Backup Vault Type.
3704 ///
3705 /// # Working with unknown values
3706 ///
3707 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3708 /// additional enum variants at any time. Adding new variants is not considered
3709 /// a breaking change. Applications should write their code in anticipation of:
3710 ///
3711 /// - New values appearing in future releases of the client library, **and**
3712 /// - New values received dynamically, without application changes.
3713 ///
3714 /// Please consult the [Working with enums] section in the user guide for some
3715 /// guidelines.
3716 ///
3717 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3718 #[derive(Clone, Debug, PartialEq)]
3719 #[non_exhaustive]
3720 pub enum BackupVaultType {
3721 /// BackupVault type not set.
3722 Unspecified,
3723 /// BackupVault type is IN_REGION.
3724 InRegion,
3725 /// BackupVault type is CROSS_REGION.
3726 CrossRegion,
3727 /// If set, the enum was initialized with an unknown value.
3728 ///
3729 /// Applications can examine the value using [BackupVaultType::value] or
3730 /// [BackupVaultType::name].
3731 UnknownValue(backup_vault_type::UnknownValue),
3732 }
3733
3734 #[doc(hidden)]
3735 pub mod backup_vault_type {
3736 #[allow(unused_imports)]
3737 use super::*;
3738 #[derive(Clone, Debug, PartialEq)]
3739 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3740 }
3741
3742 impl BackupVaultType {
3743 /// Gets the enum value.
3744 ///
3745 /// Returns `None` if the enum contains an unknown value deserialized from
3746 /// the string representation of enums.
3747 pub fn value(&self) -> std::option::Option<i32> {
3748 match self {
3749 Self::Unspecified => std::option::Option::Some(0),
3750 Self::InRegion => std::option::Option::Some(1),
3751 Self::CrossRegion => std::option::Option::Some(2),
3752 Self::UnknownValue(u) => u.0.value(),
3753 }
3754 }
3755
3756 /// Gets the enum value as a string.
3757 ///
3758 /// Returns `None` if the enum contains an unknown value deserialized from
3759 /// the integer representation of enums.
3760 pub fn name(&self) -> std::option::Option<&str> {
3761 match self {
3762 Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3763 Self::InRegion => std::option::Option::Some("IN_REGION"),
3764 Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3765 Self::UnknownValue(u) => u.0.name(),
3766 }
3767 }
3768 }
3769
3770 impl std::default::Default for BackupVaultType {
3771 fn default() -> Self {
3772 use std::convert::From;
3773 Self::from(0)
3774 }
3775 }
3776
3777 impl std::fmt::Display for BackupVaultType {
3778 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3779 wkt::internal::display_enum(f, self.name(), self.value())
3780 }
3781 }
3782
3783 impl std::convert::From<i32> for BackupVaultType {
3784 fn from(value: i32) -> Self {
3785 match value {
3786 0 => Self::Unspecified,
3787 1 => Self::InRegion,
3788 2 => Self::CrossRegion,
3789 _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3790 wkt::internal::UnknownEnumValue::Integer(value),
3791 )),
3792 }
3793 }
3794 }
3795
3796 impl std::convert::From<&str> for BackupVaultType {
3797 fn from(value: &str) -> Self {
3798 use std::string::ToString;
3799 match value {
3800 "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3801 "IN_REGION" => Self::InRegion,
3802 "CROSS_REGION" => Self::CrossRegion,
3803 _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3804 wkt::internal::UnknownEnumValue::String(value.to_string()),
3805 )),
3806 }
3807 }
3808 }
3809
3810 impl serde::ser::Serialize for BackupVaultType {
3811 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3812 where
3813 S: serde::Serializer,
3814 {
3815 match self {
3816 Self::Unspecified => serializer.serialize_i32(0),
3817 Self::InRegion => serializer.serialize_i32(1),
3818 Self::CrossRegion => serializer.serialize_i32(2),
3819 Self::UnknownValue(u) => u.0.serialize(serializer),
3820 }
3821 }
3822 }
3823
3824 impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3825 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3826 where
3827 D: serde::Deserializer<'de>,
3828 {
3829 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3830 ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3831 ))
3832 }
3833 }
3834
3835 /// Encryption state of customer-managed encryption keys (CMEK) backups.
3836 ///
3837 /// # Working with unknown values
3838 ///
3839 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3840 /// additional enum variants at any time. Adding new variants is not considered
3841 /// a breaking change. Applications should write their code in anticipation of:
3842 ///
3843 /// - New values appearing in future releases of the client library, **and**
3844 /// - New values received dynamically, without application changes.
3845 ///
3846 /// Please consult the [Working with enums] section in the user guide for some
3847 /// guidelines.
3848 ///
3849 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3850 #[derive(Clone, Debug, PartialEq)]
3851 #[non_exhaustive]
3852 pub enum EncryptionState {
3853 /// Encryption state not set.
3854 Unspecified,
3855 /// Encryption state is pending.
3856 Pending,
3857 /// Encryption is complete.
3858 Completed,
3859 /// Encryption is in progress.
3860 InProgress,
3861 /// Encryption has failed.
3862 Failed,
3863 /// If set, the enum was initialized with an unknown value.
3864 ///
3865 /// Applications can examine the value using [EncryptionState::value] or
3866 /// [EncryptionState::name].
3867 UnknownValue(encryption_state::UnknownValue),
3868 }
3869
3870 #[doc(hidden)]
3871 pub mod encryption_state {
3872 #[allow(unused_imports)]
3873 use super::*;
3874 #[derive(Clone, Debug, PartialEq)]
3875 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3876 }
3877
3878 impl EncryptionState {
3879 /// Gets the enum value.
3880 ///
3881 /// Returns `None` if the enum contains an unknown value deserialized from
3882 /// the string representation of enums.
3883 pub fn value(&self) -> std::option::Option<i32> {
3884 match self {
3885 Self::Unspecified => std::option::Option::Some(0),
3886 Self::Pending => std::option::Option::Some(1),
3887 Self::Completed => std::option::Option::Some(2),
3888 Self::InProgress => std::option::Option::Some(3),
3889 Self::Failed => std::option::Option::Some(4),
3890 Self::UnknownValue(u) => u.0.value(),
3891 }
3892 }
3893
3894 /// Gets the enum value as a string.
3895 ///
3896 /// Returns `None` if the enum contains an unknown value deserialized from
3897 /// the integer representation of enums.
3898 pub fn name(&self) -> std::option::Option<&str> {
3899 match self {
3900 Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3901 Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3902 Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3903 Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3904 Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3905 Self::UnknownValue(u) => u.0.name(),
3906 }
3907 }
3908 }
3909
3910 impl std::default::Default for EncryptionState {
3911 fn default() -> Self {
3912 use std::convert::From;
3913 Self::from(0)
3914 }
3915 }
3916
3917 impl std::fmt::Display for EncryptionState {
3918 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3919 wkt::internal::display_enum(f, self.name(), self.value())
3920 }
3921 }
3922
3923 impl std::convert::From<i32> for EncryptionState {
3924 fn from(value: i32) -> Self {
3925 match value {
3926 0 => Self::Unspecified,
3927 1 => Self::Pending,
3928 2 => Self::Completed,
3929 3 => Self::InProgress,
3930 4 => Self::Failed,
3931 _ => Self::UnknownValue(encryption_state::UnknownValue(
3932 wkt::internal::UnknownEnumValue::Integer(value),
3933 )),
3934 }
3935 }
3936 }
3937
3938 impl std::convert::From<&str> for EncryptionState {
3939 fn from(value: &str) -> Self {
3940 use std::string::ToString;
3941 match value {
3942 "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
3943 "ENCRYPTION_STATE_PENDING" => Self::Pending,
3944 "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
3945 "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
3946 "ENCRYPTION_STATE_FAILED" => Self::Failed,
3947 _ => Self::UnknownValue(encryption_state::UnknownValue(
3948 wkt::internal::UnknownEnumValue::String(value.to_string()),
3949 )),
3950 }
3951 }
3952 }
3953
3954 impl serde::ser::Serialize for EncryptionState {
3955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3956 where
3957 S: serde::Serializer,
3958 {
3959 match self {
3960 Self::Unspecified => serializer.serialize_i32(0),
3961 Self::Pending => serializer.serialize_i32(1),
3962 Self::Completed => serializer.serialize_i32(2),
3963 Self::InProgress => serializer.serialize_i32(3),
3964 Self::Failed => serializer.serialize_i32(4),
3965 Self::UnknownValue(u) => u.0.serialize(serializer),
3966 }
3967 }
3968 }
3969
3970 impl<'de> serde::de::Deserialize<'de> for EncryptionState {
3971 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3972 where
3973 D: serde::Deserializer<'de>,
3974 {
3975 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
3976 ".google.cloud.netapp.v1.BackupVault.EncryptionState",
3977 ))
3978 }
3979 }
3980}
3981
3982/// GetBackupVaultRequest gets the state of a backupVault.
3983#[derive(Clone, Default, PartialEq)]
3984#[non_exhaustive]
3985pub struct GetBackupVaultRequest {
3986 /// Required. The backupVault resource name, in the format
3987 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3988 pub name: std::string::String,
3989
3990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3991}
3992
3993impl GetBackupVaultRequest {
3994 /// Creates a new default instance.
3995 pub fn new() -> Self {
3996 std::default::Default::default()
3997 }
3998
3999 /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
4000 ///
4001 /// # Example
4002 /// ```ignore,no_run
4003 /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
4004 /// let x = GetBackupVaultRequest::new().set_name("example");
4005 /// ```
4006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4007 self.name = v.into();
4008 self
4009 }
4010}
4011
4012impl wkt::message::Message for GetBackupVaultRequest {
4013 fn typename() -> &'static str {
4014 "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
4015 }
4016}
4017
4018/// ListBackupVaultsRequest lists backupVaults.
4019#[derive(Clone, Default, PartialEq)]
4020#[non_exhaustive]
4021pub struct ListBackupVaultsRequest {
4022 /// Required. The location for which to retrieve backupVault information,
4023 /// in the format
4024 /// `projects/{project_id}/locations/{location}`.
4025 pub parent: std::string::String,
4026
4027 /// The maximum number of items to return.
4028 pub page_size: i32,
4029
4030 /// The next_page_token value to use if there are additional
4031 /// results to retrieve for this list request.
4032 pub page_token: std::string::String,
4033
4034 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4035 pub order_by: std::string::String,
4036
4037 /// List filter.
4038 pub filter: std::string::String,
4039
4040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4041}
4042
4043impl ListBackupVaultsRequest {
4044 /// Creates a new default instance.
4045 pub fn new() -> Self {
4046 std::default::Default::default()
4047 }
4048
4049 /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4050 ///
4051 /// # Example
4052 /// ```ignore,no_run
4053 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4054 /// let x = ListBackupVaultsRequest::new().set_parent("example");
4055 /// ```
4056 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4057 self.parent = v.into();
4058 self
4059 }
4060
4061 /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4062 ///
4063 /// # Example
4064 /// ```ignore,no_run
4065 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4066 /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4067 /// ```
4068 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4069 self.page_size = v.into();
4070 self
4071 }
4072
4073 /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4074 ///
4075 /// # Example
4076 /// ```ignore,no_run
4077 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4078 /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4079 /// ```
4080 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4081 self.page_token = v.into();
4082 self
4083 }
4084
4085 /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4090 /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4091 /// ```
4092 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.order_by = v.into();
4094 self
4095 }
4096
4097 /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4098 ///
4099 /// # Example
4100 /// ```ignore,no_run
4101 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4102 /// let x = ListBackupVaultsRequest::new().set_filter("example");
4103 /// ```
4104 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4105 self.filter = v.into();
4106 self
4107 }
4108}
4109
4110impl wkt::message::Message for ListBackupVaultsRequest {
4111 fn typename() -> &'static str {
4112 "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4113 }
4114}
4115
4116/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4117#[derive(Clone, Default, PartialEq)]
4118#[non_exhaustive]
4119pub struct ListBackupVaultsResponse {
4120 /// A list of backupVaults in the project for the specified location.
4121 pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4122
4123 /// The token you can use to retrieve the next page of results. Not returned
4124 /// if there are no more results in the list.
4125 pub next_page_token: std::string::String,
4126
4127 /// Locations that could not be reached.
4128 pub unreachable: std::vec::Vec<std::string::String>,
4129
4130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4131}
4132
4133impl ListBackupVaultsResponse {
4134 /// Creates a new default instance.
4135 pub fn new() -> Self {
4136 std::default::Default::default()
4137 }
4138
4139 /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4140 ///
4141 /// # Example
4142 /// ```ignore,no_run
4143 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4144 /// use google_cloud_netapp_v1::model::BackupVault;
4145 /// let x = ListBackupVaultsResponse::new()
4146 /// .set_backup_vaults([
4147 /// BackupVault::default()/* use setters */,
4148 /// BackupVault::default()/* use (different) setters */,
4149 /// ]);
4150 /// ```
4151 pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4152 where
4153 T: std::iter::IntoIterator<Item = V>,
4154 V: std::convert::Into<crate::model::BackupVault>,
4155 {
4156 use std::iter::Iterator;
4157 self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4158 self
4159 }
4160
4161 /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4162 ///
4163 /// # Example
4164 /// ```ignore,no_run
4165 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4166 /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4167 /// ```
4168 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4169 self.next_page_token = v.into();
4170 self
4171 }
4172
4173 /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4174 ///
4175 /// # Example
4176 /// ```ignore,no_run
4177 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4178 /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4179 /// ```
4180 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4181 where
4182 T: std::iter::IntoIterator<Item = V>,
4183 V: std::convert::Into<std::string::String>,
4184 {
4185 use std::iter::Iterator;
4186 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4187 self
4188 }
4189}
4190
4191impl wkt::message::Message for ListBackupVaultsResponse {
4192 fn typename() -> &'static str {
4193 "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4194 }
4195}
4196
4197#[doc(hidden)]
4198impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4199 type PageItem = crate::model::BackupVault;
4200
4201 fn items(self) -> std::vec::Vec<Self::PageItem> {
4202 self.backup_vaults
4203 }
4204
4205 fn next_page_token(&self) -> std::string::String {
4206 use std::clone::Clone;
4207 self.next_page_token.clone()
4208 }
4209}
4210
4211/// CreateBackupVaultRequest creates a backup vault.
4212#[derive(Clone, Default, PartialEq)]
4213#[non_exhaustive]
4214pub struct CreateBackupVaultRequest {
4215 /// Required. The location to create the backup vaults, in the format
4216 /// `projects/{project_id}/locations/{location}`
4217 pub parent: std::string::String,
4218
4219 /// Required. The ID to use for the backupVault.
4220 /// The ID must be unique within the specified location.
4221 /// Must contain only letters, numbers and hyphen, with the first
4222 /// character a letter, the last a letter or a
4223 /// number, and a 63 character maximum.
4224 pub backup_vault_id: std::string::String,
4225
4226 /// Required. A backupVault resource
4227 pub backup_vault: std::option::Option<crate::model::BackupVault>,
4228
4229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4230}
4231
4232impl CreateBackupVaultRequest {
4233 /// Creates a new default instance.
4234 pub fn new() -> Self {
4235 std::default::Default::default()
4236 }
4237
4238 /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4239 ///
4240 /// # Example
4241 /// ```ignore,no_run
4242 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4243 /// let x = CreateBackupVaultRequest::new().set_parent("example");
4244 /// ```
4245 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4246 self.parent = v.into();
4247 self
4248 }
4249
4250 /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4255 /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4256 /// ```
4257 pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4258 self.backup_vault_id = v.into();
4259 self
4260 }
4261
4262 /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4263 ///
4264 /// # Example
4265 /// ```ignore,no_run
4266 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4267 /// use google_cloud_netapp_v1::model::BackupVault;
4268 /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4269 /// ```
4270 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4271 where
4272 T: std::convert::Into<crate::model::BackupVault>,
4273 {
4274 self.backup_vault = std::option::Option::Some(v.into());
4275 self
4276 }
4277
4278 /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4279 ///
4280 /// # Example
4281 /// ```ignore,no_run
4282 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4283 /// use google_cloud_netapp_v1::model::BackupVault;
4284 /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4285 /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4286 /// ```
4287 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4288 where
4289 T: std::convert::Into<crate::model::BackupVault>,
4290 {
4291 self.backup_vault = v.map(|x| x.into());
4292 self
4293 }
4294}
4295
4296impl wkt::message::Message for CreateBackupVaultRequest {
4297 fn typename() -> &'static str {
4298 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4299 }
4300}
4301
4302/// DeleteBackupVaultRequest deletes a backupVault.
4303#[derive(Clone, Default, PartialEq)]
4304#[non_exhaustive]
4305pub struct DeleteBackupVaultRequest {
4306 /// Required. The backupVault resource name, in the format
4307 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4308 pub name: std::string::String,
4309
4310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4311}
4312
4313impl DeleteBackupVaultRequest {
4314 /// Creates a new default instance.
4315 pub fn new() -> Self {
4316 std::default::Default::default()
4317 }
4318
4319 /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4320 ///
4321 /// # Example
4322 /// ```ignore,no_run
4323 /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4324 /// let x = DeleteBackupVaultRequest::new().set_name("example");
4325 /// ```
4326 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4327 self.name = v.into();
4328 self
4329 }
4330}
4331
4332impl wkt::message::Message for DeleteBackupVaultRequest {
4333 fn typename() -> &'static str {
4334 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4335 }
4336}
4337
4338/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4339#[derive(Clone, Default, PartialEq)]
4340#[non_exhaustive]
4341pub struct UpdateBackupVaultRequest {
4342 /// Required. Field mask is used to specify the fields to be overwritten in the
4343 /// Backup resource to be updated.
4344 /// The fields specified in the update_mask are relative to the resource, not
4345 /// the full request. A field will be overwritten if it is in the mask. If the
4346 /// user does not provide a mask then all fields will be overwritten.
4347 pub update_mask: std::option::Option<wkt::FieldMask>,
4348
4349 /// Required. The backupVault being updated
4350 pub backup_vault: std::option::Option<crate::model::BackupVault>,
4351
4352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4353}
4354
4355impl UpdateBackupVaultRequest {
4356 /// Creates a new default instance.
4357 pub fn new() -> Self {
4358 std::default::Default::default()
4359 }
4360
4361 /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4362 ///
4363 /// # Example
4364 /// ```ignore,no_run
4365 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4366 /// use wkt::FieldMask;
4367 /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4368 /// ```
4369 pub fn set_update_mask<T>(mut self, v: T) -> Self
4370 where
4371 T: std::convert::Into<wkt::FieldMask>,
4372 {
4373 self.update_mask = std::option::Option::Some(v.into());
4374 self
4375 }
4376
4377 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4378 ///
4379 /// # Example
4380 /// ```ignore,no_run
4381 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4382 /// use wkt::FieldMask;
4383 /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4384 /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4385 /// ```
4386 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4387 where
4388 T: std::convert::Into<wkt::FieldMask>,
4389 {
4390 self.update_mask = v.map(|x| x.into());
4391 self
4392 }
4393
4394 /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4395 ///
4396 /// # Example
4397 /// ```ignore,no_run
4398 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4399 /// use google_cloud_netapp_v1::model::BackupVault;
4400 /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4401 /// ```
4402 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4403 where
4404 T: std::convert::Into<crate::model::BackupVault>,
4405 {
4406 self.backup_vault = std::option::Option::Some(v.into());
4407 self
4408 }
4409
4410 /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4411 ///
4412 /// # Example
4413 /// ```ignore,no_run
4414 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4415 /// use google_cloud_netapp_v1::model::BackupVault;
4416 /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4417 /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4418 /// ```
4419 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4420 where
4421 T: std::convert::Into<crate::model::BackupVault>,
4422 {
4423 self.backup_vault = v.map(|x| x.into());
4424 self
4425 }
4426}
4427
4428impl wkt::message::Message for UpdateBackupVaultRequest {
4429 fn typename() -> &'static str {
4430 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4431 }
4432}
4433
4434/// Represents the metadata of the long-running operation.
4435#[derive(Clone, Default, PartialEq)]
4436#[non_exhaustive]
4437pub struct OperationMetadata {
4438 /// Output only. The time the operation was created.
4439 pub create_time: std::option::Option<wkt::Timestamp>,
4440
4441 /// Output only. The time the operation finished running.
4442 pub end_time: std::option::Option<wkt::Timestamp>,
4443
4444 /// Output only. Server-defined resource path for the target of the operation.
4445 pub target: std::string::String,
4446
4447 /// Output only. Name of the verb executed by the operation.
4448 pub verb: std::string::String,
4449
4450 /// Output only. Human-readable status of the operation, if any.
4451 pub status_message: std::string::String,
4452
4453 /// Output only. Identifies whether the user has requested cancellation
4454 /// of the operation. Operations that have been canceled successfully
4455 /// have [Operation.error][] value with a
4456 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4457 /// `Code.CANCELLED`.
4458 ///
4459 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4460 pub requested_cancellation: bool,
4461
4462 /// Output only. API version used to start the operation.
4463 pub api_version: std::string::String,
4464
4465 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4466}
4467
4468impl OperationMetadata {
4469 /// Creates a new default instance.
4470 pub fn new() -> Self {
4471 std::default::Default::default()
4472 }
4473
4474 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4475 ///
4476 /// # Example
4477 /// ```ignore,no_run
4478 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4479 /// use wkt::Timestamp;
4480 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4481 /// ```
4482 pub fn set_create_time<T>(mut self, v: T) -> Self
4483 where
4484 T: std::convert::Into<wkt::Timestamp>,
4485 {
4486 self.create_time = std::option::Option::Some(v.into());
4487 self
4488 }
4489
4490 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4491 ///
4492 /// # Example
4493 /// ```ignore,no_run
4494 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4495 /// use wkt::Timestamp;
4496 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4497 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4498 /// ```
4499 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4500 where
4501 T: std::convert::Into<wkt::Timestamp>,
4502 {
4503 self.create_time = v.map(|x| x.into());
4504 self
4505 }
4506
4507 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4508 ///
4509 /// # Example
4510 /// ```ignore,no_run
4511 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4512 /// use wkt::Timestamp;
4513 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4514 /// ```
4515 pub fn set_end_time<T>(mut self, v: T) -> Self
4516 where
4517 T: std::convert::Into<wkt::Timestamp>,
4518 {
4519 self.end_time = std::option::Option::Some(v.into());
4520 self
4521 }
4522
4523 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4524 ///
4525 /// # Example
4526 /// ```ignore,no_run
4527 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4528 /// use wkt::Timestamp;
4529 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4530 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4531 /// ```
4532 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4533 where
4534 T: std::convert::Into<wkt::Timestamp>,
4535 {
4536 self.end_time = v.map(|x| x.into());
4537 self
4538 }
4539
4540 /// Sets the value of [target][crate::model::OperationMetadata::target].
4541 ///
4542 /// # Example
4543 /// ```ignore,no_run
4544 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4545 /// let x = OperationMetadata::new().set_target("example");
4546 /// ```
4547 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4548 self.target = v.into();
4549 self
4550 }
4551
4552 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4553 ///
4554 /// # Example
4555 /// ```ignore,no_run
4556 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4557 /// let x = OperationMetadata::new().set_verb("example");
4558 /// ```
4559 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4560 self.verb = v.into();
4561 self
4562 }
4563
4564 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4565 ///
4566 /// # Example
4567 /// ```ignore,no_run
4568 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4569 /// let x = OperationMetadata::new().set_status_message("example");
4570 /// ```
4571 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4572 self.status_message = v.into();
4573 self
4574 }
4575
4576 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4577 ///
4578 /// # Example
4579 /// ```ignore,no_run
4580 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4581 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4582 /// ```
4583 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4584 self.requested_cancellation = v.into();
4585 self
4586 }
4587
4588 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4589 ///
4590 /// # Example
4591 /// ```ignore,no_run
4592 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4593 /// let x = OperationMetadata::new().set_api_version("example");
4594 /// ```
4595 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4596 self.api_version = v.into();
4597 self
4598 }
4599}
4600
4601impl wkt::message::Message for OperationMetadata {
4602 fn typename() -> &'static str {
4603 "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4604 }
4605}
4606
4607/// Metadata for a given
4608/// [google.cloud.location.Location][google.cloud.location.Location].
4609///
4610/// [google.cloud.location.Location]: google_cloud_location::model::Location
4611#[derive(Clone, Default, PartialEq)]
4612#[non_exhaustive]
4613pub struct LocationMetadata {
4614 /// Output only. Supported service levels in a location.
4615 pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4616
4617 /// Output only. Supported flex performance in a location.
4618 pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4619
4620 /// Output only. Indicates if the location has VCP support.
4621 pub has_vcp: bool,
4622
4623 /// Output only. Indicates if the location has ONTAP Proxy support.
4624 pub has_ontap_proxy: bool,
4625
4626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4627}
4628
4629impl LocationMetadata {
4630 /// Creates a new default instance.
4631 pub fn new() -> Self {
4632 std::default::Default::default()
4633 }
4634
4635 /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4636 ///
4637 /// # Example
4638 /// ```ignore,no_run
4639 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4640 /// use google_cloud_netapp_v1::model::ServiceLevel;
4641 /// let x = LocationMetadata::new().set_supported_service_levels([
4642 /// ServiceLevel::Premium,
4643 /// ServiceLevel::Extreme,
4644 /// ServiceLevel::Standard,
4645 /// ]);
4646 /// ```
4647 pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4648 where
4649 T: std::iter::IntoIterator<Item = V>,
4650 V: std::convert::Into<crate::model::ServiceLevel>,
4651 {
4652 use std::iter::Iterator;
4653 self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4654 self
4655 }
4656
4657 /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4658 ///
4659 /// # Example
4660 /// ```ignore,no_run
4661 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4662 /// use google_cloud_netapp_v1::model::FlexPerformance;
4663 /// let x = LocationMetadata::new().set_supported_flex_performance([
4664 /// FlexPerformance::Default,
4665 /// FlexPerformance::Custom,
4666 /// ]);
4667 /// ```
4668 pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4669 where
4670 T: std::iter::IntoIterator<Item = V>,
4671 V: std::convert::Into<crate::model::FlexPerformance>,
4672 {
4673 use std::iter::Iterator;
4674 self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4675 self
4676 }
4677
4678 /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4679 ///
4680 /// # Example
4681 /// ```ignore,no_run
4682 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4683 /// let x = LocationMetadata::new().set_has_vcp(true);
4684 /// ```
4685 pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4686 self.has_vcp = v.into();
4687 self
4688 }
4689
4690 /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4691 ///
4692 /// # Example
4693 /// ```ignore,no_run
4694 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4695 /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4696 /// ```
4697 pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4698 self.has_ontap_proxy = v.into();
4699 self
4700 }
4701}
4702
4703impl wkt::message::Message for LocationMetadata {
4704 fn typename() -> &'static str {
4705 "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4706 }
4707}
4708
4709/// UserCommands contains the commands to be executed by the customer.
4710#[derive(Clone, Default, PartialEq)]
4711#[non_exhaustive]
4712pub struct UserCommands {
4713 /// Output only. List of commands to be executed by the customer.
4714 pub commands: std::vec::Vec<std::string::String>,
4715
4716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4717}
4718
4719impl UserCommands {
4720 /// Creates a new default instance.
4721 pub fn new() -> Self {
4722 std::default::Default::default()
4723 }
4724
4725 /// Sets the value of [commands][crate::model::UserCommands::commands].
4726 ///
4727 /// # Example
4728 /// ```ignore,no_run
4729 /// # use google_cloud_netapp_v1::model::UserCommands;
4730 /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4731 /// ```
4732 pub fn set_commands<T, V>(mut self, v: T) -> Self
4733 where
4734 T: std::iter::IntoIterator<Item = V>,
4735 V: std::convert::Into<std::string::String>,
4736 {
4737 use std::iter::Iterator;
4738 self.commands = v.into_iter().map(|i| i.into()).collect();
4739 self
4740 }
4741}
4742
4743impl wkt::message::Message for UserCommands {
4744 fn typename() -> &'static str {
4745 "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4746 }
4747}
4748
4749/// ListHostGroupsRequest for listing host groups.
4750#[derive(Clone, Default, PartialEq)]
4751#[non_exhaustive]
4752pub struct ListHostGroupsRequest {
4753 /// Required. Parent value for ListHostGroupsRequest
4754 pub parent: std::string::String,
4755
4756 /// Optional. Requested page size. Server may return fewer items than
4757 /// requested. If unspecified, the server will pick an appropriate default.
4758 pub page_size: i32,
4759
4760 /// Optional. A token identifying a page of results the server should return.
4761 pub page_token: std::string::String,
4762
4763 /// Optional. Filter to apply to the request.
4764 pub filter: std::string::String,
4765
4766 /// Optional. Hint for how to order the results
4767 pub order_by: std::string::String,
4768
4769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4770}
4771
4772impl ListHostGroupsRequest {
4773 /// Creates a new default instance.
4774 pub fn new() -> Self {
4775 std::default::Default::default()
4776 }
4777
4778 /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4779 ///
4780 /// # Example
4781 /// ```ignore,no_run
4782 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4783 /// let x = ListHostGroupsRequest::new().set_parent("example");
4784 /// ```
4785 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786 self.parent = v.into();
4787 self
4788 }
4789
4790 /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4791 ///
4792 /// # Example
4793 /// ```ignore,no_run
4794 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4795 /// let x = ListHostGroupsRequest::new().set_page_size(42);
4796 /// ```
4797 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4798 self.page_size = v.into();
4799 self
4800 }
4801
4802 /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4803 ///
4804 /// # Example
4805 /// ```ignore,no_run
4806 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4807 /// let x = ListHostGroupsRequest::new().set_page_token("example");
4808 /// ```
4809 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4810 self.page_token = v.into();
4811 self
4812 }
4813
4814 /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4815 ///
4816 /// # Example
4817 /// ```ignore,no_run
4818 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4819 /// let x = ListHostGroupsRequest::new().set_filter("example");
4820 /// ```
4821 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4822 self.filter = v.into();
4823 self
4824 }
4825
4826 /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4827 ///
4828 /// # Example
4829 /// ```ignore,no_run
4830 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4831 /// let x = ListHostGroupsRequest::new().set_order_by("example");
4832 /// ```
4833 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4834 self.order_by = v.into();
4835 self
4836 }
4837}
4838
4839impl wkt::message::Message for ListHostGroupsRequest {
4840 fn typename() -> &'static str {
4841 "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4842 }
4843}
4844
4845/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4846#[derive(Clone, Default, PartialEq)]
4847#[non_exhaustive]
4848pub struct ListHostGroupsResponse {
4849 /// The list of host groups.
4850 pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4851
4852 /// A token identifying a page of results the server should return.
4853 pub next_page_token: std::string::String,
4854
4855 /// Locations that could not be reached.
4856 pub unreachable: std::vec::Vec<std::string::String>,
4857
4858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4859}
4860
4861impl ListHostGroupsResponse {
4862 /// Creates a new default instance.
4863 pub fn new() -> Self {
4864 std::default::Default::default()
4865 }
4866
4867 /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4868 ///
4869 /// # Example
4870 /// ```ignore,no_run
4871 /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4872 /// use google_cloud_netapp_v1::model::HostGroup;
4873 /// let x = ListHostGroupsResponse::new()
4874 /// .set_host_groups([
4875 /// HostGroup::default()/* use setters */,
4876 /// HostGroup::default()/* use (different) setters */,
4877 /// ]);
4878 /// ```
4879 pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4880 where
4881 T: std::iter::IntoIterator<Item = V>,
4882 V: std::convert::Into<crate::model::HostGroup>,
4883 {
4884 use std::iter::Iterator;
4885 self.host_groups = v.into_iter().map(|i| i.into()).collect();
4886 self
4887 }
4888
4889 /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4890 ///
4891 /// # Example
4892 /// ```ignore,no_run
4893 /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4894 /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4895 /// ```
4896 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4897 self.next_page_token = v.into();
4898 self
4899 }
4900
4901 /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4902 ///
4903 /// # Example
4904 /// ```ignore,no_run
4905 /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4906 /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4907 /// ```
4908 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4909 where
4910 T: std::iter::IntoIterator<Item = V>,
4911 V: std::convert::Into<std::string::String>,
4912 {
4913 use std::iter::Iterator;
4914 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4915 self
4916 }
4917}
4918
4919impl wkt::message::Message for ListHostGroupsResponse {
4920 fn typename() -> &'static str {
4921 "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
4922 }
4923}
4924
4925#[doc(hidden)]
4926impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
4927 type PageItem = crate::model::HostGroup;
4928
4929 fn items(self) -> std::vec::Vec<Self::PageItem> {
4930 self.host_groups
4931 }
4932
4933 fn next_page_token(&self) -> std::string::String {
4934 use std::clone::Clone;
4935 self.next_page_token.clone()
4936 }
4937}
4938
4939/// GetHostGroupRequest for getting a host group.
4940#[derive(Clone, Default, PartialEq)]
4941#[non_exhaustive]
4942pub struct GetHostGroupRequest {
4943 /// Required. The resource name of the host group.
4944 /// Format:
4945 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
4946 pub name: std::string::String,
4947
4948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4949}
4950
4951impl GetHostGroupRequest {
4952 /// Creates a new default instance.
4953 pub fn new() -> Self {
4954 std::default::Default::default()
4955 }
4956
4957 /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
4958 ///
4959 /// # Example
4960 /// ```ignore,no_run
4961 /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
4962 /// let x = GetHostGroupRequest::new().set_name("example");
4963 /// ```
4964 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4965 self.name = v.into();
4966 self
4967 }
4968}
4969
4970impl wkt::message::Message for GetHostGroupRequest {
4971 fn typename() -> &'static str {
4972 "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
4973 }
4974}
4975
4976/// CreateHostGroupRequest for creating a host group.
4977#[derive(Clone, Default, PartialEq)]
4978#[non_exhaustive]
4979pub struct CreateHostGroupRequest {
4980 /// Required. Parent value for CreateHostGroupRequest
4981 pub parent: std::string::String,
4982
4983 /// Required. Fields of the host group to create.
4984 pub host_group: std::option::Option<crate::model::HostGroup>,
4985
4986 /// Required. ID of the host group to create. Must be unique within the parent
4987 /// resource. Must contain only letters, numbers, and hyphen, with
4988 /// the first character a letter or underscore, the last a letter or underscore
4989 /// or a number, and a 63 character maximum.
4990 pub host_group_id: std::string::String,
4991
4992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4993}
4994
4995impl CreateHostGroupRequest {
4996 /// Creates a new default instance.
4997 pub fn new() -> Self {
4998 std::default::Default::default()
4999 }
5000
5001 /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
5002 ///
5003 /// # Example
5004 /// ```ignore,no_run
5005 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5006 /// let x = CreateHostGroupRequest::new().set_parent("example");
5007 /// ```
5008 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5009 self.parent = v.into();
5010 self
5011 }
5012
5013 /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
5014 ///
5015 /// # Example
5016 /// ```ignore,no_run
5017 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5018 /// use google_cloud_netapp_v1::model::HostGroup;
5019 /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5020 /// ```
5021 pub fn set_host_group<T>(mut self, v: T) -> Self
5022 where
5023 T: std::convert::Into<crate::model::HostGroup>,
5024 {
5025 self.host_group = std::option::Option::Some(v.into());
5026 self
5027 }
5028
5029 /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
5030 ///
5031 /// # Example
5032 /// ```ignore,no_run
5033 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5034 /// use google_cloud_netapp_v1::model::HostGroup;
5035 /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5036 /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5037 /// ```
5038 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5039 where
5040 T: std::convert::Into<crate::model::HostGroup>,
5041 {
5042 self.host_group = v.map(|x| x.into());
5043 self
5044 }
5045
5046 /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5047 ///
5048 /// # Example
5049 /// ```ignore,no_run
5050 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5051 /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5052 /// ```
5053 pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5054 self.host_group_id = v.into();
5055 self
5056 }
5057}
5058
5059impl wkt::message::Message for CreateHostGroupRequest {
5060 fn typename() -> &'static str {
5061 "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5062 }
5063}
5064
5065/// UpdateHostGroupRequest for updating a host group.
5066#[derive(Clone, Default, PartialEq)]
5067#[non_exhaustive]
5068pub struct UpdateHostGroupRequest {
5069 /// Required. The host group to update.
5070 /// The host group's `name` field is used to identify the host group.
5071 /// Format:
5072 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5073 pub host_group: std::option::Option<crate::model::HostGroup>,
5074
5075 /// Optional. The list of fields to update.
5076 pub update_mask: std::option::Option<wkt::FieldMask>,
5077
5078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5079}
5080
5081impl UpdateHostGroupRequest {
5082 /// Creates a new default instance.
5083 pub fn new() -> Self {
5084 std::default::Default::default()
5085 }
5086
5087 /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5088 ///
5089 /// # Example
5090 /// ```ignore,no_run
5091 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5092 /// use google_cloud_netapp_v1::model::HostGroup;
5093 /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5094 /// ```
5095 pub fn set_host_group<T>(mut self, v: T) -> Self
5096 where
5097 T: std::convert::Into<crate::model::HostGroup>,
5098 {
5099 self.host_group = std::option::Option::Some(v.into());
5100 self
5101 }
5102
5103 /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5104 ///
5105 /// # Example
5106 /// ```ignore,no_run
5107 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5108 /// use google_cloud_netapp_v1::model::HostGroup;
5109 /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5110 /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5111 /// ```
5112 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5113 where
5114 T: std::convert::Into<crate::model::HostGroup>,
5115 {
5116 self.host_group = v.map(|x| x.into());
5117 self
5118 }
5119
5120 /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5121 ///
5122 /// # Example
5123 /// ```ignore,no_run
5124 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5125 /// use wkt::FieldMask;
5126 /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5127 /// ```
5128 pub fn set_update_mask<T>(mut self, v: T) -> Self
5129 where
5130 T: std::convert::Into<wkt::FieldMask>,
5131 {
5132 self.update_mask = std::option::Option::Some(v.into());
5133 self
5134 }
5135
5136 /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5137 ///
5138 /// # Example
5139 /// ```ignore,no_run
5140 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5141 /// use wkt::FieldMask;
5142 /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5143 /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5144 /// ```
5145 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5146 where
5147 T: std::convert::Into<wkt::FieldMask>,
5148 {
5149 self.update_mask = v.map(|x| x.into());
5150 self
5151 }
5152}
5153
5154impl wkt::message::Message for UpdateHostGroupRequest {
5155 fn typename() -> &'static str {
5156 "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5157 }
5158}
5159
5160/// DeleteHostGroupRequest for deleting a single host group.
5161#[derive(Clone, Default, PartialEq)]
5162#[non_exhaustive]
5163pub struct DeleteHostGroupRequest {
5164 /// Required. The resource name of the host group.
5165 /// Format:
5166 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5167 pub name: std::string::String,
5168
5169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5170}
5171
5172impl DeleteHostGroupRequest {
5173 /// Creates a new default instance.
5174 pub fn new() -> Self {
5175 std::default::Default::default()
5176 }
5177
5178 /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5179 ///
5180 /// # Example
5181 /// ```ignore,no_run
5182 /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5183 /// let x = DeleteHostGroupRequest::new().set_name("example");
5184 /// ```
5185 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5186 self.name = v.into();
5187 self
5188 }
5189}
5190
5191impl wkt::message::Message for DeleteHostGroupRequest {
5192 fn typename() -> &'static str {
5193 "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5194 }
5195}
5196
5197/// Host group is a collection of hosts that can be used for accessing a Block
5198/// Volume.
5199#[derive(Clone, Default, PartialEq)]
5200#[non_exhaustive]
5201pub struct HostGroup {
5202 /// Identifier. The resource name of the host group.
5203 /// Format:
5204 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5205 pub name: std::string::String,
5206
5207 /// Required. Type of the host group.
5208 pub r#type: crate::model::host_group::Type,
5209
5210 /// Output only. State of the host group.
5211 pub state: crate::model::host_group::State,
5212
5213 /// Output only. Create time of the host group.
5214 pub create_time: std::option::Option<wkt::Timestamp>,
5215
5216 /// Required. The list of hosts associated with the host group.
5217 pub hosts: std::vec::Vec<std::string::String>,
5218
5219 /// Required. The OS type of the host group. It indicates the type of operating
5220 /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5221 /// must be of the same OS type. This can be set only when creating a
5222 /// HostGroup.
5223 pub os_type: crate::model::OsType,
5224
5225 /// Optional. Description of the host group.
5226 pub description: std::string::String,
5227
5228 /// Optional. Labels of the host group.
5229 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5230
5231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5232}
5233
5234impl HostGroup {
5235 /// Creates a new default instance.
5236 pub fn new() -> Self {
5237 std::default::Default::default()
5238 }
5239
5240 /// Sets the value of [name][crate::model::HostGroup::name].
5241 ///
5242 /// # Example
5243 /// ```ignore,no_run
5244 /// # use google_cloud_netapp_v1::model::HostGroup;
5245 /// let x = HostGroup::new().set_name("example");
5246 /// ```
5247 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5248 self.name = v.into();
5249 self
5250 }
5251
5252 /// Sets the value of [r#type][crate::model::HostGroup::type].
5253 ///
5254 /// # Example
5255 /// ```ignore,no_run
5256 /// # use google_cloud_netapp_v1::model::HostGroup;
5257 /// use google_cloud_netapp_v1::model::host_group::Type;
5258 /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5259 /// ```
5260 pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5261 self.r#type = v.into();
5262 self
5263 }
5264
5265 /// Sets the value of [state][crate::model::HostGroup::state].
5266 ///
5267 /// # Example
5268 /// ```ignore,no_run
5269 /// # use google_cloud_netapp_v1::model::HostGroup;
5270 /// use google_cloud_netapp_v1::model::host_group::State;
5271 /// let x0 = HostGroup::new().set_state(State::Creating);
5272 /// let x1 = HostGroup::new().set_state(State::Ready);
5273 /// let x2 = HostGroup::new().set_state(State::Updating);
5274 /// ```
5275 pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5276 mut self,
5277 v: T,
5278 ) -> Self {
5279 self.state = v.into();
5280 self
5281 }
5282
5283 /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5284 ///
5285 /// # Example
5286 /// ```ignore,no_run
5287 /// # use google_cloud_netapp_v1::model::HostGroup;
5288 /// use wkt::Timestamp;
5289 /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5290 /// ```
5291 pub fn set_create_time<T>(mut self, v: T) -> Self
5292 where
5293 T: std::convert::Into<wkt::Timestamp>,
5294 {
5295 self.create_time = std::option::Option::Some(v.into());
5296 self
5297 }
5298
5299 /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5300 ///
5301 /// # Example
5302 /// ```ignore,no_run
5303 /// # use google_cloud_netapp_v1::model::HostGroup;
5304 /// use wkt::Timestamp;
5305 /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5306 /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5307 /// ```
5308 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5309 where
5310 T: std::convert::Into<wkt::Timestamp>,
5311 {
5312 self.create_time = v.map(|x| x.into());
5313 self
5314 }
5315
5316 /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5317 ///
5318 /// # Example
5319 /// ```ignore,no_run
5320 /// # use google_cloud_netapp_v1::model::HostGroup;
5321 /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5322 /// ```
5323 pub fn set_hosts<T, V>(mut self, v: T) -> Self
5324 where
5325 T: std::iter::IntoIterator<Item = V>,
5326 V: std::convert::Into<std::string::String>,
5327 {
5328 use std::iter::Iterator;
5329 self.hosts = v.into_iter().map(|i| i.into()).collect();
5330 self
5331 }
5332
5333 /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_netapp_v1::model::HostGroup;
5338 /// use google_cloud_netapp_v1::model::OsType;
5339 /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5340 /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5341 /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5342 /// ```
5343 pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5344 self.os_type = v.into();
5345 self
5346 }
5347
5348 /// Sets the value of [description][crate::model::HostGroup::description].
5349 ///
5350 /// # Example
5351 /// ```ignore,no_run
5352 /// # use google_cloud_netapp_v1::model::HostGroup;
5353 /// let x = HostGroup::new().set_description("example");
5354 /// ```
5355 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5356 self.description = v.into();
5357 self
5358 }
5359
5360 /// Sets the value of [labels][crate::model::HostGroup::labels].
5361 ///
5362 /// # Example
5363 /// ```ignore,no_run
5364 /// # use google_cloud_netapp_v1::model::HostGroup;
5365 /// let x = HostGroup::new().set_labels([
5366 /// ("key0", "abc"),
5367 /// ("key1", "xyz"),
5368 /// ]);
5369 /// ```
5370 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5371 where
5372 T: std::iter::IntoIterator<Item = (K, V)>,
5373 K: std::convert::Into<std::string::String>,
5374 V: std::convert::Into<std::string::String>,
5375 {
5376 use std::iter::Iterator;
5377 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5378 self
5379 }
5380}
5381
5382impl wkt::message::Message for HostGroup {
5383 fn typename() -> &'static str {
5384 "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5385 }
5386}
5387
5388/// Defines additional types related to [HostGroup].
5389pub mod host_group {
5390 #[allow(unused_imports)]
5391 use super::*;
5392
5393 /// Types of host group.
5394 ///
5395 /// # Working with unknown values
5396 ///
5397 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5398 /// additional enum variants at any time. Adding new variants is not considered
5399 /// a breaking change. Applications should write their code in anticipation of:
5400 ///
5401 /// - New values appearing in future releases of the client library, **and**
5402 /// - New values received dynamically, without application changes.
5403 ///
5404 /// Please consult the [Working with enums] section in the user guide for some
5405 /// guidelines.
5406 ///
5407 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5408 #[derive(Clone, Debug, PartialEq)]
5409 #[non_exhaustive]
5410 pub enum Type {
5411 /// Unspecified type for host group.
5412 Unspecified,
5413 /// iSCSI initiator host group.
5414 IscsiInitiator,
5415 /// If set, the enum was initialized with an unknown value.
5416 ///
5417 /// Applications can examine the value using [Type::value] or
5418 /// [Type::name].
5419 UnknownValue(r#type::UnknownValue),
5420 }
5421
5422 #[doc(hidden)]
5423 pub mod r#type {
5424 #[allow(unused_imports)]
5425 use super::*;
5426 #[derive(Clone, Debug, PartialEq)]
5427 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5428 }
5429
5430 impl Type {
5431 /// Gets the enum value.
5432 ///
5433 /// Returns `None` if the enum contains an unknown value deserialized from
5434 /// the string representation of enums.
5435 pub fn value(&self) -> std::option::Option<i32> {
5436 match self {
5437 Self::Unspecified => std::option::Option::Some(0),
5438 Self::IscsiInitiator => std::option::Option::Some(1),
5439 Self::UnknownValue(u) => u.0.value(),
5440 }
5441 }
5442
5443 /// Gets the enum value as a string.
5444 ///
5445 /// Returns `None` if the enum contains an unknown value deserialized from
5446 /// the integer representation of enums.
5447 pub fn name(&self) -> std::option::Option<&str> {
5448 match self {
5449 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5450 Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5451 Self::UnknownValue(u) => u.0.name(),
5452 }
5453 }
5454 }
5455
5456 impl std::default::Default for Type {
5457 fn default() -> Self {
5458 use std::convert::From;
5459 Self::from(0)
5460 }
5461 }
5462
5463 impl std::fmt::Display for Type {
5464 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5465 wkt::internal::display_enum(f, self.name(), self.value())
5466 }
5467 }
5468
5469 impl std::convert::From<i32> for Type {
5470 fn from(value: i32) -> Self {
5471 match value {
5472 0 => Self::Unspecified,
5473 1 => Self::IscsiInitiator,
5474 _ => Self::UnknownValue(r#type::UnknownValue(
5475 wkt::internal::UnknownEnumValue::Integer(value),
5476 )),
5477 }
5478 }
5479 }
5480
5481 impl std::convert::From<&str> for Type {
5482 fn from(value: &str) -> Self {
5483 use std::string::ToString;
5484 match value {
5485 "TYPE_UNSPECIFIED" => Self::Unspecified,
5486 "ISCSI_INITIATOR" => Self::IscsiInitiator,
5487 _ => Self::UnknownValue(r#type::UnknownValue(
5488 wkt::internal::UnknownEnumValue::String(value.to_string()),
5489 )),
5490 }
5491 }
5492 }
5493
5494 impl serde::ser::Serialize for Type {
5495 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5496 where
5497 S: serde::Serializer,
5498 {
5499 match self {
5500 Self::Unspecified => serializer.serialize_i32(0),
5501 Self::IscsiInitiator => serializer.serialize_i32(1),
5502 Self::UnknownValue(u) => u.0.serialize(serializer),
5503 }
5504 }
5505 }
5506
5507 impl<'de> serde::de::Deserialize<'de> for Type {
5508 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5509 where
5510 D: serde::Deserializer<'de>,
5511 {
5512 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5513 ".google.cloud.netapp.v1.HostGroup.Type",
5514 ))
5515 }
5516 }
5517
5518 /// Host group states.
5519 ///
5520 /// # Working with unknown values
5521 ///
5522 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5523 /// additional enum variants at any time. Adding new variants is not considered
5524 /// a breaking change. Applications should write their code in anticipation of:
5525 ///
5526 /// - New values appearing in future releases of the client library, **and**
5527 /// - New values received dynamically, without application changes.
5528 ///
5529 /// Please consult the [Working with enums] section in the user guide for some
5530 /// guidelines.
5531 ///
5532 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5533 #[derive(Clone, Debug, PartialEq)]
5534 #[non_exhaustive]
5535 pub enum State {
5536 /// Unspecified state for host group.
5537 Unspecified,
5538 /// Host group is creating.
5539 Creating,
5540 /// Host group is ready.
5541 Ready,
5542 /// Host group is updating.
5543 Updating,
5544 /// Host group is deleting.
5545 Deleting,
5546 /// Host group is disabled.
5547 Disabled,
5548 /// If set, the enum was initialized with an unknown value.
5549 ///
5550 /// Applications can examine the value using [State::value] or
5551 /// [State::name].
5552 UnknownValue(state::UnknownValue),
5553 }
5554
5555 #[doc(hidden)]
5556 pub mod state {
5557 #[allow(unused_imports)]
5558 use super::*;
5559 #[derive(Clone, Debug, PartialEq)]
5560 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5561 }
5562
5563 impl State {
5564 /// Gets the enum value.
5565 ///
5566 /// Returns `None` if the enum contains an unknown value deserialized from
5567 /// the string representation of enums.
5568 pub fn value(&self) -> std::option::Option<i32> {
5569 match self {
5570 Self::Unspecified => std::option::Option::Some(0),
5571 Self::Creating => std::option::Option::Some(1),
5572 Self::Ready => std::option::Option::Some(2),
5573 Self::Updating => std::option::Option::Some(3),
5574 Self::Deleting => std::option::Option::Some(4),
5575 Self::Disabled => std::option::Option::Some(5),
5576 Self::UnknownValue(u) => u.0.value(),
5577 }
5578 }
5579
5580 /// Gets the enum value as a string.
5581 ///
5582 /// Returns `None` if the enum contains an unknown value deserialized from
5583 /// the integer representation of enums.
5584 pub fn name(&self) -> std::option::Option<&str> {
5585 match self {
5586 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5587 Self::Creating => std::option::Option::Some("CREATING"),
5588 Self::Ready => std::option::Option::Some("READY"),
5589 Self::Updating => std::option::Option::Some("UPDATING"),
5590 Self::Deleting => std::option::Option::Some("DELETING"),
5591 Self::Disabled => std::option::Option::Some("DISABLED"),
5592 Self::UnknownValue(u) => u.0.name(),
5593 }
5594 }
5595 }
5596
5597 impl std::default::Default for State {
5598 fn default() -> Self {
5599 use std::convert::From;
5600 Self::from(0)
5601 }
5602 }
5603
5604 impl std::fmt::Display for State {
5605 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5606 wkt::internal::display_enum(f, self.name(), self.value())
5607 }
5608 }
5609
5610 impl std::convert::From<i32> for State {
5611 fn from(value: i32) -> Self {
5612 match value {
5613 0 => Self::Unspecified,
5614 1 => Self::Creating,
5615 2 => Self::Ready,
5616 3 => Self::Updating,
5617 4 => Self::Deleting,
5618 5 => Self::Disabled,
5619 _ => Self::UnknownValue(state::UnknownValue(
5620 wkt::internal::UnknownEnumValue::Integer(value),
5621 )),
5622 }
5623 }
5624 }
5625
5626 impl std::convert::From<&str> for State {
5627 fn from(value: &str) -> Self {
5628 use std::string::ToString;
5629 match value {
5630 "STATE_UNSPECIFIED" => Self::Unspecified,
5631 "CREATING" => Self::Creating,
5632 "READY" => Self::Ready,
5633 "UPDATING" => Self::Updating,
5634 "DELETING" => Self::Deleting,
5635 "DISABLED" => Self::Disabled,
5636 _ => Self::UnknownValue(state::UnknownValue(
5637 wkt::internal::UnknownEnumValue::String(value.to_string()),
5638 )),
5639 }
5640 }
5641 }
5642
5643 impl serde::ser::Serialize for State {
5644 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5645 where
5646 S: serde::Serializer,
5647 {
5648 match self {
5649 Self::Unspecified => serializer.serialize_i32(0),
5650 Self::Creating => serializer.serialize_i32(1),
5651 Self::Ready => serializer.serialize_i32(2),
5652 Self::Updating => serializer.serialize_i32(3),
5653 Self::Deleting => serializer.serialize_i32(4),
5654 Self::Disabled => serializer.serialize_i32(5),
5655 Self::UnknownValue(u) => u.0.serialize(serializer),
5656 }
5657 }
5658 }
5659
5660 impl<'de> serde::de::Deserialize<'de> for State {
5661 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5662 where
5663 D: serde::Deserializer<'de>,
5664 {
5665 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5666 ".google.cloud.netapp.v1.HostGroup.State",
5667 ))
5668 }
5669 }
5670}
5671
5672/// GetKmsConfigRequest gets a KMS Config.
5673#[derive(Clone, Default, PartialEq)]
5674#[non_exhaustive]
5675pub struct GetKmsConfigRequest {
5676 /// Required. Name of the KmsConfig
5677 pub name: std::string::String,
5678
5679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5680}
5681
5682impl GetKmsConfigRequest {
5683 /// Creates a new default instance.
5684 pub fn new() -> Self {
5685 std::default::Default::default()
5686 }
5687
5688 /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5689 ///
5690 /// # Example
5691 /// ```ignore,no_run
5692 /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5693 /// let x = GetKmsConfigRequest::new().set_name("example");
5694 /// ```
5695 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5696 self.name = v.into();
5697 self
5698 }
5699}
5700
5701impl wkt::message::Message for GetKmsConfigRequest {
5702 fn typename() -> &'static str {
5703 "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5704 }
5705}
5706
5707/// ListKmsConfigsRequest lists KMS Configs.
5708#[derive(Clone, Default, PartialEq)]
5709#[non_exhaustive]
5710pub struct ListKmsConfigsRequest {
5711 /// Required. Parent value
5712 pub parent: std::string::String,
5713
5714 /// The maximum number of items to return.
5715 pub page_size: i32,
5716
5717 /// The next_page_token value to use if there are additional
5718 /// results to retrieve for this list request.
5719 pub page_token: std::string::String,
5720
5721 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5722 pub order_by: std::string::String,
5723
5724 /// List filter.
5725 pub filter: std::string::String,
5726
5727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5728}
5729
5730impl ListKmsConfigsRequest {
5731 /// Creates a new default instance.
5732 pub fn new() -> Self {
5733 std::default::Default::default()
5734 }
5735
5736 /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5737 ///
5738 /// # Example
5739 /// ```ignore,no_run
5740 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5741 /// let x = ListKmsConfigsRequest::new().set_parent("example");
5742 /// ```
5743 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5744 self.parent = v.into();
5745 self
5746 }
5747
5748 /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5749 ///
5750 /// # Example
5751 /// ```ignore,no_run
5752 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5753 /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5754 /// ```
5755 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5756 self.page_size = v.into();
5757 self
5758 }
5759
5760 /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5761 ///
5762 /// # Example
5763 /// ```ignore,no_run
5764 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5765 /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5766 /// ```
5767 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5768 self.page_token = v.into();
5769 self
5770 }
5771
5772 /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5773 ///
5774 /// # Example
5775 /// ```ignore,no_run
5776 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5777 /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5778 /// ```
5779 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5780 self.order_by = v.into();
5781 self
5782 }
5783
5784 /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5785 ///
5786 /// # Example
5787 /// ```ignore,no_run
5788 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5789 /// let x = ListKmsConfigsRequest::new().set_filter("example");
5790 /// ```
5791 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5792 self.filter = v.into();
5793 self
5794 }
5795}
5796
5797impl wkt::message::Message for ListKmsConfigsRequest {
5798 fn typename() -> &'static str {
5799 "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5800 }
5801}
5802
5803/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5804#[derive(Clone, Default, PartialEq)]
5805#[non_exhaustive]
5806pub struct ListKmsConfigsResponse {
5807 /// The list of KmsConfigs
5808 pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5809
5810 /// A token identifying a page of results the server should return.
5811 pub next_page_token: std::string::String,
5812
5813 /// Locations that could not be reached.
5814 pub unreachable: std::vec::Vec<std::string::String>,
5815
5816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5817}
5818
5819impl ListKmsConfigsResponse {
5820 /// Creates a new default instance.
5821 pub fn new() -> Self {
5822 std::default::Default::default()
5823 }
5824
5825 /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5826 ///
5827 /// # Example
5828 /// ```ignore,no_run
5829 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5830 /// use google_cloud_netapp_v1::model::KmsConfig;
5831 /// let x = ListKmsConfigsResponse::new()
5832 /// .set_kms_configs([
5833 /// KmsConfig::default()/* use setters */,
5834 /// KmsConfig::default()/* use (different) setters */,
5835 /// ]);
5836 /// ```
5837 pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5838 where
5839 T: std::iter::IntoIterator<Item = V>,
5840 V: std::convert::Into<crate::model::KmsConfig>,
5841 {
5842 use std::iter::Iterator;
5843 self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5844 self
5845 }
5846
5847 /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5848 ///
5849 /// # Example
5850 /// ```ignore,no_run
5851 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5852 /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5853 /// ```
5854 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5855 self.next_page_token = v.into();
5856 self
5857 }
5858
5859 /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5860 ///
5861 /// # Example
5862 /// ```ignore,no_run
5863 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5864 /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5865 /// ```
5866 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5867 where
5868 T: std::iter::IntoIterator<Item = V>,
5869 V: std::convert::Into<std::string::String>,
5870 {
5871 use std::iter::Iterator;
5872 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5873 self
5874 }
5875}
5876
5877impl wkt::message::Message for ListKmsConfigsResponse {
5878 fn typename() -> &'static str {
5879 "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5880 }
5881}
5882
5883#[doc(hidden)]
5884impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5885 type PageItem = crate::model::KmsConfig;
5886
5887 fn items(self) -> std::vec::Vec<Self::PageItem> {
5888 self.kms_configs
5889 }
5890
5891 fn next_page_token(&self) -> std::string::String {
5892 use std::clone::Clone;
5893 self.next_page_token.clone()
5894 }
5895}
5896
5897/// CreateKmsConfigRequest creates a KMS Config.
5898#[derive(Clone, Default, PartialEq)]
5899#[non_exhaustive]
5900pub struct CreateKmsConfigRequest {
5901 /// Required. Value for parent.
5902 pub parent: std::string::String,
5903
5904 /// Required. Id of the requesting KmsConfig. Must be unique within the parent
5905 /// resource. Must contain only letters, numbers and hyphen, with the first
5906 /// character a letter, the last a letter or a
5907 /// number, and a 63 character maximum.
5908 pub kms_config_id: std::string::String,
5909
5910 /// Required. The required parameters to create a new KmsConfig.
5911 pub kms_config: std::option::Option<crate::model::KmsConfig>,
5912
5913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5914}
5915
5916impl CreateKmsConfigRequest {
5917 /// Creates a new default instance.
5918 pub fn new() -> Self {
5919 std::default::Default::default()
5920 }
5921
5922 /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
5923 ///
5924 /// # Example
5925 /// ```ignore,no_run
5926 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5927 /// let x = CreateKmsConfigRequest::new().set_parent("example");
5928 /// ```
5929 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5930 self.parent = v.into();
5931 self
5932 }
5933
5934 /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
5935 ///
5936 /// # Example
5937 /// ```ignore,no_run
5938 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5939 /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
5940 /// ```
5941 pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5942 self.kms_config_id = v.into();
5943 self
5944 }
5945
5946 /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5947 ///
5948 /// # Example
5949 /// ```ignore,no_run
5950 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5951 /// use google_cloud_netapp_v1::model::KmsConfig;
5952 /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
5953 /// ```
5954 pub fn set_kms_config<T>(mut self, v: T) -> Self
5955 where
5956 T: std::convert::Into<crate::model::KmsConfig>,
5957 {
5958 self.kms_config = std::option::Option::Some(v.into());
5959 self
5960 }
5961
5962 /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5963 ///
5964 /// # Example
5965 /// ```ignore,no_run
5966 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5967 /// use google_cloud_netapp_v1::model::KmsConfig;
5968 /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
5969 /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
5970 /// ```
5971 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
5972 where
5973 T: std::convert::Into<crate::model::KmsConfig>,
5974 {
5975 self.kms_config = v.map(|x| x.into());
5976 self
5977 }
5978}
5979
5980impl wkt::message::Message for CreateKmsConfigRequest {
5981 fn typename() -> &'static str {
5982 "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
5983 }
5984}
5985
5986/// UpdateKmsConfigRequest updates a KMS Config.
5987#[derive(Clone, Default, PartialEq)]
5988#[non_exhaustive]
5989pub struct UpdateKmsConfigRequest {
5990 /// Required. Field mask is used to specify the fields to be overwritten in the
5991 /// KmsConfig resource by the update.
5992 /// The fields specified in the update_mask are relative to the resource, not
5993 /// the full request. A field will be overwritten if it is in the mask. If the
5994 /// user does not provide a mask then all fields will be overwritten.
5995 pub update_mask: std::option::Option<wkt::FieldMask>,
5996
5997 /// Required. The KmsConfig being updated
5998 pub kms_config: std::option::Option<crate::model::KmsConfig>,
5999
6000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6001}
6002
6003impl UpdateKmsConfigRequest {
6004 /// Creates a new default instance.
6005 pub fn new() -> Self {
6006 std::default::Default::default()
6007 }
6008
6009 /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
6010 ///
6011 /// # Example
6012 /// ```ignore,no_run
6013 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6014 /// use wkt::FieldMask;
6015 /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6016 /// ```
6017 pub fn set_update_mask<T>(mut self, v: T) -> Self
6018 where
6019 T: std::convert::Into<wkt::FieldMask>,
6020 {
6021 self.update_mask = std::option::Option::Some(v.into());
6022 self
6023 }
6024
6025 /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
6026 ///
6027 /// # Example
6028 /// ```ignore,no_run
6029 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6030 /// use wkt::FieldMask;
6031 /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6032 /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6033 /// ```
6034 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6035 where
6036 T: std::convert::Into<wkt::FieldMask>,
6037 {
6038 self.update_mask = v.map(|x| x.into());
6039 self
6040 }
6041
6042 /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6043 ///
6044 /// # Example
6045 /// ```ignore,no_run
6046 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6047 /// use google_cloud_netapp_v1::model::KmsConfig;
6048 /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6049 /// ```
6050 pub fn set_kms_config<T>(mut self, v: T) -> Self
6051 where
6052 T: std::convert::Into<crate::model::KmsConfig>,
6053 {
6054 self.kms_config = std::option::Option::Some(v.into());
6055 self
6056 }
6057
6058 /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6059 ///
6060 /// # Example
6061 /// ```ignore,no_run
6062 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6063 /// use google_cloud_netapp_v1::model::KmsConfig;
6064 /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6065 /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6066 /// ```
6067 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6068 where
6069 T: std::convert::Into<crate::model::KmsConfig>,
6070 {
6071 self.kms_config = v.map(|x| x.into());
6072 self
6073 }
6074}
6075
6076impl wkt::message::Message for UpdateKmsConfigRequest {
6077 fn typename() -> &'static str {
6078 "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6079 }
6080}
6081
6082/// DeleteKmsConfigRequest deletes a KMS Config.
6083#[derive(Clone, Default, PartialEq)]
6084#[non_exhaustive]
6085pub struct DeleteKmsConfigRequest {
6086 /// Required. Name of the KmsConfig.
6087 pub name: std::string::String,
6088
6089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6090}
6091
6092impl DeleteKmsConfigRequest {
6093 /// Creates a new default instance.
6094 pub fn new() -> Self {
6095 std::default::Default::default()
6096 }
6097
6098 /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6099 ///
6100 /// # Example
6101 /// ```ignore,no_run
6102 /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6103 /// let x = DeleteKmsConfigRequest::new().set_name("example");
6104 /// ```
6105 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6106 self.name = v.into();
6107 self
6108 }
6109}
6110
6111impl wkt::message::Message for DeleteKmsConfigRequest {
6112 fn typename() -> &'static str {
6113 "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6114 }
6115}
6116
6117/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6118#[derive(Clone, Default, PartialEq)]
6119#[non_exhaustive]
6120pub struct EncryptVolumesRequest {
6121 /// Required. Name of the KmsConfig.
6122 pub name: std::string::String,
6123
6124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6125}
6126
6127impl EncryptVolumesRequest {
6128 /// Creates a new default instance.
6129 pub fn new() -> Self {
6130 std::default::Default::default()
6131 }
6132
6133 /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6134 ///
6135 /// # Example
6136 /// ```ignore,no_run
6137 /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6138 /// let x = EncryptVolumesRequest::new().set_name("example");
6139 /// ```
6140 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6141 self.name = v.into();
6142 self
6143 }
6144}
6145
6146impl wkt::message::Message for EncryptVolumesRequest {
6147 fn typename() -> &'static str {
6148 "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6149 }
6150}
6151
6152/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6153#[derive(Clone, Default, PartialEq)]
6154#[non_exhaustive]
6155pub struct VerifyKmsConfigRequest {
6156 /// Required. Name of the KMS Config to be verified.
6157 pub name: std::string::String,
6158
6159 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6160}
6161
6162impl VerifyKmsConfigRequest {
6163 /// Creates a new default instance.
6164 pub fn new() -> Self {
6165 std::default::Default::default()
6166 }
6167
6168 /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6169 ///
6170 /// # Example
6171 /// ```ignore,no_run
6172 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6173 /// let x = VerifyKmsConfigRequest::new().set_name("example");
6174 /// ```
6175 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6176 self.name = v.into();
6177 self
6178 }
6179}
6180
6181impl wkt::message::Message for VerifyKmsConfigRequest {
6182 fn typename() -> &'static str {
6183 "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6184 }
6185}
6186
6187/// VerifyKmsConfigResponse contains the information if the config is correctly
6188/// and error message.
6189#[derive(Clone, Default, PartialEq)]
6190#[non_exhaustive]
6191pub struct VerifyKmsConfigResponse {
6192 /// Output only. If the customer key configured correctly to the encrypt
6193 /// volume.
6194 pub healthy: bool,
6195
6196 /// Output only. Error message if config is not healthy.
6197 pub health_error: std::string::String,
6198
6199 /// Output only. Instructions for the customers to provide the access to the
6200 /// encryption key.
6201 pub instructions: std::string::String,
6202
6203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6204}
6205
6206impl VerifyKmsConfigResponse {
6207 /// Creates a new default instance.
6208 pub fn new() -> Self {
6209 std::default::Default::default()
6210 }
6211
6212 /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6213 ///
6214 /// # Example
6215 /// ```ignore,no_run
6216 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6217 /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6218 /// ```
6219 pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6220 self.healthy = v.into();
6221 self
6222 }
6223
6224 /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6225 ///
6226 /// # Example
6227 /// ```ignore,no_run
6228 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6229 /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6230 /// ```
6231 pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6232 self.health_error = v.into();
6233 self
6234 }
6235
6236 /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6237 ///
6238 /// # Example
6239 /// ```ignore,no_run
6240 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6241 /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6242 /// ```
6243 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6244 self.instructions = v.into();
6245 self
6246 }
6247}
6248
6249impl wkt::message::Message for VerifyKmsConfigResponse {
6250 fn typename() -> &'static str {
6251 "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6252 }
6253}
6254
6255/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6256#[derive(Clone, Default, PartialEq)]
6257#[non_exhaustive]
6258pub struct KmsConfig {
6259 /// Identifier. Name of the KmsConfig.
6260 /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6261 pub name: std::string::String,
6262
6263 /// Required. Customer-managed crypto key resource full name. Format:
6264 /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6265 pub crypto_key_name: std::string::String,
6266
6267 /// Output only. State of the KmsConfig.
6268 pub state: crate::model::kms_config::State,
6269
6270 /// Output only. State details of the KmsConfig.
6271 pub state_details: std::string::String,
6272
6273 /// Output only. Create time of the KmsConfig.
6274 pub create_time: std::option::Option<wkt::Timestamp>,
6275
6276 /// Description of the KmsConfig.
6277 pub description: std::string::String,
6278
6279 /// Labels as key value pairs
6280 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6281
6282 /// Output only. Instructions to provide the access to the customer provided
6283 /// encryption key.
6284 pub instructions: std::string::String,
6285
6286 /// Output only. The Service account which will have access to the customer
6287 /// provided encryption key.
6288 pub service_account: std::string::String,
6289
6290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6291}
6292
6293impl KmsConfig {
6294 /// Creates a new default instance.
6295 pub fn new() -> Self {
6296 std::default::Default::default()
6297 }
6298
6299 /// Sets the value of [name][crate::model::KmsConfig::name].
6300 ///
6301 /// # Example
6302 /// ```ignore,no_run
6303 /// # use google_cloud_netapp_v1::model::KmsConfig;
6304 /// let x = KmsConfig::new().set_name("example");
6305 /// ```
6306 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6307 self.name = v.into();
6308 self
6309 }
6310
6311 /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6312 ///
6313 /// # Example
6314 /// ```ignore,no_run
6315 /// # use google_cloud_netapp_v1::model::KmsConfig;
6316 /// let x = KmsConfig::new().set_crypto_key_name("example");
6317 /// ```
6318 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6319 self.crypto_key_name = v.into();
6320 self
6321 }
6322
6323 /// Sets the value of [state][crate::model::KmsConfig::state].
6324 ///
6325 /// # Example
6326 /// ```ignore,no_run
6327 /// # use google_cloud_netapp_v1::model::KmsConfig;
6328 /// use google_cloud_netapp_v1::model::kms_config::State;
6329 /// let x0 = KmsConfig::new().set_state(State::Ready);
6330 /// let x1 = KmsConfig::new().set_state(State::Creating);
6331 /// let x2 = KmsConfig::new().set_state(State::Deleting);
6332 /// ```
6333 pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6334 mut self,
6335 v: T,
6336 ) -> Self {
6337 self.state = v.into();
6338 self
6339 }
6340
6341 /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6342 ///
6343 /// # Example
6344 /// ```ignore,no_run
6345 /// # use google_cloud_netapp_v1::model::KmsConfig;
6346 /// let x = KmsConfig::new().set_state_details("example");
6347 /// ```
6348 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6349 self.state_details = v.into();
6350 self
6351 }
6352
6353 /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6354 ///
6355 /// # Example
6356 /// ```ignore,no_run
6357 /// # use google_cloud_netapp_v1::model::KmsConfig;
6358 /// use wkt::Timestamp;
6359 /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6360 /// ```
6361 pub fn set_create_time<T>(mut self, v: T) -> Self
6362 where
6363 T: std::convert::Into<wkt::Timestamp>,
6364 {
6365 self.create_time = std::option::Option::Some(v.into());
6366 self
6367 }
6368
6369 /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6370 ///
6371 /// # Example
6372 /// ```ignore,no_run
6373 /// # use google_cloud_netapp_v1::model::KmsConfig;
6374 /// use wkt::Timestamp;
6375 /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6376 /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6377 /// ```
6378 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6379 where
6380 T: std::convert::Into<wkt::Timestamp>,
6381 {
6382 self.create_time = v.map(|x| x.into());
6383 self
6384 }
6385
6386 /// Sets the value of [description][crate::model::KmsConfig::description].
6387 ///
6388 /// # Example
6389 /// ```ignore,no_run
6390 /// # use google_cloud_netapp_v1::model::KmsConfig;
6391 /// let x = KmsConfig::new().set_description("example");
6392 /// ```
6393 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6394 self.description = v.into();
6395 self
6396 }
6397
6398 /// Sets the value of [labels][crate::model::KmsConfig::labels].
6399 ///
6400 /// # Example
6401 /// ```ignore,no_run
6402 /// # use google_cloud_netapp_v1::model::KmsConfig;
6403 /// let x = KmsConfig::new().set_labels([
6404 /// ("key0", "abc"),
6405 /// ("key1", "xyz"),
6406 /// ]);
6407 /// ```
6408 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6409 where
6410 T: std::iter::IntoIterator<Item = (K, V)>,
6411 K: std::convert::Into<std::string::String>,
6412 V: std::convert::Into<std::string::String>,
6413 {
6414 use std::iter::Iterator;
6415 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6416 self
6417 }
6418
6419 /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6420 ///
6421 /// # Example
6422 /// ```ignore,no_run
6423 /// # use google_cloud_netapp_v1::model::KmsConfig;
6424 /// let x = KmsConfig::new().set_instructions("example");
6425 /// ```
6426 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6427 self.instructions = v.into();
6428 self
6429 }
6430
6431 /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6432 ///
6433 /// # Example
6434 /// ```ignore,no_run
6435 /// # use google_cloud_netapp_v1::model::KmsConfig;
6436 /// let x = KmsConfig::new().set_service_account("example");
6437 /// ```
6438 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6439 self.service_account = v.into();
6440 self
6441 }
6442}
6443
6444impl wkt::message::Message for KmsConfig {
6445 fn typename() -> &'static str {
6446 "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6447 }
6448}
6449
6450/// Defines additional types related to [KmsConfig].
6451pub mod kms_config {
6452 #[allow(unused_imports)]
6453 use super::*;
6454
6455 /// The KmsConfig States
6456 ///
6457 /// # Working with unknown values
6458 ///
6459 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6460 /// additional enum variants at any time. Adding new variants is not considered
6461 /// a breaking change. Applications should write their code in anticipation of:
6462 ///
6463 /// - New values appearing in future releases of the client library, **and**
6464 /// - New values received dynamically, without application changes.
6465 ///
6466 /// Please consult the [Working with enums] section in the user guide for some
6467 /// guidelines.
6468 ///
6469 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6470 #[derive(Clone, Debug, PartialEq)]
6471 #[non_exhaustive]
6472 pub enum State {
6473 /// Unspecified KmsConfig State
6474 Unspecified,
6475 /// KmsConfig State is Ready
6476 Ready,
6477 /// KmsConfig State is Creating
6478 Creating,
6479 /// KmsConfig State is Deleting
6480 Deleting,
6481 /// KmsConfig State is Updating
6482 Updating,
6483 /// KmsConfig State is In Use.
6484 InUse,
6485 /// KmsConfig State is Error
6486 Error,
6487 /// KmsConfig State is Pending to verify crypto key access.
6488 KeyCheckPending,
6489 /// KmsConfig State is Not accessbile by the SDE service account to the
6490 /// crypto key.
6491 KeyNotReachable,
6492 /// KmsConfig State is Disabling.
6493 Disabling,
6494 /// KmsConfig State is Disabled.
6495 Disabled,
6496 /// KmsConfig State is Migrating.
6497 /// The existing volumes are migrating from SMEK to CMEK.
6498 Migrating,
6499 /// If set, the enum was initialized with an unknown value.
6500 ///
6501 /// Applications can examine the value using [State::value] or
6502 /// [State::name].
6503 UnknownValue(state::UnknownValue),
6504 }
6505
6506 #[doc(hidden)]
6507 pub mod state {
6508 #[allow(unused_imports)]
6509 use super::*;
6510 #[derive(Clone, Debug, PartialEq)]
6511 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6512 }
6513
6514 impl State {
6515 /// Gets the enum value.
6516 ///
6517 /// Returns `None` if the enum contains an unknown value deserialized from
6518 /// the string representation of enums.
6519 pub fn value(&self) -> std::option::Option<i32> {
6520 match self {
6521 Self::Unspecified => std::option::Option::Some(0),
6522 Self::Ready => std::option::Option::Some(1),
6523 Self::Creating => std::option::Option::Some(2),
6524 Self::Deleting => std::option::Option::Some(3),
6525 Self::Updating => std::option::Option::Some(4),
6526 Self::InUse => std::option::Option::Some(5),
6527 Self::Error => std::option::Option::Some(6),
6528 Self::KeyCheckPending => std::option::Option::Some(7),
6529 Self::KeyNotReachable => std::option::Option::Some(8),
6530 Self::Disabling => std::option::Option::Some(9),
6531 Self::Disabled => std::option::Option::Some(10),
6532 Self::Migrating => std::option::Option::Some(11),
6533 Self::UnknownValue(u) => u.0.value(),
6534 }
6535 }
6536
6537 /// Gets the enum value as a string.
6538 ///
6539 /// Returns `None` if the enum contains an unknown value deserialized from
6540 /// the integer representation of enums.
6541 pub fn name(&self) -> std::option::Option<&str> {
6542 match self {
6543 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6544 Self::Ready => std::option::Option::Some("READY"),
6545 Self::Creating => std::option::Option::Some("CREATING"),
6546 Self::Deleting => std::option::Option::Some("DELETING"),
6547 Self::Updating => std::option::Option::Some("UPDATING"),
6548 Self::InUse => std::option::Option::Some("IN_USE"),
6549 Self::Error => std::option::Option::Some("ERROR"),
6550 Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6551 Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6552 Self::Disabling => std::option::Option::Some("DISABLING"),
6553 Self::Disabled => std::option::Option::Some("DISABLED"),
6554 Self::Migrating => std::option::Option::Some("MIGRATING"),
6555 Self::UnknownValue(u) => u.0.name(),
6556 }
6557 }
6558 }
6559
6560 impl std::default::Default for State {
6561 fn default() -> Self {
6562 use std::convert::From;
6563 Self::from(0)
6564 }
6565 }
6566
6567 impl std::fmt::Display for State {
6568 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6569 wkt::internal::display_enum(f, self.name(), self.value())
6570 }
6571 }
6572
6573 impl std::convert::From<i32> for State {
6574 fn from(value: i32) -> Self {
6575 match value {
6576 0 => Self::Unspecified,
6577 1 => Self::Ready,
6578 2 => Self::Creating,
6579 3 => Self::Deleting,
6580 4 => Self::Updating,
6581 5 => Self::InUse,
6582 6 => Self::Error,
6583 7 => Self::KeyCheckPending,
6584 8 => Self::KeyNotReachable,
6585 9 => Self::Disabling,
6586 10 => Self::Disabled,
6587 11 => Self::Migrating,
6588 _ => Self::UnknownValue(state::UnknownValue(
6589 wkt::internal::UnknownEnumValue::Integer(value),
6590 )),
6591 }
6592 }
6593 }
6594
6595 impl std::convert::From<&str> for State {
6596 fn from(value: &str) -> Self {
6597 use std::string::ToString;
6598 match value {
6599 "STATE_UNSPECIFIED" => Self::Unspecified,
6600 "READY" => Self::Ready,
6601 "CREATING" => Self::Creating,
6602 "DELETING" => Self::Deleting,
6603 "UPDATING" => Self::Updating,
6604 "IN_USE" => Self::InUse,
6605 "ERROR" => Self::Error,
6606 "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6607 "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6608 "DISABLING" => Self::Disabling,
6609 "DISABLED" => Self::Disabled,
6610 "MIGRATING" => Self::Migrating,
6611 _ => Self::UnknownValue(state::UnknownValue(
6612 wkt::internal::UnknownEnumValue::String(value.to_string()),
6613 )),
6614 }
6615 }
6616 }
6617
6618 impl serde::ser::Serialize for State {
6619 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6620 where
6621 S: serde::Serializer,
6622 {
6623 match self {
6624 Self::Unspecified => serializer.serialize_i32(0),
6625 Self::Ready => serializer.serialize_i32(1),
6626 Self::Creating => serializer.serialize_i32(2),
6627 Self::Deleting => serializer.serialize_i32(3),
6628 Self::Updating => serializer.serialize_i32(4),
6629 Self::InUse => serializer.serialize_i32(5),
6630 Self::Error => serializer.serialize_i32(6),
6631 Self::KeyCheckPending => serializer.serialize_i32(7),
6632 Self::KeyNotReachable => serializer.serialize_i32(8),
6633 Self::Disabling => serializer.serialize_i32(9),
6634 Self::Disabled => serializer.serialize_i32(10),
6635 Self::Migrating => serializer.serialize_i32(11),
6636 Self::UnknownValue(u) => u.0.serialize(serializer),
6637 }
6638 }
6639 }
6640
6641 impl<'de> serde::de::Deserialize<'de> for State {
6642 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6643 where
6644 D: serde::Deserializer<'de>,
6645 {
6646 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6647 ".google.cloud.netapp.v1.KmsConfig.State",
6648 ))
6649 }
6650 }
6651}
6652
6653/// Request message for `ExecuteOntapPost` API.
6654#[derive(Clone, Default, PartialEq)]
6655#[non_exhaustive]
6656pub struct ExecuteOntapPostRequest {
6657 /// Required. The raw `JSON` body of the request.
6658 /// The body should be in the format of the ONTAP resource.
6659 /// For example:
6660 ///
6661 /// ```norust
6662 /// {
6663 /// "body": {
6664 /// "field1": "value1",
6665 /// "field2": "value2",
6666 /// }
6667 /// }
6668 /// ```
6669 pub body: std::option::Option<wkt::Struct>,
6670
6671 /// Required. The resource path of the ONTAP resource.
6672 /// Format:
6673 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6674 /// For example:
6675 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6676 pub ontap_path: std::string::String,
6677
6678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6679}
6680
6681impl ExecuteOntapPostRequest {
6682 /// Creates a new default instance.
6683 pub fn new() -> Self {
6684 std::default::Default::default()
6685 }
6686
6687 /// Sets the value of [body][crate::model::ExecuteOntapPostRequest::body].
6688 ///
6689 /// # Example
6690 /// ```ignore,no_run
6691 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6692 /// use wkt::Struct;
6693 /// let x = ExecuteOntapPostRequest::new().set_body(Struct::default()/* use setters */);
6694 /// ```
6695 pub fn set_body<T>(mut self, v: T) -> Self
6696 where
6697 T: std::convert::Into<wkt::Struct>,
6698 {
6699 self.body = std::option::Option::Some(v.into());
6700 self
6701 }
6702
6703 /// Sets or clears the value of [body][crate::model::ExecuteOntapPostRequest::body].
6704 ///
6705 /// # Example
6706 /// ```ignore,no_run
6707 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6708 /// use wkt::Struct;
6709 /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6710 /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(None::<Struct>);
6711 /// ```
6712 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6713 where
6714 T: std::convert::Into<wkt::Struct>,
6715 {
6716 self.body = v.map(|x| x.into());
6717 self
6718 }
6719
6720 /// Sets the value of [ontap_path][crate::model::ExecuteOntapPostRequest::ontap_path].
6721 ///
6722 /// # Example
6723 /// ```ignore,no_run
6724 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6725 /// let x = ExecuteOntapPostRequest::new().set_ontap_path("example");
6726 /// ```
6727 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6728 self.ontap_path = v.into();
6729 self
6730 }
6731}
6732
6733impl wkt::message::Message for ExecuteOntapPostRequest {
6734 fn typename() -> &'static str {
6735 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostRequest"
6736 }
6737}
6738
6739/// Response message for `ExecuteOntapPost` API.
6740#[derive(Clone, Default, PartialEq)]
6741#[non_exhaustive]
6742pub struct ExecuteOntapPostResponse {
6743 /// The raw `JSON` body of the response.
6744 pub body: std::option::Option<wkt::Struct>,
6745
6746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6747}
6748
6749impl ExecuteOntapPostResponse {
6750 /// Creates a new default instance.
6751 pub fn new() -> Self {
6752 std::default::Default::default()
6753 }
6754
6755 /// Sets the value of [body][crate::model::ExecuteOntapPostResponse::body].
6756 ///
6757 /// # Example
6758 /// ```ignore,no_run
6759 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6760 /// use wkt::Struct;
6761 /// let x = ExecuteOntapPostResponse::new().set_body(Struct::default()/* use setters */);
6762 /// ```
6763 pub fn set_body<T>(mut self, v: T) -> Self
6764 where
6765 T: std::convert::Into<wkt::Struct>,
6766 {
6767 self.body = std::option::Option::Some(v.into());
6768 self
6769 }
6770
6771 /// Sets or clears the value of [body][crate::model::ExecuteOntapPostResponse::body].
6772 ///
6773 /// # Example
6774 /// ```ignore,no_run
6775 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6776 /// use wkt::Struct;
6777 /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6778 /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(None::<Struct>);
6779 /// ```
6780 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6781 where
6782 T: std::convert::Into<wkt::Struct>,
6783 {
6784 self.body = v.map(|x| x.into());
6785 self
6786 }
6787}
6788
6789impl wkt::message::Message for ExecuteOntapPostResponse {
6790 fn typename() -> &'static str {
6791 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostResponse"
6792 }
6793}
6794
6795/// Request message for `ExecuteOntapGet` API.
6796#[derive(Clone, Default, PartialEq)]
6797#[non_exhaustive]
6798pub struct ExecuteOntapGetRequest {
6799 /// Required. The resource path of the ONTAP resource.
6800 /// Format:
6801 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6802 /// For example:
6803 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6804 pub ontap_path: std::string::String,
6805
6806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6807}
6808
6809impl ExecuteOntapGetRequest {
6810 /// Creates a new default instance.
6811 pub fn new() -> Self {
6812 std::default::Default::default()
6813 }
6814
6815 /// Sets the value of [ontap_path][crate::model::ExecuteOntapGetRequest::ontap_path].
6816 ///
6817 /// # Example
6818 /// ```ignore,no_run
6819 /// # use google_cloud_netapp_v1::model::ExecuteOntapGetRequest;
6820 /// let x = ExecuteOntapGetRequest::new().set_ontap_path("example");
6821 /// ```
6822 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6823 self.ontap_path = v.into();
6824 self
6825 }
6826}
6827
6828impl wkt::message::Message for ExecuteOntapGetRequest {
6829 fn typename() -> &'static str {
6830 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetRequest"
6831 }
6832}
6833
6834/// Response message for `ExecuteOntapGet` API.
6835#[derive(Clone, Default, PartialEq)]
6836#[non_exhaustive]
6837pub struct ExecuteOntapGetResponse {
6838 /// The raw `JSON` body of the response.
6839 pub body: std::option::Option<wkt::Struct>,
6840
6841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6842}
6843
6844impl ExecuteOntapGetResponse {
6845 /// Creates a new default instance.
6846 pub fn new() -> Self {
6847 std::default::Default::default()
6848 }
6849
6850 /// Sets the value of [body][crate::model::ExecuteOntapGetResponse::body].
6851 ///
6852 /// # Example
6853 /// ```ignore,no_run
6854 /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6855 /// use wkt::Struct;
6856 /// let x = ExecuteOntapGetResponse::new().set_body(Struct::default()/* use setters */);
6857 /// ```
6858 pub fn set_body<T>(mut self, v: T) -> Self
6859 where
6860 T: std::convert::Into<wkt::Struct>,
6861 {
6862 self.body = std::option::Option::Some(v.into());
6863 self
6864 }
6865
6866 /// Sets or clears the value of [body][crate::model::ExecuteOntapGetResponse::body].
6867 ///
6868 /// # Example
6869 /// ```ignore,no_run
6870 /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6871 /// use wkt::Struct;
6872 /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6873 /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(None::<Struct>);
6874 /// ```
6875 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6876 where
6877 T: std::convert::Into<wkt::Struct>,
6878 {
6879 self.body = v.map(|x| x.into());
6880 self
6881 }
6882}
6883
6884impl wkt::message::Message for ExecuteOntapGetResponse {
6885 fn typename() -> &'static str {
6886 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetResponse"
6887 }
6888}
6889
6890/// Request message for `ExecuteOntapDelete` API.
6891#[derive(Clone, Default, PartialEq)]
6892#[non_exhaustive]
6893pub struct ExecuteOntapDeleteRequest {
6894 /// Required. The resource path of the ONTAP resource.
6895 /// Format:
6896 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6897 /// For example:
6898 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6899 pub ontap_path: std::string::String,
6900
6901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6902}
6903
6904impl ExecuteOntapDeleteRequest {
6905 /// Creates a new default instance.
6906 pub fn new() -> Self {
6907 std::default::Default::default()
6908 }
6909
6910 /// Sets the value of [ontap_path][crate::model::ExecuteOntapDeleteRequest::ontap_path].
6911 ///
6912 /// # Example
6913 /// ```ignore,no_run
6914 /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteRequest;
6915 /// let x = ExecuteOntapDeleteRequest::new().set_ontap_path("example");
6916 /// ```
6917 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6918 self.ontap_path = v.into();
6919 self
6920 }
6921}
6922
6923impl wkt::message::Message for ExecuteOntapDeleteRequest {
6924 fn typename() -> &'static str {
6925 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteRequest"
6926 }
6927}
6928
6929/// Response message for `ExecuteOntapDelete` API.
6930#[derive(Clone, Default, PartialEq)]
6931#[non_exhaustive]
6932pub struct ExecuteOntapDeleteResponse {
6933 /// The raw `JSON` body of the response.
6934 pub body: std::option::Option<wkt::Struct>,
6935
6936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6937}
6938
6939impl ExecuteOntapDeleteResponse {
6940 /// Creates a new default instance.
6941 pub fn new() -> Self {
6942 std::default::Default::default()
6943 }
6944
6945 /// Sets the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
6946 ///
6947 /// # Example
6948 /// ```ignore,no_run
6949 /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
6950 /// use wkt::Struct;
6951 /// let x = ExecuteOntapDeleteResponse::new().set_body(Struct::default()/* use setters */);
6952 /// ```
6953 pub fn set_body<T>(mut self, v: T) -> Self
6954 where
6955 T: std::convert::Into<wkt::Struct>,
6956 {
6957 self.body = std::option::Option::Some(v.into());
6958 self
6959 }
6960
6961 /// Sets or clears the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
6962 ///
6963 /// # Example
6964 /// ```ignore,no_run
6965 /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
6966 /// use wkt::Struct;
6967 /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6968 /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(None::<Struct>);
6969 /// ```
6970 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6971 where
6972 T: std::convert::Into<wkt::Struct>,
6973 {
6974 self.body = v.map(|x| x.into());
6975 self
6976 }
6977}
6978
6979impl wkt::message::Message for ExecuteOntapDeleteResponse {
6980 fn typename() -> &'static str {
6981 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteResponse"
6982 }
6983}
6984
6985/// Request message for `ExecuteOntapPatch` API.
6986#[derive(Clone, Default, PartialEq)]
6987#[non_exhaustive]
6988pub struct ExecuteOntapPatchRequest {
6989 /// Required. The raw `JSON` body of the request.
6990 /// The body should be in the format of the ONTAP resource.
6991 /// For example:
6992 ///
6993 /// ```norust
6994 /// {
6995 /// "body": {
6996 /// "field1": "value1",
6997 /// "field2": "value2",
6998 /// }
6999 /// }
7000 /// ```
7001 pub body: std::option::Option<wkt::Struct>,
7002
7003 /// Required. The resource path of the ONTAP resource.
7004 /// Format:
7005 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
7006 /// For example:
7007 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
7008 pub ontap_path: std::string::String,
7009
7010 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7011}
7012
7013impl ExecuteOntapPatchRequest {
7014 /// Creates a new default instance.
7015 pub fn new() -> Self {
7016 std::default::Default::default()
7017 }
7018
7019 /// Sets the value of [body][crate::model::ExecuteOntapPatchRequest::body].
7020 ///
7021 /// # Example
7022 /// ```ignore,no_run
7023 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7024 /// use wkt::Struct;
7025 /// let x = ExecuteOntapPatchRequest::new().set_body(Struct::default()/* use setters */);
7026 /// ```
7027 pub fn set_body<T>(mut self, v: T) -> Self
7028 where
7029 T: std::convert::Into<wkt::Struct>,
7030 {
7031 self.body = std::option::Option::Some(v.into());
7032 self
7033 }
7034
7035 /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchRequest::body].
7036 ///
7037 /// # Example
7038 /// ```ignore,no_run
7039 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7040 /// use wkt::Struct;
7041 /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7042 /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(None::<Struct>);
7043 /// ```
7044 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7045 where
7046 T: std::convert::Into<wkt::Struct>,
7047 {
7048 self.body = v.map(|x| x.into());
7049 self
7050 }
7051
7052 /// Sets the value of [ontap_path][crate::model::ExecuteOntapPatchRequest::ontap_path].
7053 ///
7054 /// # Example
7055 /// ```ignore,no_run
7056 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7057 /// let x = ExecuteOntapPatchRequest::new().set_ontap_path("example");
7058 /// ```
7059 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7060 self.ontap_path = v.into();
7061 self
7062 }
7063}
7064
7065impl wkt::message::Message for ExecuteOntapPatchRequest {
7066 fn typename() -> &'static str {
7067 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchRequest"
7068 }
7069}
7070
7071/// Response message for `ExecuteOntapPatch` API.
7072#[derive(Clone, Default, PartialEq)]
7073#[non_exhaustive]
7074pub struct ExecuteOntapPatchResponse {
7075 /// The raw `JSON` body of the response.
7076 pub body: std::option::Option<wkt::Struct>,
7077
7078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7079}
7080
7081impl ExecuteOntapPatchResponse {
7082 /// Creates a new default instance.
7083 pub fn new() -> Self {
7084 std::default::Default::default()
7085 }
7086
7087 /// Sets the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7088 ///
7089 /// # Example
7090 /// ```ignore,no_run
7091 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7092 /// use wkt::Struct;
7093 /// let x = ExecuteOntapPatchResponse::new().set_body(Struct::default()/* use setters */);
7094 /// ```
7095 pub fn set_body<T>(mut self, v: T) -> Self
7096 where
7097 T: std::convert::Into<wkt::Struct>,
7098 {
7099 self.body = std::option::Option::Some(v.into());
7100 self
7101 }
7102
7103 /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7104 ///
7105 /// # Example
7106 /// ```ignore,no_run
7107 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7108 /// use wkt::Struct;
7109 /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7110 /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(None::<Struct>);
7111 /// ```
7112 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7113 where
7114 T: std::convert::Into<wkt::Struct>,
7115 {
7116 self.body = v.map(|x| x.into());
7117 self
7118 }
7119}
7120
7121impl wkt::message::Message for ExecuteOntapPatchResponse {
7122 fn typename() -> &'static str {
7123 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchResponse"
7124 }
7125}
7126
7127/// ListQuotaRulesRequest for listing quota rules.
7128#[derive(Clone, Default, PartialEq)]
7129#[non_exhaustive]
7130pub struct ListQuotaRulesRequest {
7131 /// Required. Parent value for ListQuotaRulesRequest
7132 pub parent: std::string::String,
7133
7134 /// Optional. Requested page size. Server may return fewer items than
7135 /// requested. If unspecified, the server will pick an appropriate default.
7136 pub page_size: i32,
7137
7138 /// Optional. A token identifying a page of results the server should return.
7139 pub page_token: std::string::String,
7140
7141 /// Optional. Filtering results
7142 pub filter: std::string::String,
7143
7144 /// Optional. Hint for how to order the results
7145 pub order_by: std::string::String,
7146
7147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7148}
7149
7150impl ListQuotaRulesRequest {
7151 /// Creates a new default instance.
7152 pub fn new() -> Self {
7153 std::default::Default::default()
7154 }
7155
7156 /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
7157 ///
7158 /// # Example
7159 /// ```ignore,no_run
7160 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7161 /// let x = ListQuotaRulesRequest::new().set_parent("example");
7162 /// ```
7163 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7164 self.parent = v.into();
7165 self
7166 }
7167
7168 /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
7169 ///
7170 /// # Example
7171 /// ```ignore,no_run
7172 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7173 /// let x = ListQuotaRulesRequest::new().set_page_size(42);
7174 /// ```
7175 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7176 self.page_size = v.into();
7177 self
7178 }
7179
7180 /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
7181 ///
7182 /// # Example
7183 /// ```ignore,no_run
7184 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7185 /// let x = ListQuotaRulesRequest::new().set_page_token("example");
7186 /// ```
7187 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7188 self.page_token = v.into();
7189 self
7190 }
7191
7192 /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
7193 ///
7194 /// # Example
7195 /// ```ignore,no_run
7196 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7197 /// let x = ListQuotaRulesRequest::new().set_filter("example");
7198 /// ```
7199 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7200 self.filter = v.into();
7201 self
7202 }
7203
7204 /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
7205 ///
7206 /// # Example
7207 /// ```ignore,no_run
7208 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7209 /// let x = ListQuotaRulesRequest::new().set_order_by("example");
7210 /// ```
7211 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7212 self.order_by = v.into();
7213 self
7214 }
7215}
7216
7217impl wkt::message::Message for ListQuotaRulesRequest {
7218 fn typename() -> &'static str {
7219 "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
7220 }
7221}
7222
7223/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
7224#[derive(Clone, Default, PartialEq)]
7225#[non_exhaustive]
7226pub struct ListQuotaRulesResponse {
7227 /// List of quota rules
7228 pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
7229
7230 /// A token identifying a page of results the server should return.
7231 pub next_page_token: std::string::String,
7232
7233 /// Locations that could not be reached.
7234 pub unreachable: std::vec::Vec<std::string::String>,
7235
7236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7237}
7238
7239impl ListQuotaRulesResponse {
7240 /// Creates a new default instance.
7241 pub fn new() -> Self {
7242 std::default::Default::default()
7243 }
7244
7245 /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
7246 ///
7247 /// # Example
7248 /// ```ignore,no_run
7249 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7250 /// use google_cloud_netapp_v1::model::QuotaRule;
7251 /// let x = ListQuotaRulesResponse::new()
7252 /// .set_quota_rules([
7253 /// QuotaRule::default()/* use setters */,
7254 /// QuotaRule::default()/* use (different) setters */,
7255 /// ]);
7256 /// ```
7257 pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
7258 where
7259 T: std::iter::IntoIterator<Item = V>,
7260 V: std::convert::Into<crate::model::QuotaRule>,
7261 {
7262 use std::iter::Iterator;
7263 self.quota_rules = v.into_iter().map(|i| i.into()).collect();
7264 self
7265 }
7266
7267 /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
7268 ///
7269 /// # Example
7270 /// ```ignore,no_run
7271 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7272 /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
7273 /// ```
7274 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7275 self.next_page_token = v.into();
7276 self
7277 }
7278
7279 /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
7280 ///
7281 /// # Example
7282 /// ```ignore,no_run
7283 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7284 /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
7285 /// ```
7286 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7287 where
7288 T: std::iter::IntoIterator<Item = V>,
7289 V: std::convert::Into<std::string::String>,
7290 {
7291 use std::iter::Iterator;
7292 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7293 self
7294 }
7295}
7296
7297impl wkt::message::Message for ListQuotaRulesResponse {
7298 fn typename() -> &'static str {
7299 "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
7300 }
7301}
7302
7303#[doc(hidden)]
7304impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
7305 type PageItem = crate::model::QuotaRule;
7306
7307 fn items(self) -> std::vec::Vec<Self::PageItem> {
7308 self.quota_rules
7309 }
7310
7311 fn next_page_token(&self) -> std::string::String {
7312 use std::clone::Clone;
7313 self.next_page_token.clone()
7314 }
7315}
7316
7317/// GetQuotaRuleRequest for getting a quota rule.
7318#[derive(Clone, Default, PartialEq)]
7319#[non_exhaustive]
7320pub struct GetQuotaRuleRequest {
7321 /// Required. Name of the quota rule
7322 pub name: std::string::String,
7323
7324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7325}
7326
7327impl GetQuotaRuleRequest {
7328 /// Creates a new default instance.
7329 pub fn new() -> Self {
7330 std::default::Default::default()
7331 }
7332
7333 /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
7334 ///
7335 /// # Example
7336 /// ```ignore,no_run
7337 /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
7338 /// let x = GetQuotaRuleRequest::new().set_name("example");
7339 /// ```
7340 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7341 self.name = v.into();
7342 self
7343 }
7344}
7345
7346impl wkt::message::Message for GetQuotaRuleRequest {
7347 fn typename() -> &'static str {
7348 "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
7349 }
7350}
7351
7352/// CreateQuotaRuleRequest for creating a quota rule.
7353#[derive(Clone, Default, PartialEq)]
7354#[non_exhaustive]
7355pub struct CreateQuotaRuleRequest {
7356 /// Required. Parent value for CreateQuotaRuleRequest
7357 pub parent: std::string::String,
7358
7359 /// Required. Fields of the to be created quota rule.
7360 pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7361
7362 /// Required. ID of the quota rule to create. Must be unique within the parent
7363 /// resource. Must contain only letters, numbers, underscore and hyphen, with
7364 /// the first character a letter or underscore, the last a letter or underscore
7365 /// or a number, and a 63 character maximum.
7366 pub quota_rule_id: std::string::String,
7367
7368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7369}
7370
7371impl CreateQuotaRuleRequest {
7372 /// Creates a new default instance.
7373 pub fn new() -> Self {
7374 std::default::Default::default()
7375 }
7376
7377 /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
7378 ///
7379 /// # Example
7380 /// ```ignore,no_run
7381 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7382 /// let x = CreateQuotaRuleRequest::new().set_parent("example");
7383 /// ```
7384 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7385 self.parent = v.into();
7386 self
7387 }
7388
7389 /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7390 ///
7391 /// # Example
7392 /// ```ignore,no_run
7393 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7394 /// use google_cloud_netapp_v1::model::QuotaRule;
7395 /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7396 /// ```
7397 pub fn set_quota_rule<T>(mut self, v: T) -> Self
7398 where
7399 T: std::convert::Into<crate::model::QuotaRule>,
7400 {
7401 self.quota_rule = std::option::Option::Some(v.into());
7402 self
7403 }
7404
7405 /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7406 ///
7407 /// # Example
7408 /// ```ignore,no_run
7409 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7410 /// use google_cloud_netapp_v1::model::QuotaRule;
7411 /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7412 /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7413 /// ```
7414 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7415 where
7416 T: std::convert::Into<crate::model::QuotaRule>,
7417 {
7418 self.quota_rule = v.map(|x| x.into());
7419 self
7420 }
7421
7422 /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
7423 ///
7424 /// # Example
7425 /// ```ignore,no_run
7426 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7427 /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
7428 /// ```
7429 pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7430 self.quota_rule_id = v.into();
7431 self
7432 }
7433}
7434
7435impl wkt::message::Message for CreateQuotaRuleRequest {
7436 fn typename() -> &'static str {
7437 "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
7438 }
7439}
7440
7441/// UpdateQuotaRuleRequest for updating a quota rule.
7442#[derive(Clone, Default, PartialEq)]
7443#[non_exhaustive]
7444pub struct UpdateQuotaRuleRequest {
7445 /// Optional. Field mask is used to specify the fields to be overwritten in the
7446 /// Quota Rule resource by the update.
7447 /// The fields specified in the update_mask are relative to the resource, not
7448 /// the full request. A field will be overwritten if it is in the mask. If the
7449 /// user does not provide a mask then all fields will be overwritten.
7450 pub update_mask: std::option::Option<wkt::FieldMask>,
7451
7452 /// Required. The quota rule being updated
7453 pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7454
7455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7456}
7457
7458impl UpdateQuotaRuleRequest {
7459 /// Creates a new default instance.
7460 pub fn new() -> Self {
7461 std::default::Default::default()
7462 }
7463
7464 /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7465 ///
7466 /// # Example
7467 /// ```ignore,no_run
7468 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7469 /// use wkt::FieldMask;
7470 /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7471 /// ```
7472 pub fn set_update_mask<T>(mut self, v: T) -> Self
7473 where
7474 T: std::convert::Into<wkt::FieldMask>,
7475 {
7476 self.update_mask = std::option::Option::Some(v.into());
7477 self
7478 }
7479
7480 /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7481 ///
7482 /// # Example
7483 /// ```ignore,no_run
7484 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7485 /// use wkt::FieldMask;
7486 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7487 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7488 /// ```
7489 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7490 where
7491 T: std::convert::Into<wkt::FieldMask>,
7492 {
7493 self.update_mask = v.map(|x| x.into());
7494 self
7495 }
7496
7497 /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7498 ///
7499 /// # Example
7500 /// ```ignore,no_run
7501 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7502 /// use google_cloud_netapp_v1::model::QuotaRule;
7503 /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7504 /// ```
7505 pub fn set_quota_rule<T>(mut self, v: T) -> Self
7506 where
7507 T: std::convert::Into<crate::model::QuotaRule>,
7508 {
7509 self.quota_rule = std::option::Option::Some(v.into());
7510 self
7511 }
7512
7513 /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7514 ///
7515 /// # Example
7516 /// ```ignore,no_run
7517 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7518 /// use google_cloud_netapp_v1::model::QuotaRule;
7519 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7520 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7521 /// ```
7522 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7523 where
7524 T: std::convert::Into<crate::model::QuotaRule>,
7525 {
7526 self.quota_rule = v.map(|x| x.into());
7527 self
7528 }
7529}
7530
7531impl wkt::message::Message for UpdateQuotaRuleRequest {
7532 fn typename() -> &'static str {
7533 "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7534 }
7535}
7536
7537/// DeleteQuotaRuleRequest for deleting a single quota rule.
7538#[derive(Clone, Default, PartialEq)]
7539#[non_exhaustive]
7540pub struct DeleteQuotaRuleRequest {
7541 /// Required. Name of the quota rule.
7542 pub name: std::string::String,
7543
7544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7545}
7546
7547impl DeleteQuotaRuleRequest {
7548 /// Creates a new default instance.
7549 pub fn new() -> Self {
7550 std::default::Default::default()
7551 }
7552
7553 /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7554 ///
7555 /// # Example
7556 /// ```ignore,no_run
7557 /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7558 /// let x = DeleteQuotaRuleRequest::new().set_name("example");
7559 /// ```
7560 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7561 self.name = v.into();
7562 self
7563 }
7564}
7565
7566impl wkt::message::Message for DeleteQuotaRuleRequest {
7567 fn typename() -> &'static str {
7568 "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7569 }
7570}
7571
7572/// QuotaRule specifies the maximum disk space a user or group can use within a
7573/// volume. They can be used for creating default and individual quota rules.
7574#[derive(Clone, Default, PartialEq)]
7575#[non_exhaustive]
7576pub struct QuotaRule {
7577 /// Identifier. The resource name of the quota rule.
7578 /// Format:
7579 /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7580 pub name: std::string::String,
7581
7582 /// Optional. The quota rule applies to the specified user or group, identified
7583 /// by a Unix UID/GID, Windows SID, or null for default.
7584 pub target: std::string::String,
7585
7586 /// Required. The type of quota rule.
7587 pub r#type: crate::model::quota_rule::Type,
7588
7589 /// Required. The maximum allowed disk space in MiB.
7590 pub disk_limit_mib: i32,
7591
7592 /// Output only. State of the quota rule
7593 pub state: crate::model::quota_rule::State,
7594
7595 /// Output only. State details of the quota rule
7596 pub state_details: std::string::String,
7597
7598 /// Output only. Create time of the quota rule
7599 pub create_time: std::option::Option<wkt::Timestamp>,
7600
7601 /// Optional. Description of the quota rule
7602 pub description: std::string::String,
7603
7604 /// Optional. Labels of the quota rule
7605 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7606
7607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7608}
7609
7610impl QuotaRule {
7611 /// Creates a new default instance.
7612 pub fn new() -> Self {
7613 std::default::Default::default()
7614 }
7615
7616 /// Sets the value of [name][crate::model::QuotaRule::name].
7617 ///
7618 /// # Example
7619 /// ```ignore,no_run
7620 /// # use google_cloud_netapp_v1::model::QuotaRule;
7621 /// let x = QuotaRule::new().set_name("example");
7622 /// ```
7623 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7624 self.name = v.into();
7625 self
7626 }
7627
7628 /// Sets the value of [target][crate::model::QuotaRule::target].
7629 ///
7630 /// # Example
7631 /// ```ignore,no_run
7632 /// # use google_cloud_netapp_v1::model::QuotaRule;
7633 /// let x = QuotaRule::new().set_target("example");
7634 /// ```
7635 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7636 self.target = v.into();
7637 self
7638 }
7639
7640 /// Sets the value of [r#type][crate::model::QuotaRule::type].
7641 ///
7642 /// # Example
7643 /// ```ignore,no_run
7644 /// # use google_cloud_netapp_v1::model::QuotaRule;
7645 /// use google_cloud_netapp_v1::model::quota_rule::Type;
7646 /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7647 /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7648 /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7649 /// ```
7650 pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7651 self.r#type = v.into();
7652 self
7653 }
7654
7655 /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7656 ///
7657 /// # Example
7658 /// ```ignore,no_run
7659 /// # use google_cloud_netapp_v1::model::QuotaRule;
7660 /// let x = QuotaRule::new().set_disk_limit_mib(42);
7661 /// ```
7662 pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7663 self.disk_limit_mib = v.into();
7664 self
7665 }
7666
7667 /// Sets the value of [state][crate::model::QuotaRule::state].
7668 ///
7669 /// # Example
7670 /// ```ignore,no_run
7671 /// # use google_cloud_netapp_v1::model::QuotaRule;
7672 /// use google_cloud_netapp_v1::model::quota_rule::State;
7673 /// let x0 = QuotaRule::new().set_state(State::Creating);
7674 /// let x1 = QuotaRule::new().set_state(State::Updating);
7675 /// let x2 = QuotaRule::new().set_state(State::Deleting);
7676 /// ```
7677 pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7678 mut self,
7679 v: T,
7680 ) -> Self {
7681 self.state = v.into();
7682 self
7683 }
7684
7685 /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7686 ///
7687 /// # Example
7688 /// ```ignore,no_run
7689 /// # use google_cloud_netapp_v1::model::QuotaRule;
7690 /// let x = QuotaRule::new().set_state_details("example");
7691 /// ```
7692 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7693 self.state_details = v.into();
7694 self
7695 }
7696
7697 /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7698 ///
7699 /// # Example
7700 /// ```ignore,no_run
7701 /// # use google_cloud_netapp_v1::model::QuotaRule;
7702 /// use wkt::Timestamp;
7703 /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7704 /// ```
7705 pub fn set_create_time<T>(mut self, v: T) -> Self
7706 where
7707 T: std::convert::Into<wkt::Timestamp>,
7708 {
7709 self.create_time = std::option::Option::Some(v.into());
7710 self
7711 }
7712
7713 /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7714 ///
7715 /// # Example
7716 /// ```ignore,no_run
7717 /// # use google_cloud_netapp_v1::model::QuotaRule;
7718 /// use wkt::Timestamp;
7719 /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7720 /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7721 /// ```
7722 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7723 where
7724 T: std::convert::Into<wkt::Timestamp>,
7725 {
7726 self.create_time = v.map(|x| x.into());
7727 self
7728 }
7729
7730 /// Sets the value of [description][crate::model::QuotaRule::description].
7731 ///
7732 /// # Example
7733 /// ```ignore,no_run
7734 /// # use google_cloud_netapp_v1::model::QuotaRule;
7735 /// let x = QuotaRule::new().set_description("example");
7736 /// ```
7737 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7738 self.description = v.into();
7739 self
7740 }
7741
7742 /// Sets the value of [labels][crate::model::QuotaRule::labels].
7743 ///
7744 /// # Example
7745 /// ```ignore,no_run
7746 /// # use google_cloud_netapp_v1::model::QuotaRule;
7747 /// let x = QuotaRule::new().set_labels([
7748 /// ("key0", "abc"),
7749 /// ("key1", "xyz"),
7750 /// ]);
7751 /// ```
7752 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7753 where
7754 T: std::iter::IntoIterator<Item = (K, V)>,
7755 K: std::convert::Into<std::string::String>,
7756 V: std::convert::Into<std::string::String>,
7757 {
7758 use std::iter::Iterator;
7759 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7760 self
7761 }
7762}
7763
7764impl wkt::message::Message for QuotaRule {
7765 fn typename() -> &'static str {
7766 "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7767 }
7768}
7769
7770/// Defines additional types related to [QuotaRule].
7771pub mod quota_rule {
7772 #[allow(unused_imports)]
7773 use super::*;
7774
7775 /// Types of Quota Rule
7776 ///
7777 /// # Working with unknown values
7778 ///
7779 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7780 /// additional enum variants at any time. Adding new variants is not considered
7781 /// a breaking change. Applications should write their code in anticipation of:
7782 ///
7783 /// - New values appearing in future releases of the client library, **and**
7784 /// - New values received dynamically, without application changes.
7785 ///
7786 /// Please consult the [Working with enums] section in the user guide for some
7787 /// guidelines.
7788 ///
7789 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7790 #[derive(Clone, Debug, PartialEq)]
7791 #[non_exhaustive]
7792 pub enum Type {
7793 /// Unspecified type for quota rule
7794 Unspecified,
7795 /// Individual user quota rule
7796 IndividualUserQuota,
7797 /// Individual group quota rule
7798 IndividualGroupQuota,
7799 /// Default user quota rule
7800 DefaultUserQuota,
7801 /// Default group quota rule
7802 DefaultGroupQuota,
7803 /// If set, the enum was initialized with an unknown value.
7804 ///
7805 /// Applications can examine the value using [Type::value] or
7806 /// [Type::name].
7807 UnknownValue(r#type::UnknownValue),
7808 }
7809
7810 #[doc(hidden)]
7811 pub mod r#type {
7812 #[allow(unused_imports)]
7813 use super::*;
7814 #[derive(Clone, Debug, PartialEq)]
7815 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7816 }
7817
7818 impl Type {
7819 /// Gets the enum value.
7820 ///
7821 /// Returns `None` if the enum contains an unknown value deserialized from
7822 /// the string representation of enums.
7823 pub fn value(&self) -> std::option::Option<i32> {
7824 match self {
7825 Self::Unspecified => std::option::Option::Some(0),
7826 Self::IndividualUserQuota => std::option::Option::Some(1),
7827 Self::IndividualGroupQuota => std::option::Option::Some(2),
7828 Self::DefaultUserQuota => std::option::Option::Some(3),
7829 Self::DefaultGroupQuota => std::option::Option::Some(4),
7830 Self::UnknownValue(u) => u.0.value(),
7831 }
7832 }
7833
7834 /// Gets the enum value as a string.
7835 ///
7836 /// Returns `None` if the enum contains an unknown value deserialized from
7837 /// the integer representation of enums.
7838 pub fn name(&self) -> std::option::Option<&str> {
7839 match self {
7840 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7841 Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7842 Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7843 Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7844 Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7845 Self::UnknownValue(u) => u.0.name(),
7846 }
7847 }
7848 }
7849
7850 impl std::default::Default for Type {
7851 fn default() -> Self {
7852 use std::convert::From;
7853 Self::from(0)
7854 }
7855 }
7856
7857 impl std::fmt::Display for Type {
7858 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7859 wkt::internal::display_enum(f, self.name(), self.value())
7860 }
7861 }
7862
7863 impl std::convert::From<i32> for Type {
7864 fn from(value: i32) -> Self {
7865 match value {
7866 0 => Self::Unspecified,
7867 1 => Self::IndividualUserQuota,
7868 2 => Self::IndividualGroupQuota,
7869 3 => Self::DefaultUserQuota,
7870 4 => Self::DefaultGroupQuota,
7871 _ => Self::UnknownValue(r#type::UnknownValue(
7872 wkt::internal::UnknownEnumValue::Integer(value),
7873 )),
7874 }
7875 }
7876 }
7877
7878 impl std::convert::From<&str> for Type {
7879 fn from(value: &str) -> Self {
7880 use std::string::ToString;
7881 match value {
7882 "TYPE_UNSPECIFIED" => Self::Unspecified,
7883 "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
7884 "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
7885 "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
7886 "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
7887 _ => Self::UnknownValue(r#type::UnknownValue(
7888 wkt::internal::UnknownEnumValue::String(value.to_string()),
7889 )),
7890 }
7891 }
7892 }
7893
7894 impl serde::ser::Serialize for Type {
7895 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7896 where
7897 S: serde::Serializer,
7898 {
7899 match self {
7900 Self::Unspecified => serializer.serialize_i32(0),
7901 Self::IndividualUserQuota => serializer.serialize_i32(1),
7902 Self::IndividualGroupQuota => serializer.serialize_i32(2),
7903 Self::DefaultUserQuota => serializer.serialize_i32(3),
7904 Self::DefaultGroupQuota => serializer.serialize_i32(4),
7905 Self::UnknownValue(u) => u.0.serialize(serializer),
7906 }
7907 }
7908 }
7909
7910 impl<'de> serde::de::Deserialize<'de> for Type {
7911 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7912 where
7913 D: serde::Deserializer<'de>,
7914 {
7915 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7916 ".google.cloud.netapp.v1.QuotaRule.Type",
7917 ))
7918 }
7919 }
7920
7921 /// Quota Rule states
7922 ///
7923 /// # Working with unknown values
7924 ///
7925 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7926 /// additional enum variants at any time. Adding new variants is not considered
7927 /// a breaking change. Applications should write their code in anticipation of:
7928 ///
7929 /// - New values appearing in future releases of the client library, **and**
7930 /// - New values received dynamically, without application changes.
7931 ///
7932 /// Please consult the [Working with enums] section in the user guide for some
7933 /// guidelines.
7934 ///
7935 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7936 #[derive(Clone, Debug, PartialEq)]
7937 #[non_exhaustive]
7938 pub enum State {
7939 /// Unspecified state for quota rule
7940 Unspecified,
7941 /// Quota rule is creating
7942 Creating,
7943 /// Quota rule is updating
7944 Updating,
7945 /// Quota rule is deleting
7946 Deleting,
7947 /// Quota rule is ready
7948 Ready,
7949 /// Quota rule is in error state.
7950 Error,
7951 /// If set, the enum was initialized with an unknown value.
7952 ///
7953 /// Applications can examine the value using [State::value] or
7954 /// [State::name].
7955 UnknownValue(state::UnknownValue),
7956 }
7957
7958 #[doc(hidden)]
7959 pub mod state {
7960 #[allow(unused_imports)]
7961 use super::*;
7962 #[derive(Clone, Debug, PartialEq)]
7963 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7964 }
7965
7966 impl State {
7967 /// Gets the enum value.
7968 ///
7969 /// Returns `None` if the enum contains an unknown value deserialized from
7970 /// the string representation of enums.
7971 pub fn value(&self) -> std::option::Option<i32> {
7972 match self {
7973 Self::Unspecified => std::option::Option::Some(0),
7974 Self::Creating => std::option::Option::Some(1),
7975 Self::Updating => std::option::Option::Some(2),
7976 Self::Deleting => std::option::Option::Some(3),
7977 Self::Ready => std::option::Option::Some(4),
7978 Self::Error => std::option::Option::Some(5),
7979 Self::UnknownValue(u) => u.0.value(),
7980 }
7981 }
7982
7983 /// Gets the enum value as a string.
7984 ///
7985 /// Returns `None` if the enum contains an unknown value deserialized from
7986 /// the integer representation of enums.
7987 pub fn name(&self) -> std::option::Option<&str> {
7988 match self {
7989 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7990 Self::Creating => std::option::Option::Some("CREATING"),
7991 Self::Updating => std::option::Option::Some("UPDATING"),
7992 Self::Deleting => std::option::Option::Some("DELETING"),
7993 Self::Ready => std::option::Option::Some("READY"),
7994 Self::Error => std::option::Option::Some("ERROR"),
7995 Self::UnknownValue(u) => u.0.name(),
7996 }
7997 }
7998 }
7999
8000 impl std::default::Default for State {
8001 fn default() -> Self {
8002 use std::convert::From;
8003 Self::from(0)
8004 }
8005 }
8006
8007 impl std::fmt::Display for State {
8008 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8009 wkt::internal::display_enum(f, self.name(), self.value())
8010 }
8011 }
8012
8013 impl std::convert::From<i32> for State {
8014 fn from(value: i32) -> Self {
8015 match value {
8016 0 => Self::Unspecified,
8017 1 => Self::Creating,
8018 2 => Self::Updating,
8019 3 => Self::Deleting,
8020 4 => Self::Ready,
8021 5 => Self::Error,
8022 _ => Self::UnknownValue(state::UnknownValue(
8023 wkt::internal::UnknownEnumValue::Integer(value),
8024 )),
8025 }
8026 }
8027 }
8028
8029 impl std::convert::From<&str> for State {
8030 fn from(value: &str) -> Self {
8031 use std::string::ToString;
8032 match value {
8033 "STATE_UNSPECIFIED" => Self::Unspecified,
8034 "CREATING" => Self::Creating,
8035 "UPDATING" => Self::Updating,
8036 "DELETING" => Self::Deleting,
8037 "READY" => Self::Ready,
8038 "ERROR" => Self::Error,
8039 _ => Self::UnknownValue(state::UnknownValue(
8040 wkt::internal::UnknownEnumValue::String(value.to_string()),
8041 )),
8042 }
8043 }
8044 }
8045
8046 impl serde::ser::Serialize for State {
8047 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8048 where
8049 S: serde::Serializer,
8050 {
8051 match self {
8052 Self::Unspecified => serializer.serialize_i32(0),
8053 Self::Creating => serializer.serialize_i32(1),
8054 Self::Updating => serializer.serialize_i32(2),
8055 Self::Deleting => serializer.serialize_i32(3),
8056 Self::Ready => serializer.serialize_i32(4),
8057 Self::Error => serializer.serialize_i32(5),
8058 Self::UnknownValue(u) => u.0.serialize(serializer),
8059 }
8060 }
8061 }
8062
8063 impl<'de> serde::de::Deserialize<'de> for State {
8064 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8065 where
8066 D: serde::Deserializer<'de>,
8067 {
8068 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8069 ".google.cloud.netapp.v1.QuotaRule.State",
8070 ))
8071 }
8072 }
8073}
8074
8075/// TransferStats reports all statistics related to replication transfer.
8076#[derive(Clone, Default, PartialEq)]
8077#[non_exhaustive]
8078pub struct TransferStats {
8079 /// Cumulative bytes transferred so far for the replication relationship.
8080 pub transfer_bytes: std::option::Option<i64>,
8081
8082 /// Cumulative time taken across all transfers for the replication
8083 /// relationship.
8084 pub total_transfer_duration: std::option::Option<wkt::Duration>,
8085
8086 /// Last transfer size in bytes.
8087 pub last_transfer_bytes: std::option::Option<i64>,
8088
8089 /// Time taken during last transfer.
8090 pub last_transfer_duration: std::option::Option<wkt::Duration>,
8091
8092 /// Lag duration indicates the duration by which Destination region volume
8093 /// content lags behind the primary region volume content.
8094 pub lag_duration: std::option::Option<wkt::Duration>,
8095
8096 /// Time when progress was updated last.
8097 pub update_time: std::option::Option<wkt::Timestamp>,
8098
8099 /// Time when last transfer completed.
8100 pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
8101
8102 /// A message describing the cause of the last transfer failure.
8103 pub last_transfer_error: std::option::Option<std::string::String>,
8104
8105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8106}
8107
8108impl TransferStats {
8109 /// Creates a new default instance.
8110 pub fn new() -> Self {
8111 std::default::Default::default()
8112 }
8113
8114 /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8115 ///
8116 /// # Example
8117 /// ```ignore,no_run
8118 /// # use google_cloud_netapp_v1::model::TransferStats;
8119 /// let x = TransferStats::new().set_transfer_bytes(42);
8120 /// ```
8121 pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
8122 where
8123 T: std::convert::Into<i64>,
8124 {
8125 self.transfer_bytes = std::option::Option::Some(v.into());
8126 self
8127 }
8128
8129 /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8130 ///
8131 /// # Example
8132 /// ```ignore,no_run
8133 /// # use google_cloud_netapp_v1::model::TransferStats;
8134 /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
8135 /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
8136 /// ```
8137 pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8138 where
8139 T: std::convert::Into<i64>,
8140 {
8141 self.transfer_bytes = v.map(|x| x.into());
8142 self
8143 }
8144
8145 /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8146 ///
8147 /// # Example
8148 /// ```ignore,no_run
8149 /// # use google_cloud_netapp_v1::model::TransferStats;
8150 /// use wkt::Duration;
8151 /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
8152 /// ```
8153 pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
8154 where
8155 T: std::convert::Into<wkt::Duration>,
8156 {
8157 self.total_transfer_duration = std::option::Option::Some(v.into());
8158 self
8159 }
8160
8161 /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8162 ///
8163 /// # Example
8164 /// ```ignore,no_run
8165 /// # use google_cloud_netapp_v1::model::TransferStats;
8166 /// use wkt::Duration;
8167 /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
8168 /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
8169 /// ```
8170 pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8171 where
8172 T: std::convert::Into<wkt::Duration>,
8173 {
8174 self.total_transfer_duration = v.map(|x| x.into());
8175 self
8176 }
8177
8178 /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8179 ///
8180 /// # Example
8181 /// ```ignore,no_run
8182 /// # use google_cloud_netapp_v1::model::TransferStats;
8183 /// let x = TransferStats::new().set_last_transfer_bytes(42);
8184 /// ```
8185 pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
8186 where
8187 T: std::convert::Into<i64>,
8188 {
8189 self.last_transfer_bytes = std::option::Option::Some(v.into());
8190 self
8191 }
8192
8193 /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8194 ///
8195 /// # Example
8196 /// ```ignore,no_run
8197 /// # use google_cloud_netapp_v1::model::TransferStats;
8198 /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
8199 /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
8200 /// ```
8201 pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8202 where
8203 T: std::convert::Into<i64>,
8204 {
8205 self.last_transfer_bytes = v.map(|x| x.into());
8206 self
8207 }
8208
8209 /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8210 ///
8211 /// # Example
8212 /// ```ignore,no_run
8213 /// # use google_cloud_netapp_v1::model::TransferStats;
8214 /// use wkt::Duration;
8215 /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
8216 /// ```
8217 pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
8218 where
8219 T: std::convert::Into<wkt::Duration>,
8220 {
8221 self.last_transfer_duration = std::option::Option::Some(v.into());
8222 self
8223 }
8224
8225 /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8226 ///
8227 /// # Example
8228 /// ```ignore,no_run
8229 /// # use google_cloud_netapp_v1::model::TransferStats;
8230 /// use wkt::Duration;
8231 /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
8232 /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
8233 /// ```
8234 pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8235 where
8236 T: std::convert::Into<wkt::Duration>,
8237 {
8238 self.last_transfer_duration = v.map(|x| x.into());
8239 self
8240 }
8241
8242 /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
8243 ///
8244 /// # Example
8245 /// ```ignore,no_run
8246 /// # use google_cloud_netapp_v1::model::TransferStats;
8247 /// use wkt::Duration;
8248 /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
8249 /// ```
8250 pub fn set_lag_duration<T>(mut self, v: T) -> Self
8251 where
8252 T: std::convert::Into<wkt::Duration>,
8253 {
8254 self.lag_duration = std::option::Option::Some(v.into());
8255 self
8256 }
8257
8258 /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
8259 ///
8260 /// # Example
8261 /// ```ignore,no_run
8262 /// # use google_cloud_netapp_v1::model::TransferStats;
8263 /// use wkt::Duration;
8264 /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
8265 /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
8266 /// ```
8267 pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
8268 where
8269 T: std::convert::Into<wkt::Duration>,
8270 {
8271 self.lag_duration = v.map(|x| x.into());
8272 self
8273 }
8274
8275 /// Sets the value of [update_time][crate::model::TransferStats::update_time].
8276 ///
8277 /// # Example
8278 /// ```ignore,no_run
8279 /// # use google_cloud_netapp_v1::model::TransferStats;
8280 /// use wkt::Timestamp;
8281 /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
8282 /// ```
8283 pub fn set_update_time<T>(mut self, v: T) -> Self
8284 where
8285 T: std::convert::Into<wkt::Timestamp>,
8286 {
8287 self.update_time = std::option::Option::Some(v.into());
8288 self
8289 }
8290
8291 /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
8292 ///
8293 /// # Example
8294 /// ```ignore,no_run
8295 /// # use google_cloud_netapp_v1::model::TransferStats;
8296 /// use wkt::Timestamp;
8297 /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8298 /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
8299 /// ```
8300 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8301 where
8302 T: std::convert::Into<wkt::Timestamp>,
8303 {
8304 self.update_time = v.map(|x| x.into());
8305 self
8306 }
8307
8308 /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8309 ///
8310 /// # Example
8311 /// ```ignore,no_run
8312 /// # use google_cloud_netapp_v1::model::TransferStats;
8313 /// use wkt::Timestamp;
8314 /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
8315 /// ```
8316 pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
8317 where
8318 T: std::convert::Into<wkt::Timestamp>,
8319 {
8320 self.last_transfer_end_time = std::option::Option::Some(v.into());
8321 self
8322 }
8323
8324 /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8325 ///
8326 /// # Example
8327 /// ```ignore,no_run
8328 /// # use google_cloud_netapp_v1::model::TransferStats;
8329 /// use wkt::Timestamp;
8330 /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
8331 /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
8332 /// ```
8333 pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8334 where
8335 T: std::convert::Into<wkt::Timestamp>,
8336 {
8337 self.last_transfer_end_time = v.map(|x| x.into());
8338 self
8339 }
8340
8341 /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8342 ///
8343 /// # Example
8344 /// ```ignore,no_run
8345 /// # use google_cloud_netapp_v1::model::TransferStats;
8346 /// let x = TransferStats::new().set_last_transfer_error("example");
8347 /// ```
8348 pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
8349 where
8350 T: std::convert::Into<std::string::String>,
8351 {
8352 self.last_transfer_error = std::option::Option::Some(v.into());
8353 self
8354 }
8355
8356 /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8357 ///
8358 /// # Example
8359 /// ```ignore,no_run
8360 /// # use google_cloud_netapp_v1::model::TransferStats;
8361 /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
8362 /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
8363 /// ```
8364 pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
8365 where
8366 T: std::convert::Into<std::string::String>,
8367 {
8368 self.last_transfer_error = v.map(|x| x.into());
8369 self
8370 }
8371}
8372
8373impl wkt::message::Message for TransferStats {
8374 fn typename() -> &'static str {
8375 "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
8376 }
8377}
8378
8379/// Replication is a nested resource under Volume, that describes a
8380/// cross-region replication relationship between 2 volumes in different
8381/// regions.
8382#[derive(Clone, Default, PartialEq)]
8383#[non_exhaustive]
8384pub struct Replication {
8385 /// Identifier. The resource name of the Replication.
8386 /// Format:
8387 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
8388 pub name: std::string::String,
8389
8390 /// Output only. State of the replication.
8391 pub state: crate::model::replication::State,
8392
8393 /// Output only. State details of the replication.
8394 pub state_details: std::string::String,
8395
8396 /// Output only. Indicates whether this points to source or destination.
8397 pub role: crate::model::replication::ReplicationRole,
8398
8399 /// Required. Indicates the schedule for replication.
8400 pub replication_schedule: crate::model::replication::ReplicationSchedule,
8401
8402 /// Output only. Indicates the state of mirroring.
8403 pub mirror_state: crate::model::replication::MirrorState,
8404
8405 /// Output only. Condition of the relationship. Can be one of the following:
8406 ///
8407 /// - true: The replication relationship is healthy. It has not missed the most
8408 /// recent scheduled transfer.
8409 /// - false: The replication relationship is not healthy. It has missed the
8410 /// most recent scheduled transfer.
8411 pub healthy: std::option::Option<bool>,
8412
8413 /// Output only. Replication create time.
8414 pub create_time: std::option::Option<wkt::Timestamp>,
8415
8416 /// Output only. Full name of destination volume resource.
8417 /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8418 pub destination_volume: std::string::String,
8419
8420 /// Output only. Replication transfer statistics.
8421 pub transfer_stats: std::option::Option<crate::model::TransferStats>,
8422
8423 /// Resource labels to represent user provided metadata.
8424 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8425
8426 /// A description about this replication relationship.
8427 pub description: std::option::Option<std::string::String>,
8428
8429 /// Required. Input only. Destination volume parameters
8430 pub destination_volume_parameters:
8431 std::option::Option<crate::model::DestinationVolumeParameters>,
8432
8433 /// Output only. Full name of source volume resource.
8434 /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8435 pub source_volume: std::string::String,
8436
8437 /// Output only. Hybrid peering details.
8438 pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
8439
8440 /// Optional. Location of the user cluster.
8441 pub cluster_location: std::string::String,
8442
8443 /// Output only. Type of the hybrid replication.
8444 pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
8445
8446 /// Output only. Copy pastable snapmirror commands to be executed on onprem
8447 /// cluster by the customer.
8448 pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
8449
8450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8451}
8452
8453impl Replication {
8454 /// Creates a new default instance.
8455 pub fn new() -> Self {
8456 std::default::Default::default()
8457 }
8458
8459 /// Sets the value of [name][crate::model::Replication::name].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_netapp_v1::model::Replication;
8464 /// let x = Replication::new().set_name("example");
8465 /// ```
8466 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8467 self.name = v.into();
8468 self
8469 }
8470
8471 /// Sets the value of [state][crate::model::Replication::state].
8472 ///
8473 /// # Example
8474 /// ```ignore,no_run
8475 /// # use google_cloud_netapp_v1::model::Replication;
8476 /// use google_cloud_netapp_v1::model::replication::State;
8477 /// let x0 = Replication::new().set_state(State::Creating);
8478 /// let x1 = Replication::new().set_state(State::Ready);
8479 /// let x2 = Replication::new().set_state(State::Updating);
8480 /// ```
8481 pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
8482 mut self,
8483 v: T,
8484 ) -> Self {
8485 self.state = v.into();
8486 self
8487 }
8488
8489 /// Sets the value of [state_details][crate::model::Replication::state_details].
8490 ///
8491 /// # Example
8492 /// ```ignore,no_run
8493 /// # use google_cloud_netapp_v1::model::Replication;
8494 /// let x = Replication::new().set_state_details("example");
8495 /// ```
8496 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8497 self.state_details = v.into();
8498 self
8499 }
8500
8501 /// Sets the value of [role][crate::model::Replication::role].
8502 ///
8503 /// # Example
8504 /// ```ignore,no_run
8505 /// # use google_cloud_netapp_v1::model::Replication;
8506 /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
8507 /// let x0 = Replication::new().set_role(ReplicationRole::Source);
8508 /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
8509 /// ```
8510 pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
8511 mut self,
8512 v: T,
8513 ) -> Self {
8514 self.role = v.into();
8515 self
8516 }
8517
8518 /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
8519 ///
8520 /// # Example
8521 /// ```ignore,no_run
8522 /// # use google_cloud_netapp_v1::model::Replication;
8523 /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
8524 /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
8525 /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
8526 /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
8527 /// ```
8528 pub fn set_replication_schedule<
8529 T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
8530 >(
8531 mut self,
8532 v: T,
8533 ) -> Self {
8534 self.replication_schedule = v.into();
8535 self
8536 }
8537
8538 /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8539 ///
8540 /// # Example
8541 /// ```ignore,no_run
8542 /// # use google_cloud_netapp_v1::model::Replication;
8543 /// use google_cloud_netapp_v1::model::replication::MirrorState;
8544 /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8545 /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8546 /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8547 /// ```
8548 pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8549 mut self,
8550 v: T,
8551 ) -> Self {
8552 self.mirror_state = v.into();
8553 self
8554 }
8555
8556 /// Sets the value of [healthy][crate::model::Replication::healthy].
8557 ///
8558 /// # Example
8559 /// ```ignore,no_run
8560 /// # use google_cloud_netapp_v1::model::Replication;
8561 /// let x = Replication::new().set_healthy(true);
8562 /// ```
8563 pub fn set_healthy<T>(mut self, v: T) -> Self
8564 where
8565 T: std::convert::Into<bool>,
8566 {
8567 self.healthy = std::option::Option::Some(v.into());
8568 self
8569 }
8570
8571 /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8572 ///
8573 /// # Example
8574 /// ```ignore,no_run
8575 /// # use google_cloud_netapp_v1::model::Replication;
8576 /// let x = Replication::new().set_or_clear_healthy(Some(false));
8577 /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8578 /// ```
8579 pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8580 where
8581 T: std::convert::Into<bool>,
8582 {
8583 self.healthy = v.map(|x| x.into());
8584 self
8585 }
8586
8587 /// Sets the value of [create_time][crate::model::Replication::create_time].
8588 ///
8589 /// # Example
8590 /// ```ignore,no_run
8591 /// # use google_cloud_netapp_v1::model::Replication;
8592 /// use wkt::Timestamp;
8593 /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8594 /// ```
8595 pub fn set_create_time<T>(mut self, v: T) -> Self
8596 where
8597 T: std::convert::Into<wkt::Timestamp>,
8598 {
8599 self.create_time = std::option::Option::Some(v.into());
8600 self
8601 }
8602
8603 /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8604 ///
8605 /// # Example
8606 /// ```ignore,no_run
8607 /// # use google_cloud_netapp_v1::model::Replication;
8608 /// use wkt::Timestamp;
8609 /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8610 /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8611 /// ```
8612 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8613 where
8614 T: std::convert::Into<wkt::Timestamp>,
8615 {
8616 self.create_time = v.map(|x| x.into());
8617 self
8618 }
8619
8620 /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8621 ///
8622 /// # Example
8623 /// ```ignore,no_run
8624 /// # use google_cloud_netapp_v1::model::Replication;
8625 /// let x = Replication::new().set_destination_volume("example");
8626 /// ```
8627 pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8628 mut self,
8629 v: T,
8630 ) -> Self {
8631 self.destination_volume = v.into();
8632 self
8633 }
8634
8635 /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8636 ///
8637 /// # Example
8638 /// ```ignore,no_run
8639 /// # use google_cloud_netapp_v1::model::Replication;
8640 /// use google_cloud_netapp_v1::model::TransferStats;
8641 /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8642 /// ```
8643 pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8644 where
8645 T: std::convert::Into<crate::model::TransferStats>,
8646 {
8647 self.transfer_stats = std::option::Option::Some(v.into());
8648 self
8649 }
8650
8651 /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8652 ///
8653 /// # Example
8654 /// ```ignore,no_run
8655 /// # use google_cloud_netapp_v1::model::Replication;
8656 /// use google_cloud_netapp_v1::model::TransferStats;
8657 /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8658 /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8659 /// ```
8660 pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8661 where
8662 T: std::convert::Into<crate::model::TransferStats>,
8663 {
8664 self.transfer_stats = v.map(|x| x.into());
8665 self
8666 }
8667
8668 /// Sets the value of [labels][crate::model::Replication::labels].
8669 ///
8670 /// # Example
8671 /// ```ignore,no_run
8672 /// # use google_cloud_netapp_v1::model::Replication;
8673 /// let x = Replication::new().set_labels([
8674 /// ("key0", "abc"),
8675 /// ("key1", "xyz"),
8676 /// ]);
8677 /// ```
8678 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8679 where
8680 T: std::iter::IntoIterator<Item = (K, V)>,
8681 K: std::convert::Into<std::string::String>,
8682 V: std::convert::Into<std::string::String>,
8683 {
8684 use std::iter::Iterator;
8685 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8686 self
8687 }
8688
8689 /// Sets the value of [description][crate::model::Replication::description].
8690 ///
8691 /// # Example
8692 /// ```ignore,no_run
8693 /// # use google_cloud_netapp_v1::model::Replication;
8694 /// let x = Replication::new().set_description("example");
8695 /// ```
8696 pub fn set_description<T>(mut self, v: T) -> Self
8697 where
8698 T: std::convert::Into<std::string::String>,
8699 {
8700 self.description = std::option::Option::Some(v.into());
8701 self
8702 }
8703
8704 /// Sets or clears the value of [description][crate::model::Replication::description].
8705 ///
8706 /// # Example
8707 /// ```ignore,no_run
8708 /// # use google_cloud_netapp_v1::model::Replication;
8709 /// let x = Replication::new().set_or_clear_description(Some("example"));
8710 /// let x = Replication::new().set_or_clear_description(None::<String>);
8711 /// ```
8712 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8713 where
8714 T: std::convert::Into<std::string::String>,
8715 {
8716 self.description = v.map(|x| x.into());
8717 self
8718 }
8719
8720 /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8721 ///
8722 /// # Example
8723 /// ```ignore,no_run
8724 /// # use google_cloud_netapp_v1::model::Replication;
8725 /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8726 /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8727 /// ```
8728 pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8729 where
8730 T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8731 {
8732 self.destination_volume_parameters = std::option::Option::Some(v.into());
8733 self
8734 }
8735
8736 /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8737 ///
8738 /// # Example
8739 /// ```ignore,no_run
8740 /// # use google_cloud_netapp_v1::model::Replication;
8741 /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8742 /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8743 /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8744 /// ```
8745 pub fn set_or_clear_destination_volume_parameters<T>(
8746 mut self,
8747 v: std::option::Option<T>,
8748 ) -> Self
8749 where
8750 T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8751 {
8752 self.destination_volume_parameters = v.map(|x| x.into());
8753 self
8754 }
8755
8756 /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8757 ///
8758 /// # Example
8759 /// ```ignore,no_run
8760 /// # use google_cloud_netapp_v1::model::Replication;
8761 /// let x = Replication::new().set_source_volume("example");
8762 /// ```
8763 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8764 self.source_volume = v.into();
8765 self
8766 }
8767
8768 /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8769 ///
8770 /// # Example
8771 /// ```ignore,no_run
8772 /// # use google_cloud_netapp_v1::model::Replication;
8773 /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8774 /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8775 /// ```
8776 pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8777 where
8778 T: std::convert::Into<crate::model::HybridPeeringDetails>,
8779 {
8780 self.hybrid_peering_details = std::option::Option::Some(v.into());
8781 self
8782 }
8783
8784 /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8785 ///
8786 /// # Example
8787 /// ```ignore,no_run
8788 /// # use google_cloud_netapp_v1::model::Replication;
8789 /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8790 /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8791 /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8792 /// ```
8793 pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8794 where
8795 T: std::convert::Into<crate::model::HybridPeeringDetails>,
8796 {
8797 self.hybrid_peering_details = v.map(|x| x.into());
8798 self
8799 }
8800
8801 /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8802 ///
8803 /// # Example
8804 /// ```ignore,no_run
8805 /// # use google_cloud_netapp_v1::model::Replication;
8806 /// let x = Replication::new().set_cluster_location("example");
8807 /// ```
8808 pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8809 mut self,
8810 v: T,
8811 ) -> Self {
8812 self.cluster_location = v.into();
8813 self
8814 }
8815
8816 /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8817 ///
8818 /// # Example
8819 /// ```ignore,no_run
8820 /// # use google_cloud_netapp_v1::model::Replication;
8821 /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8822 /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8823 /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8824 /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8825 /// ```
8826 pub fn set_hybrid_replication_type<
8827 T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8828 >(
8829 mut self,
8830 v: T,
8831 ) -> Self {
8832 self.hybrid_replication_type = v.into();
8833 self
8834 }
8835
8836 /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8837 ///
8838 /// # Example
8839 /// ```ignore,no_run
8840 /// # use google_cloud_netapp_v1::model::Replication;
8841 /// use google_cloud_netapp_v1::model::UserCommands;
8842 /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8843 /// ```
8844 pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8845 where
8846 T: std::convert::Into<crate::model::UserCommands>,
8847 {
8848 self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8849 self
8850 }
8851
8852 /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8853 ///
8854 /// # Example
8855 /// ```ignore,no_run
8856 /// # use google_cloud_netapp_v1::model::Replication;
8857 /// use google_cloud_netapp_v1::model::UserCommands;
8858 /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8859 /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8860 /// ```
8861 pub fn set_or_clear_hybrid_replication_user_commands<T>(
8862 mut self,
8863 v: std::option::Option<T>,
8864 ) -> Self
8865 where
8866 T: std::convert::Into<crate::model::UserCommands>,
8867 {
8868 self.hybrid_replication_user_commands = v.map(|x| x.into());
8869 self
8870 }
8871}
8872
8873impl wkt::message::Message for Replication {
8874 fn typename() -> &'static str {
8875 "type.googleapis.com/google.cloud.netapp.v1.Replication"
8876 }
8877}
8878
8879/// Defines additional types related to [Replication].
8880pub mod replication {
8881 #[allow(unused_imports)]
8882 use super::*;
8883
8884 /// The replication states
8885 /// New enum values may be added in future to indicate possible new states.
8886 ///
8887 /// # Working with unknown values
8888 ///
8889 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8890 /// additional enum variants at any time. Adding new variants is not considered
8891 /// a breaking change. Applications should write their code in anticipation of:
8892 ///
8893 /// - New values appearing in future releases of the client library, **and**
8894 /// - New values received dynamically, without application changes.
8895 ///
8896 /// Please consult the [Working with enums] section in the user guide for some
8897 /// guidelines.
8898 ///
8899 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8900 #[derive(Clone, Debug, PartialEq)]
8901 #[non_exhaustive]
8902 pub enum State {
8903 /// Unspecified replication State
8904 Unspecified,
8905 /// Replication is creating.
8906 Creating,
8907 /// Replication is ready.
8908 Ready,
8909 /// Replication is updating.
8910 Updating,
8911 /// Replication is deleting.
8912 Deleting,
8913 /// Replication is in error state.
8914 Error,
8915 /// Replication is waiting for cluster peering to be established.
8916 PendingClusterPeering,
8917 /// Replication is waiting for SVM peering to be established.
8918 PendingSvmPeering,
8919 /// Replication is waiting for Commands to be executed on Onprem ONTAP.
8920 PendingRemoteResync,
8921 /// Onprem ONTAP is destination and Replication can only be managed from
8922 /// Onprem.
8923 ExternallyManagedReplication,
8924 /// If set, the enum was initialized with an unknown value.
8925 ///
8926 /// Applications can examine the value using [State::value] or
8927 /// [State::name].
8928 UnknownValue(state::UnknownValue),
8929 }
8930
8931 #[doc(hidden)]
8932 pub mod state {
8933 #[allow(unused_imports)]
8934 use super::*;
8935 #[derive(Clone, Debug, PartialEq)]
8936 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8937 }
8938
8939 impl State {
8940 /// Gets the enum value.
8941 ///
8942 /// Returns `None` if the enum contains an unknown value deserialized from
8943 /// the string representation of enums.
8944 pub fn value(&self) -> std::option::Option<i32> {
8945 match self {
8946 Self::Unspecified => std::option::Option::Some(0),
8947 Self::Creating => std::option::Option::Some(1),
8948 Self::Ready => std::option::Option::Some(2),
8949 Self::Updating => std::option::Option::Some(3),
8950 Self::Deleting => std::option::Option::Some(5),
8951 Self::Error => std::option::Option::Some(6),
8952 Self::PendingClusterPeering => std::option::Option::Some(8),
8953 Self::PendingSvmPeering => std::option::Option::Some(9),
8954 Self::PendingRemoteResync => std::option::Option::Some(10),
8955 Self::ExternallyManagedReplication => std::option::Option::Some(11),
8956 Self::UnknownValue(u) => u.0.value(),
8957 }
8958 }
8959
8960 /// Gets the enum value as a string.
8961 ///
8962 /// Returns `None` if the enum contains an unknown value deserialized from
8963 /// the integer representation of enums.
8964 pub fn name(&self) -> std::option::Option<&str> {
8965 match self {
8966 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8967 Self::Creating => std::option::Option::Some("CREATING"),
8968 Self::Ready => std::option::Option::Some("READY"),
8969 Self::Updating => std::option::Option::Some("UPDATING"),
8970 Self::Deleting => std::option::Option::Some("DELETING"),
8971 Self::Error => std::option::Option::Some("ERROR"),
8972 Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
8973 Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
8974 Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
8975 Self::ExternallyManagedReplication => {
8976 std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
8977 }
8978 Self::UnknownValue(u) => u.0.name(),
8979 }
8980 }
8981 }
8982
8983 impl std::default::Default for State {
8984 fn default() -> Self {
8985 use std::convert::From;
8986 Self::from(0)
8987 }
8988 }
8989
8990 impl std::fmt::Display for State {
8991 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8992 wkt::internal::display_enum(f, self.name(), self.value())
8993 }
8994 }
8995
8996 impl std::convert::From<i32> for State {
8997 fn from(value: i32) -> Self {
8998 match value {
8999 0 => Self::Unspecified,
9000 1 => Self::Creating,
9001 2 => Self::Ready,
9002 3 => Self::Updating,
9003 5 => Self::Deleting,
9004 6 => Self::Error,
9005 8 => Self::PendingClusterPeering,
9006 9 => Self::PendingSvmPeering,
9007 10 => Self::PendingRemoteResync,
9008 11 => Self::ExternallyManagedReplication,
9009 _ => Self::UnknownValue(state::UnknownValue(
9010 wkt::internal::UnknownEnumValue::Integer(value),
9011 )),
9012 }
9013 }
9014 }
9015
9016 impl std::convert::From<&str> for State {
9017 fn from(value: &str) -> Self {
9018 use std::string::ToString;
9019 match value {
9020 "STATE_UNSPECIFIED" => Self::Unspecified,
9021 "CREATING" => Self::Creating,
9022 "READY" => Self::Ready,
9023 "UPDATING" => Self::Updating,
9024 "DELETING" => Self::Deleting,
9025 "ERROR" => Self::Error,
9026 "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
9027 "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
9028 "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
9029 "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
9030 _ => Self::UnknownValue(state::UnknownValue(
9031 wkt::internal::UnknownEnumValue::String(value.to_string()),
9032 )),
9033 }
9034 }
9035 }
9036
9037 impl serde::ser::Serialize for State {
9038 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9039 where
9040 S: serde::Serializer,
9041 {
9042 match self {
9043 Self::Unspecified => serializer.serialize_i32(0),
9044 Self::Creating => serializer.serialize_i32(1),
9045 Self::Ready => serializer.serialize_i32(2),
9046 Self::Updating => serializer.serialize_i32(3),
9047 Self::Deleting => serializer.serialize_i32(5),
9048 Self::Error => serializer.serialize_i32(6),
9049 Self::PendingClusterPeering => serializer.serialize_i32(8),
9050 Self::PendingSvmPeering => serializer.serialize_i32(9),
9051 Self::PendingRemoteResync => serializer.serialize_i32(10),
9052 Self::ExternallyManagedReplication => serializer.serialize_i32(11),
9053 Self::UnknownValue(u) => u.0.serialize(serializer),
9054 }
9055 }
9056 }
9057
9058 impl<'de> serde::de::Deserialize<'de> for State {
9059 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9060 where
9061 D: serde::Deserializer<'de>,
9062 {
9063 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9064 ".google.cloud.netapp.v1.Replication.State",
9065 ))
9066 }
9067 }
9068
9069 /// New enum values may be added in future to support different replication
9070 /// topology.
9071 ///
9072 /// # Working with unknown values
9073 ///
9074 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9075 /// additional enum variants at any time. Adding new variants is not considered
9076 /// a breaking change. Applications should write their code in anticipation of:
9077 ///
9078 /// - New values appearing in future releases of the client library, **and**
9079 /// - New values received dynamically, without application changes.
9080 ///
9081 /// Please consult the [Working with enums] section in the user guide for some
9082 /// guidelines.
9083 ///
9084 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9085 #[derive(Clone, Debug, PartialEq)]
9086 #[non_exhaustive]
9087 pub enum ReplicationRole {
9088 /// Unspecified replication role
9089 Unspecified,
9090 /// Indicates Source volume.
9091 Source,
9092 /// Indicates Destination volume.
9093 Destination,
9094 /// If set, the enum was initialized with an unknown value.
9095 ///
9096 /// Applications can examine the value using [ReplicationRole::value] or
9097 /// [ReplicationRole::name].
9098 UnknownValue(replication_role::UnknownValue),
9099 }
9100
9101 #[doc(hidden)]
9102 pub mod replication_role {
9103 #[allow(unused_imports)]
9104 use super::*;
9105 #[derive(Clone, Debug, PartialEq)]
9106 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9107 }
9108
9109 impl ReplicationRole {
9110 /// Gets the enum value.
9111 ///
9112 /// Returns `None` if the enum contains an unknown value deserialized from
9113 /// the string representation of enums.
9114 pub fn value(&self) -> std::option::Option<i32> {
9115 match self {
9116 Self::Unspecified => std::option::Option::Some(0),
9117 Self::Source => std::option::Option::Some(1),
9118 Self::Destination => std::option::Option::Some(2),
9119 Self::UnknownValue(u) => u.0.value(),
9120 }
9121 }
9122
9123 /// Gets the enum value as a string.
9124 ///
9125 /// Returns `None` if the enum contains an unknown value deserialized from
9126 /// the integer representation of enums.
9127 pub fn name(&self) -> std::option::Option<&str> {
9128 match self {
9129 Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
9130 Self::Source => std::option::Option::Some("SOURCE"),
9131 Self::Destination => std::option::Option::Some("DESTINATION"),
9132 Self::UnknownValue(u) => u.0.name(),
9133 }
9134 }
9135 }
9136
9137 impl std::default::Default for ReplicationRole {
9138 fn default() -> Self {
9139 use std::convert::From;
9140 Self::from(0)
9141 }
9142 }
9143
9144 impl std::fmt::Display for ReplicationRole {
9145 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9146 wkt::internal::display_enum(f, self.name(), self.value())
9147 }
9148 }
9149
9150 impl std::convert::From<i32> for ReplicationRole {
9151 fn from(value: i32) -> Self {
9152 match value {
9153 0 => Self::Unspecified,
9154 1 => Self::Source,
9155 2 => Self::Destination,
9156 _ => Self::UnknownValue(replication_role::UnknownValue(
9157 wkt::internal::UnknownEnumValue::Integer(value),
9158 )),
9159 }
9160 }
9161 }
9162
9163 impl std::convert::From<&str> for ReplicationRole {
9164 fn from(value: &str) -> Self {
9165 use std::string::ToString;
9166 match value {
9167 "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
9168 "SOURCE" => Self::Source,
9169 "DESTINATION" => Self::Destination,
9170 _ => Self::UnknownValue(replication_role::UnknownValue(
9171 wkt::internal::UnknownEnumValue::String(value.to_string()),
9172 )),
9173 }
9174 }
9175 }
9176
9177 impl serde::ser::Serialize for ReplicationRole {
9178 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9179 where
9180 S: serde::Serializer,
9181 {
9182 match self {
9183 Self::Unspecified => serializer.serialize_i32(0),
9184 Self::Source => serializer.serialize_i32(1),
9185 Self::Destination => serializer.serialize_i32(2),
9186 Self::UnknownValue(u) => u.0.serialize(serializer),
9187 }
9188 }
9189 }
9190
9191 impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
9192 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9193 where
9194 D: serde::Deserializer<'de>,
9195 {
9196 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
9197 ".google.cloud.netapp.v1.Replication.ReplicationRole",
9198 ))
9199 }
9200 }
9201
9202 /// Schedule for Replication.
9203 /// New enum values may be added in future to support different frequency of
9204 /// replication.
9205 ///
9206 /// # Working with unknown values
9207 ///
9208 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9209 /// additional enum variants at any time. Adding new variants is not considered
9210 /// a breaking change. Applications should write their code in anticipation of:
9211 ///
9212 /// - New values appearing in future releases of the client library, **and**
9213 /// - New values received dynamically, without application changes.
9214 ///
9215 /// Please consult the [Working with enums] section in the user guide for some
9216 /// guidelines.
9217 ///
9218 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9219 #[derive(Clone, Debug, PartialEq)]
9220 #[non_exhaustive]
9221 pub enum ReplicationSchedule {
9222 /// Unspecified ReplicationSchedule
9223 Unspecified,
9224 /// Replication happens once every 10 minutes.
9225 Every10Minutes,
9226 /// Replication happens once every hour.
9227 Hourly,
9228 /// Replication happens once every day.
9229 Daily,
9230 /// If set, the enum was initialized with an unknown value.
9231 ///
9232 /// Applications can examine the value using [ReplicationSchedule::value] or
9233 /// [ReplicationSchedule::name].
9234 UnknownValue(replication_schedule::UnknownValue),
9235 }
9236
9237 #[doc(hidden)]
9238 pub mod replication_schedule {
9239 #[allow(unused_imports)]
9240 use super::*;
9241 #[derive(Clone, Debug, PartialEq)]
9242 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9243 }
9244
9245 impl ReplicationSchedule {
9246 /// Gets the enum value.
9247 ///
9248 /// Returns `None` if the enum contains an unknown value deserialized from
9249 /// the string representation of enums.
9250 pub fn value(&self) -> std::option::Option<i32> {
9251 match self {
9252 Self::Unspecified => std::option::Option::Some(0),
9253 Self::Every10Minutes => std::option::Option::Some(1),
9254 Self::Hourly => std::option::Option::Some(2),
9255 Self::Daily => std::option::Option::Some(3),
9256 Self::UnknownValue(u) => u.0.value(),
9257 }
9258 }
9259
9260 /// Gets the enum value as a string.
9261 ///
9262 /// Returns `None` if the enum contains an unknown value deserialized from
9263 /// the integer representation of enums.
9264 pub fn name(&self) -> std::option::Option<&str> {
9265 match self {
9266 Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
9267 Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
9268 Self::Hourly => std::option::Option::Some("HOURLY"),
9269 Self::Daily => std::option::Option::Some("DAILY"),
9270 Self::UnknownValue(u) => u.0.name(),
9271 }
9272 }
9273 }
9274
9275 impl std::default::Default for ReplicationSchedule {
9276 fn default() -> Self {
9277 use std::convert::From;
9278 Self::from(0)
9279 }
9280 }
9281
9282 impl std::fmt::Display for ReplicationSchedule {
9283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9284 wkt::internal::display_enum(f, self.name(), self.value())
9285 }
9286 }
9287
9288 impl std::convert::From<i32> for ReplicationSchedule {
9289 fn from(value: i32) -> Self {
9290 match value {
9291 0 => Self::Unspecified,
9292 1 => Self::Every10Minutes,
9293 2 => Self::Hourly,
9294 3 => Self::Daily,
9295 _ => Self::UnknownValue(replication_schedule::UnknownValue(
9296 wkt::internal::UnknownEnumValue::Integer(value),
9297 )),
9298 }
9299 }
9300 }
9301
9302 impl std::convert::From<&str> for ReplicationSchedule {
9303 fn from(value: &str) -> Self {
9304 use std::string::ToString;
9305 match value {
9306 "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
9307 "EVERY_10_MINUTES" => Self::Every10Minutes,
9308 "HOURLY" => Self::Hourly,
9309 "DAILY" => Self::Daily,
9310 _ => Self::UnknownValue(replication_schedule::UnknownValue(
9311 wkt::internal::UnknownEnumValue::String(value.to_string()),
9312 )),
9313 }
9314 }
9315 }
9316
9317 impl serde::ser::Serialize for ReplicationSchedule {
9318 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9319 where
9320 S: serde::Serializer,
9321 {
9322 match self {
9323 Self::Unspecified => serializer.serialize_i32(0),
9324 Self::Every10Minutes => serializer.serialize_i32(1),
9325 Self::Hourly => serializer.serialize_i32(2),
9326 Self::Daily => serializer.serialize_i32(3),
9327 Self::UnknownValue(u) => u.0.serialize(serializer),
9328 }
9329 }
9330 }
9331
9332 impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
9333 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9334 where
9335 D: serde::Deserializer<'de>,
9336 {
9337 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
9338 ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
9339 ))
9340 }
9341 }
9342
9343 /// Mirroring states.
9344 /// No new value is expected to be added in future.
9345 ///
9346 /// # Working with unknown values
9347 ///
9348 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9349 /// additional enum variants at any time. Adding new variants is not considered
9350 /// a breaking change. Applications should write their code in anticipation of:
9351 ///
9352 /// - New values appearing in future releases of the client library, **and**
9353 /// - New values received dynamically, without application changes.
9354 ///
9355 /// Please consult the [Working with enums] section in the user guide for some
9356 /// guidelines.
9357 ///
9358 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9359 #[derive(Clone, Debug, PartialEq)]
9360 #[non_exhaustive]
9361 pub enum MirrorState {
9362 /// Unspecified MirrorState
9363 Unspecified,
9364 /// Destination volume is being prepared.
9365 Preparing,
9366 /// Destination volume has been initialized and is ready to receive
9367 /// replication transfers.
9368 Mirrored,
9369 /// Destination volume is not receiving replication transfers.
9370 Stopped,
9371 /// Incremental replication is in progress.
9372 Transferring,
9373 /// Baseline replication is in progress.
9374 BaselineTransferring,
9375 /// Replication is aborted.
9376 Aborted,
9377 /// Replication is being managed from Onprem ONTAP.
9378 ExternallyManaged,
9379 /// Peering is yet to be established.
9380 PendingPeering,
9381 /// If set, the enum was initialized with an unknown value.
9382 ///
9383 /// Applications can examine the value using [MirrorState::value] or
9384 /// [MirrorState::name].
9385 UnknownValue(mirror_state::UnknownValue),
9386 }
9387
9388 #[doc(hidden)]
9389 pub mod mirror_state {
9390 #[allow(unused_imports)]
9391 use super::*;
9392 #[derive(Clone, Debug, PartialEq)]
9393 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9394 }
9395
9396 impl MirrorState {
9397 /// Gets the enum value.
9398 ///
9399 /// Returns `None` if the enum contains an unknown value deserialized from
9400 /// the string representation of enums.
9401 pub fn value(&self) -> std::option::Option<i32> {
9402 match self {
9403 Self::Unspecified => std::option::Option::Some(0),
9404 Self::Preparing => std::option::Option::Some(1),
9405 Self::Mirrored => std::option::Option::Some(2),
9406 Self::Stopped => std::option::Option::Some(3),
9407 Self::Transferring => std::option::Option::Some(4),
9408 Self::BaselineTransferring => std::option::Option::Some(5),
9409 Self::Aborted => std::option::Option::Some(6),
9410 Self::ExternallyManaged => std::option::Option::Some(7),
9411 Self::PendingPeering => std::option::Option::Some(8),
9412 Self::UnknownValue(u) => u.0.value(),
9413 }
9414 }
9415
9416 /// Gets the enum value as a string.
9417 ///
9418 /// Returns `None` if the enum contains an unknown value deserialized from
9419 /// the integer representation of enums.
9420 pub fn name(&self) -> std::option::Option<&str> {
9421 match self {
9422 Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
9423 Self::Preparing => std::option::Option::Some("PREPARING"),
9424 Self::Mirrored => std::option::Option::Some("MIRRORED"),
9425 Self::Stopped => std::option::Option::Some("STOPPED"),
9426 Self::Transferring => std::option::Option::Some("TRANSFERRING"),
9427 Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
9428 Self::Aborted => std::option::Option::Some("ABORTED"),
9429 Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
9430 Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
9431 Self::UnknownValue(u) => u.0.name(),
9432 }
9433 }
9434 }
9435
9436 impl std::default::Default for MirrorState {
9437 fn default() -> Self {
9438 use std::convert::From;
9439 Self::from(0)
9440 }
9441 }
9442
9443 impl std::fmt::Display for MirrorState {
9444 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9445 wkt::internal::display_enum(f, self.name(), self.value())
9446 }
9447 }
9448
9449 impl std::convert::From<i32> for MirrorState {
9450 fn from(value: i32) -> Self {
9451 match value {
9452 0 => Self::Unspecified,
9453 1 => Self::Preparing,
9454 2 => Self::Mirrored,
9455 3 => Self::Stopped,
9456 4 => Self::Transferring,
9457 5 => Self::BaselineTransferring,
9458 6 => Self::Aborted,
9459 7 => Self::ExternallyManaged,
9460 8 => Self::PendingPeering,
9461 _ => Self::UnknownValue(mirror_state::UnknownValue(
9462 wkt::internal::UnknownEnumValue::Integer(value),
9463 )),
9464 }
9465 }
9466 }
9467
9468 impl std::convert::From<&str> for MirrorState {
9469 fn from(value: &str) -> Self {
9470 use std::string::ToString;
9471 match value {
9472 "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
9473 "PREPARING" => Self::Preparing,
9474 "MIRRORED" => Self::Mirrored,
9475 "STOPPED" => Self::Stopped,
9476 "TRANSFERRING" => Self::Transferring,
9477 "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
9478 "ABORTED" => Self::Aborted,
9479 "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
9480 "PENDING_PEERING" => Self::PendingPeering,
9481 _ => Self::UnknownValue(mirror_state::UnknownValue(
9482 wkt::internal::UnknownEnumValue::String(value.to_string()),
9483 )),
9484 }
9485 }
9486 }
9487
9488 impl serde::ser::Serialize for MirrorState {
9489 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9490 where
9491 S: serde::Serializer,
9492 {
9493 match self {
9494 Self::Unspecified => serializer.serialize_i32(0),
9495 Self::Preparing => serializer.serialize_i32(1),
9496 Self::Mirrored => serializer.serialize_i32(2),
9497 Self::Stopped => serializer.serialize_i32(3),
9498 Self::Transferring => serializer.serialize_i32(4),
9499 Self::BaselineTransferring => serializer.serialize_i32(5),
9500 Self::Aborted => serializer.serialize_i32(6),
9501 Self::ExternallyManaged => serializer.serialize_i32(7),
9502 Self::PendingPeering => serializer.serialize_i32(8),
9503 Self::UnknownValue(u) => u.0.serialize(serializer),
9504 }
9505 }
9506 }
9507
9508 impl<'de> serde::de::Deserialize<'de> for MirrorState {
9509 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9510 where
9511 D: serde::Deserializer<'de>,
9512 {
9513 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
9514 ".google.cloud.netapp.v1.Replication.MirrorState",
9515 ))
9516 }
9517 }
9518
9519 /// Hybrid replication type.
9520 ///
9521 /// # Working with unknown values
9522 ///
9523 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9524 /// additional enum variants at any time. Adding new variants is not considered
9525 /// a breaking change. Applications should write their code in anticipation of:
9526 ///
9527 /// - New values appearing in future releases of the client library, **and**
9528 /// - New values received dynamically, without application changes.
9529 ///
9530 /// Please consult the [Working with enums] section in the user guide for some
9531 /// guidelines.
9532 ///
9533 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9534 #[derive(Clone, Debug, PartialEq)]
9535 #[non_exhaustive]
9536 pub enum HybridReplicationType {
9537 /// Unspecified hybrid replication type.
9538 Unspecified,
9539 /// Hybrid replication type for migration.
9540 Migration,
9541 /// Hybrid replication type for continuous replication.
9542 ContinuousReplication,
9543 /// New field for reversible OnPrem replication, to be used for data
9544 /// protection.
9545 OnpremReplication,
9546 /// Hybrid replication type for incremental Transfer in the reverse direction
9547 /// (GCNV is source and Onprem is destination)
9548 ReverseOnpremReplication,
9549 /// If set, the enum was initialized with an unknown value.
9550 ///
9551 /// Applications can examine the value using [HybridReplicationType::value] or
9552 /// [HybridReplicationType::name].
9553 UnknownValue(hybrid_replication_type::UnknownValue),
9554 }
9555
9556 #[doc(hidden)]
9557 pub mod hybrid_replication_type {
9558 #[allow(unused_imports)]
9559 use super::*;
9560 #[derive(Clone, Debug, PartialEq)]
9561 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9562 }
9563
9564 impl HybridReplicationType {
9565 /// Gets the enum value.
9566 ///
9567 /// Returns `None` if the enum contains an unknown value deserialized from
9568 /// the string representation of enums.
9569 pub fn value(&self) -> std::option::Option<i32> {
9570 match self {
9571 Self::Unspecified => std::option::Option::Some(0),
9572 Self::Migration => std::option::Option::Some(1),
9573 Self::ContinuousReplication => std::option::Option::Some(2),
9574 Self::OnpremReplication => std::option::Option::Some(3),
9575 Self::ReverseOnpremReplication => std::option::Option::Some(4),
9576 Self::UnknownValue(u) => u.0.value(),
9577 }
9578 }
9579
9580 /// Gets the enum value as a string.
9581 ///
9582 /// Returns `None` if the enum contains an unknown value deserialized from
9583 /// the integer representation of enums.
9584 pub fn name(&self) -> std::option::Option<&str> {
9585 match self {
9586 Self::Unspecified => {
9587 std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9588 }
9589 Self::Migration => std::option::Option::Some("MIGRATION"),
9590 Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9591 Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9592 Self::ReverseOnpremReplication => {
9593 std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9594 }
9595 Self::UnknownValue(u) => u.0.name(),
9596 }
9597 }
9598 }
9599
9600 impl std::default::Default for HybridReplicationType {
9601 fn default() -> Self {
9602 use std::convert::From;
9603 Self::from(0)
9604 }
9605 }
9606
9607 impl std::fmt::Display for HybridReplicationType {
9608 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9609 wkt::internal::display_enum(f, self.name(), self.value())
9610 }
9611 }
9612
9613 impl std::convert::From<i32> for HybridReplicationType {
9614 fn from(value: i32) -> Self {
9615 match value {
9616 0 => Self::Unspecified,
9617 1 => Self::Migration,
9618 2 => Self::ContinuousReplication,
9619 3 => Self::OnpremReplication,
9620 4 => Self::ReverseOnpremReplication,
9621 _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9622 wkt::internal::UnknownEnumValue::Integer(value),
9623 )),
9624 }
9625 }
9626 }
9627
9628 impl std::convert::From<&str> for HybridReplicationType {
9629 fn from(value: &str) -> Self {
9630 use std::string::ToString;
9631 match value {
9632 "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9633 "MIGRATION" => Self::Migration,
9634 "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9635 "ONPREM_REPLICATION" => Self::OnpremReplication,
9636 "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9637 _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9638 wkt::internal::UnknownEnumValue::String(value.to_string()),
9639 )),
9640 }
9641 }
9642 }
9643
9644 impl serde::ser::Serialize for HybridReplicationType {
9645 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9646 where
9647 S: serde::Serializer,
9648 {
9649 match self {
9650 Self::Unspecified => serializer.serialize_i32(0),
9651 Self::Migration => serializer.serialize_i32(1),
9652 Self::ContinuousReplication => serializer.serialize_i32(2),
9653 Self::OnpremReplication => serializer.serialize_i32(3),
9654 Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9655 Self::UnknownValue(u) => u.0.serialize(serializer),
9656 }
9657 }
9658 }
9659
9660 impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9661 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9662 where
9663 D: serde::Deserializer<'de>,
9664 {
9665 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9666 ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9667 ))
9668 }
9669 }
9670}
9671
9672/// HybridPeeringDetails contains details about the hybrid peering.
9673#[derive(Clone, Default, PartialEq)]
9674#[non_exhaustive]
9675pub struct HybridPeeringDetails {
9676 /// Output only. IP address of the subnet.
9677 pub subnet_ip: std::string::String,
9678
9679 /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9680 /// peering requests.
9681 pub command: std::string::String,
9682
9683 /// Output only. Expiration time for the peering command to be executed on
9684 /// user's ONTAP.
9685 pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9686
9687 /// Output only. Temporary passphrase generated to accept cluster peering
9688 /// command.
9689 pub passphrase: std::string::String,
9690
9691 /// Output only. Name of the user's local source volume to be peered with the
9692 /// destination volume.
9693 pub peer_volume_name: std::string::String,
9694
9695 /// Output only. Name of the user's local source cluster to be peered with the
9696 /// destination cluster.
9697 pub peer_cluster_name: std::string::String,
9698
9699 /// Output only. Name of the user's local source vserver svm to be peered with
9700 /// the destination vserver svm.
9701 pub peer_svm_name: std::string::String,
9702
9703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9704}
9705
9706impl HybridPeeringDetails {
9707 /// Creates a new default instance.
9708 pub fn new() -> Self {
9709 std::default::Default::default()
9710 }
9711
9712 /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9713 ///
9714 /// # Example
9715 /// ```ignore,no_run
9716 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9717 /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9718 /// ```
9719 pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9720 self.subnet_ip = v.into();
9721 self
9722 }
9723
9724 /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9725 ///
9726 /// # Example
9727 /// ```ignore,no_run
9728 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9729 /// let x = HybridPeeringDetails::new().set_command("example");
9730 /// ```
9731 pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9732 self.command = v.into();
9733 self
9734 }
9735
9736 /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9737 ///
9738 /// # Example
9739 /// ```ignore,no_run
9740 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9741 /// use wkt::Timestamp;
9742 /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9743 /// ```
9744 pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9745 where
9746 T: std::convert::Into<wkt::Timestamp>,
9747 {
9748 self.command_expiry_time = std::option::Option::Some(v.into());
9749 self
9750 }
9751
9752 /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9753 ///
9754 /// # Example
9755 /// ```ignore,no_run
9756 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9757 /// use wkt::Timestamp;
9758 /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9759 /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9760 /// ```
9761 pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9762 where
9763 T: std::convert::Into<wkt::Timestamp>,
9764 {
9765 self.command_expiry_time = v.map(|x| x.into());
9766 self
9767 }
9768
9769 /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9770 ///
9771 /// # Example
9772 /// ```ignore,no_run
9773 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9774 /// let x = HybridPeeringDetails::new().set_passphrase("example");
9775 /// ```
9776 pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9777 self.passphrase = v.into();
9778 self
9779 }
9780
9781 /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9782 ///
9783 /// # Example
9784 /// ```ignore,no_run
9785 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9786 /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9787 /// ```
9788 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9789 mut self,
9790 v: T,
9791 ) -> Self {
9792 self.peer_volume_name = v.into();
9793 self
9794 }
9795
9796 /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9797 ///
9798 /// # Example
9799 /// ```ignore,no_run
9800 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9801 /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9802 /// ```
9803 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9804 mut self,
9805 v: T,
9806 ) -> Self {
9807 self.peer_cluster_name = v.into();
9808 self
9809 }
9810
9811 /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9812 ///
9813 /// # Example
9814 /// ```ignore,no_run
9815 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9816 /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9817 /// ```
9818 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9819 self.peer_svm_name = v.into();
9820 self
9821 }
9822}
9823
9824impl wkt::message::Message for HybridPeeringDetails {
9825 fn typename() -> &'static str {
9826 "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9827 }
9828}
9829
9830/// ListReplications lists replications.
9831#[derive(Clone, Default, PartialEq)]
9832#[non_exhaustive]
9833pub struct ListReplicationsRequest {
9834 /// Required. The volume for which to retrieve replication information,
9835 /// in the format
9836 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9837 pub parent: std::string::String,
9838
9839 /// The maximum number of items to return.
9840 pub page_size: i32,
9841
9842 /// The next_page_token value to use if there are additional
9843 /// results to retrieve for this list request.
9844 pub page_token: std::string::String,
9845
9846 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9847 pub order_by: std::string::String,
9848
9849 /// List filter.
9850 pub filter: std::string::String,
9851
9852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9853}
9854
9855impl ListReplicationsRequest {
9856 /// Creates a new default instance.
9857 pub fn new() -> Self {
9858 std::default::Default::default()
9859 }
9860
9861 /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9862 ///
9863 /// # Example
9864 /// ```ignore,no_run
9865 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9866 /// let x = ListReplicationsRequest::new().set_parent("example");
9867 /// ```
9868 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9869 self.parent = v.into();
9870 self
9871 }
9872
9873 /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
9874 ///
9875 /// # Example
9876 /// ```ignore,no_run
9877 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9878 /// let x = ListReplicationsRequest::new().set_page_size(42);
9879 /// ```
9880 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9881 self.page_size = v.into();
9882 self
9883 }
9884
9885 /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
9886 ///
9887 /// # Example
9888 /// ```ignore,no_run
9889 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9890 /// let x = ListReplicationsRequest::new().set_page_token("example");
9891 /// ```
9892 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9893 self.page_token = v.into();
9894 self
9895 }
9896
9897 /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
9898 ///
9899 /// # Example
9900 /// ```ignore,no_run
9901 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9902 /// let x = ListReplicationsRequest::new().set_order_by("example");
9903 /// ```
9904 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9905 self.order_by = v.into();
9906 self
9907 }
9908
9909 /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
9910 ///
9911 /// # Example
9912 /// ```ignore,no_run
9913 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9914 /// let x = ListReplicationsRequest::new().set_filter("example");
9915 /// ```
9916 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9917 self.filter = v.into();
9918 self
9919 }
9920}
9921
9922impl wkt::message::Message for ListReplicationsRequest {
9923 fn typename() -> &'static str {
9924 "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
9925 }
9926}
9927
9928/// ListReplicationsResponse is the result of ListReplicationsRequest.
9929#[derive(Clone, Default, PartialEq)]
9930#[non_exhaustive]
9931pub struct ListReplicationsResponse {
9932 /// A list of replications in the project for the specified volume.
9933 pub replications: std::vec::Vec<crate::model::Replication>,
9934
9935 /// The token you can use to retrieve the next page of results. Not returned
9936 /// if there are no more results in the list.
9937 pub next_page_token: std::string::String,
9938
9939 /// Locations that could not be reached.
9940 pub unreachable: std::vec::Vec<std::string::String>,
9941
9942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9943}
9944
9945impl ListReplicationsResponse {
9946 /// Creates a new default instance.
9947 pub fn new() -> Self {
9948 std::default::Default::default()
9949 }
9950
9951 /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
9952 ///
9953 /// # Example
9954 /// ```ignore,no_run
9955 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9956 /// use google_cloud_netapp_v1::model::Replication;
9957 /// let x = ListReplicationsResponse::new()
9958 /// .set_replications([
9959 /// Replication::default()/* use setters */,
9960 /// Replication::default()/* use (different) setters */,
9961 /// ]);
9962 /// ```
9963 pub fn set_replications<T, V>(mut self, v: T) -> Self
9964 where
9965 T: std::iter::IntoIterator<Item = V>,
9966 V: std::convert::Into<crate::model::Replication>,
9967 {
9968 use std::iter::Iterator;
9969 self.replications = v.into_iter().map(|i| i.into()).collect();
9970 self
9971 }
9972
9973 /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
9974 ///
9975 /// # Example
9976 /// ```ignore,no_run
9977 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9978 /// let x = ListReplicationsResponse::new().set_next_page_token("example");
9979 /// ```
9980 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9981 self.next_page_token = v.into();
9982 self
9983 }
9984
9985 /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
9986 ///
9987 /// # Example
9988 /// ```ignore,no_run
9989 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9990 /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
9991 /// ```
9992 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9993 where
9994 T: std::iter::IntoIterator<Item = V>,
9995 V: std::convert::Into<std::string::String>,
9996 {
9997 use std::iter::Iterator;
9998 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9999 self
10000 }
10001}
10002
10003impl wkt::message::Message for ListReplicationsResponse {
10004 fn typename() -> &'static str {
10005 "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
10006 }
10007}
10008
10009#[doc(hidden)]
10010impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
10011 type PageItem = crate::model::Replication;
10012
10013 fn items(self) -> std::vec::Vec<Self::PageItem> {
10014 self.replications
10015 }
10016
10017 fn next_page_token(&self) -> std::string::String {
10018 use std::clone::Clone;
10019 self.next_page_token.clone()
10020 }
10021}
10022
10023/// GetReplicationRequest gets the state of a replication.
10024#[derive(Clone, Default, PartialEq)]
10025#[non_exhaustive]
10026pub struct GetReplicationRequest {
10027 /// Required. The replication resource name, in the format
10028 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
10029 pub name: std::string::String,
10030
10031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10032}
10033
10034impl GetReplicationRequest {
10035 /// Creates a new default instance.
10036 pub fn new() -> Self {
10037 std::default::Default::default()
10038 }
10039
10040 /// Sets the value of [name][crate::model::GetReplicationRequest::name].
10041 ///
10042 /// # Example
10043 /// ```ignore,no_run
10044 /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
10045 /// let x = GetReplicationRequest::new().set_name("example");
10046 /// ```
10047 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10048 self.name = v.into();
10049 self
10050 }
10051}
10052
10053impl wkt::message::Message for GetReplicationRequest {
10054 fn typename() -> &'static str {
10055 "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
10056 }
10057}
10058
10059/// DestinationVolumeParameters specify input parameters used for creating
10060/// destination volume.
10061#[derive(Clone, Default, PartialEq)]
10062#[non_exhaustive]
10063pub struct DestinationVolumeParameters {
10064 /// Required. Existing destination StoragePool name.
10065 pub storage_pool: std::string::String,
10066
10067 /// Desired destination volume resource id. If not specified, source volume's
10068 /// resource id will be used.
10069 /// This value must start with a lowercase letter followed by up to 62
10070 /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
10071 pub volume_id: std::string::String,
10072
10073 /// Destination volume's share name. If not specified, source volume's share
10074 /// name will be used.
10075 pub share_name: std::string::String,
10076
10077 /// Description for the destination volume.
10078 pub description: std::option::Option<std::string::String>,
10079
10080 /// Optional. Tiering policy for the volume.
10081 pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
10082
10083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10084}
10085
10086impl DestinationVolumeParameters {
10087 /// Creates a new default instance.
10088 pub fn new() -> Self {
10089 std::default::Default::default()
10090 }
10091
10092 /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
10093 ///
10094 /// # Example
10095 /// ```ignore,no_run
10096 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10097 /// let x = DestinationVolumeParameters::new().set_storage_pool("example");
10098 /// ```
10099 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10100 self.storage_pool = v.into();
10101 self
10102 }
10103
10104 /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
10105 ///
10106 /// # Example
10107 /// ```ignore,no_run
10108 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10109 /// let x = DestinationVolumeParameters::new().set_volume_id("example");
10110 /// ```
10111 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10112 self.volume_id = v.into();
10113 self
10114 }
10115
10116 /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
10117 ///
10118 /// # Example
10119 /// ```ignore,no_run
10120 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10121 /// let x = DestinationVolumeParameters::new().set_share_name("example");
10122 /// ```
10123 pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10124 self.share_name = v.into();
10125 self
10126 }
10127
10128 /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
10129 ///
10130 /// # Example
10131 /// ```ignore,no_run
10132 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10133 /// let x = DestinationVolumeParameters::new().set_description("example");
10134 /// ```
10135 pub fn set_description<T>(mut self, v: T) -> Self
10136 where
10137 T: std::convert::Into<std::string::String>,
10138 {
10139 self.description = std::option::Option::Some(v.into());
10140 self
10141 }
10142
10143 /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
10144 ///
10145 /// # Example
10146 /// ```ignore,no_run
10147 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10148 /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
10149 /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
10150 /// ```
10151 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
10152 where
10153 T: std::convert::Into<std::string::String>,
10154 {
10155 self.description = v.map(|x| x.into());
10156 self
10157 }
10158
10159 /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10160 ///
10161 /// # Example
10162 /// ```ignore,no_run
10163 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10164 /// use google_cloud_netapp_v1::model::TieringPolicy;
10165 /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
10166 /// ```
10167 pub fn set_tiering_policy<T>(mut self, v: T) -> Self
10168 where
10169 T: std::convert::Into<crate::model::TieringPolicy>,
10170 {
10171 self.tiering_policy = std::option::Option::Some(v.into());
10172 self
10173 }
10174
10175 /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10176 ///
10177 /// # Example
10178 /// ```ignore,no_run
10179 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10180 /// use google_cloud_netapp_v1::model::TieringPolicy;
10181 /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
10182 /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
10183 /// ```
10184 pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
10185 where
10186 T: std::convert::Into<crate::model::TieringPolicy>,
10187 {
10188 self.tiering_policy = v.map(|x| x.into());
10189 self
10190 }
10191}
10192
10193impl wkt::message::Message for DestinationVolumeParameters {
10194 fn typename() -> &'static str {
10195 "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
10196 }
10197}
10198
10199/// CreateReplicationRequest creates a replication.
10200#[derive(Clone, Default, PartialEq)]
10201#[non_exhaustive]
10202pub struct CreateReplicationRequest {
10203 /// Required. The NetApp volume to create the replications of, in the format
10204 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10205 pub parent: std::string::String,
10206
10207 /// Required. A replication resource
10208 pub replication: std::option::Option<crate::model::Replication>,
10209
10210 /// Required. ID of the replication to create. Must be unique within the parent
10211 /// resource. Must contain only letters, numbers and hyphen, with the first
10212 /// character a letter, the last a letter or a
10213 /// number, and a 63 character maximum.
10214 pub replication_id: std::string::String,
10215
10216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10217}
10218
10219impl CreateReplicationRequest {
10220 /// Creates a new default instance.
10221 pub fn new() -> Self {
10222 std::default::Default::default()
10223 }
10224
10225 /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
10226 ///
10227 /// # Example
10228 /// ```ignore,no_run
10229 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10230 /// let x = CreateReplicationRequest::new().set_parent("example");
10231 /// ```
10232 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10233 self.parent = v.into();
10234 self
10235 }
10236
10237 /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
10238 ///
10239 /// # Example
10240 /// ```ignore,no_run
10241 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10242 /// use google_cloud_netapp_v1::model::Replication;
10243 /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10244 /// ```
10245 pub fn set_replication<T>(mut self, v: T) -> Self
10246 where
10247 T: std::convert::Into<crate::model::Replication>,
10248 {
10249 self.replication = std::option::Option::Some(v.into());
10250 self
10251 }
10252
10253 /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
10254 ///
10255 /// # Example
10256 /// ```ignore,no_run
10257 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10258 /// use google_cloud_netapp_v1::model::Replication;
10259 /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10260 /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10261 /// ```
10262 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10263 where
10264 T: std::convert::Into<crate::model::Replication>,
10265 {
10266 self.replication = v.map(|x| x.into());
10267 self
10268 }
10269
10270 /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
10271 ///
10272 /// # Example
10273 /// ```ignore,no_run
10274 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10275 /// let x = CreateReplicationRequest::new().set_replication_id("example");
10276 /// ```
10277 pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10278 self.replication_id = v.into();
10279 self
10280 }
10281}
10282
10283impl wkt::message::Message for CreateReplicationRequest {
10284 fn typename() -> &'static str {
10285 "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
10286 }
10287}
10288
10289/// DeleteReplicationRequest deletes a replication.
10290#[derive(Clone, Default, PartialEq)]
10291#[non_exhaustive]
10292pub struct DeleteReplicationRequest {
10293 /// Required. The replication resource name, in the format
10294 /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
10295 pub name: std::string::String,
10296
10297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10298}
10299
10300impl DeleteReplicationRequest {
10301 /// Creates a new default instance.
10302 pub fn new() -> Self {
10303 std::default::Default::default()
10304 }
10305
10306 /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
10307 ///
10308 /// # Example
10309 /// ```ignore,no_run
10310 /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
10311 /// let x = DeleteReplicationRequest::new().set_name("example");
10312 /// ```
10313 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10314 self.name = v.into();
10315 self
10316 }
10317}
10318
10319impl wkt::message::Message for DeleteReplicationRequest {
10320 fn typename() -> &'static str {
10321 "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
10322 }
10323}
10324
10325/// UpdateReplicationRequest updates description and/or labels for a replication.
10326#[derive(Clone, Default, PartialEq)]
10327#[non_exhaustive]
10328pub struct UpdateReplicationRequest {
10329 /// Required. Mask of fields to update. At least one path must be supplied in
10330 /// this field.
10331 pub update_mask: std::option::Option<wkt::FieldMask>,
10332
10333 /// Required. A replication resource
10334 pub replication: std::option::Option<crate::model::Replication>,
10335
10336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10337}
10338
10339impl UpdateReplicationRequest {
10340 /// Creates a new default instance.
10341 pub fn new() -> Self {
10342 std::default::Default::default()
10343 }
10344
10345 /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10346 ///
10347 /// # Example
10348 /// ```ignore,no_run
10349 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10350 /// use wkt::FieldMask;
10351 /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10352 /// ```
10353 pub fn set_update_mask<T>(mut self, v: T) -> Self
10354 where
10355 T: std::convert::Into<wkt::FieldMask>,
10356 {
10357 self.update_mask = std::option::Option::Some(v.into());
10358 self
10359 }
10360
10361 /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10362 ///
10363 /// # Example
10364 /// ```ignore,no_run
10365 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10366 /// use wkt::FieldMask;
10367 /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10368 /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10369 /// ```
10370 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10371 where
10372 T: std::convert::Into<wkt::FieldMask>,
10373 {
10374 self.update_mask = v.map(|x| x.into());
10375 self
10376 }
10377
10378 /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
10379 ///
10380 /// # Example
10381 /// ```ignore,no_run
10382 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10383 /// use google_cloud_netapp_v1::model::Replication;
10384 /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10385 /// ```
10386 pub fn set_replication<T>(mut self, v: T) -> Self
10387 where
10388 T: std::convert::Into<crate::model::Replication>,
10389 {
10390 self.replication = std::option::Option::Some(v.into());
10391 self
10392 }
10393
10394 /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
10395 ///
10396 /// # Example
10397 /// ```ignore,no_run
10398 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10399 /// use google_cloud_netapp_v1::model::Replication;
10400 /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10401 /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10402 /// ```
10403 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10404 where
10405 T: std::convert::Into<crate::model::Replication>,
10406 {
10407 self.replication = v.map(|x| x.into());
10408 self
10409 }
10410}
10411
10412impl wkt::message::Message for UpdateReplicationRequest {
10413 fn typename() -> &'static str {
10414 "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
10415 }
10416}
10417
10418/// StopReplicationRequest stops a replication until resumed.
10419#[derive(Clone, Default, PartialEq)]
10420#[non_exhaustive]
10421pub struct StopReplicationRequest {
10422 /// Required. The resource name of the replication, in the format of
10423 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10424 pub name: std::string::String,
10425
10426 /// Indicates whether to stop replication forcefully while data transfer is in
10427 /// progress.
10428 /// Warning! if force is true, this will abort any current transfers
10429 /// and can lead to data loss due to partial transfer.
10430 /// If force is false, stop replication will fail while data transfer is in
10431 /// progress and you will need to retry later.
10432 pub force: bool,
10433
10434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10435}
10436
10437impl StopReplicationRequest {
10438 /// Creates a new default instance.
10439 pub fn new() -> Self {
10440 std::default::Default::default()
10441 }
10442
10443 /// Sets the value of [name][crate::model::StopReplicationRequest::name].
10444 ///
10445 /// # Example
10446 /// ```ignore,no_run
10447 /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10448 /// let x = StopReplicationRequest::new().set_name("example");
10449 /// ```
10450 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10451 self.name = v.into();
10452 self
10453 }
10454
10455 /// Sets the value of [force][crate::model::StopReplicationRequest::force].
10456 ///
10457 /// # Example
10458 /// ```ignore,no_run
10459 /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10460 /// let x = StopReplicationRequest::new().set_force(true);
10461 /// ```
10462 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10463 self.force = v.into();
10464 self
10465 }
10466}
10467
10468impl wkt::message::Message for StopReplicationRequest {
10469 fn typename() -> &'static str {
10470 "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
10471 }
10472}
10473
10474/// ResumeReplicationRequest resumes a stopped replication.
10475#[derive(Clone, Default, PartialEq)]
10476#[non_exhaustive]
10477pub struct ResumeReplicationRequest {
10478 /// Required. The resource name of the replication, in the format of
10479 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10480 pub name: std::string::String,
10481
10482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10483}
10484
10485impl ResumeReplicationRequest {
10486 /// Creates a new default instance.
10487 pub fn new() -> Self {
10488 std::default::Default::default()
10489 }
10490
10491 /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
10492 ///
10493 /// # Example
10494 /// ```ignore,no_run
10495 /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
10496 /// let x = ResumeReplicationRequest::new().set_name("example");
10497 /// ```
10498 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10499 self.name = v.into();
10500 self
10501 }
10502}
10503
10504impl wkt::message::Message for ResumeReplicationRequest {
10505 fn typename() -> &'static str {
10506 "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
10507 }
10508}
10509
10510/// ReverseReplicationDirectionRequest reverses direction of replication. Source
10511/// becomes destination and destination becomes source.
10512#[derive(Clone, Default, PartialEq)]
10513#[non_exhaustive]
10514pub struct ReverseReplicationDirectionRequest {
10515 /// Required. The resource name of the replication, in the format of
10516 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10517 pub name: std::string::String,
10518
10519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10520}
10521
10522impl ReverseReplicationDirectionRequest {
10523 /// Creates a new default instance.
10524 pub fn new() -> Self {
10525 std::default::Default::default()
10526 }
10527
10528 /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
10529 ///
10530 /// # Example
10531 /// ```ignore,no_run
10532 /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
10533 /// let x = ReverseReplicationDirectionRequest::new().set_name("example");
10534 /// ```
10535 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10536 self.name = v.into();
10537 self
10538 }
10539}
10540
10541impl wkt::message::Message for ReverseReplicationDirectionRequest {
10542 fn typename() -> &'static str {
10543 "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
10544 }
10545}
10546
10547/// EstablishPeeringRequest establishes cluster and svm peerings between the
10548/// source and the destination replications.
10549#[derive(Clone, Default, PartialEq)]
10550#[non_exhaustive]
10551pub struct EstablishPeeringRequest {
10552 /// Required. The resource name of the replication, in the format of
10553 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10554 pub name: std::string::String,
10555
10556 /// Required. Name of the user's local source cluster to be peered with the
10557 /// destination cluster.
10558 pub peer_cluster_name: std::string::String,
10559
10560 /// Required. Name of the user's local source vserver svm to be peered with the
10561 /// destination vserver svm.
10562 pub peer_svm_name: std::string::String,
10563
10564 /// Optional. List of IPv4 ip addresses to be used for peering.
10565 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10566
10567 /// Required. Name of the user's local source volume to be peered with the
10568 /// destination volume.
10569 pub peer_volume_name: std::string::String,
10570
10571 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10572}
10573
10574impl EstablishPeeringRequest {
10575 /// Creates a new default instance.
10576 pub fn new() -> Self {
10577 std::default::Default::default()
10578 }
10579
10580 /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10581 ///
10582 /// # Example
10583 /// ```ignore,no_run
10584 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10585 /// let x = EstablishPeeringRequest::new().set_name("example");
10586 /// ```
10587 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10588 self.name = v.into();
10589 self
10590 }
10591
10592 /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10593 ///
10594 /// # Example
10595 /// ```ignore,no_run
10596 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10597 /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10598 /// ```
10599 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10600 mut self,
10601 v: T,
10602 ) -> Self {
10603 self.peer_cluster_name = v.into();
10604 self
10605 }
10606
10607 /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10608 ///
10609 /// # Example
10610 /// ```ignore,no_run
10611 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10612 /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10613 /// ```
10614 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10615 self.peer_svm_name = v.into();
10616 self
10617 }
10618
10619 /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10620 ///
10621 /// # Example
10622 /// ```ignore,no_run
10623 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10624 /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10625 /// ```
10626 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10627 where
10628 T: std::iter::IntoIterator<Item = V>,
10629 V: std::convert::Into<std::string::String>,
10630 {
10631 use std::iter::Iterator;
10632 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10633 self
10634 }
10635
10636 /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10637 ///
10638 /// # Example
10639 /// ```ignore,no_run
10640 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10641 /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10642 /// ```
10643 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10644 mut self,
10645 v: T,
10646 ) -> Self {
10647 self.peer_volume_name = v.into();
10648 self
10649 }
10650}
10651
10652impl wkt::message::Message for EstablishPeeringRequest {
10653 fn typename() -> &'static str {
10654 "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10655 }
10656}
10657
10658/// SyncReplicationRequest syncs the replication from source to destination.
10659#[derive(Clone, Default, PartialEq)]
10660#[non_exhaustive]
10661pub struct SyncReplicationRequest {
10662 /// Required. The resource name of the replication, in the format of
10663 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10664 pub name: std::string::String,
10665
10666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10667}
10668
10669impl SyncReplicationRequest {
10670 /// Creates a new default instance.
10671 pub fn new() -> Self {
10672 std::default::Default::default()
10673 }
10674
10675 /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10676 ///
10677 /// # Example
10678 /// ```ignore,no_run
10679 /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10680 /// let x = SyncReplicationRequest::new().set_name("example");
10681 /// ```
10682 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10683 self.name = v.into();
10684 self
10685 }
10686}
10687
10688impl wkt::message::Message for SyncReplicationRequest {
10689 fn typename() -> &'static str {
10690 "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10691 }
10692}
10693
10694/// ListSnapshotsRequest lists snapshots.
10695#[derive(Clone, Default, PartialEq)]
10696#[non_exhaustive]
10697pub struct ListSnapshotsRequest {
10698 /// Required. The volume for which to retrieve snapshot information,
10699 /// in the format
10700 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10701 pub parent: std::string::String,
10702
10703 /// The maximum number of items to return.
10704 pub page_size: i32,
10705
10706 /// The next_page_token value to use if there are additional
10707 /// results to retrieve for this list request.
10708 pub page_token: std::string::String,
10709
10710 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10711 pub order_by: std::string::String,
10712
10713 /// List filter.
10714 pub filter: std::string::String,
10715
10716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10717}
10718
10719impl ListSnapshotsRequest {
10720 /// Creates a new default instance.
10721 pub fn new() -> Self {
10722 std::default::Default::default()
10723 }
10724
10725 /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10726 ///
10727 /// # Example
10728 /// ```ignore,no_run
10729 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10730 /// let x = ListSnapshotsRequest::new().set_parent("example");
10731 /// ```
10732 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10733 self.parent = v.into();
10734 self
10735 }
10736
10737 /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10738 ///
10739 /// # Example
10740 /// ```ignore,no_run
10741 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10742 /// let x = ListSnapshotsRequest::new().set_page_size(42);
10743 /// ```
10744 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10745 self.page_size = v.into();
10746 self
10747 }
10748
10749 /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10750 ///
10751 /// # Example
10752 /// ```ignore,no_run
10753 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10754 /// let x = ListSnapshotsRequest::new().set_page_token("example");
10755 /// ```
10756 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10757 self.page_token = v.into();
10758 self
10759 }
10760
10761 /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10762 ///
10763 /// # Example
10764 /// ```ignore,no_run
10765 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10766 /// let x = ListSnapshotsRequest::new().set_order_by("example");
10767 /// ```
10768 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10769 self.order_by = v.into();
10770 self
10771 }
10772
10773 /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10774 ///
10775 /// # Example
10776 /// ```ignore,no_run
10777 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10778 /// let x = ListSnapshotsRequest::new().set_filter("example");
10779 /// ```
10780 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10781 self.filter = v.into();
10782 self
10783 }
10784}
10785
10786impl wkt::message::Message for ListSnapshotsRequest {
10787 fn typename() -> &'static str {
10788 "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10789 }
10790}
10791
10792/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10793#[derive(Clone, Default, PartialEq)]
10794#[non_exhaustive]
10795pub struct ListSnapshotsResponse {
10796 /// A list of snapshots in the project for the specified volume.
10797 pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10798
10799 /// The token you can use to retrieve the next page of results. Not returned
10800 /// if there are no more results in the list.
10801 pub next_page_token: std::string::String,
10802
10803 /// Locations that could not be reached.
10804 pub unreachable: std::vec::Vec<std::string::String>,
10805
10806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10807}
10808
10809impl ListSnapshotsResponse {
10810 /// Creates a new default instance.
10811 pub fn new() -> Self {
10812 std::default::Default::default()
10813 }
10814
10815 /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10816 ///
10817 /// # Example
10818 /// ```ignore,no_run
10819 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10820 /// use google_cloud_netapp_v1::model::Snapshot;
10821 /// let x = ListSnapshotsResponse::new()
10822 /// .set_snapshots([
10823 /// Snapshot::default()/* use setters */,
10824 /// Snapshot::default()/* use (different) setters */,
10825 /// ]);
10826 /// ```
10827 pub fn set_snapshots<T, V>(mut self, v: T) -> Self
10828 where
10829 T: std::iter::IntoIterator<Item = V>,
10830 V: std::convert::Into<crate::model::Snapshot>,
10831 {
10832 use std::iter::Iterator;
10833 self.snapshots = v.into_iter().map(|i| i.into()).collect();
10834 self
10835 }
10836
10837 /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
10838 ///
10839 /// # Example
10840 /// ```ignore,no_run
10841 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10842 /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
10843 /// ```
10844 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10845 self.next_page_token = v.into();
10846 self
10847 }
10848
10849 /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
10850 ///
10851 /// # Example
10852 /// ```ignore,no_run
10853 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10854 /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
10855 /// ```
10856 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10857 where
10858 T: std::iter::IntoIterator<Item = V>,
10859 V: std::convert::Into<std::string::String>,
10860 {
10861 use std::iter::Iterator;
10862 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10863 self
10864 }
10865}
10866
10867impl wkt::message::Message for ListSnapshotsResponse {
10868 fn typename() -> &'static str {
10869 "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
10870 }
10871}
10872
10873#[doc(hidden)]
10874impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
10875 type PageItem = crate::model::Snapshot;
10876
10877 fn items(self) -> std::vec::Vec<Self::PageItem> {
10878 self.snapshots
10879 }
10880
10881 fn next_page_token(&self) -> std::string::String {
10882 use std::clone::Clone;
10883 self.next_page_token.clone()
10884 }
10885}
10886
10887/// GetSnapshotRequest gets the state of a snapshot.
10888#[derive(Clone, Default, PartialEq)]
10889#[non_exhaustive]
10890pub struct GetSnapshotRequest {
10891 /// Required. The snapshot resource name, in the format
10892 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
10893 pub name: std::string::String,
10894
10895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10896}
10897
10898impl GetSnapshotRequest {
10899 /// Creates a new default instance.
10900 pub fn new() -> Self {
10901 std::default::Default::default()
10902 }
10903
10904 /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
10905 ///
10906 /// # Example
10907 /// ```ignore,no_run
10908 /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
10909 /// let x = GetSnapshotRequest::new().set_name("example");
10910 /// ```
10911 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10912 self.name = v.into();
10913 self
10914 }
10915}
10916
10917impl wkt::message::Message for GetSnapshotRequest {
10918 fn typename() -> &'static str {
10919 "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
10920 }
10921}
10922
10923/// CreateSnapshotRequest creates a snapshot.
10924#[derive(Clone, Default, PartialEq)]
10925#[non_exhaustive]
10926pub struct CreateSnapshotRequest {
10927 /// Required. The NetApp volume to create the snapshots of, in the format
10928 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10929 pub parent: std::string::String,
10930
10931 /// Required. A snapshot resource
10932 pub snapshot: std::option::Option<crate::model::Snapshot>,
10933
10934 /// Required. ID of the snapshot to create. Must be unique within the parent
10935 /// resource. Must contain only letters, numbers and hyphen, with the first
10936 /// character a letter, the last a letter or a
10937 /// number, and a 63 character maximum.
10938 pub snapshot_id: std::string::String,
10939
10940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10941}
10942
10943impl CreateSnapshotRequest {
10944 /// Creates a new default instance.
10945 pub fn new() -> Self {
10946 std::default::Default::default()
10947 }
10948
10949 /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
10950 ///
10951 /// # Example
10952 /// ```ignore,no_run
10953 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10954 /// let x = CreateSnapshotRequest::new().set_parent("example");
10955 /// ```
10956 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10957 self.parent = v.into();
10958 self
10959 }
10960
10961 /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10962 ///
10963 /// # Example
10964 /// ```ignore,no_run
10965 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10966 /// use google_cloud_netapp_v1::model::Snapshot;
10967 /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10968 /// ```
10969 pub fn set_snapshot<T>(mut self, v: T) -> Self
10970 where
10971 T: std::convert::Into<crate::model::Snapshot>,
10972 {
10973 self.snapshot = std::option::Option::Some(v.into());
10974 self
10975 }
10976
10977 /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10978 ///
10979 /// # Example
10980 /// ```ignore,no_run
10981 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10982 /// use google_cloud_netapp_v1::model::Snapshot;
10983 /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10984 /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10985 /// ```
10986 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10987 where
10988 T: std::convert::Into<crate::model::Snapshot>,
10989 {
10990 self.snapshot = v.map(|x| x.into());
10991 self
10992 }
10993
10994 /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
10995 ///
10996 /// # Example
10997 /// ```ignore,no_run
10998 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10999 /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
11000 /// ```
11001 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11002 self.snapshot_id = v.into();
11003 self
11004 }
11005}
11006
11007impl wkt::message::Message for CreateSnapshotRequest {
11008 fn typename() -> &'static str {
11009 "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
11010 }
11011}
11012
11013/// DeleteSnapshotRequest deletes a snapshot.
11014#[derive(Clone, Default, PartialEq)]
11015#[non_exhaustive]
11016pub struct DeleteSnapshotRequest {
11017 /// Required. The snapshot resource name, in the format
11018 /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
11019 pub name: std::string::String,
11020
11021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11022}
11023
11024impl DeleteSnapshotRequest {
11025 /// Creates a new default instance.
11026 pub fn new() -> Self {
11027 std::default::Default::default()
11028 }
11029
11030 /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
11031 ///
11032 /// # Example
11033 /// ```ignore,no_run
11034 /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
11035 /// let x = DeleteSnapshotRequest::new().set_name("example");
11036 /// ```
11037 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11038 self.name = v.into();
11039 self
11040 }
11041}
11042
11043impl wkt::message::Message for DeleteSnapshotRequest {
11044 fn typename() -> &'static str {
11045 "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
11046 }
11047}
11048
11049/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
11050#[derive(Clone, Default, PartialEq)]
11051#[non_exhaustive]
11052pub struct UpdateSnapshotRequest {
11053 /// Required. Mask of fields to update. At least one path must be supplied in
11054 /// this field.
11055 pub update_mask: std::option::Option<wkt::FieldMask>,
11056
11057 /// Required. A snapshot resource
11058 pub snapshot: std::option::Option<crate::model::Snapshot>,
11059
11060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11061}
11062
11063impl UpdateSnapshotRequest {
11064 /// Creates a new default instance.
11065 pub fn new() -> Self {
11066 std::default::Default::default()
11067 }
11068
11069 /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11070 ///
11071 /// # Example
11072 /// ```ignore,no_run
11073 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11074 /// use wkt::FieldMask;
11075 /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11076 /// ```
11077 pub fn set_update_mask<T>(mut self, v: T) -> Self
11078 where
11079 T: std::convert::Into<wkt::FieldMask>,
11080 {
11081 self.update_mask = std::option::Option::Some(v.into());
11082 self
11083 }
11084
11085 /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11086 ///
11087 /// # Example
11088 /// ```ignore,no_run
11089 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11090 /// use wkt::FieldMask;
11091 /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11092 /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11093 /// ```
11094 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11095 where
11096 T: std::convert::Into<wkt::FieldMask>,
11097 {
11098 self.update_mask = v.map(|x| x.into());
11099 self
11100 }
11101
11102 /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11103 ///
11104 /// # Example
11105 /// ```ignore,no_run
11106 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11107 /// use google_cloud_netapp_v1::model::Snapshot;
11108 /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
11109 /// ```
11110 pub fn set_snapshot<T>(mut self, v: T) -> Self
11111 where
11112 T: std::convert::Into<crate::model::Snapshot>,
11113 {
11114 self.snapshot = std::option::Option::Some(v.into());
11115 self
11116 }
11117
11118 /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11119 ///
11120 /// # Example
11121 /// ```ignore,no_run
11122 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11123 /// use google_cloud_netapp_v1::model::Snapshot;
11124 /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
11125 /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
11126 /// ```
11127 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
11128 where
11129 T: std::convert::Into<crate::model::Snapshot>,
11130 {
11131 self.snapshot = v.map(|x| x.into());
11132 self
11133 }
11134}
11135
11136impl wkt::message::Message for UpdateSnapshotRequest {
11137 fn typename() -> &'static str {
11138 "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
11139 }
11140}
11141
11142/// Snapshot is a point-in-time version of a Volume's content.
11143#[derive(Clone, Default, PartialEq)]
11144#[non_exhaustive]
11145pub struct Snapshot {
11146 /// Identifier. The resource name of the snapshot.
11147 /// Format:
11148 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
11149 pub name: std::string::String,
11150
11151 /// Output only. The snapshot state.
11152 pub state: crate::model::snapshot::State,
11153
11154 /// Output only. State details of the storage pool
11155 pub state_details: std::string::String,
11156
11157 /// A description of the snapshot with 2048 characters or less.
11158 /// Requests with longer descriptions will be rejected.
11159 pub description: std::string::String,
11160
11161 /// Output only. Current storage usage for the snapshot in bytes.
11162 pub used_bytes: f64,
11163
11164 /// Output only. The time when the snapshot was created.
11165 pub create_time: std::option::Option<wkt::Timestamp>,
11166
11167 /// Resource labels to represent user provided metadata.
11168 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11169
11170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11171}
11172
11173impl Snapshot {
11174 /// Creates a new default instance.
11175 pub fn new() -> Self {
11176 std::default::Default::default()
11177 }
11178
11179 /// Sets the value of [name][crate::model::Snapshot::name].
11180 ///
11181 /// # Example
11182 /// ```ignore,no_run
11183 /// # use google_cloud_netapp_v1::model::Snapshot;
11184 /// let x = Snapshot::new().set_name("example");
11185 /// ```
11186 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11187 self.name = v.into();
11188 self
11189 }
11190
11191 /// Sets the value of [state][crate::model::Snapshot::state].
11192 ///
11193 /// # Example
11194 /// ```ignore,no_run
11195 /// # use google_cloud_netapp_v1::model::Snapshot;
11196 /// use google_cloud_netapp_v1::model::snapshot::State;
11197 /// let x0 = Snapshot::new().set_state(State::Ready);
11198 /// let x1 = Snapshot::new().set_state(State::Creating);
11199 /// let x2 = Snapshot::new().set_state(State::Deleting);
11200 /// ```
11201 pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
11202 self.state = v.into();
11203 self
11204 }
11205
11206 /// Sets the value of [state_details][crate::model::Snapshot::state_details].
11207 ///
11208 /// # Example
11209 /// ```ignore,no_run
11210 /// # use google_cloud_netapp_v1::model::Snapshot;
11211 /// let x = Snapshot::new().set_state_details("example");
11212 /// ```
11213 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11214 self.state_details = v.into();
11215 self
11216 }
11217
11218 /// Sets the value of [description][crate::model::Snapshot::description].
11219 ///
11220 /// # Example
11221 /// ```ignore,no_run
11222 /// # use google_cloud_netapp_v1::model::Snapshot;
11223 /// let x = Snapshot::new().set_description("example");
11224 /// ```
11225 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11226 self.description = v.into();
11227 self
11228 }
11229
11230 /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
11231 ///
11232 /// # Example
11233 /// ```ignore,no_run
11234 /// # use google_cloud_netapp_v1::model::Snapshot;
11235 /// let x = Snapshot::new().set_used_bytes(42.0);
11236 /// ```
11237 pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11238 self.used_bytes = v.into();
11239 self
11240 }
11241
11242 /// Sets the value of [create_time][crate::model::Snapshot::create_time].
11243 ///
11244 /// # Example
11245 /// ```ignore,no_run
11246 /// # use google_cloud_netapp_v1::model::Snapshot;
11247 /// use wkt::Timestamp;
11248 /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
11249 /// ```
11250 pub fn set_create_time<T>(mut self, v: T) -> Self
11251 where
11252 T: std::convert::Into<wkt::Timestamp>,
11253 {
11254 self.create_time = std::option::Option::Some(v.into());
11255 self
11256 }
11257
11258 /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
11259 ///
11260 /// # Example
11261 /// ```ignore,no_run
11262 /// # use google_cloud_netapp_v1::model::Snapshot;
11263 /// use wkt::Timestamp;
11264 /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11265 /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
11266 /// ```
11267 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11268 where
11269 T: std::convert::Into<wkt::Timestamp>,
11270 {
11271 self.create_time = v.map(|x| x.into());
11272 self
11273 }
11274
11275 /// Sets the value of [labels][crate::model::Snapshot::labels].
11276 ///
11277 /// # Example
11278 /// ```ignore,no_run
11279 /// # use google_cloud_netapp_v1::model::Snapshot;
11280 /// let x = Snapshot::new().set_labels([
11281 /// ("key0", "abc"),
11282 /// ("key1", "xyz"),
11283 /// ]);
11284 /// ```
11285 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11286 where
11287 T: std::iter::IntoIterator<Item = (K, V)>,
11288 K: std::convert::Into<std::string::String>,
11289 V: std::convert::Into<std::string::String>,
11290 {
11291 use std::iter::Iterator;
11292 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11293 self
11294 }
11295}
11296
11297impl wkt::message::Message for Snapshot {
11298 fn typename() -> &'static str {
11299 "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
11300 }
11301}
11302
11303/// Defines additional types related to [Snapshot].
11304pub mod snapshot {
11305 #[allow(unused_imports)]
11306 use super::*;
11307
11308 /// The Snapshot States
11309 ///
11310 /// # Working with unknown values
11311 ///
11312 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11313 /// additional enum variants at any time. Adding new variants is not considered
11314 /// a breaking change. Applications should write their code in anticipation of:
11315 ///
11316 /// - New values appearing in future releases of the client library, **and**
11317 /// - New values received dynamically, without application changes.
11318 ///
11319 /// Please consult the [Working with enums] section in the user guide for some
11320 /// guidelines.
11321 ///
11322 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11323 #[derive(Clone, Debug, PartialEq)]
11324 #[non_exhaustive]
11325 pub enum State {
11326 /// Unspecified Snapshot State
11327 Unspecified,
11328 /// Snapshot State is Ready
11329 Ready,
11330 /// Snapshot State is Creating
11331 Creating,
11332 /// Snapshot State is Deleting
11333 Deleting,
11334 /// Snapshot State is Updating
11335 Updating,
11336 /// Snapshot State is Disabled
11337 Disabled,
11338 /// Snapshot State is Error
11339 Error,
11340 /// If set, the enum was initialized with an unknown value.
11341 ///
11342 /// Applications can examine the value using [State::value] or
11343 /// [State::name].
11344 UnknownValue(state::UnknownValue),
11345 }
11346
11347 #[doc(hidden)]
11348 pub mod state {
11349 #[allow(unused_imports)]
11350 use super::*;
11351 #[derive(Clone, Debug, PartialEq)]
11352 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11353 }
11354
11355 impl State {
11356 /// Gets the enum value.
11357 ///
11358 /// Returns `None` if the enum contains an unknown value deserialized from
11359 /// the string representation of enums.
11360 pub fn value(&self) -> std::option::Option<i32> {
11361 match self {
11362 Self::Unspecified => std::option::Option::Some(0),
11363 Self::Ready => std::option::Option::Some(1),
11364 Self::Creating => std::option::Option::Some(2),
11365 Self::Deleting => std::option::Option::Some(3),
11366 Self::Updating => std::option::Option::Some(4),
11367 Self::Disabled => std::option::Option::Some(5),
11368 Self::Error => std::option::Option::Some(6),
11369 Self::UnknownValue(u) => u.0.value(),
11370 }
11371 }
11372
11373 /// Gets the enum value as a string.
11374 ///
11375 /// Returns `None` if the enum contains an unknown value deserialized from
11376 /// the integer representation of enums.
11377 pub fn name(&self) -> std::option::Option<&str> {
11378 match self {
11379 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11380 Self::Ready => std::option::Option::Some("READY"),
11381 Self::Creating => std::option::Option::Some("CREATING"),
11382 Self::Deleting => std::option::Option::Some("DELETING"),
11383 Self::Updating => std::option::Option::Some("UPDATING"),
11384 Self::Disabled => std::option::Option::Some("DISABLED"),
11385 Self::Error => std::option::Option::Some("ERROR"),
11386 Self::UnknownValue(u) => u.0.name(),
11387 }
11388 }
11389 }
11390
11391 impl std::default::Default for State {
11392 fn default() -> Self {
11393 use std::convert::From;
11394 Self::from(0)
11395 }
11396 }
11397
11398 impl std::fmt::Display for State {
11399 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11400 wkt::internal::display_enum(f, self.name(), self.value())
11401 }
11402 }
11403
11404 impl std::convert::From<i32> for State {
11405 fn from(value: i32) -> Self {
11406 match value {
11407 0 => Self::Unspecified,
11408 1 => Self::Ready,
11409 2 => Self::Creating,
11410 3 => Self::Deleting,
11411 4 => Self::Updating,
11412 5 => Self::Disabled,
11413 6 => Self::Error,
11414 _ => Self::UnknownValue(state::UnknownValue(
11415 wkt::internal::UnknownEnumValue::Integer(value),
11416 )),
11417 }
11418 }
11419 }
11420
11421 impl std::convert::From<&str> for State {
11422 fn from(value: &str) -> Self {
11423 use std::string::ToString;
11424 match value {
11425 "STATE_UNSPECIFIED" => Self::Unspecified,
11426 "READY" => Self::Ready,
11427 "CREATING" => Self::Creating,
11428 "DELETING" => Self::Deleting,
11429 "UPDATING" => Self::Updating,
11430 "DISABLED" => Self::Disabled,
11431 "ERROR" => Self::Error,
11432 _ => Self::UnknownValue(state::UnknownValue(
11433 wkt::internal::UnknownEnumValue::String(value.to_string()),
11434 )),
11435 }
11436 }
11437 }
11438
11439 impl serde::ser::Serialize for State {
11440 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11441 where
11442 S: serde::Serializer,
11443 {
11444 match self {
11445 Self::Unspecified => serializer.serialize_i32(0),
11446 Self::Ready => serializer.serialize_i32(1),
11447 Self::Creating => serializer.serialize_i32(2),
11448 Self::Deleting => serializer.serialize_i32(3),
11449 Self::Updating => serializer.serialize_i32(4),
11450 Self::Disabled => serializer.serialize_i32(5),
11451 Self::Error => serializer.serialize_i32(6),
11452 Self::UnknownValue(u) => u.0.serialize(serializer),
11453 }
11454 }
11455 }
11456
11457 impl<'de> serde::de::Deserialize<'de> for State {
11458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11459 where
11460 D: serde::Deserializer<'de>,
11461 {
11462 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11463 ".google.cloud.netapp.v1.Snapshot.State",
11464 ))
11465 }
11466 }
11467}
11468
11469/// GetStoragePoolRequest gets a Storage Pool.
11470#[derive(Clone, Default, PartialEq)]
11471#[non_exhaustive]
11472pub struct GetStoragePoolRequest {
11473 /// Required. Name of the storage pool
11474 pub name: std::string::String,
11475
11476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11477}
11478
11479impl GetStoragePoolRequest {
11480 /// Creates a new default instance.
11481 pub fn new() -> Self {
11482 std::default::Default::default()
11483 }
11484
11485 /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
11486 ///
11487 /// # Example
11488 /// ```ignore,no_run
11489 /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
11490 /// let x = GetStoragePoolRequest::new().set_name("example");
11491 /// ```
11492 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11493 self.name = v.into();
11494 self
11495 }
11496}
11497
11498impl wkt::message::Message for GetStoragePoolRequest {
11499 fn typename() -> &'static str {
11500 "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
11501 }
11502}
11503
11504/// ListStoragePoolsRequest lists Storage Pools.
11505#[derive(Clone, Default, PartialEq)]
11506#[non_exhaustive]
11507pub struct ListStoragePoolsRequest {
11508 /// Required. Parent value
11509 pub parent: std::string::String,
11510
11511 /// Optional. The maximum number of items to return.
11512 pub page_size: i32,
11513
11514 /// Optional. The next_page_token value to use if there are additional
11515 /// results to retrieve for this list request.
11516 pub page_token: std::string::String,
11517
11518 /// Optional. Sort results. Supported values are "name", "name desc" or ""
11519 /// (unsorted).
11520 pub order_by: std::string::String,
11521
11522 /// Optional. List filter.
11523 pub filter: std::string::String,
11524
11525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11526}
11527
11528impl ListStoragePoolsRequest {
11529 /// Creates a new default instance.
11530 pub fn new() -> Self {
11531 std::default::Default::default()
11532 }
11533
11534 /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
11535 ///
11536 /// # Example
11537 /// ```ignore,no_run
11538 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11539 /// let x = ListStoragePoolsRequest::new().set_parent("example");
11540 /// ```
11541 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11542 self.parent = v.into();
11543 self
11544 }
11545
11546 /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
11547 ///
11548 /// # Example
11549 /// ```ignore,no_run
11550 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11551 /// let x = ListStoragePoolsRequest::new().set_page_size(42);
11552 /// ```
11553 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11554 self.page_size = v.into();
11555 self
11556 }
11557
11558 /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11559 ///
11560 /// # Example
11561 /// ```ignore,no_run
11562 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11563 /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11564 /// ```
11565 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11566 self.page_token = v.into();
11567 self
11568 }
11569
11570 /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11571 ///
11572 /// # Example
11573 /// ```ignore,no_run
11574 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11575 /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11576 /// ```
11577 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11578 self.order_by = v.into();
11579 self
11580 }
11581
11582 /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11583 ///
11584 /// # Example
11585 /// ```ignore,no_run
11586 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11587 /// let x = ListStoragePoolsRequest::new().set_filter("example");
11588 /// ```
11589 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11590 self.filter = v.into();
11591 self
11592 }
11593}
11594
11595impl wkt::message::Message for ListStoragePoolsRequest {
11596 fn typename() -> &'static str {
11597 "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11598 }
11599}
11600
11601/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11602#[derive(Clone, Default, PartialEq)]
11603#[non_exhaustive]
11604pub struct ListStoragePoolsResponse {
11605 /// The list of StoragePools
11606 pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11607
11608 /// A token identifying a page of results the server should return.
11609 pub next_page_token: std::string::String,
11610
11611 /// Locations that could not be reached.
11612 pub unreachable: std::vec::Vec<std::string::String>,
11613
11614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11615}
11616
11617impl ListStoragePoolsResponse {
11618 /// Creates a new default instance.
11619 pub fn new() -> Self {
11620 std::default::Default::default()
11621 }
11622
11623 /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11624 ///
11625 /// # Example
11626 /// ```ignore,no_run
11627 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11628 /// use google_cloud_netapp_v1::model::StoragePool;
11629 /// let x = ListStoragePoolsResponse::new()
11630 /// .set_storage_pools([
11631 /// StoragePool::default()/* use setters */,
11632 /// StoragePool::default()/* use (different) setters */,
11633 /// ]);
11634 /// ```
11635 pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11636 where
11637 T: std::iter::IntoIterator<Item = V>,
11638 V: std::convert::Into<crate::model::StoragePool>,
11639 {
11640 use std::iter::Iterator;
11641 self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11642 self
11643 }
11644
11645 /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11646 ///
11647 /// # Example
11648 /// ```ignore,no_run
11649 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11650 /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11651 /// ```
11652 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11653 self.next_page_token = v.into();
11654 self
11655 }
11656
11657 /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11658 ///
11659 /// # Example
11660 /// ```ignore,no_run
11661 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11662 /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11663 /// ```
11664 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11665 where
11666 T: std::iter::IntoIterator<Item = V>,
11667 V: std::convert::Into<std::string::String>,
11668 {
11669 use std::iter::Iterator;
11670 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11671 self
11672 }
11673}
11674
11675impl wkt::message::Message for ListStoragePoolsResponse {
11676 fn typename() -> &'static str {
11677 "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11678 }
11679}
11680
11681#[doc(hidden)]
11682impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11683 type PageItem = crate::model::StoragePool;
11684
11685 fn items(self) -> std::vec::Vec<Self::PageItem> {
11686 self.storage_pools
11687 }
11688
11689 fn next_page_token(&self) -> std::string::String {
11690 use std::clone::Clone;
11691 self.next_page_token.clone()
11692 }
11693}
11694
11695/// CreateStoragePoolRequest creates a Storage Pool.
11696#[derive(Clone, Default, PartialEq)]
11697#[non_exhaustive]
11698pub struct CreateStoragePoolRequest {
11699 /// Required. Value for parent.
11700 pub parent: std::string::String,
11701
11702 /// Required. Id of the requesting storage pool. Must be unique within the
11703 /// parent resource. Must contain only letters, numbers and hyphen, with the
11704 /// first character a letter, the last a letter or a number, and a 63 character
11705 /// maximum.
11706 pub storage_pool_id: std::string::String,
11707
11708 /// Required. The required parameters to create a new storage pool.
11709 pub storage_pool: std::option::Option<crate::model::StoragePool>,
11710
11711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11712}
11713
11714impl CreateStoragePoolRequest {
11715 /// Creates a new default instance.
11716 pub fn new() -> Self {
11717 std::default::Default::default()
11718 }
11719
11720 /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11721 ///
11722 /// # Example
11723 /// ```ignore,no_run
11724 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11725 /// let x = CreateStoragePoolRequest::new().set_parent("example");
11726 /// ```
11727 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11728 self.parent = v.into();
11729 self
11730 }
11731
11732 /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11733 ///
11734 /// # Example
11735 /// ```ignore,no_run
11736 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11737 /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11738 /// ```
11739 pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11740 self.storage_pool_id = v.into();
11741 self
11742 }
11743
11744 /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11745 ///
11746 /// # Example
11747 /// ```ignore,no_run
11748 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11749 /// use google_cloud_netapp_v1::model::StoragePool;
11750 /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11751 /// ```
11752 pub fn set_storage_pool<T>(mut self, v: T) -> Self
11753 where
11754 T: std::convert::Into<crate::model::StoragePool>,
11755 {
11756 self.storage_pool = std::option::Option::Some(v.into());
11757 self
11758 }
11759
11760 /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11761 ///
11762 /// # Example
11763 /// ```ignore,no_run
11764 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11765 /// use google_cloud_netapp_v1::model::StoragePool;
11766 /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11767 /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11768 /// ```
11769 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11770 where
11771 T: std::convert::Into<crate::model::StoragePool>,
11772 {
11773 self.storage_pool = v.map(|x| x.into());
11774 self
11775 }
11776}
11777
11778impl wkt::message::Message for CreateStoragePoolRequest {
11779 fn typename() -> &'static str {
11780 "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11781 }
11782}
11783
11784/// UpdateStoragePoolRequest updates a Storage Pool.
11785#[derive(Clone, Default, PartialEq)]
11786#[non_exhaustive]
11787pub struct UpdateStoragePoolRequest {
11788 /// Required. Field mask is used to specify the fields to be overwritten in the
11789 /// StoragePool resource by the update.
11790 /// The fields specified in the update_mask are relative to the resource, not
11791 /// the full request. A field will be overwritten if it is in the mask. If the
11792 /// user does not provide a mask then all fields will be overwritten.
11793 pub update_mask: std::option::Option<wkt::FieldMask>,
11794
11795 /// Required. The pool being updated
11796 pub storage_pool: std::option::Option<crate::model::StoragePool>,
11797
11798 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11799}
11800
11801impl UpdateStoragePoolRequest {
11802 /// Creates a new default instance.
11803 pub fn new() -> Self {
11804 std::default::Default::default()
11805 }
11806
11807 /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11808 ///
11809 /// # Example
11810 /// ```ignore,no_run
11811 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11812 /// use wkt::FieldMask;
11813 /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11814 /// ```
11815 pub fn set_update_mask<T>(mut self, v: T) -> Self
11816 where
11817 T: std::convert::Into<wkt::FieldMask>,
11818 {
11819 self.update_mask = std::option::Option::Some(v.into());
11820 self
11821 }
11822
11823 /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11824 ///
11825 /// # Example
11826 /// ```ignore,no_run
11827 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11828 /// use wkt::FieldMask;
11829 /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11830 /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11831 /// ```
11832 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11833 where
11834 T: std::convert::Into<wkt::FieldMask>,
11835 {
11836 self.update_mask = v.map(|x| x.into());
11837 self
11838 }
11839
11840 /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11841 ///
11842 /// # Example
11843 /// ```ignore,no_run
11844 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11845 /// use google_cloud_netapp_v1::model::StoragePool;
11846 /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11847 /// ```
11848 pub fn set_storage_pool<T>(mut self, v: T) -> Self
11849 where
11850 T: std::convert::Into<crate::model::StoragePool>,
11851 {
11852 self.storage_pool = std::option::Option::Some(v.into());
11853 self
11854 }
11855
11856 /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11857 ///
11858 /// # Example
11859 /// ```ignore,no_run
11860 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11861 /// use google_cloud_netapp_v1::model::StoragePool;
11862 /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11863 /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11864 /// ```
11865 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11866 where
11867 T: std::convert::Into<crate::model::StoragePool>,
11868 {
11869 self.storage_pool = v.map(|x| x.into());
11870 self
11871 }
11872}
11873
11874impl wkt::message::Message for UpdateStoragePoolRequest {
11875 fn typename() -> &'static str {
11876 "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
11877 }
11878}
11879
11880/// DeleteStoragePoolRequest deletes a Storage Pool.
11881#[derive(Clone, Default, PartialEq)]
11882#[non_exhaustive]
11883pub struct DeleteStoragePoolRequest {
11884 /// Required. Name of the storage pool
11885 pub name: std::string::String,
11886
11887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11888}
11889
11890impl DeleteStoragePoolRequest {
11891 /// Creates a new default instance.
11892 pub fn new() -> Self {
11893 std::default::Default::default()
11894 }
11895
11896 /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
11897 ///
11898 /// # Example
11899 /// ```ignore,no_run
11900 /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
11901 /// let x = DeleteStoragePoolRequest::new().set_name("example");
11902 /// ```
11903 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11904 self.name = v.into();
11905 self
11906 }
11907}
11908
11909impl wkt::message::Message for DeleteStoragePoolRequest {
11910 fn typename() -> &'static str {
11911 "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
11912 }
11913}
11914
11915/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
11916/// storagePool.
11917#[derive(Clone, Default, PartialEq)]
11918#[non_exhaustive]
11919pub struct SwitchActiveReplicaZoneRequest {
11920 /// Required. Name of the storage pool
11921 pub name: std::string::String,
11922
11923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11924}
11925
11926impl SwitchActiveReplicaZoneRequest {
11927 /// Creates a new default instance.
11928 pub fn new() -> Self {
11929 std::default::Default::default()
11930 }
11931
11932 /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
11933 ///
11934 /// # Example
11935 /// ```ignore,no_run
11936 /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
11937 /// let x = SwitchActiveReplicaZoneRequest::new().set_name("example");
11938 /// ```
11939 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11940 self.name = v.into();
11941 self
11942 }
11943}
11944
11945impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
11946 fn typename() -> &'static str {
11947 "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
11948 }
11949}
11950
11951/// StoragePool is a container for volumes with a service level and capacity.
11952/// Volumes can be created in a pool of sufficient available capacity.
11953/// StoragePool capacity is what you are billed for.
11954#[derive(Clone, Default, PartialEq)]
11955#[non_exhaustive]
11956pub struct StoragePool {
11957 /// Identifier. Name of the storage pool
11958 pub name: std::string::String,
11959
11960 /// Required. Service level of the storage pool
11961 pub service_level: crate::model::ServiceLevel,
11962
11963 /// Required. Capacity in GIB of the pool
11964 pub capacity_gib: i64,
11965
11966 /// Output only. Allocated size of all volumes in GIB in the storage pool
11967 pub volume_capacity_gib: i64,
11968
11969 /// Output only. Volume count of the storage pool
11970 pub volume_count: i32,
11971
11972 /// Output only. State of the storage pool
11973 pub state: crate::model::storage_pool::State,
11974
11975 /// Output only. State details of the storage pool
11976 pub state_details: std::string::String,
11977
11978 /// Output only. Create time of the storage pool
11979 pub create_time: std::option::Option<wkt::Timestamp>,
11980
11981 /// Optional. Description of the storage pool
11982 pub description: std::string::String,
11983
11984 /// Optional. Labels as key value pairs
11985 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11986
11987 /// Required. VPC Network name.
11988 /// Format: projects/{project}/global/networks/{network}
11989 pub network: std::string::String,
11990
11991 /// Optional. Specifies the Active Directory to be used for creating a SMB
11992 /// volume.
11993 pub active_directory: std::string::String,
11994
11995 /// Optional. Specifies the KMS config to be used for volume encryption.
11996 pub kms_config: std::string::String,
11997
11998 /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
11999 pub ldap_enabled: bool,
12000
12001 /// Optional. This field is not implemented. The values provided in this field
12002 /// are ignored.
12003 pub psa_range: std::string::String,
12004
12005 /// Output only. Specifies the current pool encryption key source.
12006 pub encryption_type: crate::model::EncryptionType,
12007
12008 /// Deprecated. Used to allow SO pool to access AD or DNS server from other
12009 /// regions.
12010 #[deprecated]
12011 pub global_access_allowed: std::option::Option<bool>,
12012
12013 /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
12014 /// Default is false. Auto-tiering can be enabled after storage pool creation
12015 /// but it can't be disabled once enabled.
12016 pub allow_auto_tiering: bool,
12017
12018 /// Optional. Specifies the replica zone for regional storagePool.
12019 pub replica_zone: std::string::String,
12020
12021 /// Optional. Specifies the active zone for regional storagePool.
12022 pub zone: std::string::String,
12023
12024 /// Output only. Reserved for future use
12025 pub satisfies_pzs: bool,
12026
12027 /// Output only. Reserved for future use
12028 pub satisfies_pzi: bool,
12029
12030 /// Optional. True if using Independent Scaling of capacity and performance
12031 /// (Hyperdisk) By default set to false
12032 pub custom_performance_enabled: bool,
12033
12034 /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
12035 pub total_throughput_mibps: i64,
12036
12037 /// Optional. Custom Performance Total IOPS of the pool
12038 /// if not provided, it will be calculated based on the total_throughput_mibps
12039 pub total_iops: i64,
12040
12041 /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
12042 /// only to Flex service level. It should be less than the minimum storage pool
12043 /// size and cannot be more than the current storage pool size. It cannot be
12044 /// decreased once set.
12045 pub hot_tier_size_gib: i64,
12046
12047 /// Optional. Flag indicating that the hot-tier threshold will be
12048 /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
12049 /// The increment will kick in only if the new size after increment is
12050 /// still less than or equal to storage pool size.
12051 pub enable_hot_tier_auto_resize: std::option::Option<bool>,
12052
12053 /// Optional. QoS (Quality of Service) Type of the storage pool
12054 pub qos_type: crate::model::QosType,
12055
12056 /// Output only. Available throughput of the storage pool (in MiB/s).
12057 pub available_throughput_mibps: f64,
12058
12059 /// Output only. Total cold tier data rounded down to the nearest GiB used by
12060 /// the storage pool.
12061 pub cold_tier_size_used_gib: i64,
12062
12063 /// Output only. Total hot tier data rounded down to the nearest GiB used by
12064 /// the storage pool.
12065 pub hot_tier_size_used_gib: i64,
12066
12067 /// Optional. Type of the storage pool. This field is used to control whether
12068 /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
12069 /// `BLOCK`) volumes. If not specified during creation, it defaults to `FILE`.
12070 pub r#type: std::option::Option<crate::model::StoragePoolType>,
12071
12072 /// Optional. Mode of the storage pool. This field is used to control whether
12073 /// the user can perform the ONTAP operations on the storage pool using the
12074 /// GCNV ONTAP Mode APIs. If not specified during creation, it defaults to
12075 /// `DEFAULT`.
12076 pub mode: std::option::Option<crate::model::Mode>,
12077
12078 /// Optional. The scale type of the storage pool. Defaults to
12079 /// `SCALE_TYPE_DEFAULT` if not specified.
12080 pub scale_type: crate::model::ScaleType,
12081
12082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12083}
12084
12085impl StoragePool {
12086 /// Creates a new default instance.
12087 pub fn new() -> Self {
12088 std::default::Default::default()
12089 }
12090
12091 /// Sets the value of [name][crate::model::StoragePool::name].
12092 ///
12093 /// # Example
12094 /// ```ignore,no_run
12095 /// # use google_cloud_netapp_v1::model::StoragePool;
12096 /// let x = StoragePool::new().set_name("example");
12097 /// ```
12098 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12099 self.name = v.into();
12100 self
12101 }
12102
12103 /// Sets the value of [service_level][crate::model::StoragePool::service_level].
12104 ///
12105 /// # Example
12106 /// ```ignore,no_run
12107 /// # use google_cloud_netapp_v1::model::StoragePool;
12108 /// use google_cloud_netapp_v1::model::ServiceLevel;
12109 /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
12110 /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
12111 /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
12112 /// ```
12113 pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
12114 mut self,
12115 v: T,
12116 ) -> Self {
12117 self.service_level = v.into();
12118 self
12119 }
12120
12121 /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
12122 ///
12123 /// # Example
12124 /// ```ignore,no_run
12125 /// # use google_cloud_netapp_v1::model::StoragePool;
12126 /// let x = StoragePool::new().set_capacity_gib(42);
12127 /// ```
12128 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12129 self.capacity_gib = v.into();
12130 self
12131 }
12132
12133 /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
12134 ///
12135 /// # Example
12136 /// ```ignore,no_run
12137 /// # use google_cloud_netapp_v1::model::StoragePool;
12138 /// let x = StoragePool::new().set_volume_capacity_gib(42);
12139 /// ```
12140 pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12141 self.volume_capacity_gib = v.into();
12142 self
12143 }
12144
12145 /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
12146 ///
12147 /// # Example
12148 /// ```ignore,no_run
12149 /// # use google_cloud_netapp_v1::model::StoragePool;
12150 /// let x = StoragePool::new().set_volume_count(42);
12151 /// ```
12152 pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12153 self.volume_count = v.into();
12154 self
12155 }
12156
12157 /// Sets the value of [state][crate::model::StoragePool::state].
12158 ///
12159 /// # Example
12160 /// ```ignore,no_run
12161 /// # use google_cloud_netapp_v1::model::StoragePool;
12162 /// use google_cloud_netapp_v1::model::storage_pool::State;
12163 /// let x0 = StoragePool::new().set_state(State::Ready);
12164 /// let x1 = StoragePool::new().set_state(State::Creating);
12165 /// let x2 = StoragePool::new().set_state(State::Deleting);
12166 /// ```
12167 pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
12168 mut self,
12169 v: T,
12170 ) -> Self {
12171 self.state = v.into();
12172 self
12173 }
12174
12175 /// Sets the value of [state_details][crate::model::StoragePool::state_details].
12176 ///
12177 /// # Example
12178 /// ```ignore,no_run
12179 /// # use google_cloud_netapp_v1::model::StoragePool;
12180 /// let x = StoragePool::new().set_state_details("example");
12181 /// ```
12182 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12183 self.state_details = v.into();
12184 self
12185 }
12186
12187 /// Sets the value of [create_time][crate::model::StoragePool::create_time].
12188 ///
12189 /// # Example
12190 /// ```ignore,no_run
12191 /// # use google_cloud_netapp_v1::model::StoragePool;
12192 /// use wkt::Timestamp;
12193 /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
12194 /// ```
12195 pub fn set_create_time<T>(mut self, v: T) -> Self
12196 where
12197 T: std::convert::Into<wkt::Timestamp>,
12198 {
12199 self.create_time = std::option::Option::Some(v.into());
12200 self
12201 }
12202
12203 /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
12204 ///
12205 /// # Example
12206 /// ```ignore,no_run
12207 /// # use google_cloud_netapp_v1::model::StoragePool;
12208 /// use wkt::Timestamp;
12209 /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12210 /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
12211 /// ```
12212 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12213 where
12214 T: std::convert::Into<wkt::Timestamp>,
12215 {
12216 self.create_time = v.map(|x| x.into());
12217 self
12218 }
12219
12220 /// Sets the value of [description][crate::model::StoragePool::description].
12221 ///
12222 /// # Example
12223 /// ```ignore,no_run
12224 /// # use google_cloud_netapp_v1::model::StoragePool;
12225 /// let x = StoragePool::new().set_description("example");
12226 /// ```
12227 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12228 self.description = v.into();
12229 self
12230 }
12231
12232 /// Sets the value of [labels][crate::model::StoragePool::labels].
12233 ///
12234 /// # Example
12235 /// ```ignore,no_run
12236 /// # use google_cloud_netapp_v1::model::StoragePool;
12237 /// let x = StoragePool::new().set_labels([
12238 /// ("key0", "abc"),
12239 /// ("key1", "xyz"),
12240 /// ]);
12241 /// ```
12242 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12243 where
12244 T: std::iter::IntoIterator<Item = (K, V)>,
12245 K: std::convert::Into<std::string::String>,
12246 V: std::convert::Into<std::string::String>,
12247 {
12248 use std::iter::Iterator;
12249 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12250 self
12251 }
12252
12253 /// Sets the value of [network][crate::model::StoragePool::network].
12254 ///
12255 /// # Example
12256 /// ```ignore,no_run
12257 /// # use google_cloud_netapp_v1::model::StoragePool;
12258 /// let x = StoragePool::new().set_network("example");
12259 /// ```
12260 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12261 self.network = v.into();
12262 self
12263 }
12264
12265 /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
12266 ///
12267 /// # Example
12268 /// ```ignore,no_run
12269 /// # use google_cloud_netapp_v1::model::StoragePool;
12270 /// let x = StoragePool::new().set_active_directory("example");
12271 /// ```
12272 pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
12273 mut self,
12274 v: T,
12275 ) -> Self {
12276 self.active_directory = v.into();
12277 self
12278 }
12279
12280 /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
12281 ///
12282 /// # Example
12283 /// ```ignore,no_run
12284 /// # use google_cloud_netapp_v1::model::StoragePool;
12285 /// let x = StoragePool::new().set_kms_config("example");
12286 /// ```
12287 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12288 self.kms_config = v.into();
12289 self
12290 }
12291
12292 /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
12293 ///
12294 /// # Example
12295 /// ```ignore,no_run
12296 /// # use google_cloud_netapp_v1::model::StoragePool;
12297 /// let x = StoragePool::new().set_ldap_enabled(true);
12298 /// ```
12299 pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12300 self.ldap_enabled = v.into();
12301 self
12302 }
12303
12304 /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
12305 ///
12306 /// # Example
12307 /// ```ignore,no_run
12308 /// # use google_cloud_netapp_v1::model::StoragePool;
12309 /// let x = StoragePool::new().set_psa_range("example");
12310 /// ```
12311 pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12312 self.psa_range = v.into();
12313 self
12314 }
12315
12316 /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
12317 ///
12318 /// # Example
12319 /// ```ignore,no_run
12320 /// # use google_cloud_netapp_v1::model::StoragePool;
12321 /// use google_cloud_netapp_v1::model::EncryptionType;
12322 /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
12323 /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
12324 /// ```
12325 pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
12326 mut self,
12327 v: T,
12328 ) -> Self {
12329 self.encryption_type = v.into();
12330 self
12331 }
12332
12333 /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12334 ///
12335 /// # Example
12336 /// ```ignore,no_run
12337 /// # use google_cloud_netapp_v1::model::StoragePool;
12338 /// let x = StoragePool::new().set_global_access_allowed(true);
12339 /// ```
12340 #[deprecated]
12341 pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
12342 where
12343 T: std::convert::Into<bool>,
12344 {
12345 self.global_access_allowed = std::option::Option::Some(v.into());
12346 self
12347 }
12348
12349 /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12350 ///
12351 /// # Example
12352 /// ```ignore,no_run
12353 /// # use google_cloud_netapp_v1::model::StoragePool;
12354 /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
12355 /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
12356 /// ```
12357 #[deprecated]
12358 pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
12359 where
12360 T: std::convert::Into<bool>,
12361 {
12362 self.global_access_allowed = v.map(|x| x.into());
12363 self
12364 }
12365
12366 /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
12367 ///
12368 /// # Example
12369 /// ```ignore,no_run
12370 /// # use google_cloud_netapp_v1::model::StoragePool;
12371 /// let x = StoragePool::new().set_allow_auto_tiering(true);
12372 /// ```
12373 pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12374 self.allow_auto_tiering = v.into();
12375 self
12376 }
12377
12378 /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
12379 ///
12380 /// # Example
12381 /// ```ignore,no_run
12382 /// # use google_cloud_netapp_v1::model::StoragePool;
12383 /// let x = StoragePool::new().set_replica_zone("example");
12384 /// ```
12385 pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12386 self.replica_zone = v.into();
12387 self
12388 }
12389
12390 /// Sets the value of [zone][crate::model::StoragePool::zone].
12391 ///
12392 /// # Example
12393 /// ```ignore,no_run
12394 /// # use google_cloud_netapp_v1::model::StoragePool;
12395 /// let x = StoragePool::new().set_zone("example");
12396 /// ```
12397 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12398 self.zone = v.into();
12399 self
12400 }
12401
12402 /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
12403 ///
12404 /// # Example
12405 /// ```ignore,no_run
12406 /// # use google_cloud_netapp_v1::model::StoragePool;
12407 /// let x = StoragePool::new().set_satisfies_pzs(true);
12408 /// ```
12409 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12410 self.satisfies_pzs = v.into();
12411 self
12412 }
12413
12414 /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
12415 ///
12416 /// # Example
12417 /// ```ignore,no_run
12418 /// # use google_cloud_netapp_v1::model::StoragePool;
12419 /// let x = StoragePool::new().set_satisfies_pzi(true);
12420 /// ```
12421 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12422 self.satisfies_pzi = v.into();
12423 self
12424 }
12425
12426 /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
12427 ///
12428 /// # Example
12429 /// ```ignore,no_run
12430 /// # use google_cloud_netapp_v1::model::StoragePool;
12431 /// let x = StoragePool::new().set_custom_performance_enabled(true);
12432 /// ```
12433 pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12434 self.custom_performance_enabled = v.into();
12435 self
12436 }
12437
12438 /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
12439 ///
12440 /// # Example
12441 /// ```ignore,no_run
12442 /// # use google_cloud_netapp_v1::model::StoragePool;
12443 /// let x = StoragePool::new().set_total_throughput_mibps(42);
12444 /// ```
12445 pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12446 self.total_throughput_mibps = v.into();
12447 self
12448 }
12449
12450 /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
12451 ///
12452 /// # Example
12453 /// ```ignore,no_run
12454 /// # use google_cloud_netapp_v1::model::StoragePool;
12455 /// let x = StoragePool::new().set_total_iops(42);
12456 /// ```
12457 pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12458 self.total_iops = v.into();
12459 self
12460 }
12461
12462 /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
12463 ///
12464 /// # Example
12465 /// ```ignore,no_run
12466 /// # use google_cloud_netapp_v1::model::StoragePool;
12467 /// let x = StoragePool::new().set_hot_tier_size_gib(42);
12468 /// ```
12469 pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12470 self.hot_tier_size_gib = v.into();
12471 self
12472 }
12473
12474 /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12475 ///
12476 /// # Example
12477 /// ```ignore,no_run
12478 /// # use google_cloud_netapp_v1::model::StoragePool;
12479 /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
12480 /// ```
12481 pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
12482 where
12483 T: std::convert::Into<bool>,
12484 {
12485 self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
12486 self
12487 }
12488
12489 /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12490 ///
12491 /// # Example
12492 /// ```ignore,no_run
12493 /// # use google_cloud_netapp_v1::model::StoragePool;
12494 /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
12495 /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
12496 /// ```
12497 pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
12498 where
12499 T: std::convert::Into<bool>,
12500 {
12501 self.enable_hot_tier_auto_resize = v.map(|x| x.into());
12502 self
12503 }
12504
12505 /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
12506 ///
12507 /// # Example
12508 /// ```ignore,no_run
12509 /// # use google_cloud_netapp_v1::model::StoragePool;
12510 /// use google_cloud_netapp_v1::model::QosType;
12511 /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
12512 /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
12513 /// ```
12514 pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
12515 self.qos_type = v.into();
12516 self
12517 }
12518
12519 /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
12520 ///
12521 /// # Example
12522 /// ```ignore,no_run
12523 /// # use google_cloud_netapp_v1::model::StoragePool;
12524 /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
12525 /// ```
12526 pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12527 self.available_throughput_mibps = v.into();
12528 self
12529 }
12530
12531 /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
12532 ///
12533 /// # Example
12534 /// ```ignore,no_run
12535 /// # use google_cloud_netapp_v1::model::StoragePool;
12536 /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
12537 /// ```
12538 pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12539 self.cold_tier_size_used_gib = v.into();
12540 self
12541 }
12542
12543 /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
12544 ///
12545 /// # Example
12546 /// ```ignore,no_run
12547 /// # use google_cloud_netapp_v1::model::StoragePool;
12548 /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
12549 /// ```
12550 pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12551 self.hot_tier_size_used_gib = v.into();
12552 self
12553 }
12554
12555 /// Sets the value of [r#type][crate::model::StoragePool::type].
12556 ///
12557 /// # Example
12558 /// ```ignore,no_run
12559 /// # use google_cloud_netapp_v1::model::StoragePool;
12560 /// use google_cloud_netapp_v1::model::StoragePoolType;
12561 /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
12562 /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
12563 /// ```
12564 pub fn set_type<T>(mut self, v: T) -> Self
12565 where
12566 T: std::convert::Into<crate::model::StoragePoolType>,
12567 {
12568 self.r#type = std::option::Option::Some(v.into());
12569 self
12570 }
12571
12572 /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12573 ///
12574 /// # Example
12575 /// ```ignore,no_run
12576 /// # use google_cloud_netapp_v1::model::StoragePool;
12577 /// use google_cloud_netapp_v1::model::StoragePoolType;
12578 /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12579 /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12580 /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12581 /// ```
12582 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12583 where
12584 T: std::convert::Into<crate::model::StoragePoolType>,
12585 {
12586 self.r#type = v.map(|x| x.into());
12587 self
12588 }
12589
12590 /// Sets the value of [mode][crate::model::StoragePool::mode].
12591 ///
12592 /// # Example
12593 /// ```ignore,no_run
12594 /// # use google_cloud_netapp_v1::model::StoragePool;
12595 /// use google_cloud_netapp_v1::model::Mode;
12596 /// let x0 = StoragePool::new().set_mode(Mode::Default);
12597 /// let x1 = StoragePool::new().set_mode(Mode::Ontap);
12598 /// ```
12599 pub fn set_mode<T>(mut self, v: T) -> Self
12600 where
12601 T: std::convert::Into<crate::model::Mode>,
12602 {
12603 self.mode = std::option::Option::Some(v.into());
12604 self
12605 }
12606
12607 /// Sets or clears the value of [mode][crate::model::StoragePool::mode].
12608 ///
12609 /// # Example
12610 /// ```ignore,no_run
12611 /// # use google_cloud_netapp_v1::model::StoragePool;
12612 /// use google_cloud_netapp_v1::model::Mode;
12613 /// let x0 = StoragePool::new().set_or_clear_mode(Some(Mode::Default));
12614 /// let x1 = StoragePool::new().set_or_clear_mode(Some(Mode::Ontap));
12615 /// let x_none = StoragePool::new().set_or_clear_mode(None::<Mode>);
12616 /// ```
12617 pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
12618 where
12619 T: std::convert::Into<crate::model::Mode>,
12620 {
12621 self.mode = v.map(|x| x.into());
12622 self
12623 }
12624
12625 /// Sets the value of [scale_type][crate::model::StoragePool::scale_type].
12626 ///
12627 /// # Example
12628 /// ```ignore,no_run
12629 /// # use google_cloud_netapp_v1::model::StoragePool;
12630 /// use google_cloud_netapp_v1::model::ScaleType;
12631 /// let x0 = StoragePool::new().set_scale_type(ScaleType::Default);
12632 /// let x1 = StoragePool::new().set_scale_type(ScaleType::Scaleout);
12633 /// ```
12634 pub fn set_scale_type<T: std::convert::Into<crate::model::ScaleType>>(mut self, v: T) -> Self {
12635 self.scale_type = v.into();
12636 self
12637 }
12638}
12639
12640impl wkt::message::Message for StoragePool {
12641 fn typename() -> &'static str {
12642 "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12643 }
12644}
12645
12646/// Defines additional types related to [StoragePool].
12647pub mod storage_pool {
12648 #[allow(unused_imports)]
12649 use super::*;
12650
12651 /// The Storage Pool States
12652 ///
12653 /// # Working with unknown values
12654 ///
12655 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12656 /// additional enum variants at any time. Adding new variants is not considered
12657 /// a breaking change. Applications should write their code in anticipation of:
12658 ///
12659 /// - New values appearing in future releases of the client library, **and**
12660 /// - New values received dynamically, without application changes.
12661 ///
12662 /// Please consult the [Working with enums] section in the user guide for some
12663 /// guidelines.
12664 ///
12665 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12666 #[derive(Clone, Debug, PartialEq)]
12667 #[non_exhaustive]
12668 pub enum State {
12669 /// Unspecified Storage Pool State
12670 Unspecified,
12671 /// Storage Pool State is Ready
12672 Ready,
12673 /// Storage Pool State is Creating
12674 Creating,
12675 /// Storage Pool State is Deleting
12676 Deleting,
12677 /// Storage Pool State is Updating
12678 Updating,
12679 /// Storage Pool State is Restoring
12680 Restoring,
12681 /// Storage Pool State is Disabled
12682 Disabled,
12683 /// Storage Pool State is Error
12684 Error,
12685 /// If set, the enum was initialized with an unknown value.
12686 ///
12687 /// Applications can examine the value using [State::value] or
12688 /// [State::name].
12689 UnknownValue(state::UnknownValue),
12690 }
12691
12692 #[doc(hidden)]
12693 pub mod state {
12694 #[allow(unused_imports)]
12695 use super::*;
12696 #[derive(Clone, Debug, PartialEq)]
12697 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12698 }
12699
12700 impl State {
12701 /// Gets the enum value.
12702 ///
12703 /// Returns `None` if the enum contains an unknown value deserialized from
12704 /// the string representation of enums.
12705 pub fn value(&self) -> std::option::Option<i32> {
12706 match self {
12707 Self::Unspecified => std::option::Option::Some(0),
12708 Self::Ready => std::option::Option::Some(1),
12709 Self::Creating => std::option::Option::Some(2),
12710 Self::Deleting => std::option::Option::Some(3),
12711 Self::Updating => std::option::Option::Some(4),
12712 Self::Restoring => std::option::Option::Some(5),
12713 Self::Disabled => std::option::Option::Some(6),
12714 Self::Error => std::option::Option::Some(7),
12715 Self::UnknownValue(u) => u.0.value(),
12716 }
12717 }
12718
12719 /// Gets the enum value as a string.
12720 ///
12721 /// Returns `None` if the enum contains an unknown value deserialized from
12722 /// the integer representation of enums.
12723 pub fn name(&self) -> std::option::Option<&str> {
12724 match self {
12725 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12726 Self::Ready => std::option::Option::Some("READY"),
12727 Self::Creating => std::option::Option::Some("CREATING"),
12728 Self::Deleting => std::option::Option::Some("DELETING"),
12729 Self::Updating => std::option::Option::Some("UPDATING"),
12730 Self::Restoring => std::option::Option::Some("RESTORING"),
12731 Self::Disabled => std::option::Option::Some("DISABLED"),
12732 Self::Error => std::option::Option::Some("ERROR"),
12733 Self::UnknownValue(u) => u.0.name(),
12734 }
12735 }
12736 }
12737
12738 impl std::default::Default for State {
12739 fn default() -> Self {
12740 use std::convert::From;
12741 Self::from(0)
12742 }
12743 }
12744
12745 impl std::fmt::Display for State {
12746 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12747 wkt::internal::display_enum(f, self.name(), self.value())
12748 }
12749 }
12750
12751 impl std::convert::From<i32> for State {
12752 fn from(value: i32) -> Self {
12753 match value {
12754 0 => Self::Unspecified,
12755 1 => Self::Ready,
12756 2 => Self::Creating,
12757 3 => Self::Deleting,
12758 4 => Self::Updating,
12759 5 => Self::Restoring,
12760 6 => Self::Disabled,
12761 7 => Self::Error,
12762 _ => Self::UnknownValue(state::UnknownValue(
12763 wkt::internal::UnknownEnumValue::Integer(value),
12764 )),
12765 }
12766 }
12767 }
12768
12769 impl std::convert::From<&str> for State {
12770 fn from(value: &str) -> Self {
12771 use std::string::ToString;
12772 match value {
12773 "STATE_UNSPECIFIED" => Self::Unspecified,
12774 "READY" => Self::Ready,
12775 "CREATING" => Self::Creating,
12776 "DELETING" => Self::Deleting,
12777 "UPDATING" => Self::Updating,
12778 "RESTORING" => Self::Restoring,
12779 "DISABLED" => Self::Disabled,
12780 "ERROR" => Self::Error,
12781 _ => Self::UnknownValue(state::UnknownValue(
12782 wkt::internal::UnknownEnumValue::String(value.to_string()),
12783 )),
12784 }
12785 }
12786 }
12787
12788 impl serde::ser::Serialize for State {
12789 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12790 where
12791 S: serde::Serializer,
12792 {
12793 match self {
12794 Self::Unspecified => serializer.serialize_i32(0),
12795 Self::Ready => serializer.serialize_i32(1),
12796 Self::Creating => serializer.serialize_i32(2),
12797 Self::Deleting => serializer.serialize_i32(3),
12798 Self::Updating => serializer.serialize_i32(4),
12799 Self::Restoring => serializer.serialize_i32(5),
12800 Self::Disabled => serializer.serialize_i32(6),
12801 Self::Error => serializer.serialize_i32(7),
12802 Self::UnknownValue(u) => u.0.serialize(serializer),
12803 }
12804 }
12805 }
12806
12807 impl<'de> serde::de::Deserialize<'de> for State {
12808 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12809 where
12810 D: serde::Deserializer<'de>,
12811 {
12812 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12813 ".google.cloud.netapp.v1.StoragePool.State",
12814 ))
12815 }
12816 }
12817}
12818
12819/// ValidateDirectoryServiceRequest validates the directory service policy
12820/// attached to the storage pool.
12821#[derive(Clone, Default, PartialEq)]
12822#[non_exhaustive]
12823pub struct ValidateDirectoryServiceRequest {
12824 /// Required. Name of the storage pool
12825 pub name: std::string::String,
12826
12827 /// Type of directory service policy attached to the storage pool.
12828 pub directory_service_type: crate::model::DirectoryServiceType,
12829
12830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12831}
12832
12833impl ValidateDirectoryServiceRequest {
12834 /// Creates a new default instance.
12835 pub fn new() -> Self {
12836 std::default::Default::default()
12837 }
12838
12839 /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
12840 ///
12841 /// # Example
12842 /// ```ignore,no_run
12843 /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12844 /// let x = ValidateDirectoryServiceRequest::new().set_name("example");
12845 /// ```
12846 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12847 self.name = v.into();
12848 self
12849 }
12850
12851 /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
12852 ///
12853 /// # Example
12854 /// ```ignore,no_run
12855 /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12856 /// use google_cloud_netapp_v1::model::DirectoryServiceType;
12857 /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
12858 /// ```
12859 pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
12860 mut self,
12861 v: T,
12862 ) -> Self {
12863 self.directory_service_type = v.into();
12864 self
12865 }
12866}
12867
12868impl wkt::message::Message for ValidateDirectoryServiceRequest {
12869 fn typename() -> &'static str {
12870 "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
12871 }
12872}
12873
12874/// Message for requesting list of Volumes
12875#[derive(Clone, Default, PartialEq)]
12876#[non_exhaustive]
12877pub struct ListVolumesRequest {
12878 /// Required. Parent value for ListVolumesRequest
12879 pub parent: std::string::String,
12880
12881 /// Requested page size. Server may return fewer items than requested.
12882 /// If unspecified, the server will pick an appropriate default.
12883 pub page_size: i32,
12884
12885 /// A token identifying a page of results the server should return.
12886 pub page_token: std::string::String,
12887
12888 /// Filtering results
12889 pub filter: std::string::String,
12890
12891 /// Hint for how to order the results
12892 pub order_by: std::string::String,
12893
12894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12895}
12896
12897impl ListVolumesRequest {
12898 /// Creates a new default instance.
12899 pub fn new() -> Self {
12900 std::default::Default::default()
12901 }
12902
12903 /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
12904 ///
12905 /// # Example
12906 /// ```ignore,no_run
12907 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12908 /// let x = ListVolumesRequest::new().set_parent("example");
12909 /// ```
12910 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12911 self.parent = v.into();
12912 self
12913 }
12914
12915 /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
12916 ///
12917 /// # Example
12918 /// ```ignore,no_run
12919 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12920 /// let x = ListVolumesRequest::new().set_page_size(42);
12921 /// ```
12922 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12923 self.page_size = v.into();
12924 self
12925 }
12926
12927 /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
12928 ///
12929 /// # Example
12930 /// ```ignore,no_run
12931 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12932 /// let x = ListVolumesRequest::new().set_page_token("example");
12933 /// ```
12934 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12935 self.page_token = v.into();
12936 self
12937 }
12938
12939 /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
12940 ///
12941 /// # Example
12942 /// ```ignore,no_run
12943 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12944 /// let x = ListVolumesRequest::new().set_filter("example");
12945 /// ```
12946 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12947 self.filter = v.into();
12948 self
12949 }
12950
12951 /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
12952 ///
12953 /// # Example
12954 /// ```ignore,no_run
12955 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12956 /// let x = ListVolumesRequest::new().set_order_by("example");
12957 /// ```
12958 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12959 self.order_by = v.into();
12960 self
12961 }
12962}
12963
12964impl wkt::message::Message for ListVolumesRequest {
12965 fn typename() -> &'static str {
12966 "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
12967 }
12968}
12969
12970/// Message for response to listing Volumes
12971#[derive(Clone, Default, PartialEq)]
12972#[non_exhaustive]
12973pub struct ListVolumesResponse {
12974 /// The list of Volume
12975 pub volumes: std::vec::Vec<crate::model::Volume>,
12976
12977 /// A token identifying a page of results the server should return.
12978 pub next_page_token: std::string::String,
12979
12980 /// Locations that could not be reached.
12981 pub unreachable: std::vec::Vec<std::string::String>,
12982
12983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12984}
12985
12986impl ListVolumesResponse {
12987 /// Creates a new default instance.
12988 pub fn new() -> Self {
12989 std::default::Default::default()
12990 }
12991
12992 /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
12993 ///
12994 /// # Example
12995 /// ```ignore,no_run
12996 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12997 /// use google_cloud_netapp_v1::model::Volume;
12998 /// let x = ListVolumesResponse::new()
12999 /// .set_volumes([
13000 /// Volume::default()/* use setters */,
13001 /// Volume::default()/* use (different) setters */,
13002 /// ]);
13003 /// ```
13004 pub fn set_volumes<T, V>(mut self, v: T) -> Self
13005 where
13006 T: std::iter::IntoIterator<Item = V>,
13007 V: std::convert::Into<crate::model::Volume>,
13008 {
13009 use std::iter::Iterator;
13010 self.volumes = v.into_iter().map(|i| i.into()).collect();
13011 self
13012 }
13013
13014 /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
13015 ///
13016 /// # Example
13017 /// ```ignore,no_run
13018 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13019 /// let x = ListVolumesResponse::new().set_next_page_token("example");
13020 /// ```
13021 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13022 self.next_page_token = v.into();
13023 self
13024 }
13025
13026 /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
13027 ///
13028 /// # Example
13029 /// ```ignore,no_run
13030 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13031 /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
13032 /// ```
13033 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13034 where
13035 T: std::iter::IntoIterator<Item = V>,
13036 V: std::convert::Into<std::string::String>,
13037 {
13038 use std::iter::Iterator;
13039 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13040 self
13041 }
13042}
13043
13044impl wkt::message::Message for ListVolumesResponse {
13045 fn typename() -> &'static str {
13046 "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
13047 }
13048}
13049
13050#[doc(hidden)]
13051impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
13052 type PageItem = crate::model::Volume;
13053
13054 fn items(self) -> std::vec::Vec<Self::PageItem> {
13055 self.volumes
13056 }
13057
13058 fn next_page_token(&self) -> std::string::String {
13059 use std::clone::Clone;
13060 self.next_page_token.clone()
13061 }
13062}
13063
13064/// Message for getting a Volume
13065#[derive(Clone, Default, PartialEq)]
13066#[non_exhaustive]
13067pub struct GetVolumeRequest {
13068 /// Required. Name of the volume
13069 pub name: std::string::String,
13070
13071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13072}
13073
13074impl GetVolumeRequest {
13075 /// Creates a new default instance.
13076 pub fn new() -> Self {
13077 std::default::Default::default()
13078 }
13079
13080 /// Sets the value of [name][crate::model::GetVolumeRequest::name].
13081 ///
13082 /// # Example
13083 /// ```ignore,no_run
13084 /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
13085 /// let x = GetVolumeRequest::new().set_name("example");
13086 /// ```
13087 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13088 self.name = v.into();
13089 self
13090 }
13091}
13092
13093impl wkt::message::Message for GetVolumeRequest {
13094 fn typename() -> &'static str {
13095 "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
13096 }
13097}
13098
13099/// Message for creating a Volume
13100#[derive(Clone, Default, PartialEq)]
13101#[non_exhaustive]
13102pub struct CreateVolumeRequest {
13103 /// Required. Value for parent.
13104 pub parent: std::string::String,
13105
13106 /// Required. Id of the requesting volume. Must be unique within the parent
13107 /// resource. Must contain only letters, numbers and hyphen, with the first
13108 /// character a letter, the last a letter or a number,
13109 /// and a 63 character maximum.
13110 pub volume_id: std::string::String,
13111
13112 /// Required. The volume being created.
13113 pub volume: std::option::Option<crate::model::Volume>,
13114
13115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13116}
13117
13118impl CreateVolumeRequest {
13119 /// Creates a new default instance.
13120 pub fn new() -> Self {
13121 std::default::Default::default()
13122 }
13123
13124 /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
13125 ///
13126 /// # Example
13127 /// ```ignore,no_run
13128 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13129 /// let x = CreateVolumeRequest::new().set_parent("example");
13130 /// ```
13131 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13132 self.parent = v.into();
13133 self
13134 }
13135
13136 /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
13137 ///
13138 /// # Example
13139 /// ```ignore,no_run
13140 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13141 /// let x = CreateVolumeRequest::new().set_volume_id("example");
13142 /// ```
13143 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13144 self.volume_id = v.into();
13145 self
13146 }
13147
13148 /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
13149 ///
13150 /// # Example
13151 /// ```ignore,no_run
13152 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13153 /// use google_cloud_netapp_v1::model::Volume;
13154 /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13155 /// ```
13156 pub fn set_volume<T>(mut self, v: T) -> Self
13157 where
13158 T: std::convert::Into<crate::model::Volume>,
13159 {
13160 self.volume = std::option::Option::Some(v.into());
13161 self
13162 }
13163
13164 /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
13165 ///
13166 /// # Example
13167 /// ```ignore,no_run
13168 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13169 /// use google_cloud_netapp_v1::model::Volume;
13170 /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13171 /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13172 /// ```
13173 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13174 where
13175 T: std::convert::Into<crate::model::Volume>,
13176 {
13177 self.volume = v.map(|x| x.into());
13178 self
13179 }
13180}
13181
13182impl wkt::message::Message for CreateVolumeRequest {
13183 fn typename() -> &'static str {
13184 "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
13185 }
13186}
13187
13188/// Message for updating a Volume
13189#[derive(Clone, Default, PartialEq)]
13190#[non_exhaustive]
13191pub struct UpdateVolumeRequest {
13192 /// Required. Field mask is used to specify the fields to be overwritten in the
13193 /// Volume resource by the update.
13194 /// The fields specified in the update_mask are relative to the resource, not
13195 /// the full request. A field will be overwritten if it is in the mask. If the
13196 /// user does not provide a mask then all fields will be overwritten.
13197 pub update_mask: std::option::Option<wkt::FieldMask>,
13198
13199 /// Required. The volume being updated
13200 pub volume: std::option::Option<crate::model::Volume>,
13201
13202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13203}
13204
13205impl UpdateVolumeRequest {
13206 /// Creates a new default instance.
13207 pub fn new() -> Self {
13208 std::default::Default::default()
13209 }
13210
13211 /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13212 ///
13213 /// # Example
13214 /// ```ignore,no_run
13215 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13216 /// use wkt::FieldMask;
13217 /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13218 /// ```
13219 pub fn set_update_mask<T>(mut self, v: T) -> Self
13220 where
13221 T: std::convert::Into<wkt::FieldMask>,
13222 {
13223 self.update_mask = std::option::Option::Some(v.into());
13224 self
13225 }
13226
13227 /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13228 ///
13229 /// # Example
13230 /// ```ignore,no_run
13231 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13232 /// use wkt::FieldMask;
13233 /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13234 /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13235 /// ```
13236 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13237 where
13238 T: std::convert::Into<wkt::FieldMask>,
13239 {
13240 self.update_mask = v.map(|x| x.into());
13241 self
13242 }
13243
13244 /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
13245 ///
13246 /// # Example
13247 /// ```ignore,no_run
13248 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13249 /// use google_cloud_netapp_v1::model::Volume;
13250 /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13251 /// ```
13252 pub fn set_volume<T>(mut self, v: T) -> Self
13253 where
13254 T: std::convert::Into<crate::model::Volume>,
13255 {
13256 self.volume = std::option::Option::Some(v.into());
13257 self
13258 }
13259
13260 /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
13261 ///
13262 /// # Example
13263 /// ```ignore,no_run
13264 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13265 /// use google_cloud_netapp_v1::model::Volume;
13266 /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13267 /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13268 /// ```
13269 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13270 where
13271 T: std::convert::Into<crate::model::Volume>,
13272 {
13273 self.volume = v.map(|x| x.into());
13274 self
13275 }
13276}
13277
13278impl wkt::message::Message for UpdateVolumeRequest {
13279 fn typename() -> &'static str {
13280 "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
13281 }
13282}
13283
13284/// Message for deleting a Volume
13285#[derive(Clone, Default, PartialEq)]
13286#[non_exhaustive]
13287pub struct DeleteVolumeRequest {
13288 /// Required. Name of the volume
13289 pub name: std::string::String,
13290
13291 /// If this field is set as true, CCFE will not block the volume resource
13292 /// deletion even if it has any snapshots resource. (Otherwise, the request
13293 /// will only work if the volume has no snapshots.)
13294 pub force: bool,
13295
13296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13297}
13298
13299impl DeleteVolumeRequest {
13300 /// Creates a new default instance.
13301 pub fn new() -> Self {
13302 std::default::Default::default()
13303 }
13304
13305 /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
13306 ///
13307 /// # Example
13308 /// ```ignore,no_run
13309 /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13310 /// let x = DeleteVolumeRequest::new().set_name("example");
13311 /// ```
13312 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13313 self.name = v.into();
13314 self
13315 }
13316
13317 /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
13318 ///
13319 /// # Example
13320 /// ```ignore,no_run
13321 /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13322 /// let x = DeleteVolumeRequest::new().set_force(true);
13323 /// ```
13324 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13325 self.force = v.into();
13326 self
13327 }
13328}
13329
13330impl wkt::message::Message for DeleteVolumeRequest {
13331 fn typename() -> &'static str {
13332 "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
13333 }
13334}
13335
13336/// RevertVolumeRequest reverts the given volume to the specified snapshot.
13337#[derive(Clone, Default, PartialEq)]
13338#[non_exhaustive]
13339pub struct RevertVolumeRequest {
13340 /// Required. The resource name of the volume, in the format of
13341 /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
13342 pub name: std::string::String,
13343
13344 /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
13345 /// specified ID is the {snapshot_id} of the fully qualified name like
13346 /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
13347 pub snapshot_id: std::string::String,
13348
13349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13350}
13351
13352impl RevertVolumeRequest {
13353 /// Creates a new default instance.
13354 pub fn new() -> Self {
13355 std::default::Default::default()
13356 }
13357
13358 /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
13359 ///
13360 /// # Example
13361 /// ```ignore,no_run
13362 /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13363 /// let x = RevertVolumeRequest::new().set_name("example");
13364 /// ```
13365 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13366 self.name = v.into();
13367 self
13368 }
13369
13370 /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
13371 ///
13372 /// # Example
13373 /// ```ignore,no_run
13374 /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13375 /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
13376 /// ```
13377 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13378 self.snapshot_id = v.into();
13379 self
13380 }
13381}
13382
13383impl wkt::message::Message for RevertVolumeRequest {
13384 fn typename() -> &'static str {
13385 "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
13386 }
13387}
13388
13389/// Volume provides a filesystem that you can mount.
13390#[derive(Clone, Default, PartialEq)]
13391#[non_exhaustive]
13392pub struct Volume {
13393 /// Identifier. Name of the volume
13394 pub name: std::string::String,
13395
13396 /// Output only. State of the volume
13397 pub state: crate::model::volume::State,
13398
13399 /// Output only. State details of the volume
13400 pub state_details: std::string::String,
13401
13402 /// Output only. Create time of the volume
13403 pub create_time: std::option::Option<wkt::Timestamp>,
13404
13405 /// Required. Share name of the volume
13406 pub share_name: std::string::String,
13407
13408 /// Output only. This field is not implemented. The values provided in this
13409 /// field are ignored.
13410 pub psa_range: std::string::String,
13411
13412 /// Required. StoragePool name of the volume
13413 pub storage_pool: std::string::String,
13414
13415 /// Output only. VPC Network name.
13416 /// Format: projects/{project}/global/networks/{network}
13417 pub network: std::string::String,
13418
13419 /// Output only. Service level of the volume
13420 pub service_level: crate::model::ServiceLevel,
13421
13422 /// Required. Capacity in GIB of the volume
13423 pub capacity_gib: i64,
13424
13425 /// Optional. Export policy of the volume
13426 pub export_policy: std::option::Option<crate::model::ExportPolicy>,
13427
13428 /// Required. Protocols required for the volume
13429 pub protocols: std::vec::Vec<crate::model::Protocols>,
13430
13431 /// Optional. SMB share settings for the volume.
13432 pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
13433
13434 /// Output only. Mount options of this volume
13435 pub mount_options: std::vec::Vec<crate::model::MountOption>,
13436
13437 /// Optional. Default unix style permission (e.g. 777) the mount point will be
13438 /// created with. Applicable for NFS protocol types only.
13439 pub unix_permissions: std::string::String,
13440
13441 /// Optional. Labels as key value pairs
13442 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13443
13444 /// Optional. Description of the volume
13445 pub description: std::string::String,
13446
13447 /// Optional. SnapshotPolicy for a volume.
13448 pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
13449
13450 /// Optional. Snap_reserve specifies percentage of volume storage reserved for
13451 /// snapshot storage. Default is 0 percent.
13452 pub snap_reserve: f64,
13453
13454 /// Optional. Snapshot_directory if enabled (true) the volume will contain a
13455 /// read-only .snapshot directory which provides access to each of the volume's
13456 /// snapshots.
13457 pub snapshot_directory: bool,
13458
13459 /// Output only. Used capacity in GIB of the volume. This is computed
13460 /// periodically and it does not represent the realtime usage.
13461 pub used_gib: i64,
13462
13463 /// Optional. Security Style of the Volume
13464 pub security_style: crate::model::SecurityStyle,
13465
13466 /// Optional. Flag indicating if the volume is a kerberos volume or not, export
13467 /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
13468 pub kerberos_enabled: bool,
13469
13470 /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
13471 pub ldap_enabled: bool,
13472
13473 /// Output only. Specifies the ActiveDirectory name of a SMB volume.
13474 pub active_directory: std::string::String,
13475
13476 /// Optional. Specifies the source of the volume to be created from.
13477 pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
13478
13479 /// Output only. Specifies the KMS config to be used for volume encryption.
13480 pub kms_config: std::string::String,
13481
13482 /// Output only. Specified the current volume encryption key source.
13483 pub encryption_type: crate::model::EncryptionType,
13484
13485 /// Output only. Indicates whether the volume is part of a replication
13486 /// relationship.
13487 pub has_replication: bool,
13488
13489 /// BackupConfig of the volume.
13490 pub backup_config: std::option::Option<crate::model::BackupConfig>,
13491
13492 /// Optional. List of actions that are restricted on this volume.
13493 pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
13494
13495 /// Optional. Flag indicating if the volume will be a large capacity volume or
13496 /// a regular volume. This field is used for legacy FILE pools. For Unified
13497 /// pools, use the `large_capacity_config` field instead. This field and
13498 /// `large_capacity_config` are mutually exclusive.
13499 pub large_capacity: bool,
13500
13501 /// Optional. Flag indicating if the volume will have an IP address per node
13502 /// for volumes supporting multiple IP endpoints. Only the volume with
13503 /// large_capacity will be allowed to have multiple endpoints.
13504 pub multiple_endpoints: bool,
13505
13506 /// Tiering policy for the volume.
13507 pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
13508
13509 /// Output only. Specifies the replica zone for regional volume.
13510 pub replica_zone: std::string::String,
13511
13512 /// Output only. Specifies the active zone for regional volume.
13513 pub zone: std::string::String,
13514
13515 /// Output only. Size of the volume cold tier data rounded down to the nearest
13516 /// GiB.
13517 pub cold_tier_size_gib: i64,
13518
13519 /// Optional. The Hybrid Replication parameters for the volume.
13520 pub hybrid_replication_parameters:
13521 std::option::Option<crate::model::HybridReplicationParameters>,
13522
13523 /// Optional. Throughput of the volume (in MiB/s)
13524 pub throughput_mibps: f64,
13525
13526 /// Optional. Cache parameters for the volume.
13527 pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
13528
13529 /// Output only. Total hot tier data rounded down to the nearest GiB used by
13530 /// the Volume. This field is only used for flex Service Level
13531 pub hot_tier_size_used_gib: i64,
13532
13533 /// Optional. Block devices for the volume.
13534 /// Currently, only one block device is permitted per Volume.
13535 pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
13536
13537 /// Optional. Large capacity config for the volume.
13538 /// Enables and configures large capacity for volumes in Unified pools with
13539 /// File protocols. Not applicable for Block protocols in Unified pools.
13540 /// This field and the legacy `large_capacity` boolean field
13541 /// are mutually exclusive.
13542 pub large_capacity_config: std::option::Option<crate::model::LargeCapacityConfig>,
13543
13544 /// Output only. If this volume is a clone, this field contains details about
13545 /// the clone.
13546 pub clone_details: std::option::Option<crate::model::volume::CloneDetails>,
13547
13548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13549}
13550
13551impl Volume {
13552 /// Creates a new default instance.
13553 pub fn new() -> Self {
13554 std::default::Default::default()
13555 }
13556
13557 /// Sets the value of [name][crate::model::Volume::name].
13558 ///
13559 /// # Example
13560 /// ```ignore,no_run
13561 /// # use google_cloud_netapp_v1::model::Volume;
13562 /// let x = Volume::new().set_name("example");
13563 /// ```
13564 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13565 self.name = v.into();
13566 self
13567 }
13568
13569 /// Sets the value of [state][crate::model::Volume::state].
13570 ///
13571 /// # Example
13572 /// ```ignore,no_run
13573 /// # use google_cloud_netapp_v1::model::Volume;
13574 /// use google_cloud_netapp_v1::model::volume::State;
13575 /// let x0 = Volume::new().set_state(State::Ready);
13576 /// let x1 = Volume::new().set_state(State::Creating);
13577 /// let x2 = Volume::new().set_state(State::Deleting);
13578 /// ```
13579 pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
13580 self.state = v.into();
13581 self
13582 }
13583
13584 /// Sets the value of [state_details][crate::model::Volume::state_details].
13585 ///
13586 /// # Example
13587 /// ```ignore,no_run
13588 /// # use google_cloud_netapp_v1::model::Volume;
13589 /// let x = Volume::new().set_state_details("example");
13590 /// ```
13591 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13592 self.state_details = v.into();
13593 self
13594 }
13595
13596 /// Sets the value of [create_time][crate::model::Volume::create_time].
13597 ///
13598 /// # Example
13599 /// ```ignore,no_run
13600 /// # use google_cloud_netapp_v1::model::Volume;
13601 /// use wkt::Timestamp;
13602 /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
13603 /// ```
13604 pub fn set_create_time<T>(mut self, v: T) -> Self
13605 where
13606 T: std::convert::Into<wkt::Timestamp>,
13607 {
13608 self.create_time = std::option::Option::Some(v.into());
13609 self
13610 }
13611
13612 /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
13613 ///
13614 /// # Example
13615 /// ```ignore,no_run
13616 /// # use google_cloud_netapp_v1::model::Volume;
13617 /// use wkt::Timestamp;
13618 /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13619 /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
13620 /// ```
13621 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13622 where
13623 T: std::convert::Into<wkt::Timestamp>,
13624 {
13625 self.create_time = v.map(|x| x.into());
13626 self
13627 }
13628
13629 /// Sets the value of [share_name][crate::model::Volume::share_name].
13630 ///
13631 /// # Example
13632 /// ```ignore,no_run
13633 /// # use google_cloud_netapp_v1::model::Volume;
13634 /// let x = Volume::new().set_share_name("example");
13635 /// ```
13636 pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13637 self.share_name = v.into();
13638 self
13639 }
13640
13641 /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13642 ///
13643 /// # Example
13644 /// ```ignore,no_run
13645 /// # use google_cloud_netapp_v1::model::Volume;
13646 /// let x = Volume::new().set_psa_range("example");
13647 /// ```
13648 pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13649 self.psa_range = v.into();
13650 self
13651 }
13652
13653 /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13654 ///
13655 /// # Example
13656 /// ```ignore,no_run
13657 /// # use google_cloud_netapp_v1::model::Volume;
13658 /// let x = Volume::new().set_storage_pool("example");
13659 /// ```
13660 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13661 self.storage_pool = v.into();
13662 self
13663 }
13664
13665 /// Sets the value of [network][crate::model::Volume::network].
13666 ///
13667 /// # Example
13668 /// ```ignore,no_run
13669 /// # use google_cloud_netapp_v1::model::Volume;
13670 /// let x = Volume::new().set_network("example");
13671 /// ```
13672 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13673 self.network = v.into();
13674 self
13675 }
13676
13677 /// Sets the value of [service_level][crate::model::Volume::service_level].
13678 ///
13679 /// # Example
13680 /// ```ignore,no_run
13681 /// # use google_cloud_netapp_v1::model::Volume;
13682 /// use google_cloud_netapp_v1::model::ServiceLevel;
13683 /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13684 /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13685 /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13686 /// ```
13687 pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13688 mut self,
13689 v: T,
13690 ) -> Self {
13691 self.service_level = v.into();
13692 self
13693 }
13694
13695 /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13696 ///
13697 /// # Example
13698 /// ```ignore,no_run
13699 /// # use google_cloud_netapp_v1::model::Volume;
13700 /// let x = Volume::new().set_capacity_gib(42);
13701 /// ```
13702 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13703 self.capacity_gib = v.into();
13704 self
13705 }
13706
13707 /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13708 ///
13709 /// # Example
13710 /// ```ignore,no_run
13711 /// # use google_cloud_netapp_v1::model::Volume;
13712 /// use google_cloud_netapp_v1::model::ExportPolicy;
13713 /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13714 /// ```
13715 pub fn set_export_policy<T>(mut self, v: T) -> Self
13716 where
13717 T: std::convert::Into<crate::model::ExportPolicy>,
13718 {
13719 self.export_policy = std::option::Option::Some(v.into());
13720 self
13721 }
13722
13723 /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13724 ///
13725 /// # Example
13726 /// ```ignore,no_run
13727 /// # use google_cloud_netapp_v1::model::Volume;
13728 /// use google_cloud_netapp_v1::model::ExportPolicy;
13729 /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13730 /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13731 /// ```
13732 pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13733 where
13734 T: std::convert::Into<crate::model::ExportPolicy>,
13735 {
13736 self.export_policy = v.map(|x| x.into());
13737 self
13738 }
13739
13740 /// Sets the value of [protocols][crate::model::Volume::protocols].
13741 ///
13742 /// # Example
13743 /// ```ignore,no_run
13744 /// # use google_cloud_netapp_v1::model::Volume;
13745 /// use google_cloud_netapp_v1::model::Protocols;
13746 /// let x = Volume::new().set_protocols([
13747 /// Protocols::Nfsv3,
13748 /// Protocols::Nfsv4,
13749 /// Protocols::Smb,
13750 /// ]);
13751 /// ```
13752 pub fn set_protocols<T, V>(mut self, v: T) -> Self
13753 where
13754 T: std::iter::IntoIterator<Item = V>,
13755 V: std::convert::Into<crate::model::Protocols>,
13756 {
13757 use std::iter::Iterator;
13758 self.protocols = v.into_iter().map(|i| i.into()).collect();
13759 self
13760 }
13761
13762 /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13763 ///
13764 /// # Example
13765 /// ```ignore,no_run
13766 /// # use google_cloud_netapp_v1::model::Volume;
13767 /// use google_cloud_netapp_v1::model::SMBSettings;
13768 /// let x = Volume::new().set_smb_settings([
13769 /// SMBSettings::EncryptData,
13770 /// SMBSettings::Browsable,
13771 /// SMBSettings::ChangeNotify,
13772 /// ]);
13773 /// ```
13774 pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
13775 where
13776 T: std::iter::IntoIterator<Item = V>,
13777 V: std::convert::Into<crate::model::SMBSettings>,
13778 {
13779 use std::iter::Iterator;
13780 self.smb_settings = v.into_iter().map(|i| i.into()).collect();
13781 self
13782 }
13783
13784 /// Sets the value of [mount_options][crate::model::Volume::mount_options].
13785 ///
13786 /// # Example
13787 /// ```ignore,no_run
13788 /// # use google_cloud_netapp_v1::model::Volume;
13789 /// use google_cloud_netapp_v1::model::MountOption;
13790 /// let x = Volume::new()
13791 /// .set_mount_options([
13792 /// MountOption::default()/* use setters */,
13793 /// MountOption::default()/* use (different) setters */,
13794 /// ]);
13795 /// ```
13796 pub fn set_mount_options<T, V>(mut self, v: T) -> Self
13797 where
13798 T: std::iter::IntoIterator<Item = V>,
13799 V: std::convert::Into<crate::model::MountOption>,
13800 {
13801 use std::iter::Iterator;
13802 self.mount_options = v.into_iter().map(|i| i.into()).collect();
13803 self
13804 }
13805
13806 /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
13807 ///
13808 /// # Example
13809 /// ```ignore,no_run
13810 /// # use google_cloud_netapp_v1::model::Volume;
13811 /// let x = Volume::new().set_unix_permissions("example");
13812 /// ```
13813 pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
13814 mut self,
13815 v: T,
13816 ) -> Self {
13817 self.unix_permissions = v.into();
13818 self
13819 }
13820
13821 /// Sets the value of [labels][crate::model::Volume::labels].
13822 ///
13823 /// # Example
13824 /// ```ignore,no_run
13825 /// # use google_cloud_netapp_v1::model::Volume;
13826 /// let x = Volume::new().set_labels([
13827 /// ("key0", "abc"),
13828 /// ("key1", "xyz"),
13829 /// ]);
13830 /// ```
13831 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13832 where
13833 T: std::iter::IntoIterator<Item = (K, V)>,
13834 K: std::convert::Into<std::string::String>,
13835 V: std::convert::Into<std::string::String>,
13836 {
13837 use std::iter::Iterator;
13838 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13839 self
13840 }
13841
13842 /// Sets the value of [description][crate::model::Volume::description].
13843 ///
13844 /// # Example
13845 /// ```ignore,no_run
13846 /// # use google_cloud_netapp_v1::model::Volume;
13847 /// let x = Volume::new().set_description("example");
13848 /// ```
13849 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13850 self.description = v.into();
13851 self
13852 }
13853
13854 /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13855 ///
13856 /// # Example
13857 /// ```ignore,no_run
13858 /// # use google_cloud_netapp_v1::model::Volume;
13859 /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13860 /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
13861 /// ```
13862 pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
13863 where
13864 T: std::convert::Into<crate::model::SnapshotPolicy>,
13865 {
13866 self.snapshot_policy = std::option::Option::Some(v.into());
13867 self
13868 }
13869
13870 /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13871 ///
13872 /// # Example
13873 /// ```ignore,no_run
13874 /// # use google_cloud_netapp_v1::model::Volume;
13875 /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13876 /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
13877 /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
13878 /// ```
13879 pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
13880 where
13881 T: std::convert::Into<crate::model::SnapshotPolicy>,
13882 {
13883 self.snapshot_policy = v.map(|x| x.into());
13884 self
13885 }
13886
13887 /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
13888 ///
13889 /// # Example
13890 /// ```ignore,no_run
13891 /// # use google_cloud_netapp_v1::model::Volume;
13892 /// let x = Volume::new().set_snap_reserve(42.0);
13893 /// ```
13894 pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13895 self.snap_reserve = v.into();
13896 self
13897 }
13898
13899 /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
13900 ///
13901 /// # Example
13902 /// ```ignore,no_run
13903 /// # use google_cloud_netapp_v1::model::Volume;
13904 /// let x = Volume::new().set_snapshot_directory(true);
13905 /// ```
13906 pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13907 self.snapshot_directory = v.into();
13908 self
13909 }
13910
13911 /// Sets the value of [used_gib][crate::model::Volume::used_gib].
13912 ///
13913 /// # Example
13914 /// ```ignore,no_run
13915 /// # use google_cloud_netapp_v1::model::Volume;
13916 /// let x = Volume::new().set_used_gib(42);
13917 /// ```
13918 pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13919 self.used_gib = v.into();
13920 self
13921 }
13922
13923 /// Sets the value of [security_style][crate::model::Volume::security_style].
13924 ///
13925 /// # Example
13926 /// ```ignore,no_run
13927 /// # use google_cloud_netapp_v1::model::Volume;
13928 /// use google_cloud_netapp_v1::model::SecurityStyle;
13929 /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
13930 /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
13931 /// ```
13932 pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
13933 mut self,
13934 v: T,
13935 ) -> Self {
13936 self.security_style = v.into();
13937 self
13938 }
13939
13940 /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
13941 ///
13942 /// # Example
13943 /// ```ignore,no_run
13944 /// # use google_cloud_netapp_v1::model::Volume;
13945 /// let x = Volume::new().set_kerberos_enabled(true);
13946 /// ```
13947 pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13948 self.kerberos_enabled = v.into();
13949 self
13950 }
13951
13952 /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
13953 ///
13954 /// # Example
13955 /// ```ignore,no_run
13956 /// # use google_cloud_netapp_v1::model::Volume;
13957 /// let x = Volume::new().set_ldap_enabled(true);
13958 /// ```
13959 pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13960 self.ldap_enabled = v.into();
13961 self
13962 }
13963
13964 /// Sets the value of [active_directory][crate::model::Volume::active_directory].
13965 ///
13966 /// # Example
13967 /// ```ignore,no_run
13968 /// # use google_cloud_netapp_v1::model::Volume;
13969 /// let x = Volume::new().set_active_directory("example");
13970 /// ```
13971 pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
13972 mut self,
13973 v: T,
13974 ) -> Self {
13975 self.active_directory = v.into();
13976 self
13977 }
13978
13979 /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
13980 ///
13981 /// # Example
13982 /// ```ignore,no_run
13983 /// # use google_cloud_netapp_v1::model::Volume;
13984 /// use google_cloud_netapp_v1::model::RestoreParameters;
13985 /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
13986 /// ```
13987 pub fn set_restore_parameters<T>(mut self, v: T) -> Self
13988 where
13989 T: std::convert::Into<crate::model::RestoreParameters>,
13990 {
13991 self.restore_parameters = std::option::Option::Some(v.into());
13992 self
13993 }
13994
13995 /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
13996 ///
13997 /// # Example
13998 /// ```ignore,no_run
13999 /// # use google_cloud_netapp_v1::model::Volume;
14000 /// use google_cloud_netapp_v1::model::RestoreParameters;
14001 /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
14002 /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
14003 /// ```
14004 pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14005 where
14006 T: std::convert::Into<crate::model::RestoreParameters>,
14007 {
14008 self.restore_parameters = v.map(|x| x.into());
14009 self
14010 }
14011
14012 /// Sets the value of [kms_config][crate::model::Volume::kms_config].
14013 ///
14014 /// # Example
14015 /// ```ignore,no_run
14016 /// # use google_cloud_netapp_v1::model::Volume;
14017 /// let x = Volume::new().set_kms_config("example");
14018 /// ```
14019 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14020 self.kms_config = v.into();
14021 self
14022 }
14023
14024 /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
14025 ///
14026 /// # Example
14027 /// ```ignore,no_run
14028 /// # use google_cloud_netapp_v1::model::Volume;
14029 /// use google_cloud_netapp_v1::model::EncryptionType;
14030 /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
14031 /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
14032 /// ```
14033 pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
14034 mut self,
14035 v: T,
14036 ) -> Self {
14037 self.encryption_type = v.into();
14038 self
14039 }
14040
14041 /// Sets the value of [has_replication][crate::model::Volume::has_replication].
14042 ///
14043 /// # Example
14044 /// ```ignore,no_run
14045 /// # use google_cloud_netapp_v1::model::Volume;
14046 /// let x = Volume::new().set_has_replication(true);
14047 /// ```
14048 pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14049 self.has_replication = v.into();
14050 self
14051 }
14052
14053 /// Sets the value of [backup_config][crate::model::Volume::backup_config].
14054 ///
14055 /// # Example
14056 /// ```ignore,no_run
14057 /// # use google_cloud_netapp_v1::model::Volume;
14058 /// use google_cloud_netapp_v1::model::BackupConfig;
14059 /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
14060 /// ```
14061 pub fn set_backup_config<T>(mut self, v: T) -> Self
14062 where
14063 T: std::convert::Into<crate::model::BackupConfig>,
14064 {
14065 self.backup_config = std::option::Option::Some(v.into());
14066 self
14067 }
14068
14069 /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
14070 ///
14071 /// # Example
14072 /// ```ignore,no_run
14073 /// # use google_cloud_netapp_v1::model::Volume;
14074 /// use google_cloud_netapp_v1::model::BackupConfig;
14075 /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
14076 /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
14077 /// ```
14078 pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
14079 where
14080 T: std::convert::Into<crate::model::BackupConfig>,
14081 {
14082 self.backup_config = v.map(|x| x.into());
14083 self
14084 }
14085
14086 /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
14087 ///
14088 /// # Example
14089 /// ```ignore,no_run
14090 /// # use google_cloud_netapp_v1::model::Volume;
14091 /// use google_cloud_netapp_v1::model::RestrictedAction;
14092 /// let x = Volume::new().set_restricted_actions([
14093 /// RestrictedAction::Delete,
14094 /// ]);
14095 /// ```
14096 pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
14097 where
14098 T: std::iter::IntoIterator<Item = V>,
14099 V: std::convert::Into<crate::model::RestrictedAction>,
14100 {
14101 use std::iter::Iterator;
14102 self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
14103 self
14104 }
14105
14106 /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
14107 ///
14108 /// # Example
14109 /// ```ignore,no_run
14110 /// # use google_cloud_netapp_v1::model::Volume;
14111 /// let x = Volume::new().set_large_capacity(true);
14112 /// ```
14113 pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14114 self.large_capacity = v.into();
14115 self
14116 }
14117
14118 /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
14119 ///
14120 /// # Example
14121 /// ```ignore,no_run
14122 /// # use google_cloud_netapp_v1::model::Volume;
14123 /// let x = Volume::new().set_multiple_endpoints(true);
14124 /// ```
14125 pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14126 self.multiple_endpoints = v.into();
14127 self
14128 }
14129
14130 /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
14131 ///
14132 /// # Example
14133 /// ```ignore,no_run
14134 /// # use google_cloud_netapp_v1::model::Volume;
14135 /// use google_cloud_netapp_v1::model::TieringPolicy;
14136 /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
14137 /// ```
14138 pub fn set_tiering_policy<T>(mut self, v: T) -> Self
14139 where
14140 T: std::convert::Into<crate::model::TieringPolicy>,
14141 {
14142 self.tiering_policy = std::option::Option::Some(v.into());
14143 self
14144 }
14145
14146 /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
14147 ///
14148 /// # Example
14149 /// ```ignore,no_run
14150 /// # use google_cloud_netapp_v1::model::Volume;
14151 /// use google_cloud_netapp_v1::model::TieringPolicy;
14152 /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
14153 /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
14154 /// ```
14155 pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
14156 where
14157 T: std::convert::Into<crate::model::TieringPolicy>,
14158 {
14159 self.tiering_policy = v.map(|x| x.into());
14160 self
14161 }
14162
14163 /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
14164 ///
14165 /// # Example
14166 /// ```ignore,no_run
14167 /// # use google_cloud_netapp_v1::model::Volume;
14168 /// let x = Volume::new().set_replica_zone("example");
14169 /// ```
14170 pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14171 self.replica_zone = v.into();
14172 self
14173 }
14174
14175 /// Sets the value of [zone][crate::model::Volume::zone].
14176 ///
14177 /// # Example
14178 /// ```ignore,no_run
14179 /// # use google_cloud_netapp_v1::model::Volume;
14180 /// let x = Volume::new().set_zone("example");
14181 /// ```
14182 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14183 self.zone = v.into();
14184 self
14185 }
14186
14187 /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
14188 ///
14189 /// # Example
14190 /// ```ignore,no_run
14191 /// # use google_cloud_netapp_v1::model::Volume;
14192 /// let x = Volume::new().set_cold_tier_size_gib(42);
14193 /// ```
14194 pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14195 self.cold_tier_size_gib = v.into();
14196 self
14197 }
14198
14199 /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14200 ///
14201 /// # Example
14202 /// ```ignore,no_run
14203 /// # use google_cloud_netapp_v1::model::Volume;
14204 /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14205 /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
14206 /// ```
14207 pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
14208 where
14209 T: std::convert::Into<crate::model::HybridReplicationParameters>,
14210 {
14211 self.hybrid_replication_parameters = std::option::Option::Some(v.into());
14212 self
14213 }
14214
14215 /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14216 ///
14217 /// # Example
14218 /// ```ignore,no_run
14219 /// # use google_cloud_netapp_v1::model::Volume;
14220 /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14221 /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
14222 /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
14223 /// ```
14224 pub fn set_or_clear_hybrid_replication_parameters<T>(
14225 mut self,
14226 v: std::option::Option<T>,
14227 ) -> Self
14228 where
14229 T: std::convert::Into<crate::model::HybridReplicationParameters>,
14230 {
14231 self.hybrid_replication_parameters = v.map(|x| x.into());
14232 self
14233 }
14234
14235 /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
14236 ///
14237 /// # Example
14238 /// ```ignore,no_run
14239 /// # use google_cloud_netapp_v1::model::Volume;
14240 /// let x = Volume::new().set_throughput_mibps(42.0);
14241 /// ```
14242 pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14243 self.throughput_mibps = v.into();
14244 self
14245 }
14246
14247 /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_netapp_v1::model::Volume;
14252 /// use google_cloud_netapp_v1::model::CacheParameters;
14253 /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
14254 /// ```
14255 pub fn set_cache_parameters<T>(mut self, v: T) -> Self
14256 where
14257 T: std::convert::Into<crate::model::CacheParameters>,
14258 {
14259 self.cache_parameters = std::option::Option::Some(v.into());
14260 self
14261 }
14262
14263 /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
14264 ///
14265 /// # Example
14266 /// ```ignore,no_run
14267 /// # use google_cloud_netapp_v1::model::Volume;
14268 /// use google_cloud_netapp_v1::model::CacheParameters;
14269 /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
14270 /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
14271 /// ```
14272 pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14273 where
14274 T: std::convert::Into<crate::model::CacheParameters>,
14275 {
14276 self.cache_parameters = v.map(|x| x.into());
14277 self
14278 }
14279
14280 /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
14281 ///
14282 /// # Example
14283 /// ```ignore,no_run
14284 /// # use google_cloud_netapp_v1::model::Volume;
14285 /// let x = Volume::new().set_hot_tier_size_used_gib(42);
14286 /// ```
14287 pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14288 self.hot_tier_size_used_gib = v.into();
14289 self
14290 }
14291
14292 /// Sets the value of [block_devices][crate::model::Volume::block_devices].
14293 ///
14294 /// # Example
14295 /// ```ignore,no_run
14296 /// # use google_cloud_netapp_v1::model::Volume;
14297 /// use google_cloud_netapp_v1::model::BlockDevice;
14298 /// let x = Volume::new()
14299 /// .set_block_devices([
14300 /// BlockDevice::default()/* use setters */,
14301 /// BlockDevice::default()/* use (different) setters */,
14302 /// ]);
14303 /// ```
14304 pub fn set_block_devices<T, V>(mut self, v: T) -> Self
14305 where
14306 T: std::iter::IntoIterator<Item = V>,
14307 V: std::convert::Into<crate::model::BlockDevice>,
14308 {
14309 use std::iter::Iterator;
14310 self.block_devices = v.into_iter().map(|i| i.into()).collect();
14311 self
14312 }
14313
14314 /// Sets the value of [large_capacity_config][crate::model::Volume::large_capacity_config].
14315 ///
14316 /// # Example
14317 /// ```ignore,no_run
14318 /// # use google_cloud_netapp_v1::model::Volume;
14319 /// use google_cloud_netapp_v1::model::LargeCapacityConfig;
14320 /// let x = Volume::new().set_large_capacity_config(LargeCapacityConfig::default()/* use setters */);
14321 /// ```
14322 pub fn set_large_capacity_config<T>(mut self, v: T) -> Self
14323 where
14324 T: std::convert::Into<crate::model::LargeCapacityConfig>,
14325 {
14326 self.large_capacity_config = std::option::Option::Some(v.into());
14327 self
14328 }
14329
14330 /// Sets or clears the value of [large_capacity_config][crate::model::Volume::large_capacity_config].
14331 ///
14332 /// # Example
14333 /// ```ignore,no_run
14334 /// # use google_cloud_netapp_v1::model::Volume;
14335 /// use google_cloud_netapp_v1::model::LargeCapacityConfig;
14336 /// let x = Volume::new().set_or_clear_large_capacity_config(Some(LargeCapacityConfig::default()/* use setters */));
14337 /// let x = Volume::new().set_or_clear_large_capacity_config(None::<LargeCapacityConfig>);
14338 /// ```
14339 pub fn set_or_clear_large_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
14340 where
14341 T: std::convert::Into<crate::model::LargeCapacityConfig>,
14342 {
14343 self.large_capacity_config = v.map(|x| x.into());
14344 self
14345 }
14346
14347 /// Sets the value of [clone_details][crate::model::Volume::clone_details].
14348 ///
14349 /// # Example
14350 /// ```ignore,no_run
14351 /// # use google_cloud_netapp_v1::model::Volume;
14352 /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14353 /// let x = Volume::new().set_clone_details(CloneDetails::default()/* use setters */);
14354 /// ```
14355 pub fn set_clone_details<T>(mut self, v: T) -> Self
14356 where
14357 T: std::convert::Into<crate::model::volume::CloneDetails>,
14358 {
14359 self.clone_details = std::option::Option::Some(v.into());
14360 self
14361 }
14362
14363 /// Sets or clears the value of [clone_details][crate::model::Volume::clone_details].
14364 ///
14365 /// # Example
14366 /// ```ignore,no_run
14367 /// # use google_cloud_netapp_v1::model::Volume;
14368 /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14369 /// let x = Volume::new().set_or_clear_clone_details(Some(CloneDetails::default()/* use setters */));
14370 /// let x = Volume::new().set_or_clear_clone_details(None::<CloneDetails>);
14371 /// ```
14372 pub fn set_or_clear_clone_details<T>(mut self, v: std::option::Option<T>) -> Self
14373 where
14374 T: std::convert::Into<crate::model::volume::CloneDetails>,
14375 {
14376 self.clone_details = v.map(|x| x.into());
14377 self
14378 }
14379}
14380
14381impl wkt::message::Message for Volume {
14382 fn typename() -> &'static str {
14383 "type.googleapis.com/google.cloud.netapp.v1.Volume"
14384 }
14385}
14386
14387/// Defines additional types related to [Volume].
14388pub mod volume {
14389 #[allow(unused_imports)]
14390 use super::*;
14391
14392 /// Details about a clone volume.
14393 #[derive(Clone, Default, PartialEq)]
14394 #[non_exhaustive]
14395 pub struct CloneDetails {
14396 /// Output only. Specifies the full resource name of the source snapshot from
14397 /// which this volume was cloned. Format:
14398 /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
14399 pub source_snapshot: std::string::String,
14400
14401 /// Output only. Full name of the source volume resource.
14402 /// Format:
14403 /// projects/{project}/locations/{location}/volumes/{volume}
14404 pub source_volume: std::string::String,
14405
14406 /// Output only. Shared space in GiB. Determined at volume creation time
14407 /// based on size of source snapshot.
14408 pub shared_space_gib: i64,
14409
14410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14411 }
14412
14413 impl CloneDetails {
14414 /// Creates a new default instance.
14415 pub fn new() -> Self {
14416 std::default::Default::default()
14417 }
14418
14419 /// Sets the value of [source_snapshot][crate::model::volume::CloneDetails::source_snapshot].
14420 ///
14421 /// # Example
14422 /// ```ignore,no_run
14423 /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14424 /// let x = CloneDetails::new().set_source_snapshot("example");
14425 /// ```
14426 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(
14427 mut self,
14428 v: T,
14429 ) -> Self {
14430 self.source_snapshot = v.into();
14431 self
14432 }
14433
14434 /// Sets the value of [source_volume][crate::model::volume::CloneDetails::source_volume].
14435 ///
14436 /// # Example
14437 /// ```ignore,no_run
14438 /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14439 /// let x = CloneDetails::new().set_source_volume("example");
14440 /// ```
14441 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(
14442 mut self,
14443 v: T,
14444 ) -> Self {
14445 self.source_volume = v.into();
14446 self
14447 }
14448
14449 /// Sets the value of [shared_space_gib][crate::model::volume::CloneDetails::shared_space_gib].
14450 ///
14451 /// # Example
14452 /// ```ignore,no_run
14453 /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14454 /// let x = CloneDetails::new().set_shared_space_gib(42);
14455 /// ```
14456 pub fn set_shared_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14457 self.shared_space_gib = v.into();
14458 self
14459 }
14460 }
14461
14462 impl wkt::message::Message for CloneDetails {
14463 fn typename() -> &'static str {
14464 "type.googleapis.com/google.cloud.netapp.v1.Volume.CloneDetails"
14465 }
14466 }
14467
14468 /// The volume states
14469 ///
14470 /// # Working with unknown values
14471 ///
14472 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14473 /// additional enum variants at any time. Adding new variants is not considered
14474 /// a breaking change. Applications should write their code in anticipation of:
14475 ///
14476 /// - New values appearing in future releases of the client library, **and**
14477 /// - New values received dynamically, without application changes.
14478 ///
14479 /// Please consult the [Working with enums] section in the user guide for some
14480 /// guidelines.
14481 ///
14482 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14483 #[derive(Clone, Debug, PartialEq)]
14484 #[non_exhaustive]
14485 pub enum State {
14486 /// Unspecified Volume State
14487 Unspecified,
14488 /// Volume State is Ready
14489 Ready,
14490 /// Volume State is Creating
14491 Creating,
14492 /// Volume State is Deleting
14493 Deleting,
14494 /// Volume State is Updating
14495 Updating,
14496 /// Volume State is Restoring
14497 Restoring,
14498 /// Volume State is Disabled
14499 Disabled,
14500 /// Volume State is Error
14501 Error,
14502 /// Volume State is Preparing. Note that this is different from CREATING
14503 /// where CREATING means the volume is being created, while PREPARING means
14504 /// the volume is created and now being prepared for the replication.
14505 Preparing,
14506 /// Volume State is Read Only
14507 ReadOnly,
14508 /// If set, the enum was initialized with an unknown value.
14509 ///
14510 /// Applications can examine the value using [State::value] or
14511 /// [State::name].
14512 UnknownValue(state::UnknownValue),
14513 }
14514
14515 #[doc(hidden)]
14516 pub mod state {
14517 #[allow(unused_imports)]
14518 use super::*;
14519 #[derive(Clone, Debug, PartialEq)]
14520 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14521 }
14522
14523 impl State {
14524 /// Gets the enum value.
14525 ///
14526 /// Returns `None` if the enum contains an unknown value deserialized from
14527 /// the string representation of enums.
14528 pub fn value(&self) -> std::option::Option<i32> {
14529 match self {
14530 Self::Unspecified => std::option::Option::Some(0),
14531 Self::Ready => std::option::Option::Some(1),
14532 Self::Creating => std::option::Option::Some(2),
14533 Self::Deleting => std::option::Option::Some(3),
14534 Self::Updating => std::option::Option::Some(4),
14535 Self::Restoring => std::option::Option::Some(5),
14536 Self::Disabled => std::option::Option::Some(6),
14537 Self::Error => std::option::Option::Some(7),
14538 Self::Preparing => std::option::Option::Some(8),
14539 Self::ReadOnly => std::option::Option::Some(9),
14540 Self::UnknownValue(u) => u.0.value(),
14541 }
14542 }
14543
14544 /// Gets the enum value as a string.
14545 ///
14546 /// Returns `None` if the enum contains an unknown value deserialized from
14547 /// the integer representation of enums.
14548 pub fn name(&self) -> std::option::Option<&str> {
14549 match self {
14550 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14551 Self::Ready => std::option::Option::Some("READY"),
14552 Self::Creating => std::option::Option::Some("CREATING"),
14553 Self::Deleting => std::option::Option::Some("DELETING"),
14554 Self::Updating => std::option::Option::Some("UPDATING"),
14555 Self::Restoring => std::option::Option::Some("RESTORING"),
14556 Self::Disabled => std::option::Option::Some("DISABLED"),
14557 Self::Error => std::option::Option::Some("ERROR"),
14558 Self::Preparing => std::option::Option::Some("PREPARING"),
14559 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
14560 Self::UnknownValue(u) => u.0.name(),
14561 }
14562 }
14563 }
14564
14565 impl std::default::Default for State {
14566 fn default() -> Self {
14567 use std::convert::From;
14568 Self::from(0)
14569 }
14570 }
14571
14572 impl std::fmt::Display for State {
14573 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14574 wkt::internal::display_enum(f, self.name(), self.value())
14575 }
14576 }
14577
14578 impl std::convert::From<i32> for State {
14579 fn from(value: i32) -> Self {
14580 match value {
14581 0 => Self::Unspecified,
14582 1 => Self::Ready,
14583 2 => Self::Creating,
14584 3 => Self::Deleting,
14585 4 => Self::Updating,
14586 5 => Self::Restoring,
14587 6 => Self::Disabled,
14588 7 => Self::Error,
14589 8 => Self::Preparing,
14590 9 => Self::ReadOnly,
14591 _ => Self::UnknownValue(state::UnknownValue(
14592 wkt::internal::UnknownEnumValue::Integer(value),
14593 )),
14594 }
14595 }
14596 }
14597
14598 impl std::convert::From<&str> for State {
14599 fn from(value: &str) -> Self {
14600 use std::string::ToString;
14601 match value {
14602 "STATE_UNSPECIFIED" => Self::Unspecified,
14603 "READY" => Self::Ready,
14604 "CREATING" => Self::Creating,
14605 "DELETING" => Self::Deleting,
14606 "UPDATING" => Self::Updating,
14607 "RESTORING" => Self::Restoring,
14608 "DISABLED" => Self::Disabled,
14609 "ERROR" => Self::Error,
14610 "PREPARING" => Self::Preparing,
14611 "READ_ONLY" => Self::ReadOnly,
14612 _ => Self::UnknownValue(state::UnknownValue(
14613 wkt::internal::UnknownEnumValue::String(value.to_string()),
14614 )),
14615 }
14616 }
14617 }
14618
14619 impl serde::ser::Serialize for State {
14620 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14621 where
14622 S: serde::Serializer,
14623 {
14624 match self {
14625 Self::Unspecified => serializer.serialize_i32(0),
14626 Self::Ready => serializer.serialize_i32(1),
14627 Self::Creating => serializer.serialize_i32(2),
14628 Self::Deleting => serializer.serialize_i32(3),
14629 Self::Updating => serializer.serialize_i32(4),
14630 Self::Restoring => serializer.serialize_i32(5),
14631 Self::Disabled => serializer.serialize_i32(6),
14632 Self::Error => serializer.serialize_i32(7),
14633 Self::Preparing => serializer.serialize_i32(8),
14634 Self::ReadOnly => serializer.serialize_i32(9),
14635 Self::UnknownValue(u) => u.0.serialize(serializer),
14636 }
14637 }
14638 }
14639
14640 impl<'de> serde::de::Deserialize<'de> for State {
14641 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14642 where
14643 D: serde::Deserializer<'de>,
14644 {
14645 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14646 ".google.cloud.netapp.v1.Volume.State",
14647 ))
14648 }
14649 }
14650}
14651
14652/// Configuration for a Large Capacity Volume. A Large Capacity Volume
14653/// supports sizes ranging from 4.8 TiB to 20 PiB, it is composed of multiple
14654/// internal constituents, and must be created in a large capacity pool.
14655#[derive(Clone, Default, PartialEq)]
14656#[non_exhaustive]
14657pub struct LargeCapacityConfig {
14658 /// Optional. The number of internal constituents (e.g., FlexVols) for this
14659 /// large volume. The minimum number of constituents is 2.
14660 pub constituent_count: i32,
14661
14662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14663}
14664
14665impl LargeCapacityConfig {
14666 /// Creates a new default instance.
14667 pub fn new() -> Self {
14668 std::default::Default::default()
14669 }
14670
14671 /// Sets the value of [constituent_count][crate::model::LargeCapacityConfig::constituent_count].
14672 ///
14673 /// # Example
14674 /// ```ignore,no_run
14675 /// # use google_cloud_netapp_v1::model::LargeCapacityConfig;
14676 /// let x = LargeCapacityConfig::new().set_constituent_count(42);
14677 /// ```
14678 pub fn set_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14679 self.constituent_count = v.into();
14680 self
14681 }
14682}
14683
14684impl wkt::message::Message for LargeCapacityConfig {
14685 fn typename() -> &'static str {
14686 "type.googleapis.com/google.cloud.netapp.v1.LargeCapacityConfig"
14687 }
14688}
14689
14690/// Defines the export policy for the volume.
14691#[derive(Clone, Default, PartialEq)]
14692#[non_exhaustive]
14693pub struct ExportPolicy {
14694 /// Required. List of export policy rules
14695 pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
14696
14697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14698}
14699
14700impl ExportPolicy {
14701 /// Creates a new default instance.
14702 pub fn new() -> Self {
14703 std::default::Default::default()
14704 }
14705
14706 /// Sets the value of [rules][crate::model::ExportPolicy::rules].
14707 ///
14708 /// # Example
14709 /// ```ignore,no_run
14710 /// # use google_cloud_netapp_v1::model::ExportPolicy;
14711 /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14712 /// let x = ExportPolicy::new()
14713 /// .set_rules([
14714 /// SimpleExportPolicyRule::default()/* use setters */,
14715 /// SimpleExportPolicyRule::default()/* use (different) setters */,
14716 /// ]);
14717 /// ```
14718 pub fn set_rules<T, V>(mut self, v: T) -> Self
14719 where
14720 T: std::iter::IntoIterator<Item = V>,
14721 V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
14722 {
14723 use std::iter::Iterator;
14724 self.rules = v.into_iter().map(|i| i.into()).collect();
14725 self
14726 }
14727}
14728
14729impl wkt::message::Message for ExportPolicy {
14730 fn typename() -> &'static str {
14731 "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
14732 }
14733}
14734
14735/// An export policy rule describing various export options.
14736#[derive(Clone, Default, PartialEq)]
14737#[non_exhaustive]
14738pub struct SimpleExportPolicyRule {
14739 /// Comma separated list of allowed clients IP addresses
14740 pub allowed_clients: std::option::Option<std::string::String>,
14741
14742 /// Whether Unix root access will be granted.
14743 pub has_root_access: std::option::Option<std::string::String>,
14744
14745 /// Access type (ReadWrite, ReadOnly, None)
14746 pub access_type: std::option::Option<crate::model::AccessType>,
14747
14748 /// NFS V3 protocol.
14749 pub nfsv3: std::option::Option<bool>,
14750
14751 /// NFS V4 protocol.
14752 pub nfsv4: std::option::Option<bool>,
14753
14754 /// If enabled (true) the rule defines a read only access for clients matching
14755 /// the 'allowedClients' specification. It enables nfs clients to mount using
14756 /// 'authentication' kerberos security mode.
14757 pub kerberos_5_read_only: std::option::Option<bool>,
14758
14759 /// If enabled (true) the rule defines read and write access for clients
14760 /// matching the 'allowedClients' specification. It enables nfs clients to
14761 /// mount using 'authentication' kerberos security mode. The
14762 /// 'kerberos5ReadOnly' value be ignored if this is enabled.
14763 pub kerberos_5_read_write: std::option::Option<bool>,
14764
14765 /// If enabled (true) the rule defines a read only access for clients matching
14766 /// the 'allowedClients' specification. It enables nfs clients to mount using
14767 /// 'integrity' kerberos security mode.
14768 pub kerberos_5i_read_only: std::option::Option<bool>,
14769
14770 /// If enabled (true) the rule defines read and write access for clients
14771 /// matching the 'allowedClients' specification. It enables nfs clients to
14772 /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
14773 /// value be ignored if this is enabled.
14774 pub kerberos_5i_read_write: std::option::Option<bool>,
14775
14776 /// If enabled (true) the rule defines a read only access for clients matching
14777 /// the 'allowedClients' specification. It enables nfs clients to mount using
14778 /// 'privacy' kerberos security mode.
14779 pub kerberos_5p_read_only: std::option::Option<bool>,
14780
14781 /// If enabled (true) the rule defines read and write access for clients
14782 /// matching the 'allowedClients' specification. It enables nfs clients to
14783 /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
14784 /// value be ignored if this is enabled.
14785 pub kerberos_5p_read_write: std::option::Option<bool>,
14786
14787 /// Optional. Defines how user identity squashing is applied for this export
14788 /// rule. This field is the preferred way to configure squashing behavior and
14789 /// takes precedence over `has_root_access` if both are provided.
14790 pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
14791
14792 /// Optional. An integer representing the anonymous user ID. Range is 0 to
14793 /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
14794 pub anon_uid: std::option::Option<i64>,
14795
14796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14797}
14798
14799impl SimpleExportPolicyRule {
14800 /// Creates a new default instance.
14801 pub fn new() -> Self {
14802 std::default::Default::default()
14803 }
14804
14805 /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14806 ///
14807 /// # Example
14808 /// ```ignore,no_run
14809 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14810 /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
14811 /// ```
14812 pub fn set_allowed_clients<T>(mut self, v: T) -> Self
14813 where
14814 T: std::convert::Into<std::string::String>,
14815 {
14816 self.allowed_clients = std::option::Option::Some(v.into());
14817 self
14818 }
14819
14820 /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14821 ///
14822 /// # Example
14823 /// ```ignore,no_run
14824 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14825 /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
14826 /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
14827 /// ```
14828 pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
14829 where
14830 T: std::convert::Into<std::string::String>,
14831 {
14832 self.allowed_clients = v.map(|x| x.into());
14833 self
14834 }
14835
14836 /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14837 ///
14838 /// # Example
14839 /// ```ignore,no_run
14840 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14841 /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
14842 /// ```
14843 pub fn set_has_root_access<T>(mut self, v: T) -> Self
14844 where
14845 T: std::convert::Into<std::string::String>,
14846 {
14847 self.has_root_access = std::option::Option::Some(v.into());
14848 self
14849 }
14850
14851 /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14852 ///
14853 /// # Example
14854 /// ```ignore,no_run
14855 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14856 /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
14857 /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
14858 /// ```
14859 pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
14860 where
14861 T: std::convert::Into<std::string::String>,
14862 {
14863 self.has_root_access = v.map(|x| x.into());
14864 self
14865 }
14866
14867 /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14868 ///
14869 /// # Example
14870 /// ```ignore,no_run
14871 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14872 /// use google_cloud_netapp_v1::model::AccessType;
14873 /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
14874 /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
14875 /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
14876 /// ```
14877 pub fn set_access_type<T>(mut self, v: T) -> Self
14878 where
14879 T: std::convert::Into<crate::model::AccessType>,
14880 {
14881 self.access_type = std::option::Option::Some(v.into());
14882 self
14883 }
14884
14885 /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14886 ///
14887 /// # Example
14888 /// ```ignore,no_run
14889 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14890 /// use google_cloud_netapp_v1::model::AccessType;
14891 /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
14892 /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
14893 /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
14894 /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
14895 /// ```
14896 pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
14897 where
14898 T: std::convert::Into<crate::model::AccessType>,
14899 {
14900 self.access_type = v.map(|x| x.into());
14901 self
14902 }
14903
14904 /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14905 ///
14906 /// # Example
14907 /// ```ignore,no_run
14908 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14909 /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
14910 /// ```
14911 pub fn set_nfsv3<T>(mut self, v: T) -> Self
14912 where
14913 T: std::convert::Into<bool>,
14914 {
14915 self.nfsv3 = std::option::Option::Some(v.into());
14916 self
14917 }
14918
14919 /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14920 ///
14921 /// # Example
14922 /// ```ignore,no_run
14923 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14924 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
14925 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
14926 /// ```
14927 pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
14928 where
14929 T: std::convert::Into<bool>,
14930 {
14931 self.nfsv3 = v.map(|x| x.into());
14932 self
14933 }
14934
14935 /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14936 ///
14937 /// # Example
14938 /// ```ignore,no_run
14939 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14940 /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
14941 /// ```
14942 pub fn set_nfsv4<T>(mut self, v: T) -> Self
14943 where
14944 T: std::convert::Into<bool>,
14945 {
14946 self.nfsv4 = std::option::Option::Some(v.into());
14947 self
14948 }
14949
14950 /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14951 ///
14952 /// # Example
14953 /// ```ignore,no_run
14954 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14955 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
14956 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
14957 /// ```
14958 pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
14959 where
14960 T: std::convert::Into<bool>,
14961 {
14962 self.nfsv4 = v.map(|x| x.into());
14963 self
14964 }
14965
14966 /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14967 ///
14968 /// # Example
14969 /// ```ignore,no_run
14970 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14971 /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
14972 /// ```
14973 pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
14974 where
14975 T: std::convert::Into<bool>,
14976 {
14977 self.kerberos_5_read_only = std::option::Option::Some(v.into());
14978 self
14979 }
14980
14981 /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14982 ///
14983 /// # Example
14984 /// ```ignore,no_run
14985 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14986 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
14987 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
14988 /// ```
14989 pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14990 where
14991 T: std::convert::Into<bool>,
14992 {
14993 self.kerberos_5_read_only = v.map(|x| x.into());
14994 self
14995 }
14996
14997 /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14998 ///
14999 /// # Example
15000 /// ```ignore,no_run
15001 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15002 /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
15003 /// ```
15004 pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
15005 where
15006 T: std::convert::Into<bool>,
15007 {
15008 self.kerberos_5_read_write = std::option::Option::Some(v.into());
15009 self
15010 }
15011
15012 /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
15013 ///
15014 /// # Example
15015 /// ```ignore,no_run
15016 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15017 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
15018 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
15019 /// ```
15020 pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15021 where
15022 T: std::convert::Into<bool>,
15023 {
15024 self.kerberos_5_read_write = v.map(|x| x.into());
15025 self
15026 }
15027
15028 /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
15029 ///
15030 /// # Example
15031 /// ```ignore,no_run
15032 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15033 /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
15034 /// ```
15035 pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
15036 where
15037 T: std::convert::Into<bool>,
15038 {
15039 self.kerberos_5i_read_only = std::option::Option::Some(v.into());
15040 self
15041 }
15042
15043 /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
15044 ///
15045 /// # Example
15046 /// ```ignore,no_run
15047 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15048 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
15049 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
15050 /// ```
15051 pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15052 where
15053 T: std::convert::Into<bool>,
15054 {
15055 self.kerberos_5i_read_only = v.map(|x| x.into());
15056 self
15057 }
15058
15059 /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
15060 ///
15061 /// # Example
15062 /// ```ignore,no_run
15063 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15064 /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
15065 /// ```
15066 pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
15067 where
15068 T: std::convert::Into<bool>,
15069 {
15070 self.kerberos_5i_read_write = std::option::Option::Some(v.into());
15071 self
15072 }
15073
15074 /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
15075 ///
15076 /// # Example
15077 /// ```ignore,no_run
15078 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15079 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
15080 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
15081 /// ```
15082 pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15083 where
15084 T: std::convert::Into<bool>,
15085 {
15086 self.kerberos_5i_read_write = v.map(|x| x.into());
15087 self
15088 }
15089
15090 /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
15091 ///
15092 /// # Example
15093 /// ```ignore,no_run
15094 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15095 /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
15096 /// ```
15097 pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
15098 where
15099 T: std::convert::Into<bool>,
15100 {
15101 self.kerberos_5p_read_only = std::option::Option::Some(v.into());
15102 self
15103 }
15104
15105 /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
15106 ///
15107 /// # Example
15108 /// ```ignore,no_run
15109 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15110 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
15111 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
15112 /// ```
15113 pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15114 where
15115 T: std::convert::Into<bool>,
15116 {
15117 self.kerberos_5p_read_only = v.map(|x| x.into());
15118 self
15119 }
15120
15121 /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
15122 ///
15123 /// # Example
15124 /// ```ignore,no_run
15125 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15126 /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
15127 /// ```
15128 pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
15129 where
15130 T: std::convert::Into<bool>,
15131 {
15132 self.kerberos_5p_read_write = std::option::Option::Some(v.into());
15133 self
15134 }
15135
15136 /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
15137 ///
15138 /// # Example
15139 /// ```ignore,no_run
15140 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15141 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
15142 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
15143 /// ```
15144 pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15145 where
15146 T: std::convert::Into<bool>,
15147 {
15148 self.kerberos_5p_read_write = v.map(|x| x.into());
15149 self
15150 }
15151
15152 /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
15153 ///
15154 /// # Example
15155 /// ```ignore,no_run
15156 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15157 /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
15158 /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
15159 /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
15160 /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
15161 /// ```
15162 pub fn set_squash_mode<T>(mut self, v: T) -> Self
15163 where
15164 T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
15165 {
15166 self.squash_mode = std::option::Option::Some(v.into());
15167 self
15168 }
15169
15170 /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
15171 ///
15172 /// # Example
15173 /// ```ignore,no_run
15174 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15175 /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
15176 /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
15177 /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
15178 /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
15179 /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
15180 /// ```
15181 pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
15182 where
15183 T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
15184 {
15185 self.squash_mode = v.map(|x| x.into());
15186 self
15187 }
15188
15189 /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15190 ///
15191 /// # Example
15192 /// ```ignore,no_run
15193 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15194 /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
15195 /// ```
15196 pub fn set_anon_uid<T>(mut self, v: T) -> Self
15197 where
15198 T: std::convert::Into<i64>,
15199 {
15200 self.anon_uid = std::option::Option::Some(v.into());
15201 self
15202 }
15203
15204 /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15205 ///
15206 /// # Example
15207 /// ```ignore,no_run
15208 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15209 /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
15210 /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
15211 /// ```
15212 pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
15213 where
15214 T: std::convert::Into<i64>,
15215 {
15216 self.anon_uid = v.map(|x| x.into());
15217 self
15218 }
15219}
15220
15221impl wkt::message::Message for SimpleExportPolicyRule {
15222 fn typename() -> &'static str {
15223 "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
15224 }
15225}
15226
15227/// Defines additional types related to [SimpleExportPolicyRule].
15228pub mod simple_export_policy_rule {
15229 #[allow(unused_imports)]
15230 use super::*;
15231
15232 /// `SquashMode` defines how remote user privileges are restricted when
15233 /// accessing an NFS export. It controls how user identities (like root) are
15234 /// mapped to anonymous users to limit access and enforce security.
15235 ///
15236 /// # Working with unknown values
15237 ///
15238 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15239 /// additional enum variants at any time. Adding new variants is not considered
15240 /// a breaking change. Applications should write their code in anticipation of:
15241 ///
15242 /// - New values appearing in future releases of the client library, **and**
15243 /// - New values received dynamically, without application changes.
15244 ///
15245 /// Please consult the [Working with enums] section in the user guide for some
15246 /// guidelines.
15247 ///
15248 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15249 #[derive(Clone, Debug, PartialEq)]
15250 #[non_exhaustive]
15251 pub enum SquashMode {
15252 /// Defaults to `NO_ROOT_SQUASH`.
15253 Unspecified,
15254 /// The root user (UID 0) retains full access. Other users are
15255 /// unaffected.
15256 NoRootSquash,
15257 /// The root user (UID 0) is squashed to anonymous user ID. Other users are
15258 /// unaffected.
15259 RootSquash,
15260 /// All users are squashed to anonymous user ID.
15261 AllSquash,
15262 /// If set, the enum was initialized with an unknown value.
15263 ///
15264 /// Applications can examine the value using [SquashMode::value] or
15265 /// [SquashMode::name].
15266 UnknownValue(squash_mode::UnknownValue),
15267 }
15268
15269 #[doc(hidden)]
15270 pub mod squash_mode {
15271 #[allow(unused_imports)]
15272 use super::*;
15273 #[derive(Clone, Debug, PartialEq)]
15274 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15275 }
15276
15277 impl SquashMode {
15278 /// Gets the enum value.
15279 ///
15280 /// Returns `None` if the enum contains an unknown value deserialized from
15281 /// the string representation of enums.
15282 pub fn value(&self) -> std::option::Option<i32> {
15283 match self {
15284 Self::Unspecified => std::option::Option::Some(0),
15285 Self::NoRootSquash => std::option::Option::Some(1),
15286 Self::RootSquash => std::option::Option::Some(2),
15287 Self::AllSquash => std::option::Option::Some(3),
15288 Self::UnknownValue(u) => u.0.value(),
15289 }
15290 }
15291
15292 /// Gets the enum value as a string.
15293 ///
15294 /// Returns `None` if the enum contains an unknown value deserialized from
15295 /// the integer representation of enums.
15296 pub fn name(&self) -> std::option::Option<&str> {
15297 match self {
15298 Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
15299 Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
15300 Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
15301 Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
15302 Self::UnknownValue(u) => u.0.name(),
15303 }
15304 }
15305 }
15306
15307 impl std::default::Default for SquashMode {
15308 fn default() -> Self {
15309 use std::convert::From;
15310 Self::from(0)
15311 }
15312 }
15313
15314 impl std::fmt::Display for SquashMode {
15315 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15316 wkt::internal::display_enum(f, self.name(), self.value())
15317 }
15318 }
15319
15320 impl std::convert::From<i32> for SquashMode {
15321 fn from(value: i32) -> Self {
15322 match value {
15323 0 => Self::Unspecified,
15324 1 => Self::NoRootSquash,
15325 2 => Self::RootSquash,
15326 3 => Self::AllSquash,
15327 _ => Self::UnknownValue(squash_mode::UnknownValue(
15328 wkt::internal::UnknownEnumValue::Integer(value),
15329 )),
15330 }
15331 }
15332 }
15333
15334 impl std::convert::From<&str> for SquashMode {
15335 fn from(value: &str) -> Self {
15336 use std::string::ToString;
15337 match value {
15338 "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
15339 "NO_ROOT_SQUASH" => Self::NoRootSquash,
15340 "ROOT_SQUASH" => Self::RootSquash,
15341 "ALL_SQUASH" => Self::AllSquash,
15342 _ => Self::UnknownValue(squash_mode::UnknownValue(
15343 wkt::internal::UnknownEnumValue::String(value.to_string()),
15344 )),
15345 }
15346 }
15347 }
15348
15349 impl serde::ser::Serialize for SquashMode {
15350 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15351 where
15352 S: serde::Serializer,
15353 {
15354 match self {
15355 Self::Unspecified => serializer.serialize_i32(0),
15356 Self::NoRootSquash => serializer.serialize_i32(1),
15357 Self::RootSquash => serializer.serialize_i32(2),
15358 Self::AllSquash => serializer.serialize_i32(3),
15359 Self::UnknownValue(u) => u.0.serialize(serializer),
15360 }
15361 }
15362 }
15363
15364 impl<'de> serde::de::Deserialize<'de> for SquashMode {
15365 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15366 where
15367 D: serde::Deserializer<'de>,
15368 {
15369 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
15370 ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
15371 ))
15372 }
15373 }
15374}
15375
15376/// Snapshot Policy for a volume.
15377#[derive(Clone, Default, PartialEq)]
15378#[non_exhaustive]
15379pub struct SnapshotPolicy {
15380 /// If enabled, make snapshots automatically according to the schedules.
15381 /// Default is false.
15382 pub enabled: std::option::Option<bool>,
15383
15384 /// Hourly schedule policy.
15385 pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
15386
15387 /// Daily schedule policy.
15388 pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
15389
15390 /// Weekly schedule policy.
15391 pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
15392
15393 /// Monthly schedule policy.
15394 pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
15395
15396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15397}
15398
15399impl SnapshotPolicy {
15400 /// Creates a new default instance.
15401 pub fn new() -> Self {
15402 std::default::Default::default()
15403 }
15404
15405 /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
15406 ///
15407 /// # Example
15408 /// ```ignore,no_run
15409 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15410 /// let x = SnapshotPolicy::new().set_enabled(true);
15411 /// ```
15412 pub fn set_enabled<T>(mut self, v: T) -> Self
15413 where
15414 T: std::convert::Into<bool>,
15415 {
15416 self.enabled = std::option::Option::Some(v.into());
15417 self
15418 }
15419
15420 /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
15421 ///
15422 /// # Example
15423 /// ```ignore,no_run
15424 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15425 /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
15426 /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
15427 /// ```
15428 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15429 where
15430 T: std::convert::Into<bool>,
15431 {
15432 self.enabled = v.map(|x| x.into());
15433 self
15434 }
15435
15436 /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15437 ///
15438 /// # Example
15439 /// ```ignore,no_run
15440 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15441 /// use google_cloud_netapp_v1::model::HourlySchedule;
15442 /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
15443 /// ```
15444 pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
15445 where
15446 T: std::convert::Into<crate::model::HourlySchedule>,
15447 {
15448 self.hourly_schedule = std::option::Option::Some(v.into());
15449 self
15450 }
15451
15452 /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15453 ///
15454 /// # Example
15455 /// ```ignore,no_run
15456 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15457 /// use google_cloud_netapp_v1::model::HourlySchedule;
15458 /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
15459 /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
15460 /// ```
15461 pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15462 where
15463 T: std::convert::Into<crate::model::HourlySchedule>,
15464 {
15465 self.hourly_schedule = v.map(|x| x.into());
15466 self
15467 }
15468
15469 /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15470 ///
15471 /// # Example
15472 /// ```ignore,no_run
15473 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15474 /// use google_cloud_netapp_v1::model::DailySchedule;
15475 /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
15476 /// ```
15477 pub fn set_daily_schedule<T>(mut self, v: T) -> Self
15478 where
15479 T: std::convert::Into<crate::model::DailySchedule>,
15480 {
15481 self.daily_schedule = std::option::Option::Some(v.into());
15482 self
15483 }
15484
15485 /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15486 ///
15487 /// # Example
15488 /// ```ignore,no_run
15489 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15490 /// use google_cloud_netapp_v1::model::DailySchedule;
15491 /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
15492 /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
15493 /// ```
15494 pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15495 where
15496 T: std::convert::Into<crate::model::DailySchedule>,
15497 {
15498 self.daily_schedule = v.map(|x| x.into());
15499 self
15500 }
15501
15502 /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15503 ///
15504 /// # Example
15505 /// ```ignore,no_run
15506 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15507 /// use google_cloud_netapp_v1::model::WeeklySchedule;
15508 /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
15509 /// ```
15510 pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
15511 where
15512 T: std::convert::Into<crate::model::WeeklySchedule>,
15513 {
15514 self.weekly_schedule = std::option::Option::Some(v.into());
15515 self
15516 }
15517
15518 /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15519 ///
15520 /// # Example
15521 /// ```ignore,no_run
15522 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15523 /// use google_cloud_netapp_v1::model::WeeklySchedule;
15524 /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
15525 /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
15526 /// ```
15527 pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15528 where
15529 T: std::convert::Into<crate::model::WeeklySchedule>,
15530 {
15531 self.weekly_schedule = v.map(|x| x.into());
15532 self
15533 }
15534
15535 /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15536 ///
15537 /// # Example
15538 /// ```ignore,no_run
15539 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15540 /// use google_cloud_netapp_v1::model::MonthlySchedule;
15541 /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
15542 /// ```
15543 pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
15544 where
15545 T: std::convert::Into<crate::model::MonthlySchedule>,
15546 {
15547 self.monthly_schedule = std::option::Option::Some(v.into());
15548 self
15549 }
15550
15551 /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15552 ///
15553 /// # Example
15554 /// ```ignore,no_run
15555 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15556 /// use google_cloud_netapp_v1::model::MonthlySchedule;
15557 /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
15558 /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
15559 /// ```
15560 pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15561 where
15562 T: std::convert::Into<crate::model::MonthlySchedule>,
15563 {
15564 self.monthly_schedule = v.map(|x| x.into());
15565 self
15566 }
15567}
15568
15569impl wkt::message::Message for SnapshotPolicy {
15570 fn typename() -> &'static str {
15571 "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
15572 }
15573}
15574
15575/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
15576#[derive(Clone, Default, PartialEq)]
15577#[non_exhaustive]
15578pub struct HourlySchedule {
15579 /// The maximum number of Snapshots to keep for the hourly schedule
15580 pub snapshots_to_keep: std::option::Option<f64>,
15581
15582 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15583 /// top of the hour (0).
15584 pub minute: std::option::Option<f64>,
15585
15586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15587}
15588
15589impl HourlySchedule {
15590 /// Creates a new default instance.
15591 pub fn new() -> Self {
15592 std::default::Default::default()
15593 }
15594
15595 /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15596 ///
15597 /// # Example
15598 /// ```ignore,no_run
15599 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15600 /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
15601 /// ```
15602 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15603 where
15604 T: std::convert::Into<f64>,
15605 {
15606 self.snapshots_to_keep = std::option::Option::Some(v.into());
15607 self
15608 }
15609
15610 /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15611 ///
15612 /// # Example
15613 /// ```ignore,no_run
15614 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15615 /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15616 /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15617 /// ```
15618 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15619 where
15620 T: std::convert::Into<f64>,
15621 {
15622 self.snapshots_to_keep = v.map(|x| x.into());
15623 self
15624 }
15625
15626 /// Sets the value of [minute][crate::model::HourlySchedule::minute].
15627 ///
15628 /// # Example
15629 /// ```ignore,no_run
15630 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15631 /// let x = HourlySchedule::new().set_minute(42.0);
15632 /// ```
15633 pub fn set_minute<T>(mut self, v: T) -> Self
15634 where
15635 T: std::convert::Into<f64>,
15636 {
15637 self.minute = std::option::Option::Some(v.into());
15638 self
15639 }
15640
15641 /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
15642 ///
15643 /// # Example
15644 /// ```ignore,no_run
15645 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15646 /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
15647 /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
15648 /// ```
15649 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15650 where
15651 T: std::convert::Into<f64>,
15652 {
15653 self.minute = v.map(|x| x.into());
15654 self
15655 }
15656}
15657
15658impl wkt::message::Message for HourlySchedule {
15659 fn typename() -> &'static str {
15660 "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
15661 }
15662}
15663
15664/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
15665#[derive(Clone, Default, PartialEq)]
15666#[non_exhaustive]
15667pub struct DailySchedule {
15668 /// The maximum number of Snapshots to keep for the hourly schedule
15669 pub snapshots_to_keep: std::option::Option<f64>,
15670
15671 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15672 /// top of the hour (0).
15673 pub minute: std::option::Option<f64>,
15674
15675 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15676 pub hour: std::option::Option<f64>,
15677
15678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15679}
15680
15681impl DailySchedule {
15682 /// Creates a new default instance.
15683 pub fn new() -> Self {
15684 std::default::Default::default()
15685 }
15686
15687 /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15688 ///
15689 /// # Example
15690 /// ```ignore,no_run
15691 /// # use google_cloud_netapp_v1::model::DailySchedule;
15692 /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
15693 /// ```
15694 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15695 where
15696 T: std::convert::Into<f64>,
15697 {
15698 self.snapshots_to_keep = std::option::Option::Some(v.into());
15699 self
15700 }
15701
15702 /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15703 ///
15704 /// # Example
15705 /// ```ignore,no_run
15706 /// # use google_cloud_netapp_v1::model::DailySchedule;
15707 /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15708 /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15709 /// ```
15710 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15711 where
15712 T: std::convert::Into<f64>,
15713 {
15714 self.snapshots_to_keep = v.map(|x| x.into());
15715 self
15716 }
15717
15718 /// Sets the value of [minute][crate::model::DailySchedule::minute].
15719 ///
15720 /// # Example
15721 /// ```ignore,no_run
15722 /// # use google_cloud_netapp_v1::model::DailySchedule;
15723 /// let x = DailySchedule::new().set_minute(42.0);
15724 /// ```
15725 pub fn set_minute<T>(mut self, v: T) -> Self
15726 where
15727 T: std::convert::Into<f64>,
15728 {
15729 self.minute = std::option::Option::Some(v.into());
15730 self
15731 }
15732
15733 /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
15734 ///
15735 /// # Example
15736 /// ```ignore,no_run
15737 /// # use google_cloud_netapp_v1::model::DailySchedule;
15738 /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
15739 /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
15740 /// ```
15741 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15742 where
15743 T: std::convert::Into<f64>,
15744 {
15745 self.minute = v.map(|x| x.into());
15746 self
15747 }
15748
15749 /// Sets the value of [hour][crate::model::DailySchedule::hour].
15750 ///
15751 /// # Example
15752 /// ```ignore,no_run
15753 /// # use google_cloud_netapp_v1::model::DailySchedule;
15754 /// let x = DailySchedule::new().set_hour(42.0);
15755 /// ```
15756 pub fn set_hour<T>(mut self, v: T) -> Self
15757 where
15758 T: std::convert::Into<f64>,
15759 {
15760 self.hour = std::option::Option::Some(v.into());
15761 self
15762 }
15763
15764 /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
15765 ///
15766 /// # Example
15767 /// ```ignore,no_run
15768 /// # use google_cloud_netapp_v1::model::DailySchedule;
15769 /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
15770 /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
15771 /// ```
15772 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15773 where
15774 T: std::convert::Into<f64>,
15775 {
15776 self.hour = v.map(|x| x.into());
15777 self
15778 }
15779}
15780
15781impl wkt::message::Message for DailySchedule {
15782 fn typename() -> &'static str {
15783 "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
15784 }
15785}
15786
15787/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
15788/// 23:50
15789#[derive(Clone, Default, PartialEq)]
15790#[non_exhaustive]
15791pub struct WeeklySchedule {
15792 /// The maximum number of Snapshots to keep for the hourly schedule
15793 pub snapshots_to_keep: std::option::Option<f64>,
15794
15795 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15796 /// top of the hour (0).
15797 pub minute: std::option::Option<f64>,
15798
15799 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15800 pub hour: std::option::Option<f64>,
15801
15802 /// Set the day or days of the week to make a snapshot. Accepts a comma
15803 /// separated days of the week. Defaults to 'Sunday'.
15804 pub day: std::option::Option<std::string::String>,
15805
15806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15807}
15808
15809impl WeeklySchedule {
15810 /// Creates a new default instance.
15811 pub fn new() -> Self {
15812 std::default::Default::default()
15813 }
15814
15815 /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15816 ///
15817 /// # Example
15818 /// ```ignore,no_run
15819 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15820 /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
15821 /// ```
15822 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15823 where
15824 T: std::convert::Into<f64>,
15825 {
15826 self.snapshots_to_keep = std::option::Option::Some(v.into());
15827 self
15828 }
15829
15830 /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15831 ///
15832 /// # Example
15833 /// ```ignore,no_run
15834 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15835 /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15836 /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15837 /// ```
15838 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15839 where
15840 T: std::convert::Into<f64>,
15841 {
15842 self.snapshots_to_keep = v.map(|x| x.into());
15843 self
15844 }
15845
15846 /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
15847 ///
15848 /// # Example
15849 /// ```ignore,no_run
15850 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15851 /// let x = WeeklySchedule::new().set_minute(42.0);
15852 /// ```
15853 pub fn set_minute<T>(mut self, v: T) -> Self
15854 where
15855 T: std::convert::Into<f64>,
15856 {
15857 self.minute = std::option::Option::Some(v.into());
15858 self
15859 }
15860
15861 /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
15862 ///
15863 /// # Example
15864 /// ```ignore,no_run
15865 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15866 /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
15867 /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
15868 /// ```
15869 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15870 where
15871 T: std::convert::Into<f64>,
15872 {
15873 self.minute = v.map(|x| x.into());
15874 self
15875 }
15876
15877 /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
15878 ///
15879 /// # Example
15880 /// ```ignore,no_run
15881 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15882 /// let x = WeeklySchedule::new().set_hour(42.0);
15883 /// ```
15884 pub fn set_hour<T>(mut self, v: T) -> Self
15885 where
15886 T: std::convert::Into<f64>,
15887 {
15888 self.hour = std::option::Option::Some(v.into());
15889 self
15890 }
15891
15892 /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
15893 ///
15894 /// # Example
15895 /// ```ignore,no_run
15896 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15897 /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
15898 /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
15899 /// ```
15900 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15901 where
15902 T: std::convert::Into<f64>,
15903 {
15904 self.hour = v.map(|x| x.into());
15905 self
15906 }
15907
15908 /// Sets the value of [day][crate::model::WeeklySchedule::day].
15909 ///
15910 /// # Example
15911 /// ```ignore,no_run
15912 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15913 /// let x = WeeklySchedule::new().set_day("example");
15914 /// ```
15915 pub fn set_day<T>(mut self, v: T) -> Self
15916 where
15917 T: std::convert::Into<std::string::String>,
15918 {
15919 self.day = std::option::Option::Some(v.into());
15920 self
15921 }
15922
15923 /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
15924 ///
15925 /// # Example
15926 /// ```ignore,no_run
15927 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15928 /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
15929 /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
15930 /// ```
15931 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
15932 where
15933 T: std::convert::Into<std::string::String>,
15934 {
15935 self.day = v.map(|x| x.into());
15936 self
15937 }
15938}
15939
15940impl wkt::message::Message for WeeklySchedule {
15941 fn typename() -> &'static str {
15942 "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
15943 }
15944}
15945
15946/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
15947#[derive(Clone, Default, PartialEq)]
15948#[non_exhaustive]
15949pub struct MonthlySchedule {
15950 /// The maximum number of Snapshots to keep for the hourly schedule
15951 pub snapshots_to_keep: std::option::Option<f64>,
15952
15953 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15954 /// top of the hour (0).
15955 pub minute: std::option::Option<f64>,
15956
15957 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15958 pub hour: std::option::Option<f64>,
15959
15960 /// Set the day or days of the month to make a snapshot (1-31). Accepts a
15961 /// comma separated number of days. Defaults to '1'.
15962 pub days_of_month: std::option::Option<std::string::String>,
15963
15964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15965}
15966
15967impl MonthlySchedule {
15968 /// Creates a new default instance.
15969 pub fn new() -> Self {
15970 std::default::Default::default()
15971 }
15972
15973 /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15974 ///
15975 /// # Example
15976 /// ```ignore,no_run
15977 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15978 /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
15979 /// ```
15980 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15981 where
15982 T: std::convert::Into<f64>,
15983 {
15984 self.snapshots_to_keep = std::option::Option::Some(v.into());
15985 self
15986 }
15987
15988 /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15989 ///
15990 /// # Example
15991 /// ```ignore,no_run
15992 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15993 /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15994 /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15995 /// ```
15996 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15997 where
15998 T: std::convert::Into<f64>,
15999 {
16000 self.snapshots_to_keep = v.map(|x| x.into());
16001 self
16002 }
16003
16004 /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
16005 ///
16006 /// # Example
16007 /// ```ignore,no_run
16008 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16009 /// let x = MonthlySchedule::new().set_minute(42.0);
16010 /// ```
16011 pub fn set_minute<T>(mut self, v: T) -> Self
16012 where
16013 T: std::convert::Into<f64>,
16014 {
16015 self.minute = std::option::Option::Some(v.into());
16016 self
16017 }
16018
16019 /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
16020 ///
16021 /// # Example
16022 /// ```ignore,no_run
16023 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16024 /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
16025 /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
16026 /// ```
16027 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
16028 where
16029 T: std::convert::Into<f64>,
16030 {
16031 self.minute = v.map(|x| x.into());
16032 self
16033 }
16034
16035 /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
16036 ///
16037 /// # Example
16038 /// ```ignore,no_run
16039 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16040 /// let x = MonthlySchedule::new().set_hour(42.0);
16041 /// ```
16042 pub fn set_hour<T>(mut self, v: T) -> Self
16043 where
16044 T: std::convert::Into<f64>,
16045 {
16046 self.hour = std::option::Option::Some(v.into());
16047 self
16048 }
16049
16050 /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
16051 ///
16052 /// # Example
16053 /// ```ignore,no_run
16054 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16055 /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
16056 /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
16057 /// ```
16058 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16059 where
16060 T: std::convert::Into<f64>,
16061 {
16062 self.hour = v.map(|x| x.into());
16063 self
16064 }
16065
16066 /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
16067 ///
16068 /// # Example
16069 /// ```ignore,no_run
16070 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16071 /// let x = MonthlySchedule::new().set_days_of_month("example");
16072 /// ```
16073 pub fn set_days_of_month<T>(mut self, v: T) -> Self
16074 where
16075 T: std::convert::Into<std::string::String>,
16076 {
16077 self.days_of_month = std::option::Option::Some(v.into());
16078 self
16079 }
16080
16081 /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
16082 ///
16083 /// # Example
16084 /// ```ignore,no_run
16085 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16086 /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
16087 /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
16088 /// ```
16089 pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
16090 where
16091 T: std::convert::Into<std::string::String>,
16092 {
16093 self.days_of_month = v.map(|x| x.into());
16094 self
16095 }
16096}
16097
16098impl wkt::message::Message for MonthlySchedule {
16099 fn typename() -> &'static str {
16100 "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
16101 }
16102}
16103
16104/// View only mount options for a volume.
16105#[derive(Clone, Default, PartialEq)]
16106#[non_exhaustive]
16107pub struct MountOption {
16108 /// Export string
16109 pub export: std::string::String,
16110
16111 /// Full export string
16112 pub export_full: std::string::String,
16113
16114 /// Protocol to mount with.
16115 pub protocol: crate::model::Protocols,
16116
16117 /// Instructions for mounting
16118 pub instructions: std::string::String,
16119
16120 /// Output only. IP Address.
16121 pub ip_address: std::string::String,
16122
16123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16124}
16125
16126impl MountOption {
16127 /// Creates a new default instance.
16128 pub fn new() -> Self {
16129 std::default::Default::default()
16130 }
16131
16132 /// Sets the value of [export][crate::model::MountOption::export].
16133 ///
16134 /// # Example
16135 /// ```ignore,no_run
16136 /// # use google_cloud_netapp_v1::model::MountOption;
16137 /// let x = MountOption::new().set_export("example");
16138 /// ```
16139 pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16140 self.export = v.into();
16141 self
16142 }
16143
16144 /// Sets the value of [export_full][crate::model::MountOption::export_full].
16145 ///
16146 /// # Example
16147 /// ```ignore,no_run
16148 /// # use google_cloud_netapp_v1::model::MountOption;
16149 /// let x = MountOption::new().set_export_full("example");
16150 /// ```
16151 pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16152 self.export_full = v.into();
16153 self
16154 }
16155
16156 /// Sets the value of [protocol][crate::model::MountOption::protocol].
16157 ///
16158 /// # Example
16159 /// ```ignore,no_run
16160 /// # use google_cloud_netapp_v1::model::MountOption;
16161 /// use google_cloud_netapp_v1::model::Protocols;
16162 /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
16163 /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
16164 /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
16165 /// ```
16166 pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
16167 self.protocol = v.into();
16168 self
16169 }
16170
16171 /// Sets the value of [instructions][crate::model::MountOption::instructions].
16172 ///
16173 /// # Example
16174 /// ```ignore,no_run
16175 /// # use google_cloud_netapp_v1::model::MountOption;
16176 /// let x = MountOption::new().set_instructions("example");
16177 /// ```
16178 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16179 self.instructions = v.into();
16180 self
16181 }
16182
16183 /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
16184 ///
16185 /// # Example
16186 /// ```ignore,no_run
16187 /// # use google_cloud_netapp_v1::model::MountOption;
16188 /// let x = MountOption::new().set_ip_address("example");
16189 /// ```
16190 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16191 self.ip_address = v.into();
16192 self
16193 }
16194}
16195
16196impl wkt::message::Message for MountOption {
16197 fn typename() -> &'static str {
16198 "type.googleapis.com/google.cloud.netapp.v1.MountOption"
16199 }
16200}
16201
16202/// The RestoreParameters if volume is created from a snapshot or backup.
16203#[derive(Clone, Default, PartialEq)]
16204#[non_exhaustive]
16205pub struct RestoreParameters {
16206 /// The source that the volume is created from.
16207 pub source: std::option::Option<crate::model::restore_parameters::Source>,
16208
16209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16210}
16211
16212impl RestoreParameters {
16213 /// Creates a new default instance.
16214 pub fn new() -> Self {
16215 std::default::Default::default()
16216 }
16217
16218 /// Sets the value of [source][crate::model::RestoreParameters::source].
16219 ///
16220 /// Note that all the setters affecting `source` are mutually
16221 /// exclusive.
16222 ///
16223 /// # Example
16224 /// ```ignore,no_run
16225 /// # use google_cloud_netapp_v1::model::RestoreParameters;
16226 /// use google_cloud_netapp_v1::model::restore_parameters::Source;
16227 /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
16228 /// ```
16229 pub fn set_source<
16230 T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
16231 >(
16232 mut self,
16233 v: T,
16234 ) -> Self {
16235 self.source = v.into();
16236 self
16237 }
16238
16239 /// The value of [source][crate::model::RestoreParameters::source]
16240 /// if it holds a `SourceSnapshot`, `None` if the field is not set or
16241 /// holds a different branch.
16242 pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
16243 #[allow(unreachable_patterns)]
16244 self.source.as_ref().and_then(|v| match v {
16245 crate::model::restore_parameters::Source::SourceSnapshot(v) => {
16246 std::option::Option::Some(v)
16247 }
16248 _ => std::option::Option::None,
16249 })
16250 }
16251
16252 /// Sets the value of [source][crate::model::RestoreParameters::source]
16253 /// to hold a `SourceSnapshot`.
16254 ///
16255 /// Note that all the setters affecting `source` are
16256 /// mutually exclusive.
16257 ///
16258 /// # Example
16259 /// ```ignore,no_run
16260 /// # use google_cloud_netapp_v1::model::RestoreParameters;
16261 /// let x = RestoreParameters::new().set_source_snapshot("example");
16262 /// assert!(x.source_snapshot().is_some());
16263 /// assert!(x.source_backup().is_none());
16264 /// ```
16265 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16266 self.source = std::option::Option::Some(
16267 crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
16268 );
16269 self
16270 }
16271
16272 /// The value of [source][crate::model::RestoreParameters::source]
16273 /// if it holds a `SourceBackup`, `None` if the field is not set or
16274 /// holds a different branch.
16275 pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
16276 #[allow(unreachable_patterns)]
16277 self.source.as_ref().and_then(|v| match v {
16278 crate::model::restore_parameters::Source::SourceBackup(v) => {
16279 std::option::Option::Some(v)
16280 }
16281 _ => std::option::Option::None,
16282 })
16283 }
16284
16285 /// Sets the value of [source][crate::model::RestoreParameters::source]
16286 /// to hold a `SourceBackup`.
16287 ///
16288 /// Note that all the setters affecting `source` are
16289 /// mutually exclusive.
16290 ///
16291 /// # Example
16292 /// ```ignore,no_run
16293 /// # use google_cloud_netapp_v1::model::RestoreParameters;
16294 /// let x = RestoreParameters::new().set_source_backup("example");
16295 /// assert!(x.source_backup().is_some());
16296 /// assert!(x.source_snapshot().is_none());
16297 /// ```
16298 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16299 self.source = std::option::Option::Some(
16300 crate::model::restore_parameters::Source::SourceBackup(v.into()),
16301 );
16302 self
16303 }
16304}
16305
16306impl wkt::message::Message for RestoreParameters {
16307 fn typename() -> &'static str {
16308 "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
16309 }
16310}
16311
16312/// Defines additional types related to [RestoreParameters].
16313pub mod restore_parameters {
16314 #[allow(unused_imports)]
16315 use super::*;
16316
16317 /// The source that the volume is created from.
16318 #[derive(Clone, Debug, PartialEq)]
16319 #[non_exhaustive]
16320 pub enum Source {
16321 /// Full name of the snapshot resource.
16322 /// Format:
16323 /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
16324 SourceSnapshot(std::string::String),
16325 /// Full name of the backup resource.
16326 /// Format for standard backup:
16327 /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
16328 /// Format for BackupDR backup:
16329 /// projects/{project}/locations/{location}/backupVaults/{backup_vault}/dataSources/{data_source}/backups/{backup}
16330 SourceBackup(std::string::String),
16331 }
16332}
16333
16334/// BackupConfig contains backup related config on a volume.
16335#[derive(Clone, Default, PartialEq)]
16336#[non_exhaustive]
16337pub struct BackupConfig {
16338 /// Optional. When specified, schedule backups will be created based on the
16339 /// policy configuration.
16340 pub backup_policies: std::vec::Vec<std::string::String>,
16341
16342 /// Optional. Name of backup vault.
16343 /// Format:
16344 /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
16345 pub backup_vault: std::string::String,
16346
16347 /// Optional. When set to true, scheduled backup is enabled on the volume.
16348 /// This field should be nil when there's no backup policy attached.
16349 pub scheduled_backup_enabled: std::option::Option<bool>,
16350
16351 /// Output only. Total size of all backups in a chain in bytes = baseline
16352 /// backup size + sum(incremental backup size).
16353 pub backup_chain_bytes: std::option::Option<i64>,
16354
16355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16356}
16357
16358impl BackupConfig {
16359 /// Creates a new default instance.
16360 pub fn new() -> Self {
16361 std::default::Default::default()
16362 }
16363
16364 /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
16365 ///
16366 /// # Example
16367 /// ```ignore,no_run
16368 /// # use google_cloud_netapp_v1::model::BackupConfig;
16369 /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
16370 /// ```
16371 pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
16372 where
16373 T: std::iter::IntoIterator<Item = V>,
16374 V: std::convert::Into<std::string::String>,
16375 {
16376 use std::iter::Iterator;
16377 self.backup_policies = v.into_iter().map(|i| i.into()).collect();
16378 self
16379 }
16380
16381 /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
16382 ///
16383 /// # Example
16384 /// ```ignore,no_run
16385 /// # use google_cloud_netapp_v1::model::BackupConfig;
16386 /// let x = BackupConfig::new().set_backup_vault("example");
16387 /// ```
16388 pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16389 self.backup_vault = v.into();
16390 self
16391 }
16392
16393 /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16394 ///
16395 /// # Example
16396 /// ```ignore,no_run
16397 /// # use google_cloud_netapp_v1::model::BackupConfig;
16398 /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
16399 /// ```
16400 pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
16401 where
16402 T: std::convert::Into<bool>,
16403 {
16404 self.scheduled_backup_enabled = std::option::Option::Some(v.into());
16405 self
16406 }
16407
16408 /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16409 ///
16410 /// # Example
16411 /// ```ignore,no_run
16412 /// # use google_cloud_netapp_v1::model::BackupConfig;
16413 /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
16414 /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
16415 /// ```
16416 pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16417 where
16418 T: std::convert::Into<bool>,
16419 {
16420 self.scheduled_backup_enabled = v.map(|x| x.into());
16421 self
16422 }
16423
16424 /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16425 ///
16426 /// # Example
16427 /// ```ignore,no_run
16428 /// # use google_cloud_netapp_v1::model::BackupConfig;
16429 /// let x = BackupConfig::new().set_backup_chain_bytes(42);
16430 /// ```
16431 pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
16432 where
16433 T: std::convert::Into<i64>,
16434 {
16435 self.backup_chain_bytes = std::option::Option::Some(v.into());
16436 self
16437 }
16438
16439 /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16440 ///
16441 /// # Example
16442 /// ```ignore,no_run
16443 /// # use google_cloud_netapp_v1::model::BackupConfig;
16444 /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
16445 /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
16446 /// ```
16447 pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
16448 where
16449 T: std::convert::Into<i64>,
16450 {
16451 self.backup_chain_bytes = v.map(|x| x.into());
16452 self
16453 }
16454}
16455
16456impl wkt::message::Message for BackupConfig {
16457 fn typename() -> &'static str {
16458 "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
16459 }
16460}
16461
16462/// Defines tiering policy for the volume.
16463#[derive(Clone, Default, PartialEq)]
16464#[non_exhaustive]
16465pub struct TieringPolicy {
16466 /// Optional. Flag indicating if the volume has tiering policy enable/pause.
16467 /// Default is PAUSED.
16468 pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
16469
16470 /// Optional. Time in days to mark the volume's data block as cold and make it
16471 /// eligible for tiering, can be range from 2-183. Default is 31.
16472 pub cooling_threshold_days: std::option::Option<i32>,
16473
16474 /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
16475 /// is false. This is only applicable to Flex service level.
16476 pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
16477
16478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16479}
16480
16481impl TieringPolicy {
16482 /// Creates a new default instance.
16483 pub fn new() -> Self {
16484 std::default::Default::default()
16485 }
16486
16487 /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
16488 ///
16489 /// # Example
16490 /// ```ignore,no_run
16491 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16492 /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16493 /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
16494 /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
16495 /// ```
16496 pub fn set_tier_action<T>(mut self, v: T) -> Self
16497 where
16498 T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16499 {
16500 self.tier_action = std::option::Option::Some(v.into());
16501 self
16502 }
16503
16504 /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
16505 ///
16506 /// # Example
16507 /// ```ignore,no_run
16508 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16509 /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16510 /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
16511 /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
16512 /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
16513 /// ```
16514 pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
16515 where
16516 T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16517 {
16518 self.tier_action = v.map(|x| x.into());
16519 self
16520 }
16521
16522 /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16523 ///
16524 /// # Example
16525 /// ```ignore,no_run
16526 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16527 /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
16528 /// ```
16529 pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
16530 where
16531 T: std::convert::Into<i32>,
16532 {
16533 self.cooling_threshold_days = std::option::Option::Some(v.into());
16534 self
16535 }
16536
16537 /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16538 ///
16539 /// # Example
16540 /// ```ignore,no_run
16541 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16542 /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
16543 /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
16544 /// ```
16545 pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
16546 where
16547 T: std::convert::Into<i32>,
16548 {
16549 self.cooling_threshold_days = v.map(|x| x.into());
16550 self
16551 }
16552
16553 /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16554 ///
16555 /// # Example
16556 /// ```ignore,no_run
16557 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16558 /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
16559 /// ```
16560 pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
16561 where
16562 T: std::convert::Into<bool>,
16563 {
16564 self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
16565 self
16566 }
16567
16568 /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16569 ///
16570 /// # Example
16571 /// ```ignore,no_run
16572 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16573 /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
16574 /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
16575 /// ```
16576 pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16577 where
16578 T: std::convert::Into<bool>,
16579 {
16580 self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
16581 self
16582 }
16583}
16584
16585impl wkt::message::Message for TieringPolicy {
16586 fn typename() -> &'static str {
16587 "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
16588 }
16589}
16590
16591/// Defines additional types related to [TieringPolicy].
16592pub mod tiering_policy {
16593 #[allow(unused_imports)]
16594 use super::*;
16595
16596 /// Tier action for the volume.
16597 ///
16598 /// # Working with unknown values
16599 ///
16600 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16601 /// additional enum variants at any time. Adding new variants is not considered
16602 /// a breaking change. Applications should write their code in anticipation of:
16603 ///
16604 /// - New values appearing in future releases of the client library, **and**
16605 /// - New values received dynamically, without application changes.
16606 ///
16607 /// Please consult the [Working with enums] section in the user guide for some
16608 /// guidelines.
16609 ///
16610 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16611 #[derive(Clone, Debug, PartialEq)]
16612 #[non_exhaustive]
16613 pub enum TierAction {
16614 /// Unspecified.
16615 Unspecified,
16616 /// When tiering is enabled, new cold data will be tiered.
16617 Enabled,
16618 /// When paused, tiering won't be performed on new data. Existing data stays
16619 /// tiered until accessed.
16620 Paused,
16621 /// If set, the enum was initialized with an unknown value.
16622 ///
16623 /// Applications can examine the value using [TierAction::value] or
16624 /// [TierAction::name].
16625 UnknownValue(tier_action::UnknownValue),
16626 }
16627
16628 #[doc(hidden)]
16629 pub mod tier_action {
16630 #[allow(unused_imports)]
16631 use super::*;
16632 #[derive(Clone, Debug, PartialEq)]
16633 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16634 }
16635
16636 impl TierAction {
16637 /// Gets the enum value.
16638 ///
16639 /// Returns `None` if the enum contains an unknown value deserialized from
16640 /// the string representation of enums.
16641 pub fn value(&self) -> std::option::Option<i32> {
16642 match self {
16643 Self::Unspecified => std::option::Option::Some(0),
16644 Self::Enabled => std::option::Option::Some(1),
16645 Self::Paused => std::option::Option::Some(2),
16646 Self::UnknownValue(u) => u.0.value(),
16647 }
16648 }
16649
16650 /// Gets the enum value as a string.
16651 ///
16652 /// Returns `None` if the enum contains an unknown value deserialized from
16653 /// the integer representation of enums.
16654 pub fn name(&self) -> std::option::Option<&str> {
16655 match self {
16656 Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
16657 Self::Enabled => std::option::Option::Some("ENABLED"),
16658 Self::Paused => std::option::Option::Some("PAUSED"),
16659 Self::UnknownValue(u) => u.0.name(),
16660 }
16661 }
16662 }
16663
16664 impl std::default::Default for TierAction {
16665 fn default() -> Self {
16666 use std::convert::From;
16667 Self::from(0)
16668 }
16669 }
16670
16671 impl std::fmt::Display for TierAction {
16672 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16673 wkt::internal::display_enum(f, self.name(), self.value())
16674 }
16675 }
16676
16677 impl std::convert::From<i32> for TierAction {
16678 fn from(value: i32) -> Self {
16679 match value {
16680 0 => Self::Unspecified,
16681 1 => Self::Enabled,
16682 2 => Self::Paused,
16683 _ => Self::UnknownValue(tier_action::UnknownValue(
16684 wkt::internal::UnknownEnumValue::Integer(value),
16685 )),
16686 }
16687 }
16688 }
16689
16690 impl std::convert::From<&str> for TierAction {
16691 fn from(value: &str) -> Self {
16692 use std::string::ToString;
16693 match value {
16694 "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
16695 "ENABLED" => Self::Enabled,
16696 "PAUSED" => Self::Paused,
16697 _ => Self::UnknownValue(tier_action::UnknownValue(
16698 wkt::internal::UnknownEnumValue::String(value.to_string()),
16699 )),
16700 }
16701 }
16702 }
16703
16704 impl serde::ser::Serialize for TierAction {
16705 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16706 where
16707 S: serde::Serializer,
16708 {
16709 match self {
16710 Self::Unspecified => serializer.serialize_i32(0),
16711 Self::Enabled => serializer.serialize_i32(1),
16712 Self::Paused => serializer.serialize_i32(2),
16713 Self::UnknownValue(u) => u.0.serialize(serializer),
16714 }
16715 }
16716 }
16717
16718 impl<'de> serde::de::Deserialize<'de> for TierAction {
16719 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16720 where
16721 D: serde::Deserializer<'de>,
16722 {
16723 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
16724 ".google.cloud.netapp.v1.TieringPolicy.TierAction",
16725 ))
16726 }
16727 }
16728}
16729
16730/// The Hybrid Replication parameters for the volume.
16731#[derive(Clone, Default, PartialEq)]
16732#[non_exhaustive]
16733pub struct HybridReplicationParameters {
16734 /// Required. Desired name for the replication of this volume.
16735 pub replication: std::string::String,
16736
16737 /// Required. Name of the user's local source volume to be peered with the
16738 /// destination volume.
16739 pub peer_volume_name: std::string::String,
16740
16741 /// Required. Name of the user's local source cluster to be peered with the
16742 /// destination cluster.
16743 pub peer_cluster_name: std::string::String,
16744
16745 /// Required. Name of the user's local source vserver svm to be peered with the
16746 /// destination vserver svm.
16747 pub peer_svm_name: std::string::String,
16748
16749 /// Required. List of node ip addresses to be peered with.
16750 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
16751
16752 /// Optional. Name of source cluster location associated with the Hybrid
16753 /// replication. This is a free-form field for the display purpose only.
16754 pub cluster_location: std::string::String,
16755
16756 /// Optional. Description of the replication.
16757 pub description: std::string::String,
16758
16759 /// Optional. Labels to be added to the replication as the key value pairs.
16760 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16761
16762 /// Optional. Replication Schedule for the replication created.
16763 pub replication_schedule: crate::model::HybridReplicationSchedule,
16764
16765 /// Optional. Type of the hybrid replication.
16766 pub hybrid_replication_type:
16767 crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16768
16769 /// Optional. Constituent volume count for large volume.
16770 pub large_volume_constituent_count: i32,
16771
16772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16773}
16774
16775impl HybridReplicationParameters {
16776 /// Creates a new default instance.
16777 pub fn new() -> Self {
16778 std::default::Default::default()
16779 }
16780
16781 /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
16782 ///
16783 /// # Example
16784 /// ```ignore,no_run
16785 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16786 /// let x = HybridReplicationParameters::new().set_replication("example");
16787 /// ```
16788 pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16789 self.replication = v.into();
16790 self
16791 }
16792
16793 /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
16794 ///
16795 /// # Example
16796 /// ```ignore,no_run
16797 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16798 /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
16799 /// ```
16800 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
16801 mut self,
16802 v: T,
16803 ) -> Self {
16804 self.peer_volume_name = v.into();
16805 self
16806 }
16807
16808 /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
16809 ///
16810 /// # Example
16811 /// ```ignore,no_run
16812 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16813 /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
16814 /// ```
16815 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
16816 mut self,
16817 v: T,
16818 ) -> Self {
16819 self.peer_cluster_name = v.into();
16820 self
16821 }
16822
16823 /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
16824 ///
16825 /// # Example
16826 /// ```ignore,no_run
16827 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16828 /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
16829 /// ```
16830 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16831 self.peer_svm_name = v.into();
16832 self
16833 }
16834
16835 /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
16836 ///
16837 /// # Example
16838 /// ```ignore,no_run
16839 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16840 /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16841 /// ```
16842 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16843 where
16844 T: std::iter::IntoIterator<Item = V>,
16845 V: std::convert::Into<std::string::String>,
16846 {
16847 use std::iter::Iterator;
16848 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16849 self
16850 }
16851
16852 /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
16853 ///
16854 /// # Example
16855 /// ```ignore,no_run
16856 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16857 /// let x = HybridReplicationParameters::new().set_cluster_location("example");
16858 /// ```
16859 pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
16860 mut self,
16861 v: T,
16862 ) -> Self {
16863 self.cluster_location = v.into();
16864 self
16865 }
16866
16867 /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
16868 ///
16869 /// # Example
16870 /// ```ignore,no_run
16871 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16872 /// let x = HybridReplicationParameters::new().set_description("example");
16873 /// ```
16874 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16875 self.description = v.into();
16876 self
16877 }
16878
16879 /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
16880 ///
16881 /// # Example
16882 /// ```ignore,no_run
16883 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16884 /// let x = HybridReplicationParameters::new().set_labels([
16885 /// ("key0", "abc"),
16886 /// ("key1", "xyz"),
16887 /// ]);
16888 /// ```
16889 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16890 where
16891 T: std::iter::IntoIterator<Item = (K, V)>,
16892 K: std::convert::Into<std::string::String>,
16893 V: std::convert::Into<std::string::String>,
16894 {
16895 use std::iter::Iterator;
16896 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16897 self
16898 }
16899
16900 /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
16901 ///
16902 /// # Example
16903 /// ```ignore,no_run
16904 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16905 /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
16906 /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
16907 /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
16908 /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
16909 /// ```
16910 pub fn set_replication_schedule<
16911 T: std::convert::Into<crate::model::HybridReplicationSchedule>,
16912 >(
16913 mut self,
16914 v: T,
16915 ) -> Self {
16916 self.replication_schedule = v.into();
16917 self
16918 }
16919
16920 /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
16921 ///
16922 /// # Example
16923 /// ```ignore,no_run
16924 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16925 /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
16926 /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
16927 /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
16928 /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
16929 /// ```
16930 pub fn set_hybrid_replication_type<
16931 T: std::convert::Into<
16932 crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16933 >,
16934 >(
16935 mut self,
16936 v: T,
16937 ) -> Self {
16938 self.hybrid_replication_type = v.into();
16939 self
16940 }
16941
16942 /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
16943 ///
16944 /// # Example
16945 /// ```ignore,no_run
16946 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16947 /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
16948 /// ```
16949 pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16950 self.large_volume_constituent_count = v.into();
16951 self
16952 }
16953}
16954
16955impl wkt::message::Message for HybridReplicationParameters {
16956 fn typename() -> &'static str {
16957 "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
16958 }
16959}
16960
16961/// Defines additional types related to [HybridReplicationParameters].
16962pub mod hybrid_replication_parameters {
16963 #[allow(unused_imports)]
16964 use super::*;
16965
16966 /// Type of the volume's hybrid replication.
16967 ///
16968 /// # Working with unknown values
16969 ///
16970 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16971 /// additional enum variants at any time. Adding new variants is not considered
16972 /// a breaking change. Applications should write their code in anticipation of:
16973 ///
16974 /// - New values appearing in future releases of the client library, **and**
16975 /// - New values received dynamically, without application changes.
16976 ///
16977 /// Please consult the [Working with enums] section in the user guide for some
16978 /// guidelines.
16979 ///
16980 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16981 #[derive(Clone, Debug, PartialEq)]
16982 #[non_exhaustive]
16983 pub enum VolumeHybridReplicationType {
16984 /// Unspecified hybrid replication type.
16985 Unspecified,
16986 /// Hybrid replication type for migration.
16987 Migration,
16988 /// Hybrid replication type for continuous replication.
16989 ContinuousReplication,
16990 /// New field for reversible OnPrem replication, to be used for data
16991 /// protection.
16992 OnpremReplication,
16993 /// New field for reversible OnPrem replication, to be used for data
16994 /// protection.
16995 ReverseOnpremReplication,
16996 /// If set, the enum was initialized with an unknown value.
16997 ///
16998 /// Applications can examine the value using [VolumeHybridReplicationType::value] or
16999 /// [VolumeHybridReplicationType::name].
17000 UnknownValue(volume_hybrid_replication_type::UnknownValue),
17001 }
17002
17003 #[doc(hidden)]
17004 pub mod volume_hybrid_replication_type {
17005 #[allow(unused_imports)]
17006 use super::*;
17007 #[derive(Clone, Debug, PartialEq)]
17008 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17009 }
17010
17011 impl VolumeHybridReplicationType {
17012 /// Gets the enum value.
17013 ///
17014 /// Returns `None` if the enum contains an unknown value deserialized from
17015 /// the string representation of enums.
17016 pub fn value(&self) -> std::option::Option<i32> {
17017 match self {
17018 Self::Unspecified => std::option::Option::Some(0),
17019 Self::Migration => std::option::Option::Some(1),
17020 Self::ContinuousReplication => std::option::Option::Some(2),
17021 Self::OnpremReplication => std::option::Option::Some(3),
17022 Self::ReverseOnpremReplication => std::option::Option::Some(4),
17023 Self::UnknownValue(u) => u.0.value(),
17024 }
17025 }
17026
17027 /// Gets the enum value as a string.
17028 ///
17029 /// Returns `None` if the enum contains an unknown value deserialized from
17030 /// the integer representation of enums.
17031 pub fn name(&self) -> std::option::Option<&str> {
17032 match self {
17033 Self::Unspecified => {
17034 std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
17035 }
17036 Self::Migration => std::option::Option::Some("MIGRATION"),
17037 Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
17038 Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
17039 Self::ReverseOnpremReplication => {
17040 std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
17041 }
17042 Self::UnknownValue(u) => u.0.name(),
17043 }
17044 }
17045 }
17046
17047 impl std::default::Default for VolumeHybridReplicationType {
17048 fn default() -> Self {
17049 use std::convert::From;
17050 Self::from(0)
17051 }
17052 }
17053
17054 impl std::fmt::Display for VolumeHybridReplicationType {
17055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17056 wkt::internal::display_enum(f, self.name(), self.value())
17057 }
17058 }
17059
17060 impl std::convert::From<i32> for VolumeHybridReplicationType {
17061 fn from(value: i32) -> Self {
17062 match value {
17063 0 => Self::Unspecified,
17064 1 => Self::Migration,
17065 2 => Self::ContinuousReplication,
17066 3 => Self::OnpremReplication,
17067 4 => Self::ReverseOnpremReplication,
17068 _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
17069 wkt::internal::UnknownEnumValue::Integer(value),
17070 )),
17071 }
17072 }
17073 }
17074
17075 impl std::convert::From<&str> for VolumeHybridReplicationType {
17076 fn from(value: &str) -> Self {
17077 use std::string::ToString;
17078 match value {
17079 "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
17080 "MIGRATION" => Self::Migration,
17081 "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
17082 "ONPREM_REPLICATION" => Self::OnpremReplication,
17083 "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
17084 _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
17085 wkt::internal::UnknownEnumValue::String(value.to_string()),
17086 )),
17087 }
17088 }
17089 }
17090
17091 impl serde::ser::Serialize for VolumeHybridReplicationType {
17092 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17093 where
17094 S: serde::Serializer,
17095 {
17096 match self {
17097 Self::Unspecified => serializer.serialize_i32(0),
17098 Self::Migration => serializer.serialize_i32(1),
17099 Self::ContinuousReplication => serializer.serialize_i32(2),
17100 Self::OnpremReplication => serializer.serialize_i32(3),
17101 Self::ReverseOnpremReplication => serializer.serialize_i32(4),
17102 Self::UnknownValue(u) => u.0.serialize(serializer),
17103 }
17104 }
17105 }
17106
17107 impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
17108 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17109 where
17110 D: serde::Deserializer<'de>,
17111 {
17112 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
17113 ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
17114 }
17115 }
17116}
17117
17118/// Cache Parameters for the volume.
17119#[derive(Clone, Default, PartialEq)]
17120#[non_exhaustive]
17121pub struct CacheParameters {
17122 /// Required. Name of the origin volume for the cache volume.
17123 pub peer_volume_name: std::string::String,
17124
17125 /// Required. Name of the origin volume's ONTAP cluster.
17126 pub peer_cluster_name: std::string::String,
17127
17128 /// Required. Name of the origin volume's SVM.
17129 pub peer_svm_name: std::string::String,
17130
17131 /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
17132 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
17133
17134 /// Optional. Indicates whether the cache volume has global file lock enabled.
17135 pub enable_global_file_lock: std::option::Option<bool>,
17136
17137 /// Optional. Configuration of the cache volume.
17138 pub cache_config: std::option::Option<crate::model::CacheConfig>,
17139
17140 /// Output only. State of the cache volume indicating the peering status.
17141 pub cache_state: crate::model::cache_parameters::CacheState,
17142
17143 /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
17144 /// peering requests.
17145 pub command: std::string::String,
17146
17147 /// Optional. Expiration time for the peering command to be executed on user's
17148 /// ONTAP.
17149 pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
17150
17151 /// Output only. Temporary passphrase generated to accept cluster peering
17152 /// command.
17153 pub passphrase: std::string::String,
17154
17155 /// Output only. Detailed description of the current cache state.
17156 pub state_details: std::string::String,
17157
17158 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17159}
17160
17161impl CacheParameters {
17162 /// Creates a new default instance.
17163 pub fn new() -> Self {
17164 std::default::Default::default()
17165 }
17166
17167 /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
17168 ///
17169 /// # Example
17170 /// ```ignore,no_run
17171 /// # use google_cloud_netapp_v1::model::CacheParameters;
17172 /// let x = CacheParameters::new().set_peer_volume_name("example");
17173 /// ```
17174 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
17175 mut self,
17176 v: T,
17177 ) -> Self {
17178 self.peer_volume_name = v.into();
17179 self
17180 }
17181
17182 /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
17183 ///
17184 /// # Example
17185 /// ```ignore,no_run
17186 /// # use google_cloud_netapp_v1::model::CacheParameters;
17187 /// let x = CacheParameters::new().set_peer_cluster_name("example");
17188 /// ```
17189 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
17190 mut self,
17191 v: T,
17192 ) -> Self {
17193 self.peer_cluster_name = v.into();
17194 self
17195 }
17196
17197 /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
17198 ///
17199 /// # Example
17200 /// ```ignore,no_run
17201 /// # use google_cloud_netapp_v1::model::CacheParameters;
17202 /// let x = CacheParameters::new().set_peer_svm_name("example");
17203 /// ```
17204 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17205 self.peer_svm_name = v.into();
17206 self
17207 }
17208
17209 /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
17210 ///
17211 /// # Example
17212 /// ```ignore,no_run
17213 /// # use google_cloud_netapp_v1::model::CacheParameters;
17214 /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
17215 /// ```
17216 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
17217 where
17218 T: std::iter::IntoIterator<Item = V>,
17219 V: std::convert::Into<std::string::String>,
17220 {
17221 use std::iter::Iterator;
17222 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
17223 self
17224 }
17225
17226 /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17227 ///
17228 /// # Example
17229 /// ```ignore,no_run
17230 /// # use google_cloud_netapp_v1::model::CacheParameters;
17231 /// let x = CacheParameters::new().set_enable_global_file_lock(true);
17232 /// ```
17233 pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
17234 where
17235 T: std::convert::Into<bool>,
17236 {
17237 self.enable_global_file_lock = std::option::Option::Some(v.into());
17238 self
17239 }
17240
17241 /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17242 ///
17243 /// # Example
17244 /// ```ignore,no_run
17245 /// # use google_cloud_netapp_v1::model::CacheParameters;
17246 /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
17247 /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
17248 /// ```
17249 pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
17250 where
17251 T: std::convert::Into<bool>,
17252 {
17253 self.enable_global_file_lock = v.map(|x| x.into());
17254 self
17255 }
17256
17257 /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
17258 ///
17259 /// # Example
17260 /// ```ignore,no_run
17261 /// # use google_cloud_netapp_v1::model::CacheParameters;
17262 /// use google_cloud_netapp_v1::model::CacheConfig;
17263 /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
17264 /// ```
17265 pub fn set_cache_config<T>(mut self, v: T) -> Self
17266 where
17267 T: std::convert::Into<crate::model::CacheConfig>,
17268 {
17269 self.cache_config = std::option::Option::Some(v.into());
17270 self
17271 }
17272
17273 /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
17274 ///
17275 /// # Example
17276 /// ```ignore,no_run
17277 /// # use google_cloud_netapp_v1::model::CacheParameters;
17278 /// use google_cloud_netapp_v1::model::CacheConfig;
17279 /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
17280 /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
17281 /// ```
17282 pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
17283 where
17284 T: std::convert::Into<crate::model::CacheConfig>,
17285 {
17286 self.cache_config = v.map(|x| x.into());
17287 self
17288 }
17289
17290 /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
17291 ///
17292 /// # Example
17293 /// ```ignore,no_run
17294 /// # use google_cloud_netapp_v1::model::CacheParameters;
17295 /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
17296 /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
17297 /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
17298 /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
17299 /// ```
17300 pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
17301 mut self,
17302 v: T,
17303 ) -> Self {
17304 self.cache_state = v.into();
17305 self
17306 }
17307
17308 /// Sets the value of [command][crate::model::CacheParameters::command].
17309 ///
17310 /// # Example
17311 /// ```ignore,no_run
17312 /// # use google_cloud_netapp_v1::model::CacheParameters;
17313 /// let x = CacheParameters::new().set_command("example");
17314 /// ```
17315 pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17316 self.command = v.into();
17317 self
17318 }
17319
17320 /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17321 ///
17322 /// # Example
17323 /// ```ignore,no_run
17324 /// # use google_cloud_netapp_v1::model::CacheParameters;
17325 /// use wkt::Timestamp;
17326 /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
17327 /// ```
17328 pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
17329 where
17330 T: std::convert::Into<wkt::Timestamp>,
17331 {
17332 self.peering_command_expiry_time = std::option::Option::Some(v.into());
17333 self
17334 }
17335
17336 /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17337 ///
17338 /// # Example
17339 /// ```ignore,no_run
17340 /// # use google_cloud_netapp_v1::model::CacheParameters;
17341 /// use wkt::Timestamp;
17342 /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
17343 /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
17344 /// ```
17345 pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
17346 where
17347 T: std::convert::Into<wkt::Timestamp>,
17348 {
17349 self.peering_command_expiry_time = v.map(|x| x.into());
17350 self
17351 }
17352
17353 /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
17354 ///
17355 /// # Example
17356 /// ```ignore,no_run
17357 /// # use google_cloud_netapp_v1::model::CacheParameters;
17358 /// let x = CacheParameters::new().set_passphrase("example");
17359 /// ```
17360 pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17361 self.passphrase = v.into();
17362 self
17363 }
17364
17365 /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
17366 ///
17367 /// # Example
17368 /// ```ignore,no_run
17369 /// # use google_cloud_netapp_v1::model::CacheParameters;
17370 /// let x = CacheParameters::new().set_state_details("example");
17371 /// ```
17372 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17373 self.state_details = v.into();
17374 self
17375 }
17376}
17377
17378impl wkt::message::Message for CacheParameters {
17379 fn typename() -> &'static str {
17380 "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
17381 }
17382}
17383
17384/// Defines additional types related to [CacheParameters].
17385pub mod cache_parameters {
17386 #[allow(unused_imports)]
17387 use super::*;
17388
17389 /// State of the cache volume indicating the peering status.
17390 ///
17391 /// # Working with unknown values
17392 ///
17393 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17394 /// additional enum variants at any time. Adding new variants is not considered
17395 /// a breaking change. Applications should write their code in anticipation of:
17396 ///
17397 /// - New values appearing in future releases of the client library, **and**
17398 /// - New values received dynamically, without application changes.
17399 ///
17400 /// Please consult the [Working with enums] section in the user guide for some
17401 /// guidelines.
17402 ///
17403 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17404 #[derive(Clone, Debug, PartialEq)]
17405 #[non_exhaustive]
17406 pub enum CacheState {
17407 /// Default unspecified state.
17408 Unspecified,
17409 /// State indicating waiting for cluster peering to be established.
17410 PendingClusterPeering,
17411 /// State indicating waiting for SVM peering to be established.
17412 PendingSvmPeering,
17413 /// State indicating successful establishment of peering with origin
17414 /// volumes's ONTAP cluster.
17415 Peered,
17416 /// Terminal state wherein peering with origin volume's ONTAP cluster
17417 /// has failed.
17418 Error,
17419 /// If set, the enum was initialized with an unknown value.
17420 ///
17421 /// Applications can examine the value using [CacheState::value] or
17422 /// [CacheState::name].
17423 UnknownValue(cache_state::UnknownValue),
17424 }
17425
17426 #[doc(hidden)]
17427 pub mod cache_state {
17428 #[allow(unused_imports)]
17429 use super::*;
17430 #[derive(Clone, Debug, PartialEq)]
17431 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17432 }
17433
17434 impl CacheState {
17435 /// Gets the enum value.
17436 ///
17437 /// Returns `None` if the enum contains an unknown value deserialized from
17438 /// the string representation of enums.
17439 pub fn value(&self) -> std::option::Option<i32> {
17440 match self {
17441 Self::Unspecified => std::option::Option::Some(0),
17442 Self::PendingClusterPeering => std::option::Option::Some(1),
17443 Self::PendingSvmPeering => std::option::Option::Some(2),
17444 Self::Peered => std::option::Option::Some(3),
17445 Self::Error => std::option::Option::Some(4),
17446 Self::UnknownValue(u) => u.0.value(),
17447 }
17448 }
17449
17450 /// Gets the enum value as a string.
17451 ///
17452 /// Returns `None` if the enum contains an unknown value deserialized from
17453 /// the integer representation of enums.
17454 pub fn name(&self) -> std::option::Option<&str> {
17455 match self {
17456 Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
17457 Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
17458 Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
17459 Self::Peered => std::option::Option::Some("PEERED"),
17460 Self::Error => std::option::Option::Some("ERROR"),
17461 Self::UnknownValue(u) => u.0.name(),
17462 }
17463 }
17464 }
17465
17466 impl std::default::Default for CacheState {
17467 fn default() -> Self {
17468 use std::convert::From;
17469 Self::from(0)
17470 }
17471 }
17472
17473 impl std::fmt::Display for CacheState {
17474 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17475 wkt::internal::display_enum(f, self.name(), self.value())
17476 }
17477 }
17478
17479 impl std::convert::From<i32> for CacheState {
17480 fn from(value: i32) -> Self {
17481 match value {
17482 0 => Self::Unspecified,
17483 1 => Self::PendingClusterPeering,
17484 2 => Self::PendingSvmPeering,
17485 3 => Self::Peered,
17486 4 => Self::Error,
17487 _ => Self::UnknownValue(cache_state::UnknownValue(
17488 wkt::internal::UnknownEnumValue::Integer(value),
17489 )),
17490 }
17491 }
17492 }
17493
17494 impl std::convert::From<&str> for CacheState {
17495 fn from(value: &str) -> Self {
17496 use std::string::ToString;
17497 match value {
17498 "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
17499 "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
17500 "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
17501 "PEERED" => Self::Peered,
17502 "ERROR" => Self::Error,
17503 _ => Self::UnknownValue(cache_state::UnknownValue(
17504 wkt::internal::UnknownEnumValue::String(value.to_string()),
17505 )),
17506 }
17507 }
17508 }
17509
17510 impl serde::ser::Serialize for CacheState {
17511 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17512 where
17513 S: serde::Serializer,
17514 {
17515 match self {
17516 Self::Unspecified => serializer.serialize_i32(0),
17517 Self::PendingClusterPeering => serializer.serialize_i32(1),
17518 Self::PendingSvmPeering => serializer.serialize_i32(2),
17519 Self::Peered => serializer.serialize_i32(3),
17520 Self::Error => serializer.serialize_i32(4),
17521 Self::UnknownValue(u) => u.0.serialize(serializer),
17522 }
17523 }
17524 }
17525
17526 impl<'de> serde::de::Deserialize<'de> for CacheState {
17527 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17528 where
17529 D: serde::Deserializer<'de>,
17530 {
17531 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
17532 ".google.cloud.netapp.v1.CacheParameters.CacheState",
17533 ))
17534 }
17535 }
17536}
17537
17538/// Configuration of the cache volume.
17539#[derive(Clone, Default, PartialEq)]
17540#[non_exhaustive]
17541pub struct CacheConfig {
17542 /// Optional. Pre-populate cache volume with data from the origin volume.
17543 pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
17544
17545 /// Optional. Flag indicating whether writeback is enabled for the FlexCache
17546 /// volume.
17547 pub writeback_enabled: std::option::Option<bool>,
17548
17549 /// Optional. Flag indicating whether a CIFS change notification is enabled for
17550 /// the FlexCache volume.
17551 pub cifs_change_notify_enabled: std::option::Option<bool>,
17552
17553 /// Output only. State of the prepopulation job indicating how the
17554 /// prepopulation is progressing.
17555 pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
17556
17557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17558}
17559
17560impl CacheConfig {
17561 /// Creates a new default instance.
17562 pub fn new() -> Self {
17563 std::default::Default::default()
17564 }
17565
17566 /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17567 ///
17568 /// # Example
17569 /// ```ignore,no_run
17570 /// # use google_cloud_netapp_v1::model::CacheConfig;
17571 /// use google_cloud_netapp_v1::model::CachePrePopulate;
17572 /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
17573 /// ```
17574 pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
17575 where
17576 T: std::convert::Into<crate::model::CachePrePopulate>,
17577 {
17578 self.cache_pre_populate = std::option::Option::Some(v.into());
17579 self
17580 }
17581
17582 /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17583 ///
17584 /// # Example
17585 /// ```ignore,no_run
17586 /// # use google_cloud_netapp_v1::model::CacheConfig;
17587 /// use google_cloud_netapp_v1::model::CachePrePopulate;
17588 /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
17589 /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
17590 /// ```
17591 pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
17592 where
17593 T: std::convert::Into<crate::model::CachePrePopulate>,
17594 {
17595 self.cache_pre_populate = v.map(|x| x.into());
17596 self
17597 }
17598
17599 /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17600 ///
17601 /// # Example
17602 /// ```ignore,no_run
17603 /// # use google_cloud_netapp_v1::model::CacheConfig;
17604 /// let x = CacheConfig::new().set_writeback_enabled(true);
17605 /// ```
17606 pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
17607 where
17608 T: std::convert::Into<bool>,
17609 {
17610 self.writeback_enabled = std::option::Option::Some(v.into());
17611 self
17612 }
17613
17614 /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17615 ///
17616 /// # Example
17617 /// ```ignore,no_run
17618 /// # use google_cloud_netapp_v1::model::CacheConfig;
17619 /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
17620 /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
17621 /// ```
17622 pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17623 where
17624 T: std::convert::Into<bool>,
17625 {
17626 self.writeback_enabled = v.map(|x| x.into());
17627 self
17628 }
17629
17630 /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17631 ///
17632 /// # Example
17633 /// ```ignore,no_run
17634 /// # use google_cloud_netapp_v1::model::CacheConfig;
17635 /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
17636 /// ```
17637 pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
17638 where
17639 T: std::convert::Into<bool>,
17640 {
17641 self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
17642 self
17643 }
17644
17645 /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17646 ///
17647 /// # Example
17648 /// ```ignore,no_run
17649 /// # use google_cloud_netapp_v1::model::CacheConfig;
17650 /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
17651 /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
17652 /// ```
17653 pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17654 where
17655 T: std::convert::Into<bool>,
17656 {
17657 self.cifs_change_notify_enabled = v.map(|x| x.into());
17658 self
17659 }
17660
17661 /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
17662 ///
17663 /// # Example
17664 /// ```ignore,no_run
17665 /// # use google_cloud_netapp_v1::model::CacheConfig;
17666 /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
17667 /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
17668 /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
17669 /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
17670 /// ```
17671 pub fn set_cache_pre_populate_state<
17672 T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
17673 >(
17674 mut self,
17675 v: T,
17676 ) -> Self {
17677 self.cache_pre_populate_state = v.into();
17678 self
17679 }
17680}
17681
17682impl wkt::message::Message for CacheConfig {
17683 fn typename() -> &'static str {
17684 "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
17685 }
17686}
17687
17688/// Defines additional types related to [CacheConfig].
17689pub mod cache_config {
17690 #[allow(unused_imports)]
17691 use super::*;
17692
17693 /// State of the prepopulation job indicating how the prepopulation is
17694 /// progressing.
17695 ///
17696 /// # Working with unknown values
17697 ///
17698 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17699 /// additional enum variants at any time. Adding new variants is not considered
17700 /// a breaking change. Applications should write their code in anticipation of:
17701 ///
17702 /// - New values appearing in future releases of the client library, **and**
17703 /// - New values received dynamically, without application changes.
17704 ///
17705 /// Please consult the [Working with enums] section in the user guide for some
17706 /// guidelines.
17707 ///
17708 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17709 #[derive(Clone, Debug, PartialEq)]
17710 #[non_exhaustive]
17711 pub enum CachePrePopulateState {
17712 /// Default unspecified state.
17713 Unspecified,
17714 /// State representing when the most recent create or update request did not
17715 /// require a prepopulation job.
17716 NotNeeded,
17717 /// State representing when the most recent update request requested a
17718 /// prepopulation job but it has not yet completed.
17719 InProgress,
17720 /// State representing when the most recent update request requested a
17721 /// prepopulation job and it has completed successfully.
17722 Complete,
17723 /// State representing when the most recent update request requested a
17724 /// prepopulation job but the prepopulate job failed.
17725 Error,
17726 /// If set, the enum was initialized with an unknown value.
17727 ///
17728 /// Applications can examine the value using [CachePrePopulateState::value] or
17729 /// [CachePrePopulateState::name].
17730 UnknownValue(cache_pre_populate_state::UnknownValue),
17731 }
17732
17733 #[doc(hidden)]
17734 pub mod cache_pre_populate_state {
17735 #[allow(unused_imports)]
17736 use super::*;
17737 #[derive(Clone, Debug, PartialEq)]
17738 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17739 }
17740
17741 impl CachePrePopulateState {
17742 /// Gets the enum value.
17743 ///
17744 /// Returns `None` if the enum contains an unknown value deserialized from
17745 /// the string representation of enums.
17746 pub fn value(&self) -> std::option::Option<i32> {
17747 match self {
17748 Self::Unspecified => std::option::Option::Some(0),
17749 Self::NotNeeded => std::option::Option::Some(1),
17750 Self::InProgress => std::option::Option::Some(2),
17751 Self::Complete => std::option::Option::Some(3),
17752 Self::Error => std::option::Option::Some(4),
17753 Self::UnknownValue(u) => u.0.value(),
17754 }
17755 }
17756
17757 /// Gets the enum value as a string.
17758 ///
17759 /// Returns `None` if the enum contains an unknown value deserialized from
17760 /// the integer representation of enums.
17761 pub fn name(&self) -> std::option::Option<&str> {
17762 match self {
17763 Self::Unspecified => {
17764 std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
17765 }
17766 Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
17767 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
17768 Self::Complete => std::option::Option::Some("COMPLETE"),
17769 Self::Error => std::option::Option::Some("ERROR"),
17770 Self::UnknownValue(u) => u.0.name(),
17771 }
17772 }
17773 }
17774
17775 impl std::default::Default for CachePrePopulateState {
17776 fn default() -> Self {
17777 use std::convert::From;
17778 Self::from(0)
17779 }
17780 }
17781
17782 impl std::fmt::Display for CachePrePopulateState {
17783 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17784 wkt::internal::display_enum(f, self.name(), self.value())
17785 }
17786 }
17787
17788 impl std::convert::From<i32> for CachePrePopulateState {
17789 fn from(value: i32) -> Self {
17790 match value {
17791 0 => Self::Unspecified,
17792 1 => Self::NotNeeded,
17793 2 => Self::InProgress,
17794 3 => Self::Complete,
17795 4 => Self::Error,
17796 _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
17797 wkt::internal::UnknownEnumValue::Integer(value),
17798 )),
17799 }
17800 }
17801 }
17802
17803 impl std::convert::From<&str> for CachePrePopulateState {
17804 fn from(value: &str) -> Self {
17805 use std::string::ToString;
17806 match value {
17807 "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
17808 "NOT_NEEDED" => Self::NotNeeded,
17809 "IN_PROGRESS" => Self::InProgress,
17810 "COMPLETE" => Self::Complete,
17811 "ERROR" => Self::Error,
17812 _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
17813 wkt::internal::UnknownEnumValue::String(value.to_string()),
17814 )),
17815 }
17816 }
17817 }
17818
17819 impl serde::ser::Serialize for CachePrePopulateState {
17820 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17821 where
17822 S: serde::Serializer,
17823 {
17824 match self {
17825 Self::Unspecified => serializer.serialize_i32(0),
17826 Self::NotNeeded => serializer.serialize_i32(1),
17827 Self::InProgress => serializer.serialize_i32(2),
17828 Self::Complete => serializer.serialize_i32(3),
17829 Self::Error => serializer.serialize_i32(4),
17830 Self::UnknownValue(u) => u.0.serialize(serializer),
17831 }
17832 }
17833 }
17834
17835 impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
17836 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17837 where
17838 D: serde::Deserializer<'de>,
17839 {
17840 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
17841 ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
17842 ))
17843 }
17844 }
17845}
17846
17847/// Pre-populate cache volume with data from the origin volume.
17848#[derive(Clone, Default, PartialEq)]
17849#[non_exhaustive]
17850pub struct CachePrePopulate {
17851 /// Optional. List of directory-paths to be pre-populated for the FlexCache
17852 /// volume.
17853 pub path_list: std::vec::Vec<std::string::String>,
17854
17855 /// Optional. List of directory-paths to be excluded for pre-population for the
17856 /// FlexCache volume.
17857 pub exclude_path_list: std::vec::Vec<std::string::String>,
17858
17859 /// Optional. Flag indicating whether the directories listed with the
17860 /// `path_list` need to be recursively pre-populated.
17861 pub recursion: std::option::Option<bool>,
17862
17863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17864}
17865
17866impl CachePrePopulate {
17867 /// Creates a new default instance.
17868 pub fn new() -> Self {
17869 std::default::Default::default()
17870 }
17871
17872 /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
17873 ///
17874 /// # Example
17875 /// ```ignore,no_run
17876 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17877 /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
17878 /// ```
17879 pub fn set_path_list<T, V>(mut self, v: T) -> Self
17880 where
17881 T: std::iter::IntoIterator<Item = V>,
17882 V: std::convert::Into<std::string::String>,
17883 {
17884 use std::iter::Iterator;
17885 self.path_list = v.into_iter().map(|i| i.into()).collect();
17886 self
17887 }
17888
17889 /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
17890 ///
17891 /// # Example
17892 /// ```ignore,no_run
17893 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17894 /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
17895 /// ```
17896 pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
17897 where
17898 T: std::iter::IntoIterator<Item = V>,
17899 V: std::convert::Into<std::string::String>,
17900 {
17901 use std::iter::Iterator;
17902 self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
17903 self
17904 }
17905
17906 /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
17907 ///
17908 /// # Example
17909 /// ```ignore,no_run
17910 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17911 /// let x = CachePrePopulate::new().set_recursion(true);
17912 /// ```
17913 pub fn set_recursion<T>(mut self, v: T) -> Self
17914 where
17915 T: std::convert::Into<bool>,
17916 {
17917 self.recursion = std::option::Option::Some(v.into());
17918 self
17919 }
17920
17921 /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
17922 ///
17923 /// # Example
17924 /// ```ignore,no_run
17925 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17926 /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
17927 /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
17928 /// ```
17929 pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
17930 where
17931 T: std::convert::Into<bool>,
17932 {
17933 self.recursion = v.map(|x| x.into());
17934 self
17935 }
17936}
17937
17938impl wkt::message::Message for CachePrePopulate {
17939 fn typename() -> &'static str {
17940 "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
17941 }
17942}
17943
17944/// Block device represents the device(s) which are stored in the block volume.
17945#[derive(Clone, Default, PartialEq)]
17946#[non_exhaustive]
17947pub struct BlockDevice {
17948 /// Optional. User-defined name for the block device, unique within the volume.
17949 /// In case no user input is provided, name will be auto-generated in the
17950 /// backend. The name must meet the following requirements:
17951 ///
17952 /// * Be between 1 and 255 characters long.
17953 /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
17954 /// and the following special characters: "-", "_", "}", "{", ".".
17955 /// * Spaces are not allowed.
17956 pub name: std::option::Option<std::string::String>,
17957
17958 /// Optional. A list of host groups that identify hosts that can mount the
17959 /// block volume. Format:
17960 /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
17961 /// This field can be updated after the block device is created.
17962 pub host_groups: std::vec::Vec<std::string::String>,
17963
17964 /// Output only. Device identifier of the block volume. This represents
17965 /// `lun_serial_number` for iSCSI volumes.
17966 pub identifier: std::string::String,
17967
17968 /// Optional. The size of the block device in GiB.
17969 /// Any value provided for the `size_gib` field during volume creation is
17970 /// ignored. The block device's size is system-managed and will be set to match
17971 /// the parent Volume's `capacity_gib`.
17972 pub size_gib: std::option::Option<i64>,
17973
17974 /// Required. Immutable. The OS type of the volume.
17975 /// This field can't be changed after the block device is created.
17976 pub os_type: crate::model::OsType,
17977
17978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17979}
17980
17981impl BlockDevice {
17982 /// Creates a new default instance.
17983 pub fn new() -> Self {
17984 std::default::Default::default()
17985 }
17986
17987 /// Sets the value of [name][crate::model::BlockDevice::name].
17988 ///
17989 /// # Example
17990 /// ```ignore,no_run
17991 /// # use google_cloud_netapp_v1::model::BlockDevice;
17992 /// let x = BlockDevice::new().set_name("example");
17993 /// ```
17994 pub fn set_name<T>(mut self, v: T) -> Self
17995 where
17996 T: std::convert::Into<std::string::String>,
17997 {
17998 self.name = std::option::Option::Some(v.into());
17999 self
18000 }
18001
18002 /// Sets or clears the value of [name][crate::model::BlockDevice::name].
18003 ///
18004 /// # Example
18005 /// ```ignore,no_run
18006 /// # use google_cloud_netapp_v1::model::BlockDevice;
18007 /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
18008 /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
18009 /// ```
18010 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
18011 where
18012 T: std::convert::Into<std::string::String>,
18013 {
18014 self.name = v.map(|x| x.into());
18015 self
18016 }
18017
18018 /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
18019 ///
18020 /// # Example
18021 /// ```ignore,no_run
18022 /// # use google_cloud_netapp_v1::model::BlockDevice;
18023 /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
18024 /// ```
18025 pub fn set_host_groups<T, V>(mut self, v: T) -> Self
18026 where
18027 T: std::iter::IntoIterator<Item = V>,
18028 V: std::convert::Into<std::string::String>,
18029 {
18030 use std::iter::Iterator;
18031 self.host_groups = v.into_iter().map(|i| i.into()).collect();
18032 self
18033 }
18034
18035 /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
18036 ///
18037 /// # Example
18038 /// ```ignore,no_run
18039 /// # use google_cloud_netapp_v1::model::BlockDevice;
18040 /// let x = BlockDevice::new().set_identifier("example");
18041 /// ```
18042 pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18043 self.identifier = v.into();
18044 self
18045 }
18046
18047 /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
18048 ///
18049 /// # Example
18050 /// ```ignore,no_run
18051 /// # use google_cloud_netapp_v1::model::BlockDevice;
18052 /// let x = BlockDevice::new().set_size_gib(42);
18053 /// ```
18054 pub fn set_size_gib<T>(mut self, v: T) -> Self
18055 where
18056 T: std::convert::Into<i64>,
18057 {
18058 self.size_gib = std::option::Option::Some(v.into());
18059 self
18060 }
18061
18062 /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
18063 ///
18064 /// # Example
18065 /// ```ignore,no_run
18066 /// # use google_cloud_netapp_v1::model::BlockDevice;
18067 /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
18068 /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
18069 /// ```
18070 pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
18071 where
18072 T: std::convert::Into<i64>,
18073 {
18074 self.size_gib = v.map(|x| x.into());
18075 self
18076 }
18077
18078 /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
18079 ///
18080 /// # Example
18081 /// ```ignore,no_run
18082 /// # use google_cloud_netapp_v1::model::BlockDevice;
18083 /// use google_cloud_netapp_v1::model::OsType;
18084 /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
18085 /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
18086 /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
18087 /// ```
18088 pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
18089 self.os_type = v.into();
18090 self
18091 }
18092}
18093
18094impl wkt::message::Message for BlockDevice {
18095 fn typename() -> &'static str {
18096 "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
18097 }
18098}
18099
18100/// RestoreBackupFilesRequest restores files from a backup to a volume.
18101#[derive(Clone, Default, PartialEq)]
18102#[non_exhaustive]
18103pub struct RestoreBackupFilesRequest {
18104 /// Required. The volume resource name, in the format
18105 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
18106 pub name: std::string::String,
18107
18108 /// Required. The backup resource name, in the format
18109 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
18110 pub backup: std::string::String,
18111
18112 /// Required. List of files to be restored, specified by their absolute path in
18113 /// the source volume.
18114 pub file_list: std::vec::Vec<std::string::String>,
18115
18116 /// Optional. Absolute directory path in the destination volume. This is
18117 /// required if the `file_list` is provided.
18118 pub restore_destination_path: std::string::String,
18119
18120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18121}
18122
18123impl RestoreBackupFilesRequest {
18124 /// Creates a new default instance.
18125 pub fn new() -> Self {
18126 std::default::Default::default()
18127 }
18128
18129 /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
18130 ///
18131 /// # Example
18132 /// ```ignore,no_run
18133 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18134 /// let x = RestoreBackupFilesRequest::new().set_name("example");
18135 /// ```
18136 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18137 self.name = v.into();
18138 self
18139 }
18140
18141 /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
18142 ///
18143 /// # Example
18144 /// ```ignore,no_run
18145 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18146 /// let x = RestoreBackupFilesRequest::new().set_backup("example");
18147 /// ```
18148 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18149 self.backup = v.into();
18150 self
18151 }
18152
18153 /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
18154 ///
18155 /// # Example
18156 /// ```ignore,no_run
18157 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18158 /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
18159 /// ```
18160 pub fn set_file_list<T, V>(mut self, v: T) -> Self
18161 where
18162 T: std::iter::IntoIterator<Item = V>,
18163 V: std::convert::Into<std::string::String>,
18164 {
18165 use std::iter::Iterator;
18166 self.file_list = v.into_iter().map(|i| i.into()).collect();
18167 self
18168 }
18169
18170 /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
18171 ///
18172 /// # Example
18173 /// ```ignore,no_run
18174 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18175 /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
18176 /// ```
18177 pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
18178 mut self,
18179 v: T,
18180 ) -> Self {
18181 self.restore_destination_path = v.into();
18182 self
18183 }
18184}
18185
18186impl wkt::message::Message for RestoreBackupFilesRequest {
18187 fn typename() -> &'static str {
18188 "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
18189 }
18190}
18191
18192/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
18193#[derive(Clone, Default, PartialEq)]
18194#[non_exhaustive]
18195pub struct RestoreBackupFilesResponse {
18196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18197}
18198
18199impl RestoreBackupFilesResponse {
18200 /// Creates a new default instance.
18201 pub fn new() -> Self {
18202 std::default::Default::default()
18203 }
18204}
18205
18206impl wkt::message::Message for RestoreBackupFilesResponse {
18207 fn typename() -> &'static str {
18208 "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
18209 }
18210}
18211
18212/// EstablishVolumePeeringRequest establishes cluster and svm peerings between
18213/// the source and destination clusters.
18214#[derive(Clone, Default, PartialEq)]
18215#[non_exhaustive]
18216pub struct EstablishVolumePeeringRequest {
18217 /// Required. The volume resource name, in the format
18218 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
18219 pub name: std::string::String,
18220
18221 /// Required. Name of the user's local source cluster to be peered with the
18222 /// destination cluster.
18223 pub peer_cluster_name: std::string::String,
18224
18225 /// Required. Name of the user's local source vserver svm to be peered with the
18226 /// destination vserver svm.
18227 pub peer_svm_name: std::string::String,
18228
18229 /// Optional. List of IPv4 ip addresses to be used for peering.
18230 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
18231
18232 /// Required. Name of the user's local source volume to be peered with the
18233 /// destination volume.
18234 pub peer_volume_name: std::string::String,
18235
18236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18237}
18238
18239impl EstablishVolumePeeringRequest {
18240 /// Creates a new default instance.
18241 pub fn new() -> Self {
18242 std::default::Default::default()
18243 }
18244
18245 /// Sets the value of [name][crate::model::EstablishVolumePeeringRequest::name].
18246 ///
18247 /// # Example
18248 /// ```ignore,no_run
18249 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18250 /// let x = EstablishVolumePeeringRequest::new().set_name("example");
18251 /// ```
18252 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18253 self.name = v.into();
18254 self
18255 }
18256
18257 /// Sets the value of [peer_cluster_name][crate::model::EstablishVolumePeeringRequest::peer_cluster_name].
18258 ///
18259 /// # Example
18260 /// ```ignore,no_run
18261 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18262 /// let x = EstablishVolumePeeringRequest::new().set_peer_cluster_name("example");
18263 /// ```
18264 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
18265 mut self,
18266 v: T,
18267 ) -> Self {
18268 self.peer_cluster_name = v.into();
18269 self
18270 }
18271
18272 /// Sets the value of [peer_svm_name][crate::model::EstablishVolumePeeringRequest::peer_svm_name].
18273 ///
18274 /// # Example
18275 /// ```ignore,no_run
18276 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18277 /// let x = EstablishVolumePeeringRequest::new().set_peer_svm_name("example");
18278 /// ```
18279 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18280 self.peer_svm_name = v.into();
18281 self
18282 }
18283
18284 /// Sets the value of [peer_ip_addresses][crate::model::EstablishVolumePeeringRequest::peer_ip_addresses].
18285 ///
18286 /// # Example
18287 /// ```ignore,no_run
18288 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18289 /// let x = EstablishVolumePeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
18290 /// ```
18291 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
18292 where
18293 T: std::iter::IntoIterator<Item = V>,
18294 V: std::convert::Into<std::string::String>,
18295 {
18296 use std::iter::Iterator;
18297 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
18298 self
18299 }
18300
18301 /// Sets the value of [peer_volume_name][crate::model::EstablishVolumePeeringRequest::peer_volume_name].
18302 ///
18303 /// # Example
18304 /// ```ignore,no_run
18305 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18306 /// let x = EstablishVolumePeeringRequest::new().set_peer_volume_name("example");
18307 /// ```
18308 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
18309 mut self,
18310 v: T,
18311 ) -> Self {
18312 self.peer_volume_name = v.into();
18313 self
18314 }
18315}
18316
18317impl wkt::message::Message for EstablishVolumePeeringRequest {
18318 fn typename() -> &'static str {
18319 "type.googleapis.com/google.cloud.netapp.v1.EstablishVolumePeeringRequest"
18320 }
18321}
18322
18323/// The service level of a storage pool and its volumes.
18324///
18325/// # Working with unknown values
18326///
18327/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18328/// additional enum variants at any time. Adding new variants is not considered
18329/// a breaking change. Applications should write their code in anticipation of:
18330///
18331/// - New values appearing in future releases of the client library, **and**
18332/// - New values received dynamically, without application changes.
18333///
18334/// Please consult the [Working with enums] section in the user guide for some
18335/// guidelines.
18336///
18337/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18338#[derive(Clone, Debug, PartialEq)]
18339#[non_exhaustive]
18340pub enum ServiceLevel {
18341 /// Unspecified service level.
18342 Unspecified,
18343 /// Premium service level.
18344 Premium,
18345 /// Extreme service level.
18346 Extreme,
18347 /// Standard service level.
18348 Standard,
18349 /// Flex service level.
18350 Flex,
18351 /// If set, the enum was initialized with an unknown value.
18352 ///
18353 /// Applications can examine the value using [ServiceLevel::value] or
18354 /// [ServiceLevel::name].
18355 UnknownValue(service_level::UnknownValue),
18356}
18357
18358#[doc(hidden)]
18359pub mod service_level {
18360 #[allow(unused_imports)]
18361 use super::*;
18362 #[derive(Clone, Debug, PartialEq)]
18363 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18364}
18365
18366impl ServiceLevel {
18367 /// Gets the enum value.
18368 ///
18369 /// Returns `None` if the enum contains an unknown value deserialized from
18370 /// the string representation of enums.
18371 pub fn value(&self) -> std::option::Option<i32> {
18372 match self {
18373 Self::Unspecified => std::option::Option::Some(0),
18374 Self::Premium => std::option::Option::Some(1),
18375 Self::Extreme => std::option::Option::Some(2),
18376 Self::Standard => std::option::Option::Some(3),
18377 Self::Flex => std::option::Option::Some(4),
18378 Self::UnknownValue(u) => u.0.value(),
18379 }
18380 }
18381
18382 /// Gets the enum value as a string.
18383 ///
18384 /// Returns `None` if the enum contains an unknown value deserialized from
18385 /// the integer representation of enums.
18386 pub fn name(&self) -> std::option::Option<&str> {
18387 match self {
18388 Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
18389 Self::Premium => std::option::Option::Some("PREMIUM"),
18390 Self::Extreme => std::option::Option::Some("EXTREME"),
18391 Self::Standard => std::option::Option::Some("STANDARD"),
18392 Self::Flex => std::option::Option::Some("FLEX"),
18393 Self::UnknownValue(u) => u.0.name(),
18394 }
18395 }
18396}
18397
18398impl std::default::Default for ServiceLevel {
18399 fn default() -> Self {
18400 use std::convert::From;
18401 Self::from(0)
18402 }
18403}
18404
18405impl std::fmt::Display for ServiceLevel {
18406 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18407 wkt::internal::display_enum(f, self.name(), self.value())
18408 }
18409}
18410
18411impl std::convert::From<i32> for ServiceLevel {
18412 fn from(value: i32) -> Self {
18413 match value {
18414 0 => Self::Unspecified,
18415 1 => Self::Premium,
18416 2 => Self::Extreme,
18417 3 => Self::Standard,
18418 4 => Self::Flex,
18419 _ => Self::UnknownValue(service_level::UnknownValue(
18420 wkt::internal::UnknownEnumValue::Integer(value),
18421 )),
18422 }
18423 }
18424}
18425
18426impl std::convert::From<&str> for ServiceLevel {
18427 fn from(value: &str) -> Self {
18428 use std::string::ToString;
18429 match value {
18430 "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
18431 "PREMIUM" => Self::Premium,
18432 "EXTREME" => Self::Extreme,
18433 "STANDARD" => Self::Standard,
18434 "FLEX" => Self::Flex,
18435 _ => Self::UnknownValue(service_level::UnknownValue(
18436 wkt::internal::UnknownEnumValue::String(value.to_string()),
18437 )),
18438 }
18439 }
18440}
18441
18442impl serde::ser::Serialize for ServiceLevel {
18443 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18444 where
18445 S: serde::Serializer,
18446 {
18447 match self {
18448 Self::Unspecified => serializer.serialize_i32(0),
18449 Self::Premium => serializer.serialize_i32(1),
18450 Self::Extreme => serializer.serialize_i32(2),
18451 Self::Standard => serializer.serialize_i32(3),
18452 Self::Flex => serializer.serialize_i32(4),
18453 Self::UnknownValue(u) => u.0.serialize(serializer),
18454 }
18455 }
18456}
18457
18458impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
18459 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18460 where
18461 D: serde::Deserializer<'de>,
18462 {
18463 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
18464 ".google.cloud.netapp.v1.ServiceLevel",
18465 ))
18466 }
18467}
18468
18469/// Flex Storage Pool performance.
18470///
18471/// # Working with unknown values
18472///
18473/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18474/// additional enum variants at any time. Adding new variants is not considered
18475/// a breaking change. Applications should write their code in anticipation of:
18476///
18477/// - New values appearing in future releases of the client library, **and**
18478/// - New values received dynamically, without application changes.
18479///
18480/// Please consult the [Working with enums] section in the user guide for some
18481/// guidelines.
18482///
18483/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18484#[derive(Clone, Debug, PartialEq)]
18485#[non_exhaustive]
18486pub enum FlexPerformance {
18487 /// Unspecified flex performance.
18488 Unspecified,
18489 /// Flex Storage Pool with default performance.
18490 Default,
18491 /// Flex Storage Pool with custom performance.
18492 Custom,
18493 /// If set, the enum was initialized with an unknown value.
18494 ///
18495 /// Applications can examine the value using [FlexPerformance::value] or
18496 /// [FlexPerformance::name].
18497 UnknownValue(flex_performance::UnknownValue),
18498}
18499
18500#[doc(hidden)]
18501pub mod flex_performance {
18502 #[allow(unused_imports)]
18503 use super::*;
18504 #[derive(Clone, Debug, PartialEq)]
18505 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18506}
18507
18508impl FlexPerformance {
18509 /// Gets the enum value.
18510 ///
18511 /// Returns `None` if the enum contains an unknown value deserialized from
18512 /// the string representation of enums.
18513 pub fn value(&self) -> std::option::Option<i32> {
18514 match self {
18515 Self::Unspecified => std::option::Option::Some(0),
18516 Self::Default => std::option::Option::Some(1),
18517 Self::Custom => std::option::Option::Some(2),
18518 Self::UnknownValue(u) => u.0.value(),
18519 }
18520 }
18521
18522 /// Gets the enum value as a string.
18523 ///
18524 /// Returns `None` if the enum contains an unknown value deserialized from
18525 /// the integer representation of enums.
18526 pub fn name(&self) -> std::option::Option<&str> {
18527 match self {
18528 Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
18529 Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
18530 Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
18531 Self::UnknownValue(u) => u.0.name(),
18532 }
18533 }
18534}
18535
18536impl std::default::Default for FlexPerformance {
18537 fn default() -> Self {
18538 use std::convert::From;
18539 Self::from(0)
18540 }
18541}
18542
18543impl std::fmt::Display for FlexPerformance {
18544 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18545 wkt::internal::display_enum(f, self.name(), self.value())
18546 }
18547}
18548
18549impl std::convert::From<i32> for FlexPerformance {
18550 fn from(value: i32) -> Self {
18551 match value {
18552 0 => Self::Unspecified,
18553 1 => Self::Default,
18554 2 => Self::Custom,
18555 _ => Self::UnknownValue(flex_performance::UnknownValue(
18556 wkt::internal::UnknownEnumValue::Integer(value),
18557 )),
18558 }
18559 }
18560}
18561
18562impl std::convert::From<&str> for FlexPerformance {
18563 fn from(value: &str) -> Self {
18564 use std::string::ToString;
18565 match value {
18566 "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
18567 "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
18568 "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
18569 _ => Self::UnknownValue(flex_performance::UnknownValue(
18570 wkt::internal::UnknownEnumValue::String(value.to_string()),
18571 )),
18572 }
18573 }
18574}
18575
18576impl serde::ser::Serialize for FlexPerformance {
18577 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18578 where
18579 S: serde::Serializer,
18580 {
18581 match self {
18582 Self::Unspecified => serializer.serialize_i32(0),
18583 Self::Default => serializer.serialize_i32(1),
18584 Self::Custom => serializer.serialize_i32(2),
18585 Self::UnknownValue(u) => u.0.serialize(serializer),
18586 }
18587 }
18588}
18589
18590impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
18591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18592 where
18593 D: serde::Deserializer<'de>,
18594 {
18595 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
18596 ".google.cloud.netapp.v1.FlexPerformance",
18597 ))
18598 }
18599}
18600
18601/// The volume encryption key source.
18602///
18603/// # Working with unknown values
18604///
18605/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18606/// additional enum variants at any time. Adding new variants is not considered
18607/// a breaking change. Applications should write their code in anticipation of:
18608///
18609/// - New values appearing in future releases of the client library, **and**
18610/// - New values received dynamically, without application changes.
18611///
18612/// Please consult the [Working with enums] section in the user guide for some
18613/// guidelines.
18614///
18615/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18616#[derive(Clone, Debug, PartialEq)]
18617#[non_exhaustive]
18618pub enum EncryptionType {
18619 /// The source of the encryption key is not specified.
18620 Unspecified,
18621 /// Google managed encryption key.
18622 ServiceManaged,
18623 /// Customer managed encryption key, which is stored in KMS.
18624 CloudKms,
18625 /// If set, the enum was initialized with an unknown value.
18626 ///
18627 /// Applications can examine the value using [EncryptionType::value] or
18628 /// [EncryptionType::name].
18629 UnknownValue(encryption_type::UnknownValue),
18630}
18631
18632#[doc(hidden)]
18633pub mod encryption_type {
18634 #[allow(unused_imports)]
18635 use super::*;
18636 #[derive(Clone, Debug, PartialEq)]
18637 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18638}
18639
18640impl EncryptionType {
18641 /// Gets the enum value.
18642 ///
18643 /// Returns `None` if the enum contains an unknown value deserialized from
18644 /// the string representation of enums.
18645 pub fn value(&self) -> std::option::Option<i32> {
18646 match self {
18647 Self::Unspecified => std::option::Option::Some(0),
18648 Self::ServiceManaged => std::option::Option::Some(1),
18649 Self::CloudKms => std::option::Option::Some(2),
18650 Self::UnknownValue(u) => u.0.value(),
18651 }
18652 }
18653
18654 /// Gets the enum value as a string.
18655 ///
18656 /// Returns `None` if the enum contains an unknown value deserialized from
18657 /// the integer representation of enums.
18658 pub fn name(&self) -> std::option::Option<&str> {
18659 match self {
18660 Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
18661 Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
18662 Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
18663 Self::UnknownValue(u) => u.0.name(),
18664 }
18665 }
18666}
18667
18668impl std::default::Default for EncryptionType {
18669 fn default() -> Self {
18670 use std::convert::From;
18671 Self::from(0)
18672 }
18673}
18674
18675impl std::fmt::Display for EncryptionType {
18676 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18677 wkt::internal::display_enum(f, self.name(), self.value())
18678 }
18679}
18680
18681impl std::convert::From<i32> for EncryptionType {
18682 fn from(value: i32) -> Self {
18683 match value {
18684 0 => Self::Unspecified,
18685 1 => Self::ServiceManaged,
18686 2 => Self::CloudKms,
18687 _ => Self::UnknownValue(encryption_type::UnknownValue(
18688 wkt::internal::UnknownEnumValue::Integer(value),
18689 )),
18690 }
18691 }
18692}
18693
18694impl std::convert::From<&str> for EncryptionType {
18695 fn from(value: &str) -> Self {
18696 use std::string::ToString;
18697 match value {
18698 "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
18699 "SERVICE_MANAGED" => Self::ServiceManaged,
18700 "CLOUD_KMS" => Self::CloudKms,
18701 _ => Self::UnknownValue(encryption_type::UnknownValue(
18702 wkt::internal::UnknownEnumValue::String(value.to_string()),
18703 )),
18704 }
18705 }
18706}
18707
18708impl serde::ser::Serialize for EncryptionType {
18709 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18710 where
18711 S: serde::Serializer,
18712 {
18713 match self {
18714 Self::Unspecified => serializer.serialize_i32(0),
18715 Self::ServiceManaged => serializer.serialize_i32(1),
18716 Self::CloudKms => serializer.serialize_i32(2),
18717 Self::UnknownValue(u) => u.0.serialize(serializer),
18718 }
18719 }
18720}
18721
18722impl<'de> serde::de::Deserialize<'de> for EncryptionType {
18723 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18724 where
18725 D: serde::Deserializer<'de>,
18726 {
18727 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
18728 ".google.cloud.netapp.v1.EncryptionType",
18729 ))
18730 }
18731}
18732
18733/// Type of directory service
18734///
18735/// # Working with unknown values
18736///
18737/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18738/// additional enum variants at any time. Adding new variants is not considered
18739/// a breaking change. Applications should write their code in anticipation of:
18740///
18741/// - New values appearing in future releases of the client library, **and**
18742/// - New values received dynamically, without application changes.
18743///
18744/// Please consult the [Working with enums] section in the user guide for some
18745/// guidelines.
18746///
18747/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18748#[derive(Clone, Debug, PartialEq)]
18749#[non_exhaustive]
18750pub enum DirectoryServiceType {
18751 /// Directory service type is not specified.
18752 Unspecified,
18753 /// Active directory policy attached to the storage pool.
18754 ActiveDirectory,
18755 /// If set, the enum was initialized with an unknown value.
18756 ///
18757 /// Applications can examine the value using [DirectoryServiceType::value] or
18758 /// [DirectoryServiceType::name].
18759 UnknownValue(directory_service_type::UnknownValue),
18760}
18761
18762#[doc(hidden)]
18763pub mod directory_service_type {
18764 #[allow(unused_imports)]
18765 use super::*;
18766 #[derive(Clone, Debug, PartialEq)]
18767 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18768}
18769
18770impl DirectoryServiceType {
18771 /// Gets the enum value.
18772 ///
18773 /// Returns `None` if the enum contains an unknown value deserialized from
18774 /// the string representation of enums.
18775 pub fn value(&self) -> std::option::Option<i32> {
18776 match self {
18777 Self::Unspecified => std::option::Option::Some(0),
18778 Self::ActiveDirectory => std::option::Option::Some(1),
18779 Self::UnknownValue(u) => u.0.value(),
18780 }
18781 }
18782
18783 /// Gets the enum value as a string.
18784 ///
18785 /// Returns `None` if the enum contains an unknown value deserialized from
18786 /// the integer representation of enums.
18787 pub fn name(&self) -> std::option::Option<&str> {
18788 match self {
18789 Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
18790 Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
18791 Self::UnknownValue(u) => u.0.name(),
18792 }
18793 }
18794}
18795
18796impl std::default::Default for DirectoryServiceType {
18797 fn default() -> Self {
18798 use std::convert::From;
18799 Self::from(0)
18800 }
18801}
18802
18803impl std::fmt::Display for DirectoryServiceType {
18804 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18805 wkt::internal::display_enum(f, self.name(), self.value())
18806 }
18807}
18808
18809impl std::convert::From<i32> for DirectoryServiceType {
18810 fn from(value: i32) -> Self {
18811 match value {
18812 0 => Self::Unspecified,
18813 1 => Self::ActiveDirectory,
18814 _ => Self::UnknownValue(directory_service_type::UnknownValue(
18815 wkt::internal::UnknownEnumValue::Integer(value),
18816 )),
18817 }
18818 }
18819}
18820
18821impl std::convert::From<&str> for DirectoryServiceType {
18822 fn from(value: &str) -> Self {
18823 use std::string::ToString;
18824 match value {
18825 "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
18826 "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
18827 _ => Self::UnknownValue(directory_service_type::UnknownValue(
18828 wkt::internal::UnknownEnumValue::String(value.to_string()),
18829 )),
18830 }
18831 }
18832}
18833
18834impl serde::ser::Serialize for DirectoryServiceType {
18835 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18836 where
18837 S: serde::Serializer,
18838 {
18839 match self {
18840 Self::Unspecified => serializer.serialize_i32(0),
18841 Self::ActiveDirectory => serializer.serialize_i32(1),
18842 Self::UnknownValue(u) => u.0.serialize(serializer),
18843 }
18844 }
18845}
18846
18847impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
18848 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18849 where
18850 D: serde::Deserializer<'de>,
18851 {
18852 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
18853 ".google.cloud.netapp.v1.DirectoryServiceType",
18854 ))
18855 }
18856}
18857
18858/// Type of storage pool
18859///
18860/// # Working with unknown values
18861///
18862/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18863/// additional enum variants at any time. Adding new variants is not considered
18864/// a breaking change. Applications should write their code in anticipation of:
18865///
18866/// - New values appearing in future releases of the client library, **and**
18867/// - New values received dynamically, without application changes.
18868///
18869/// Please consult the [Working with enums] section in the user guide for some
18870/// guidelines.
18871///
18872/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18873#[derive(Clone, Debug, PartialEq)]
18874#[non_exhaustive]
18875pub enum StoragePoolType {
18876 /// Storage pool type is not specified.
18877 Unspecified,
18878 /// Storage pool type is file.
18879 File,
18880 /// Storage pool type is unified.
18881 Unified,
18882 /// If set, the enum was initialized with an unknown value.
18883 ///
18884 /// Applications can examine the value using [StoragePoolType::value] or
18885 /// [StoragePoolType::name].
18886 UnknownValue(storage_pool_type::UnknownValue),
18887}
18888
18889#[doc(hidden)]
18890pub mod storage_pool_type {
18891 #[allow(unused_imports)]
18892 use super::*;
18893 #[derive(Clone, Debug, PartialEq)]
18894 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18895}
18896
18897impl StoragePoolType {
18898 /// Gets the enum value.
18899 ///
18900 /// Returns `None` if the enum contains an unknown value deserialized from
18901 /// the string representation of enums.
18902 pub fn value(&self) -> std::option::Option<i32> {
18903 match self {
18904 Self::Unspecified => std::option::Option::Some(0),
18905 Self::File => std::option::Option::Some(1),
18906 Self::Unified => std::option::Option::Some(2),
18907 Self::UnknownValue(u) => u.0.value(),
18908 }
18909 }
18910
18911 /// Gets the enum value as a string.
18912 ///
18913 /// Returns `None` if the enum contains an unknown value deserialized from
18914 /// the integer representation of enums.
18915 pub fn name(&self) -> std::option::Option<&str> {
18916 match self {
18917 Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
18918 Self::File => std::option::Option::Some("FILE"),
18919 Self::Unified => std::option::Option::Some("UNIFIED"),
18920 Self::UnknownValue(u) => u.0.name(),
18921 }
18922 }
18923}
18924
18925impl std::default::Default for StoragePoolType {
18926 fn default() -> Self {
18927 use std::convert::From;
18928 Self::from(0)
18929 }
18930}
18931
18932impl std::fmt::Display for StoragePoolType {
18933 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18934 wkt::internal::display_enum(f, self.name(), self.value())
18935 }
18936}
18937
18938impl std::convert::From<i32> for StoragePoolType {
18939 fn from(value: i32) -> Self {
18940 match value {
18941 0 => Self::Unspecified,
18942 1 => Self::File,
18943 2 => Self::Unified,
18944 _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18945 wkt::internal::UnknownEnumValue::Integer(value),
18946 )),
18947 }
18948 }
18949}
18950
18951impl std::convert::From<&str> for StoragePoolType {
18952 fn from(value: &str) -> Self {
18953 use std::string::ToString;
18954 match value {
18955 "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
18956 "FILE" => Self::File,
18957 "UNIFIED" => Self::Unified,
18958 _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18959 wkt::internal::UnknownEnumValue::String(value.to_string()),
18960 )),
18961 }
18962 }
18963}
18964
18965impl serde::ser::Serialize for StoragePoolType {
18966 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18967 where
18968 S: serde::Serializer,
18969 {
18970 match self {
18971 Self::Unspecified => serializer.serialize_i32(0),
18972 Self::File => serializer.serialize_i32(1),
18973 Self::Unified => serializer.serialize_i32(2),
18974 Self::UnknownValue(u) => u.0.serialize(serializer),
18975 }
18976 }
18977}
18978
18979impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
18980 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18981 where
18982 D: serde::Deserializer<'de>,
18983 {
18984 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
18985 ".google.cloud.netapp.v1.StoragePoolType",
18986 ))
18987 }
18988}
18989
18990/// Defines the scale-type of a UNIFIED Storage Pool.
18991///
18992/// # Working with unknown values
18993///
18994/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18995/// additional enum variants at any time. Adding new variants is not considered
18996/// a breaking change. Applications should write their code in anticipation of:
18997///
18998/// - New values appearing in future releases of the client library, **and**
18999/// - New values received dynamically, without application changes.
19000///
19001/// Please consult the [Working with enums] section in the user guide for some
19002/// guidelines.
19003///
19004/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19005#[derive(Clone, Debug, PartialEq)]
19006#[non_exhaustive]
19007pub enum ScaleType {
19008 /// Unspecified scale type.
19009 Unspecified,
19010 /// Represents standard capacity and performance scale-type.
19011 /// Suitable for general purpose workloads.
19012 Default,
19013 /// Represents higher capacity and performance scale-type.
19014 /// Suitable for more demanding workloads.
19015 Scaleout,
19016 /// If set, the enum was initialized with an unknown value.
19017 ///
19018 /// Applications can examine the value using [ScaleType::value] or
19019 /// [ScaleType::name].
19020 UnknownValue(scale_type::UnknownValue),
19021}
19022
19023#[doc(hidden)]
19024pub mod scale_type {
19025 #[allow(unused_imports)]
19026 use super::*;
19027 #[derive(Clone, Debug, PartialEq)]
19028 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19029}
19030
19031impl ScaleType {
19032 /// Gets the enum value.
19033 ///
19034 /// Returns `None` if the enum contains an unknown value deserialized from
19035 /// the string representation of enums.
19036 pub fn value(&self) -> std::option::Option<i32> {
19037 match self {
19038 Self::Unspecified => std::option::Option::Some(0),
19039 Self::Default => std::option::Option::Some(1),
19040 Self::Scaleout => std::option::Option::Some(2),
19041 Self::UnknownValue(u) => u.0.value(),
19042 }
19043 }
19044
19045 /// Gets the enum value as a string.
19046 ///
19047 /// Returns `None` if the enum contains an unknown value deserialized from
19048 /// the integer representation of enums.
19049 pub fn name(&self) -> std::option::Option<&str> {
19050 match self {
19051 Self::Unspecified => std::option::Option::Some("SCALE_TYPE_UNSPECIFIED"),
19052 Self::Default => std::option::Option::Some("SCALE_TYPE_DEFAULT"),
19053 Self::Scaleout => std::option::Option::Some("SCALE_TYPE_SCALEOUT"),
19054 Self::UnknownValue(u) => u.0.name(),
19055 }
19056 }
19057}
19058
19059impl std::default::Default for ScaleType {
19060 fn default() -> Self {
19061 use std::convert::From;
19062 Self::from(0)
19063 }
19064}
19065
19066impl std::fmt::Display for ScaleType {
19067 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19068 wkt::internal::display_enum(f, self.name(), self.value())
19069 }
19070}
19071
19072impl std::convert::From<i32> for ScaleType {
19073 fn from(value: i32) -> Self {
19074 match value {
19075 0 => Self::Unspecified,
19076 1 => Self::Default,
19077 2 => Self::Scaleout,
19078 _ => Self::UnknownValue(scale_type::UnknownValue(
19079 wkt::internal::UnknownEnumValue::Integer(value),
19080 )),
19081 }
19082 }
19083}
19084
19085impl std::convert::From<&str> for ScaleType {
19086 fn from(value: &str) -> Self {
19087 use std::string::ToString;
19088 match value {
19089 "SCALE_TYPE_UNSPECIFIED" => Self::Unspecified,
19090 "SCALE_TYPE_DEFAULT" => Self::Default,
19091 "SCALE_TYPE_SCALEOUT" => Self::Scaleout,
19092 _ => Self::UnknownValue(scale_type::UnknownValue(
19093 wkt::internal::UnknownEnumValue::String(value.to_string()),
19094 )),
19095 }
19096 }
19097}
19098
19099impl serde::ser::Serialize for ScaleType {
19100 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19101 where
19102 S: serde::Serializer,
19103 {
19104 match self {
19105 Self::Unspecified => serializer.serialize_i32(0),
19106 Self::Default => serializer.serialize_i32(1),
19107 Self::Scaleout => serializer.serialize_i32(2),
19108 Self::UnknownValue(u) => u.0.serialize(serializer),
19109 }
19110 }
19111}
19112
19113impl<'de> serde::de::Deserialize<'de> for ScaleType {
19114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19115 where
19116 D: serde::Deserializer<'de>,
19117 {
19118 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScaleType>::new(
19119 ".google.cloud.netapp.v1.ScaleType",
19120 ))
19121 }
19122}
19123
19124/// Schedule for Hybrid Replication.
19125/// New enum values may be added in future to support different frequency of
19126/// replication.
19127///
19128/// # Working with unknown values
19129///
19130/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19131/// additional enum variants at any time. Adding new variants is not considered
19132/// a breaking change. Applications should write their code in anticipation of:
19133///
19134/// - New values appearing in future releases of the client library, **and**
19135/// - New values received dynamically, without application changes.
19136///
19137/// Please consult the [Working with enums] section in the user guide for some
19138/// guidelines.
19139///
19140/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19141#[derive(Clone, Debug, PartialEq)]
19142#[non_exhaustive]
19143pub enum HybridReplicationSchedule {
19144 /// Unspecified HybridReplicationSchedule
19145 Unspecified,
19146 /// Replication happens once every 10 minutes.
19147 Every10Minutes,
19148 /// Replication happens once every hour.
19149 Hourly,
19150 /// Replication happens once every day.
19151 Daily,
19152 /// If set, the enum was initialized with an unknown value.
19153 ///
19154 /// Applications can examine the value using [HybridReplicationSchedule::value] or
19155 /// [HybridReplicationSchedule::name].
19156 UnknownValue(hybrid_replication_schedule::UnknownValue),
19157}
19158
19159#[doc(hidden)]
19160pub mod hybrid_replication_schedule {
19161 #[allow(unused_imports)]
19162 use super::*;
19163 #[derive(Clone, Debug, PartialEq)]
19164 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19165}
19166
19167impl HybridReplicationSchedule {
19168 /// Gets the enum value.
19169 ///
19170 /// Returns `None` if the enum contains an unknown value deserialized from
19171 /// the string representation of enums.
19172 pub fn value(&self) -> std::option::Option<i32> {
19173 match self {
19174 Self::Unspecified => std::option::Option::Some(0),
19175 Self::Every10Minutes => std::option::Option::Some(1),
19176 Self::Hourly => std::option::Option::Some(2),
19177 Self::Daily => std::option::Option::Some(3),
19178 Self::UnknownValue(u) => u.0.value(),
19179 }
19180 }
19181
19182 /// Gets the enum value as a string.
19183 ///
19184 /// Returns `None` if the enum contains an unknown value deserialized from
19185 /// the integer representation of enums.
19186 pub fn name(&self) -> std::option::Option<&str> {
19187 match self {
19188 Self::Unspecified => {
19189 std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
19190 }
19191 Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
19192 Self::Hourly => std::option::Option::Some("HOURLY"),
19193 Self::Daily => std::option::Option::Some("DAILY"),
19194 Self::UnknownValue(u) => u.0.name(),
19195 }
19196 }
19197}
19198
19199impl std::default::Default for HybridReplicationSchedule {
19200 fn default() -> Self {
19201 use std::convert::From;
19202 Self::from(0)
19203 }
19204}
19205
19206impl std::fmt::Display for HybridReplicationSchedule {
19207 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19208 wkt::internal::display_enum(f, self.name(), self.value())
19209 }
19210}
19211
19212impl std::convert::From<i32> for HybridReplicationSchedule {
19213 fn from(value: i32) -> Self {
19214 match value {
19215 0 => Self::Unspecified,
19216 1 => Self::Every10Minutes,
19217 2 => Self::Hourly,
19218 3 => Self::Daily,
19219 _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
19220 wkt::internal::UnknownEnumValue::Integer(value),
19221 )),
19222 }
19223 }
19224}
19225
19226impl std::convert::From<&str> for HybridReplicationSchedule {
19227 fn from(value: &str) -> Self {
19228 use std::string::ToString;
19229 match value {
19230 "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
19231 "EVERY_10_MINUTES" => Self::Every10Minutes,
19232 "HOURLY" => Self::Hourly,
19233 "DAILY" => Self::Daily,
19234 _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
19235 wkt::internal::UnknownEnumValue::String(value.to_string()),
19236 )),
19237 }
19238 }
19239}
19240
19241impl serde::ser::Serialize for HybridReplicationSchedule {
19242 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19243 where
19244 S: serde::Serializer,
19245 {
19246 match self {
19247 Self::Unspecified => serializer.serialize_i32(0),
19248 Self::Every10Minutes => serializer.serialize_i32(1),
19249 Self::Hourly => serializer.serialize_i32(2),
19250 Self::Daily => serializer.serialize_i32(3),
19251 Self::UnknownValue(u) => u.0.serialize(serializer),
19252 }
19253 }
19254}
19255
19256impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
19257 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19258 where
19259 D: serde::Deserializer<'de>,
19260 {
19261 deserializer.deserialize_any(
19262 wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
19263 ".google.cloud.netapp.v1.HybridReplicationSchedule",
19264 ),
19265 )
19266 }
19267}
19268
19269/// QoS (Quality of Service) Types of the storage pool
19270///
19271/// # Working with unknown values
19272///
19273/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19274/// additional enum variants at any time. Adding new variants is not considered
19275/// a breaking change. Applications should write their code in anticipation of:
19276///
19277/// - New values appearing in future releases of the client library, **and**
19278/// - New values received dynamically, without application changes.
19279///
19280/// Please consult the [Working with enums] section in the user guide for some
19281/// guidelines.
19282///
19283/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19284#[derive(Clone, Debug, PartialEq)]
19285#[non_exhaustive]
19286pub enum QosType {
19287 /// Unspecified QoS Type
19288 Unspecified,
19289 /// QoS Type is Auto
19290 Auto,
19291 /// QoS Type is Manual
19292 Manual,
19293 /// If set, the enum was initialized with an unknown value.
19294 ///
19295 /// Applications can examine the value using [QosType::value] or
19296 /// [QosType::name].
19297 UnknownValue(qos_type::UnknownValue),
19298}
19299
19300#[doc(hidden)]
19301pub mod qos_type {
19302 #[allow(unused_imports)]
19303 use super::*;
19304 #[derive(Clone, Debug, PartialEq)]
19305 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19306}
19307
19308impl QosType {
19309 /// Gets the enum value.
19310 ///
19311 /// Returns `None` if the enum contains an unknown value deserialized from
19312 /// the string representation of enums.
19313 pub fn value(&self) -> std::option::Option<i32> {
19314 match self {
19315 Self::Unspecified => std::option::Option::Some(0),
19316 Self::Auto => std::option::Option::Some(1),
19317 Self::Manual => std::option::Option::Some(2),
19318 Self::UnknownValue(u) => u.0.value(),
19319 }
19320 }
19321
19322 /// Gets the enum value as a string.
19323 ///
19324 /// Returns `None` if the enum contains an unknown value deserialized from
19325 /// the integer representation of enums.
19326 pub fn name(&self) -> std::option::Option<&str> {
19327 match self {
19328 Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
19329 Self::Auto => std::option::Option::Some("AUTO"),
19330 Self::Manual => std::option::Option::Some("MANUAL"),
19331 Self::UnknownValue(u) => u.0.name(),
19332 }
19333 }
19334}
19335
19336impl std::default::Default for QosType {
19337 fn default() -> Self {
19338 use std::convert::From;
19339 Self::from(0)
19340 }
19341}
19342
19343impl std::fmt::Display for QosType {
19344 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19345 wkt::internal::display_enum(f, self.name(), self.value())
19346 }
19347}
19348
19349impl std::convert::From<i32> for QosType {
19350 fn from(value: i32) -> Self {
19351 match value {
19352 0 => Self::Unspecified,
19353 1 => Self::Auto,
19354 2 => Self::Manual,
19355 _ => Self::UnknownValue(qos_type::UnknownValue(
19356 wkt::internal::UnknownEnumValue::Integer(value),
19357 )),
19358 }
19359 }
19360}
19361
19362impl std::convert::From<&str> for QosType {
19363 fn from(value: &str) -> Self {
19364 use std::string::ToString;
19365 match value {
19366 "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
19367 "AUTO" => Self::Auto,
19368 "MANUAL" => Self::Manual,
19369 _ => Self::UnknownValue(qos_type::UnknownValue(
19370 wkt::internal::UnknownEnumValue::String(value.to_string()),
19371 )),
19372 }
19373 }
19374}
19375
19376impl serde::ser::Serialize for QosType {
19377 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19378 where
19379 S: serde::Serializer,
19380 {
19381 match self {
19382 Self::Unspecified => serializer.serialize_i32(0),
19383 Self::Auto => serializer.serialize_i32(1),
19384 Self::Manual => serializer.serialize_i32(2),
19385 Self::UnknownValue(u) => u.0.serialize(serializer),
19386 }
19387 }
19388}
19389
19390impl<'de> serde::de::Deserialize<'de> for QosType {
19391 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19392 where
19393 D: serde::Deserializer<'de>,
19394 {
19395 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
19396 ".google.cloud.netapp.v1.QosType",
19397 ))
19398 }
19399}
19400
19401/// OS types for the host group
19402///
19403/// # Working with unknown values
19404///
19405/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19406/// additional enum variants at any time. Adding new variants is not considered
19407/// a breaking change. Applications should write their code in anticipation of:
19408///
19409/// - New values appearing in future releases of the client library, **and**
19410/// - New values received dynamically, without application changes.
19411///
19412/// Please consult the [Working with enums] section in the user guide for some
19413/// guidelines.
19414///
19415/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19416#[derive(Clone, Debug, PartialEq)]
19417#[non_exhaustive]
19418pub enum OsType {
19419 /// Unspecified OS Type
19420 Unspecified,
19421 /// OS Type is Linux
19422 Linux,
19423 /// OS Type is Windows
19424 Windows,
19425 /// OS Type is VMware ESXi
19426 Esxi,
19427 /// If set, the enum was initialized with an unknown value.
19428 ///
19429 /// Applications can examine the value using [OsType::value] or
19430 /// [OsType::name].
19431 UnknownValue(os_type::UnknownValue),
19432}
19433
19434#[doc(hidden)]
19435pub mod os_type {
19436 #[allow(unused_imports)]
19437 use super::*;
19438 #[derive(Clone, Debug, PartialEq)]
19439 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19440}
19441
19442impl OsType {
19443 /// Gets the enum value.
19444 ///
19445 /// Returns `None` if the enum contains an unknown value deserialized from
19446 /// the string representation of enums.
19447 pub fn value(&self) -> std::option::Option<i32> {
19448 match self {
19449 Self::Unspecified => std::option::Option::Some(0),
19450 Self::Linux => std::option::Option::Some(1),
19451 Self::Windows => std::option::Option::Some(2),
19452 Self::Esxi => std::option::Option::Some(3),
19453 Self::UnknownValue(u) => u.0.value(),
19454 }
19455 }
19456
19457 /// Gets the enum value as a string.
19458 ///
19459 /// Returns `None` if the enum contains an unknown value deserialized from
19460 /// the integer representation of enums.
19461 pub fn name(&self) -> std::option::Option<&str> {
19462 match self {
19463 Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
19464 Self::Linux => std::option::Option::Some("LINUX"),
19465 Self::Windows => std::option::Option::Some("WINDOWS"),
19466 Self::Esxi => std::option::Option::Some("ESXI"),
19467 Self::UnknownValue(u) => u.0.name(),
19468 }
19469 }
19470}
19471
19472impl std::default::Default for OsType {
19473 fn default() -> Self {
19474 use std::convert::From;
19475 Self::from(0)
19476 }
19477}
19478
19479impl std::fmt::Display for OsType {
19480 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19481 wkt::internal::display_enum(f, self.name(), self.value())
19482 }
19483}
19484
19485impl std::convert::From<i32> for OsType {
19486 fn from(value: i32) -> Self {
19487 match value {
19488 0 => Self::Unspecified,
19489 1 => Self::Linux,
19490 2 => Self::Windows,
19491 3 => Self::Esxi,
19492 _ => Self::UnknownValue(os_type::UnknownValue(
19493 wkt::internal::UnknownEnumValue::Integer(value),
19494 )),
19495 }
19496 }
19497}
19498
19499impl std::convert::From<&str> for OsType {
19500 fn from(value: &str) -> Self {
19501 use std::string::ToString;
19502 match value {
19503 "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
19504 "LINUX" => Self::Linux,
19505 "WINDOWS" => Self::Windows,
19506 "ESXI" => Self::Esxi,
19507 _ => Self::UnknownValue(os_type::UnknownValue(
19508 wkt::internal::UnknownEnumValue::String(value.to_string()),
19509 )),
19510 }
19511 }
19512}
19513
19514impl serde::ser::Serialize for OsType {
19515 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19516 where
19517 S: serde::Serializer,
19518 {
19519 match self {
19520 Self::Unspecified => serializer.serialize_i32(0),
19521 Self::Linux => serializer.serialize_i32(1),
19522 Self::Windows => serializer.serialize_i32(2),
19523 Self::Esxi => serializer.serialize_i32(3),
19524 Self::UnknownValue(u) => u.0.serialize(serializer),
19525 }
19526 }
19527}
19528
19529impl<'de> serde::de::Deserialize<'de> for OsType {
19530 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19531 where
19532 D: serde::Deserializer<'de>,
19533 {
19534 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
19535 ".google.cloud.netapp.v1.OsType",
19536 ))
19537 }
19538}
19539
19540/// `Mode` of the storage pool or volume. This field is used to control whether
19541/// the resource is managed by the GCNV APIs or the GCNV ONTAP Mode APIs.
19542///
19543/// # Working with unknown values
19544///
19545/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19546/// additional enum variants at any time. Adding new variants is not considered
19547/// a breaking change. Applications should write their code in anticipation of:
19548///
19549/// - New values appearing in future releases of the client library, **and**
19550/// - New values received dynamically, without application changes.
19551///
19552/// Please consult the [Working with enums] section in the user guide for some
19553/// guidelines.
19554///
19555/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19556#[derive(Clone, Debug, PartialEq)]
19557#[non_exhaustive]
19558pub enum Mode {
19559 /// The `Mode` is not specified.
19560 Unspecified,
19561 /// The resource is managed by the GCNV APIs.
19562 Default,
19563 /// The resource is managed by the GCNV ONTAP Mode APIs.
19564 Ontap,
19565 /// If set, the enum was initialized with an unknown value.
19566 ///
19567 /// Applications can examine the value using [Mode::value] or
19568 /// [Mode::name].
19569 UnknownValue(mode::UnknownValue),
19570}
19571
19572#[doc(hidden)]
19573pub mod mode {
19574 #[allow(unused_imports)]
19575 use super::*;
19576 #[derive(Clone, Debug, PartialEq)]
19577 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19578}
19579
19580impl Mode {
19581 /// Gets the enum value.
19582 ///
19583 /// Returns `None` if the enum contains an unknown value deserialized from
19584 /// the string representation of enums.
19585 pub fn value(&self) -> std::option::Option<i32> {
19586 match self {
19587 Self::Unspecified => std::option::Option::Some(0),
19588 Self::Default => std::option::Option::Some(1),
19589 Self::Ontap => std::option::Option::Some(2),
19590 Self::UnknownValue(u) => u.0.value(),
19591 }
19592 }
19593
19594 /// Gets the enum value as a string.
19595 ///
19596 /// Returns `None` if the enum contains an unknown value deserialized from
19597 /// the integer representation of enums.
19598 pub fn name(&self) -> std::option::Option<&str> {
19599 match self {
19600 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
19601 Self::Default => std::option::Option::Some("DEFAULT"),
19602 Self::Ontap => std::option::Option::Some("ONTAP"),
19603 Self::UnknownValue(u) => u.0.name(),
19604 }
19605 }
19606}
19607
19608impl std::default::Default for Mode {
19609 fn default() -> Self {
19610 use std::convert::From;
19611 Self::from(0)
19612 }
19613}
19614
19615impl std::fmt::Display for Mode {
19616 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19617 wkt::internal::display_enum(f, self.name(), self.value())
19618 }
19619}
19620
19621impl std::convert::From<i32> for Mode {
19622 fn from(value: i32) -> Self {
19623 match value {
19624 0 => Self::Unspecified,
19625 1 => Self::Default,
19626 2 => Self::Ontap,
19627 _ => Self::UnknownValue(mode::UnknownValue(
19628 wkt::internal::UnknownEnumValue::Integer(value),
19629 )),
19630 }
19631 }
19632}
19633
19634impl std::convert::From<&str> for Mode {
19635 fn from(value: &str) -> Self {
19636 use std::string::ToString;
19637 match value {
19638 "MODE_UNSPECIFIED" => Self::Unspecified,
19639 "DEFAULT" => Self::Default,
19640 "ONTAP" => Self::Ontap,
19641 _ => Self::UnknownValue(mode::UnknownValue(wkt::internal::UnknownEnumValue::String(
19642 value.to_string(),
19643 ))),
19644 }
19645 }
19646}
19647
19648impl serde::ser::Serialize for Mode {
19649 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19650 where
19651 S: serde::Serializer,
19652 {
19653 match self {
19654 Self::Unspecified => serializer.serialize_i32(0),
19655 Self::Default => serializer.serialize_i32(1),
19656 Self::Ontap => serializer.serialize_i32(2),
19657 Self::UnknownValue(u) => u.0.serialize(serializer),
19658 }
19659 }
19660}
19661
19662impl<'de> serde::de::Deserialize<'de> for Mode {
19663 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19664 where
19665 D: serde::Deserializer<'de>,
19666 {
19667 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
19668 ".google.cloud.netapp.v1.Mode",
19669 ))
19670 }
19671}
19672
19673/// Protocols is an enum of all the supported network protocols for a volume.
19674///
19675/// # Working with unknown values
19676///
19677/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19678/// additional enum variants at any time. Adding new variants is not considered
19679/// a breaking change. Applications should write their code in anticipation of:
19680///
19681/// - New values appearing in future releases of the client library, **and**
19682/// - New values received dynamically, without application changes.
19683///
19684/// Please consult the [Working with enums] section in the user guide for some
19685/// guidelines.
19686///
19687/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19688#[derive(Clone, Debug, PartialEq)]
19689#[non_exhaustive]
19690pub enum Protocols {
19691 /// Unspecified protocol
19692 Unspecified,
19693 /// NFS V3 protocol
19694 Nfsv3,
19695 /// NFS V4 protocol
19696 Nfsv4,
19697 /// SMB protocol
19698 Smb,
19699 /// ISCSI protocol
19700 Iscsi,
19701 /// If set, the enum was initialized with an unknown value.
19702 ///
19703 /// Applications can examine the value using [Protocols::value] or
19704 /// [Protocols::name].
19705 UnknownValue(protocols::UnknownValue),
19706}
19707
19708#[doc(hidden)]
19709pub mod protocols {
19710 #[allow(unused_imports)]
19711 use super::*;
19712 #[derive(Clone, Debug, PartialEq)]
19713 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19714}
19715
19716impl Protocols {
19717 /// Gets the enum value.
19718 ///
19719 /// Returns `None` if the enum contains an unknown value deserialized from
19720 /// the string representation of enums.
19721 pub fn value(&self) -> std::option::Option<i32> {
19722 match self {
19723 Self::Unspecified => std::option::Option::Some(0),
19724 Self::Nfsv3 => std::option::Option::Some(1),
19725 Self::Nfsv4 => std::option::Option::Some(2),
19726 Self::Smb => std::option::Option::Some(3),
19727 Self::Iscsi => std::option::Option::Some(4),
19728 Self::UnknownValue(u) => u.0.value(),
19729 }
19730 }
19731
19732 /// Gets the enum value as a string.
19733 ///
19734 /// Returns `None` if the enum contains an unknown value deserialized from
19735 /// the integer representation of enums.
19736 pub fn name(&self) -> std::option::Option<&str> {
19737 match self {
19738 Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
19739 Self::Nfsv3 => std::option::Option::Some("NFSV3"),
19740 Self::Nfsv4 => std::option::Option::Some("NFSV4"),
19741 Self::Smb => std::option::Option::Some("SMB"),
19742 Self::Iscsi => std::option::Option::Some("ISCSI"),
19743 Self::UnknownValue(u) => u.0.name(),
19744 }
19745 }
19746}
19747
19748impl std::default::Default for Protocols {
19749 fn default() -> Self {
19750 use std::convert::From;
19751 Self::from(0)
19752 }
19753}
19754
19755impl std::fmt::Display for Protocols {
19756 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19757 wkt::internal::display_enum(f, self.name(), self.value())
19758 }
19759}
19760
19761impl std::convert::From<i32> for Protocols {
19762 fn from(value: i32) -> Self {
19763 match value {
19764 0 => Self::Unspecified,
19765 1 => Self::Nfsv3,
19766 2 => Self::Nfsv4,
19767 3 => Self::Smb,
19768 4 => Self::Iscsi,
19769 _ => Self::UnknownValue(protocols::UnknownValue(
19770 wkt::internal::UnknownEnumValue::Integer(value),
19771 )),
19772 }
19773 }
19774}
19775
19776impl std::convert::From<&str> for Protocols {
19777 fn from(value: &str) -> Self {
19778 use std::string::ToString;
19779 match value {
19780 "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
19781 "NFSV3" => Self::Nfsv3,
19782 "NFSV4" => Self::Nfsv4,
19783 "SMB" => Self::Smb,
19784 "ISCSI" => Self::Iscsi,
19785 _ => Self::UnknownValue(protocols::UnknownValue(
19786 wkt::internal::UnknownEnumValue::String(value.to_string()),
19787 )),
19788 }
19789 }
19790}
19791
19792impl serde::ser::Serialize for Protocols {
19793 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19794 where
19795 S: serde::Serializer,
19796 {
19797 match self {
19798 Self::Unspecified => serializer.serialize_i32(0),
19799 Self::Nfsv3 => serializer.serialize_i32(1),
19800 Self::Nfsv4 => serializer.serialize_i32(2),
19801 Self::Smb => serializer.serialize_i32(3),
19802 Self::Iscsi => serializer.serialize_i32(4),
19803 Self::UnknownValue(u) => u.0.serialize(serializer),
19804 }
19805 }
19806}
19807
19808impl<'de> serde::de::Deserialize<'de> for Protocols {
19809 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19810 where
19811 D: serde::Deserializer<'de>,
19812 {
19813 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
19814 ".google.cloud.netapp.v1.Protocols",
19815 ))
19816 }
19817}
19818
19819/// AccessType is an enum of all the supported access types for a volume.
19820///
19821/// # Working with unknown values
19822///
19823/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19824/// additional enum variants at any time. Adding new variants is not considered
19825/// a breaking change. Applications should write their code in anticipation of:
19826///
19827/// - New values appearing in future releases of the client library, **and**
19828/// - New values received dynamically, without application changes.
19829///
19830/// Please consult the [Working with enums] section in the user guide for some
19831/// guidelines.
19832///
19833/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19834#[derive(Clone, Debug, PartialEq)]
19835#[non_exhaustive]
19836pub enum AccessType {
19837 /// Unspecified Access Type
19838 Unspecified,
19839 /// Read Only
19840 ReadOnly,
19841 /// Read Write
19842 ReadWrite,
19843 /// None
19844 ReadNone,
19845 /// If set, the enum was initialized with an unknown value.
19846 ///
19847 /// Applications can examine the value using [AccessType::value] or
19848 /// [AccessType::name].
19849 UnknownValue(access_type::UnknownValue),
19850}
19851
19852#[doc(hidden)]
19853pub mod access_type {
19854 #[allow(unused_imports)]
19855 use super::*;
19856 #[derive(Clone, Debug, PartialEq)]
19857 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19858}
19859
19860impl AccessType {
19861 /// Gets the enum value.
19862 ///
19863 /// Returns `None` if the enum contains an unknown value deserialized from
19864 /// the string representation of enums.
19865 pub fn value(&self) -> std::option::Option<i32> {
19866 match self {
19867 Self::Unspecified => std::option::Option::Some(0),
19868 Self::ReadOnly => std::option::Option::Some(1),
19869 Self::ReadWrite => std::option::Option::Some(2),
19870 Self::ReadNone => std::option::Option::Some(3),
19871 Self::UnknownValue(u) => u.0.value(),
19872 }
19873 }
19874
19875 /// Gets the enum value as a string.
19876 ///
19877 /// Returns `None` if the enum contains an unknown value deserialized from
19878 /// the integer representation of enums.
19879 pub fn name(&self) -> std::option::Option<&str> {
19880 match self {
19881 Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
19882 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
19883 Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
19884 Self::ReadNone => std::option::Option::Some("READ_NONE"),
19885 Self::UnknownValue(u) => u.0.name(),
19886 }
19887 }
19888}
19889
19890impl std::default::Default for AccessType {
19891 fn default() -> Self {
19892 use std::convert::From;
19893 Self::from(0)
19894 }
19895}
19896
19897impl std::fmt::Display for AccessType {
19898 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19899 wkt::internal::display_enum(f, self.name(), self.value())
19900 }
19901}
19902
19903impl std::convert::From<i32> for AccessType {
19904 fn from(value: i32) -> Self {
19905 match value {
19906 0 => Self::Unspecified,
19907 1 => Self::ReadOnly,
19908 2 => Self::ReadWrite,
19909 3 => Self::ReadNone,
19910 _ => Self::UnknownValue(access_type::UnknownValue(
19911 wkt::internal::UnknownEnumValue::Integer(value),
19912 )),
19913 }
19914 }
19915}
19916
19917impl std::convert::From<&str> for AccessType {
19918 fn from(value: &str) -> Self {
19919 use std::string::ToString;
19920 match value {
19921 "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
19922 "READ_ONLY" => Self::ReadOnly,
19923 "READ_WRITE" => Self::ReadWrite,
19924 "READ_NONE" => Self::ReadNone,
19925 _ => Self::UnknownValue(access_type::UnknownValue(
19926 wkt::internal::UnknownEnumValue::String(value.to_string()),
19927 )),
19928 }
19929 }
19930}
19931
19932impl serde::ser::Serialize for AccessType {
19933 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19934 where
19935 S: serde::Serializer,
19936 {
19937 match self {
19938 Self::Unspecified => serializer.serialize_i32(0),
19939 Self::ReadOnly => serializer.serialize_i32(1),
19940 Self::ReadWrite => serializer.serialize_i32(2),
19941 Self::ReadNone => serializer.serialize_i32(3),
19942 Self::UnknownValue(u) => u.0.serialize(serializer),
19943 }
19944 }
19945}
19946
19947impl<'de> serde::de::Deserialize<'de> for AccessType {
19948 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19949 where
19950 D: serde::Deserializer<'de>,
19951 {
19952 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
19953 ".google.cloud.netapp.v1.AccessType",
19954 ))
19955 }
19956}
19957
19958/// SMBSettings
19959/// Modifies the behaviour of a SMB volume.
19960///
19961/// # Working with unknown values
19962///
19963/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19964/// additional enum variants at any time. Adding new variants is not considered
19965/// a breaking change. Applications should write their code in anticipation of:
19966///
19967/// - New values appearing in future releases of the client library, **and**
19968/// - New values received dynamically, without application changes.
19969///
19970/// Please consult the [Working with enums] section in the user guide for some
19971/// guidelines.
19972///
19973/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19974#[derive(Clone, Debug, PartialEq)]
19975#[non_exhaustive]
19976pub enum SMBSettings {
19977 /// Unspecified default option
19978 Unspecified,
19979 /// SMB setting encrypt data
19980 EncryptData,
19981 /// SMB setting browsable
19982 Browsable,
19983 /// SMB setting notify change
19984 ChangeNotify,
19985 /// SMB setting not to notify change
19986 NonBrowsable,
19987 /// SMB setting oplocks
19988 Oplocks,
19989 /// SMB setting to show snapshots
19990 ShowSnapshot,
19991 /// SMB setting to show previous versions
19992 ShowPreviousVersions,
19993 /// SMB setting to access volume based on enumerartion
19994 AccessBasedEnumeration,
19995 /// Continuously available enumeration
19996 ContinuouslyAvailable,
19997 /// If set, the enum was initialized with an unknown value.
19998 ///
19999 /// Applications can examine the value using [SMBSettings::value] or
20000 /// [SMBSettings::name].
20001 UnknownValue(smb_settings::UnknownValue),
20002}
20003
20004#[doc(hidden)]
20005pub mod smb_settings {
20006 #[allow(unused_imports)]
20007 use super::*;
20008 #[derive(Clone, Debug, PartialEq)]
20009 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20010}
20011
20012impl SMBSettings {
20013 /// Gets the enum value.
20014 ///
20015 /// Returns `None` if the enum contains an unknown value deserialized from
20016 /// the string representation of enums.
20017 pub fn value(&self) -> std::option::Option<i32> {
20018 match self {
20019 Self::Unspecified => std::option::Option::Some(0),
20020 Self::EncryptData => std::option::Option::Some(1),
20021 Self::Browsable => std::option::Option::Some(2),
20022 Self::ChangeNotify => std::option::Option::Some(3),
20023 Self::NonBrowsable => std::option::Option::Some(4),
20024 Self::Oplocks => std::option::Option::Some(5),
20025 Self::ShowSnapshot => std::option::Option::Some(6),
20026 Self::ShowPreviousVersions => std::option::Option::Some(7),
20027 Self::AccessBasedEnumeration => std::option::Option::Some(8),
20028 Self::ContinuouslyAvailable => std::option::Option::Some(9),
20029 Self::UnknownValue(u) => u.0.value(),
20030 }
20031 }
20032
20033 /// Gets the enum value as a string.
20034 ///
20035 /// Returns `None` if the enum contains an unknown value deserialized from
20036 /// the integer representation of enums.
20037 pub fn name(&self) -> std::option::Option<&str> {
20038 match self {
20039 Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
20040 Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
20041 Self::Browsable => std::option::Option::Some("BROWSABLE"),
20042 Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
20043 Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
20044 Self::Oplocks => std::option::Option::Some("OPLOCKS"),
20045 Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
20046 Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
20047 Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
20048 Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
20049 Self::UnknownValue(u) => u.0.name(),
20050 }
20051 }
20052}
20053
20054impl std::default::Default for SMBSettings {
20055 fn default() -> Self {
20056 use std::convert::From;
20057 Self::from(0)
20058 }
20059}
20060
20061impl std::fmt::Display for SMBSettings {
20062 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20063 wkt::internal::display_enum(f, self.name(), self.value())
20064 }
20065}
20066
20067impl std::convert::From<i32> for SMBSettings {
20068 fn from(value: i32) -> Self {
20069 match value {
20070 0 => Self::Unspecified,
20071 1 => Self::EncryptData,
20072 2 => Self::Browsable,
20073 3 => Self::ChangeNotify,
20074 4 => Self::NonBrowsable,
20075 5 => Self::Oplocks,
20076 6 => Self::ShowSnapshot,
20077 7 => Self::ShowPreviousVersions,
20078 8 => Self::AccessBasedEnumeration,
20079 9 => Self::ContinuouslyAvailable,
20080 _ => Self::UnknownValue(smb_settings::UnknownValue(
20081 wkt::internal::UnknownEnumValue::Integer(value),
20082 )),
20083 }
20084 }
20085}
20086
20087impl std::convert::From<&str> for SMBSettings {
20088 fn from(value: &str) -> Self {
20089 use std::string::ToString;
20090 match value {
20091 "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
20092 "ENCRYPT_DATA" => Self::EncryptData,
20093 "BROWSABLE" => Self::Browsable,
20094 "CHANGE_NOTIFY" => Self::ChangeNotify,
20095 "NON_BROWSABLE" => Self::NonBrowsable,
20096 "OPLOCKS" => Self::Oplocks,
20097 "SHOW_SNAPSHOT" => Self::ShowSnapshot,
20098 "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
20099 "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
20100 "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
20101 _ => Self::UnknownValue(smb_settings::UnknownValue(
20102 wkt::internal::UnknownEnumValue::String(value.to_string()),
20103 )),
20104 }
20105 }
20106}
20107
20108impl serde::ser::Serialize for SMBSettings {
20109 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20110 where
20111 S: serde::Serializer,
20112 {
20113 match self {
20114 Self::Unspecified => serializer.serialize_i32(0),
20115 Self::EncryptData => serializer.serialize_i32(1),
20116 Self::Browsable => serializer.serialize_i32(2),
20117 Self::ChangeNotify => serializer.serialize_i32(3),
20118 Self::NonBrowsable => serializer.serialize_i32(4),
20119 Self::Oplocks => serializer.serialize_i32(5),
20120 Self::ShowSnapshot => serializer.serialize_i32(6),
20121 Self::ShowPreviousVersions => serializer.serialize_i32(7),
20122 Self::AccessBasedEnumeration => serializer.serialize_i32(8),
20123 Self::ContinuouslyAvailable => serializer.serialize_i32(9),
20124 Self::UnknownValue(u) => u.0.serialize(serializer),
20125 }
20126 }
20127}
20128
20129impl<'de> serde::de::Deserialize<'de> for SMBSettings {
20130 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20131 where
20132 D: serde::Deserializer<'de>,
20133 {
20134 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
20135 ".google.cloud.netapp.v1.SMBSettings",
20136 ))
20137 }
20138}
20139
20140/// The security style of the volume, can be either UNIX or NTFS.
20141///
20142/// # Working with unknown values
20143///
20144/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20145/// additional enum variants at any time. Adding new variants is not considered
20146/// a breaking change. Applications should write their code in anticipation of:
20147///
20148/// - New values appearing in future releases of the client library, **and**
20149/// - New values received dynamically, without application changes.
20150///
20151/// Please consult the [Working with enums] section in the user guide for some
20152/// guidelines.
20153///
20154/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20155#[derive(Clone, Debug, PartialEq)]
20156#[non_exhaustive]
20157pub enum SecurityStyle {
20158 /// SecurityStyle is unspecified
20159 Unspecified,
20160 /// SecurityStyle uses NTFS
20161 Ntfs,
20162 /// SecurityStyle uses UNIX
20163 Unix,
20164 /// If set, the enum was initialized with an unknown value.
20165 ///
20166 /// Applications can examine the value using [SecurityStyle::value] or
20167 /// [SecurityStyle::name].
20168 UnknownValue(security_style::UnknownValue),
20169}
20170
20171#[doc(hidden)]
20172pub mod security_style {
20173 #[allow(unused_imports)]
20174 use super::*;
20175 #[derive(Clone, Debug, PartialEq)]
20176 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20177}
20178
20179impl SecurityStyle {
20180 /// Gets the enum value.
20181 ///
20182 /// Returns `None` if the enum contains an unknown value deserialized from
20183 /// the string representation of enums.
20184 pub fn value(&self) -> std::option::Option<i32> {
20185 match self {
20186 Self::Unspecified => std::option::Option::Some(0),
20187 Self::Ntfs => std::option::Option::Some(1),
20188 Self::Unix => std::option::Option::Some(2),
20189 Self::UnknownValue(u) => u.0.value(),
20190 }
20191 }
20192
20193 /// Gets the enum value as a string.
20194 ///
20195 /// Returns `None` if the enum contains an unknown value deserialized from
20196 /// the integer representation of enums.
20197 pub fn name(&self) -> std::option::Option<&str> {
20198 match self {
20199 Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
20200 Self::Ntfs => std::option::Option::Some("NTFS"),
20201 Self::Unix => std::option::Option::Some("UNIX"),
20202 Self::UnknownValue(u) => u.0.name(),
20203 }
20204 }
20205}
20206
20207impl std::default::Default for SecurityStyle {
20208 fn default() -> Self {
20209 use std::convert::From;
20210 Self::from(0)
20211 }
20212}
20213
20214impl std::fmt::Display for SecurityStyle {
20215 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20216 wkt::internal::display_enum(f, self.name(), self.value())
20217 }
20218}
20219
20220impl std::convert::From<i32> for SecurityStyle {
20221 fn from(value: i32) -> Self {
20222 match value {
20223 0 => Self::Unspecified,
20224 1 => Self::Ntfs,
20225 2 => Self::Unix,
20226 _ => Self::UnknownValue(security_style::UnknownValue(
20227 wkt::internal::UnknownEnumValue::Integer(value),
20228 )),
20229 }
20230 }
20231}
20232
20233impl std::convert::From<&str> for SecurityStyle {
20234 fn from(value: &str) -> Self {
20235 use std::string::ToString;
20236 match value {
20237 "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
20238 "NTFS" => Self::Ntfs,
20239 "UNIX" => Self::Unix,
20240 _ => Self::UnknownValue(security_style::UnknownValue(
20241 wkt::internal::UnknownEnumValue::String(value.to_string()),
20242 )),
20243 }
20244 }
20245}
20246
20247impl serde::ser::Serialize for SecurityStyle {
20248 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20249 where
20250 S: serde::Serializer,
20251 {
20252 match self {
20253 Self::Unspecified => serializer.serialize_i32(0),
20254 Self::Ntfs => serializer.serialize_i32(1),
20255 Self::Unix => serializer.serialize_i32(2),
20256 Self::UnknownValue(u) => u.0.serialize(serializer),
20257 }
20258 }
20259}
20260
20261impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
20262 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20263 where
20264 D: serde::Deserializer<'de>,
20265 {
20266 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
20267 ".google.cloud.netapp.v1.SecurityStyle",
20268 ))
20269 }
20270}
20271
20272/// Actions to be restricted for a volume.
20273///
20274/// # Working with unknown values
20275///
20276/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20277/// additional enum variants at any time. Adding new variants is not considered
20278/// a breaking change. Applications should write their code in anticipation of:
20279///
20280/// - New values appearing in future releases of the client library, **and**
20281/// - New values received dynamically, without application changes.
20282///
20283/// Please consult the [Working with enums] section in the user guide for some
20284/// guidelines.
20285///
20286/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20287#[derive(Clone, Debug, PartialEq)]
20288#[non_exhaustive]
20289pub enum RestrictedAction {
20290 /// Unspecified restricted action
20291 Unspecified,
20292 /// Prevent volume from being deleted when mounted.
20293 Delete,
20294 /// If set, the enum was initialized with an unknown value.
20295 ///
20296 /// Applications can examine the value using [RestrictedAction::value] or
20297 /// [RestrictedAction::name].
20298 UnknownValue(restricted_action::UnknownValue),
20299}
20300
20301#[doc(hidden)]
20302pub mod restricted_action {
20303 #[allow(unused_imports)]
20304 use super::*;
20305 #[derive(Clone, Debug, PartialEq)]
20306 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20307}
20308
20309impl RestrictedAction {
20310 /// Gets the enum value.
20311 ///
20312 /// Returns `None` if the enum contains an unknown value deserialized from
20313 /// the string representation of enums.
20314 pub fn value(&self) -> std::option::Option<i32> {
20315 match self {
20316 Self::Unspecified => std::option::Option::Some(0),
20317 Self::Delete => std::option::Option::Some(1),
20318 Self::UnknownValue(u) => u.0.value(),
20319 }
20320 }
20321
20322 /// Gets the enum value as a string.
20323 ///
20324 /// Returns `None` if the enum contains an unknown value deserialized from
20325 /// the integer representation of enums.
20326 pub fn name(&self) -> std::option::Option<&str> {
20327 match self {
20328 Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
20329 Self::Delete => std::option::Option::Some("DELETE"),
20330 Self::UnknownValue(u) => u.0.name(),
20331 }
20332 }
20333}
20334
20335impl std::default::Default for RestrictedAction {
20336 fn default() -> Self {
20337 use std::convert::From;
20338 Self::from(0)
20339 }
20340}
20341
20342impl std::fmt::Display for RestrictedAction {
20343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20344 wkt::internal::display_enum(f, self.name(), self.value())
20345 }
20346}
20347
20348impl std::convert::From<i32> for RestrictedAction {
20349 fn from(value: i32) -> Self {
20350 match value {
20351 0 => Self::Unspecified,
20352 1 => Self::Delete,
20353 _ => Self::UnknownValue(restricted_action::UnknownValue(
20354 wkt::internal::UnknownEnumValue::Integer(value),
20355 )),
20356 }
20357 }
20358}
20359
20360impl std::convert::From<&str> for RestrictedAction {
20361 fn from(value: &str) -> Self {
20362 use std::string::ToString;
20363 match value {
20364 "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
20365 "DELETE" => Self::Delete,
20366 _ => Self::UnknownValue(restricted_action::UnknownValue(
20367 wkt::internal::UnknownEnumValue::String(value.to_string()),
20368 )),
20369 }
20370 }
20371}
20372
20373impl serde::ser::Serialize for RestrictedAction {
20374 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20375 where
20376 S: serde::Serializer,
20377 {
20378 match self {
20379 Self::Unspecified => serializer.serialize_i32(0),
20380 Self::Delete => serializer.serialize_i32(1),
20381 Self::UnknownValue(u) => u.0.serialize(serializer),
20382 }
20383 }
20384}
20385
20386impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
20387 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20388 where
20389 D: serde::Deserializer<'de>,
20390 {
20391 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
20392 ".google.cloud.netapp.v1.RestrictedAction",
20393 ))
20394 }
20395}