google_cloud_netapp_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// ListActiveDirectoriesRequest for requesting multiple active directories.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct ListActiveDirectoriesRequest {
42 /// Required. Parent value for ListActiveDirectoriesRequest
43 pub parent: std::string::String,
44
45 /// Requested page size. Server may return fewer items than requested.
46 /// If unspecified, the server will pick an appropriate default.
47 pub page_size: i32,
48
49 /// A token identifying a page of results the server should return.
50 pub page_token: std::string::String,
51
52 /// Filtering results
53 pub filter: std::string::String,
54
55 /// Hint for how to order the results
56 pub order_by: std::string::String,
57
58 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl ListActiveDirectoriesRequest {
62 pub fn new() -> Self {
63 std::default::Default::default()
64 }
65
66 /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
67 ///
68 /// # Example
69 /// ```ignore,no_run
70 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
71 /// let x = ListActiveDirectoriesRequest::new().set_parent("example");
72 /// ```
73 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74 self.parent = v.into();
75 self
76 }
77
78 /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
79 ///
80 /// # Example
81 /// ```ignore,no_run
82 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
83 /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
84 /// ```
85 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
86 self.page_size = v.into();
87 self
88 }
89
90 /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
91 ///
92 /// # Example
93 /// ```ignore,no_run
94 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
95 /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
96 /// ```
97 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
98 self.page_token = v.into();
99 self
100 }
101
102 /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
103 ///
104 /// # Example
105 /// ```ignore,no_run
106 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
107 /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
108 /// ```
109 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110 self.filter = v.into();
111 self
112 }
113
114 /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
115 ///
116 /// # Example
117 /// ```ignore,no_run
118 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
119 /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
120 /// ```
121 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
122 self.order_by = v.into();
123 self
124 }
125}
126
127impl wkt::message::Message for ListActiveDirectoriesRequest {
128 fn typename() -> &'static str {
129 "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
130 }
131}
132
133/// ListActiveDirectoriesResponse contains all the active directories requested.
134#[derive(Clone, Default, PartialEq)]
135#[non_exhaustive]
136pub struct ListActiveDirectoriesResponse {
137 /// The list of active directories.
138 pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
139
140 /// A token identifying a page of results the server should return.
141 pub next_page_token: std::string::String,
142
143 /// Locations that could not be reached.
144 pub unreachable: std::vec::Vec<std::string::String>,
145
146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
147}
148
149impl ListActiveDirectoriesResponse {
150 pub fn new() -> Self {
151 std::default::Default::default()
152 }
153
154 /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
155 ///
156 /// # Example
157 /// ```ignore,no_run
158 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
159 /// use google_cloud_netapp_v1::model::ActiveDirectory;
160 /// let x = ListActiveDirectoriesResponse::new()
161 /// .set_active_directories([
162 /// ActiveDirectory::default()/* use setters */,
163 /// ActiveDirectory::default()/* use (different) setters */,
164 /// ]);
165 /// ```
166 pub fn set_active_directories<T, V>(mut self, v: T) -> Self
167 where
168 T: std::iter::IntoIterator<Item = V>,
169 V: std::convert::Into<crate::model::ActiveDirectory>,
170 {
171 use std::iter::Iterator;
172 self.active_directories = v.into_iter().map(|i| i.into()).collect();
173 self
174 }
175
176 /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
177 ///
178 /// # Example
179 /// ```ignore,no_run
180 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
181 /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
182 /// ```
183 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
184 self.next_page_token = v.into();
185 self
186 }
187
188 /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
189 ///
190 /// # Example
191 /// ```ignore,no_run
192 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
193 /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
194 /// ```
195 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
196 where
197 T: std::iter::IntoIterator<Item = V>,
198 V: std::convert::Into<std::string::String>,
199 {
200 use std::iter::Iterator;
201 self.unreachable = v.into_iter().map(|i| i.into()).collect();
202 self
203 }
204}
205
206impl wkt::message::Message for ListActiveDirectoriesResponse {
207 fn typename() -> &'static str {
208 "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
209 }
210}
211
212#[doc(hidden)]
213impl google_cloud_gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
214 type PageItem = crate::model::ActiveDirectory;
215
216 fn items(self) -> std::vec::Vec<Self::PageItem> {
217 self.active_directories
218 }
219
220 fn next_page_token(&self) -> std::string::String {
221 use std::clone::Clone;
222 self.next_page_token.clone()
223 }
224}
225
226/// GetActiveDirectory for getting a single active directory.
227#[derive(Clone, Default, PartialEq)]
228#[non_exhaustive]
229pub struct GetActiveDirectoryRequest {
230 /// Required. Name of the active directory.
231 pub name: std::string::String,
232
233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
234}
235
236impl GetActiveDirectoryRequest {
237 pub fn new() -> Self {
238 std::default::Default::default()
239 }
240
241 /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
242 ///
243 /// # Example
244 /// ```ignore,no_run
245 /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
246 /// let x = GetActiveDirectoryRequest::new().set_name("example");
247 /// ```
248 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
249 self.name = v.into();
250 self
251 }
252}
253
254impl wkt::message::Message for GetActiveDirectoryRequest {
255 fn typename() -> &'static str {
256 "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
257 }
258}
259
260/// CreateActiveDirectoryRequest for creating an active directory.
261#[derive(Clone, Default, PartialEq)]
262#[non_exhaustive]
263pub struct CreateActiveDirectoryRequest {
264 /// Required. Value for parent.
265 pub parent: std::string::String,
266
267 /// Required. Fields of the to be created active directory.
268 pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
269
270 /// Required. ID of the active directory to create. Must be unique within the
271 /// parent resource. Must contain only letters, numbers and hyphen, with the
272 /// first character a letter , the last a letter or a number, and a 63
273 /// character maximum.
274 pub active_directory_id: std::string::String,
275
276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
277}
278
279impl CreateActiveDirectoryRequest {
280 pub fn new() -> Self {
281 std::default::Default::default()
282 }
283
284 /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
285 ///
286 /// # Example
287 /// ```ignore,no_run
288 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
289 /// let x = CreateActiveDirectoryRequest::new().set_parent("example");
290 /// ```
291 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
292 self.parent = v.into();
293 self
294 }
295
296 /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
297 ///
298 /// # Example
299 /// ```ignore,no_run
300 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
301 /// use google_cloud_netapp_v1::model::ActiveDirectory;
302 /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
303 /// ```
304 pub fn set_active_directory<T>(mut self, v: T) -> Self
305 where
306 T: std::convert::Into<crate::model::ActiveDirectory>,
307 {
308 self.active_directory = std::option::Option::Some(v.into());
309 self
310 }
311
312 /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
313 ///
314 /// # Example
315 /// ```ignore,no_run
316 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
317 /// use google_cloud_netapp_v1::model::ActiveDirectory;
318 /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
319 /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
320 /// ```
321 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
322 where
323 T: std::convert::Into<crate::model::ActiveDirectory>,
324 {
325 self.active_directory = v.map(|x| x.into());
326 self
327 }
328
329 /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
330 ///
331 /// # Example
332 /// ```ignore,no_run
333 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
334 /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
335 /// ```
336 pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
337 mut self,
338 v: T,
339 ) -> Self {
340 self.active_directory_id = v.into();
341 self
342 }
343}
344
345impl wkt::message::Message for CreateActiveDirectoryRequest {
346 fn typename() -> &'static str {
347 "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
348 }
349}
350
351/// UpdateActiveDirectoryRequest for updating an active directory.
352#[derive(Clone, Default, PartialEq)]
353#[non_exhaustive]
354pub struct UpdateActiveDirectoryRequest {
355 /// Required. Field mask is used to specify the fields to be overwritten in the
356 /// Active Directory resource by the update.
357 /// The fields specified in the update_mask are relative to the resource, not
358 /// the full request. A field will be overwritten if it is in the mask. If the
359 /// user does not provide a mask then all fields will be overwritten.
360 pub update_mask: std::option::Option<wkt::FieldMask>,
361
362 /// Required. The volume being updated
363 pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
364
365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
366}
367
368impl UpdateActiveDirectoryRequest {
369 pub fn new() -> Self {
370 std::default::Default::default()
371 }
372
373 /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
374 ///
375 /// # Example
376 /// ```ignore,no_run
377 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
378 /// use wkt::FieldMask;
379 /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
380 /// ```
381 pub fn set_update_mask<T>(mut self, v: T) -> Self
382 where
383 T: std::convert::Into<wkt::FieldMask>,
384 {
385 self.update_mask = std::option::Option::Some(v.into());
386 self
387 }
388
389 /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
390 ///
391 /// # Example
392 /// ```ignore,no_run
393 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
394 /// use wkt::FieldMask;
395 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
396 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
397 /// ```
398 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
399 where
400 T: std::convert::Into<wkt::FieldMask>,
401 {
402 self.update_mask = v.map(|x| x.into());
403 self
404 }
405
406 /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
407 ///
408 /// # Example
409 /// ```ignore,no_run
410 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
411 /// use google_cloud_netapp_v1::model::ActiveDirectory;
412 /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
413 /// ```
414 pub fn set_active_directory<T>(mut self, v: T) -> Self
415 where
416 T: std::convert::Into<crate::model::ActiveDirectory>,
417 {
418 self.active_directory = std::option::Option::Some(v.into());
419 self
420 }
421
422 /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
423 ///
424 /// # Example
425 /// ```ignore,no_run
426 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
427 /// use google_cloud_netapp_v1::model::ActiveDirectory;
428 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
429 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
430 /// ```
431 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
432 where
433 T: std::convert::Into<crate::model::ActiveDirectory>,
434 {
435 self.active_directory = v.map(|x| x.into());
436 self
437 }
438}
439
440impl wkt::message::Message for UpdateActiveDirectoryRequest {
441 fn typename() -> &'static str {
442 "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
443 }
444}
445
446/// DeleteActiveDirectoryRequest for deleting a single active directory.
447#[derive(Clone, Default, PartialEq)]
448#[non_exhaustive]
449pub struct DeleteActiveDirectoryRequest {
450 /// Required. Name of the active directory.
451 pub name: std::string::String,
452
453 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
454}
455
456impl DeleteActiveDirectoryRequest {
457 pub fn new() -> Self {
458 std::default::Default::default()
459 }
460
461 /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
462 ///
463 /// # Example
464 /// ```ignore,no_run
465 /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
466 /// let x = DeleteActiveDirectoryRequest::new().set_name("example");
467 /// ```
468 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
469 self.name = v.into();
470 self
471 }
472}
473
474impl wkt::message::Message for DeleteActiveDirectoryRequest {
475 fn typename() -> &'static str {
476 "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
477 }
478}
479
480/// ActiveDirectory is the public representation of the active directory config.
481#[derive(Clone, Default, PartialEq)]
482#[non_exhaustive]
483pub struct ActiveDirectory {
484 /// Identifier. The resource name of the active directory.
485 /// Format:
486 /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
487 pub name: std::string::String,
488
489 /// Output only. Create time of the active directory.
490 pub create_time: std::option::Option<wkt::Timestamp>,
491
492 /// Output only. The state of the AD.
493 pub state: crate::model::active_directory::State,
494
495 /// Required. Name of the Active Directory domain
496 pub domain: std::string::String,
497
498 /// The Active Directory site the service will limit Domain Controller
499 /// discovery too.
500 pub site: std::string::String,
501
502 /// Required. Comma separated list of DNS server IP addresses for the Active
503 /// Directory domain.
504 pub dns: std::string::String,
505
506 /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
507 pub net_bios_prefix: std::string::String,
508
509 /// The Organizational Unit (OU) within the Windows Active Directory the user
510 /// belongs to.
511 pub organizational_unit: std::string::String,
512
513 /// If enabled, AES encryption will be enabled for SMB communication.
514 pub aes_encryption: bool,
515
516 /// Required. Username of the Active Directory domain administrator.
517 pub username: std::string::String,
518
519 /// Required. Password of the Active Directory domain administrator.
520 pub password: std::string::String,
521
522 /// Optional. Users to be added to the Built-in Backup Operator active
523 /// directory group.
524 pub backup_operators: std::vec::Vec<std::string::String>,
525
526 /// Optional. Users to be added to the Built-in Admininstrators group.
527 pub administrators: std::vec::Vec<std::string::String>,
528
529 /// Optional. Domain users to be given the SeSecurityPrivilege.
530 pub security_operators: std::vec::Vec<std::string::String>,
531
532 /// Name of the active directory machine. This optional parameter is used only
533 /// while creating kerberos volume
534 pub kdc_hostname: std::string::String,
535
536 /// KDC server IP address for the active directory machine.
537 pub kdc_ip: std::string::String,
538
539 /// If enabled, will allow access to local users and LDAP users. If access is
540 /// needed for only LDAP users, it has to be disabled.
541 pub nfs_users_with_ldap: bool,
542
543 /// Description of the active directory.
544 pub description: std::string::String,
545
546 /// Specifies whether or not the LDAP traffic needs to be signed.
547 pub ldap_signing: bool,
548
549 /// If enabled, traffic between the SMB server to Domain Controller (DC) will
550 /// be encrypted.
551 pub encrypt_dc_connections: bool,
552
553 /// Labels for the active directory.
554 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
555
556 /// Output only. The state details of the Active Directory.
557 pub state_details: std::string::String,
558
559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
560}
561
562impl ActiveDirectory {
563 pub fn new() -> Self {
564 std::default::Default::default()
565 }
566
567 /// Sets the value of [name][crate::model::ActiveDirectory::name].
568 ///
569 /// # Example
570 /// ```ignore,no_run
571 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
572 /// let x = ActiveDirectory::new().set_name("example");
573 /// ```
574 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
575 self.name = v.into();
576 self
577 }
578
579 /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
580 ///
581 /// # Example
582 /// ```ignore,no_run
583 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
584 /// use wkt::Timestamp;
585 /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
586 /// ```
587 pub fn set_create_time<T>(mut self, v: T) -> Self
588 where
589 T: std::convert::Into<wkt::Timestamp>,
590 {
591 self.create_time = std::option::Option::Some(v.into());
592 self
593 }
594
595 /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
596 ///
597 /// # Example
598 /// ```ignore,no_run
599 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
600 /// use wkt::Timestamp;
601 /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
602 /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
603 /// ```
604 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
605 where
606 T: std::convert::Into<wkt::Timestamp>,
607 {
608 self.create_time = v.map(|x| x.into());
609 self
610 }
611
612 /// Sets the value of [state][crate::model::ActiveDirectory::state].
613 ///
614 /// # Example
615 /// ```ignore,no_run
616 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
617 /// use google_cloud_netapp_v1::model::active_directory::State;
618 /// let x0 = ActiveDirectory::new().set_state(State::Creating);
619 /// let x1 = ActiveDirectory::new().set_state(State::Ready);
620 /// let x2 = ActiveDirectory::new().set_state(State::Updating);
621 /// ```
622 pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
623 mut self,
624 v: T,
625 ) -> Self {
626 self.state = v.into();
627 self
628 }
629
630 /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
631 ///
632 /// # Example
633 /// ```ignore,no_run
634 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
635 /// let x = ActiveDirectory::new().set_domain("example");
636 /// ```
637 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
638 self.domain = v.into();
639 self
640 }
641
642 /// Sets the value of [site][crate::model::ActiveDirectory::site].
643 ///
644 /// # Example
645 /// ```ignore,no_run
646 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
647 /// let x = ActiveDirectory::new().set_site("example");
648 /// ```
649 pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650 self.site = v.into();
651 self
652 }
653
654 /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
655 ///
656 /// # Example
657 /// ```ignore,no_run
658 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
659 /// let x = ActiveDirectory::new().set_dns("example");
660 /// ```
661 pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
662 self.dns = v.into();
663 self
664 }
665
666 /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
667 ///
668 /// # Example
669 /// ```ignore,no_run
670 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
671 /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
672 /// ```
673 pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674 self.net_bios_prefix = v.into();
675 self
676 }
677
678 /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
679 ///
680 /// # Example
681 /// ```ignore,no_run
682 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
683 /// let x = ActiveDirectory::new().set_organizational_unit("example");
684 /// ```
685 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
686 mut self,
687 v: T,
688 ) -> Self {
689 self.organizational_unit = v.into();
690 self
691 }
692
693 /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
694 ///
695 /// # Example
696 /// ```ignore,no_run
697 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
698 /// let x = ActiveDirectory::new().set_aes_encryption(true);
699 /// ```
700 pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
701 self.aes_encryption = v.into();
702 self
703 }
704
705 /// Sets the value of [username][crate::model::ActiveDirectory::username].
706 ///
707 /// # Example
708 /// ```ignore,no_run
709 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
710 /// let x = ActiveDirectory::new().set_username("example");
711 /// ```
712 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
713 self.username = v.into();
714 self
715 }
716
717 /// Sets the value of [password][crate::model::ActiveDirectory::password].
718 ///
719 /// # Example
720 /// ```ignore,no_run
721 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
722 /// let x = ActiveDirectory::new().set_password("example");
723 /// ```
724 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
725 self.password = v.into();
726 self
727 }
728
729 /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
730 ///
731 /// # Example
732 /// ```ignore,no_run
733 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
734 /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
735 /// ```
736 pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
737 where
738 T: std::iter::IntoIterator<Item = V>,
739 V: std::convert::Into<std::string::String>,
740 {
741 use std::iter::Iterator;
742 self.backup_operators = v.into_iter().map(|i| i.into()).collect();
743 self
744 }
745
746 /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
747 ///
748 /// # Example
749 /// ```ignore,no_run
750 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
751 /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
752 /// ```
753 pub fn set_administrators<T, V>(mut self, v: T) -> Self
754 where
755 T: std::iter::IntoIterator<Item = V>,
756 V: std::convert::Into<std::string::String>,
757 {
758 use std::iter::Iterator;
759 self.administrators = v.into_iter().map(|i| i.into()).collect();
760 self
761 }
762
763 /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
764 ///
765 /// # Example
766 /// ```ignore,no_run
767 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
768 /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
769 /// ```
770 pub fn set_security_operators<T, V>(mut self, v: T) -> Self
771 where
772 T: std::iter::IntoIterator<Item = V>,
773 V: std::convert::Into<std::string::String>,
774 {
775 use std::iter::Iterator;
776 self.security_operators = v.into_iter().map(|i| i.into()).collect();
777 self
778 }
779
780 /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
781 ///
782 /// # Example
783 /// ```ignore,no_run
784 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
785 /// let x = ActiveDirectory::new().set_kdc_hostname("example");
786 /// ```
787 pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
788 self.kdc_hostname = v.into();
789 self
790 }
791
792 /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
793 ///
794 /// # Example
795 /// ```ignore,no_run
796 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
797 /// let x = ActiveDirectory::new().set_kdc_ip("example");
798 /// ```
799 pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
800 self.kdc_ip = v.into();
801 self
802 }
803
804 /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
805 ///
806 /// # Example
807 /// ```ignore,no_run
808 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
809 /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
810 /// ```
811 pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
812 self.nfs_users_with_ldap = v.into();
813 self
814 }
815
816 /// Sets the value of [description][crate::model::ActiveDirectory::description].
817 ///
818 /// # Example
819 /// ```ignore,no_run
820 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
821 /// let x = ActiveDirectory::new().set_description("example");
822 /// ```
823 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
824 self.description = v.into();
825 self
826 }
827
828 /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
829 ///
830 /// # Example
831 /// ```ignore,no_run
832 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
833 /// let x = ActiveDirectory::new().set_ldap_signing(true);
834 /// ```
835 pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
836 self.ldap_signing = v.into();
837 self
838 }
839
840 /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
841 ///
842 /// # Example
843 /// ```ignore,no_run
844 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
845 /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
846 /// ```
847 pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
848 self.encrypt_dc_connections = v.into();
849 self
850 }
851
852 /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
853 ///
854 /// # Example
855 /// ```ignore,no_run
856 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
857 /// let x = ActiveDirectory::new().set_labels([
858 /// ("key0", "abc"),
859 /// ("key1", "xyz"),
860 /// ]);
861 /// ```
862 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
863 where
864 T: std::iter::IntoIterator<Item = (K, V)>,
865 K: std::convert::Into<std::string::String>,
866 V: std::convert::Into<std::string::String>,
867 {
868 use std::iter::Iterator;
869 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
870 self
871 }
872
873 /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
874 ///
875 /// # Example
876 /// ```ignore,no_run
877 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
878 /// let x = ActiveDirectory::new().set_state_details("example");
879 /// ```
880 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
881 self.state_details = v.into();
882 self
883 }
884}
885
886impl wkt::message::Message for ActiveDirectory {
887 fn typename() -> &'static str {
888 "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
889 }
890}
891
892/// Defines additional types related to [ActiveDirectory].
893pub mod active_directory {
894 #[allow(unused_imports)]
895 use super::*;
896
897 /// The Active Directory States
898 ///
899 /// # Working with unknown values
900 ///
901 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
902 /// additional enum variants at any time. Adding new variants is not considered
903 /// a breaking change. Applications should write their code in anticipation of:
904 ///
905 /// - New values appearing in future releases of the client library, **and**
906 /// - New values received dynamically, without application changes.
907 ///
908 /// Please consult the [Working with enums] section in the user guide for some
909 /// guidelines.
910 ///
911 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
912 #[derive(Clone, Debug, PartialEq)]
913 #[non_exhaustive]
914 pub enum State {
915 /// Unspecified Active Directory State
916 Unspecified,
917 /// Active Directory State is Creating
918 Creating,
919 /// Active Directory State is Ready
920 Ready,
921 /// Active Directory State is Updating
922 Updating,
923 /// Active Directory State is In use
924 InUse,
925 /// Active Directory State is Deleting
926 Deleting,
927 /// Active Directory State is Error
928 Error,
929 /// Active Directory State is Diagnosing.
930 Diagnosing,
931 /// If set, the enum was initialized with an unknown value.
932 ///
933 /// Applications can examine the value using [State::value] or
934 /// [State::name].
935 UnknownValue(state::UnknownValue),
936 }
937
938 #[doc(hidden)]
939 pub mod state {
940 #[allow(unused_imports)]
941 use super::*;
942 #[derive(Clone, Debug, PartialEq)]
943 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
944 }
945
946 impl State {
947 /// Gets the enum value.
948 ///
949 /// Returns `None` if the enum contains an unknown value deserialized from
950 /// the string representation of enums.
951 pub fn value(&self) -> std::option::Option<i32> {
952 match self {
953 Self::Unspecified => std::option::Option::Some(0),
954 Self::Creating => std::option::Option::Some(1),
955 Self::Ready => std::option::Option::Some(2),
956 Self::Updating => std::option::Option::Some(3),
957 Self::InUse => std::option::Option::Some(4),
958 Self::Deleting => std::option::Option::Some(5),
959 Self::Error => std::option::Option::Some(6),
960 Self::Diagnosing => std::option::Option::Some(7),
961 Self::UnknownValue(u) => u.0.value(),
962 }
963 }
964
965 /// Gets the enum value as a string.
966 ///
967 /// Returns `None` if the enum contains an unknown value deserialized from
968 /// the integer representation of enums.
969 pub fn name(&self) -> std::option::Option<&str> {
970 match self {
971 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
972 Self::Creating => std::option::Option::Some("CREATING"),
973 Self::Ready => std::option::Option::Some("READY"),
974 Self::Updating => std::option::Option::Some("UPDATING"),
975 Self::InUse => std::option::Option::Some("IN_USE"),
976 Self::Deleting => std::option::Option::Some("DELETING"),
977 Self::Error => std::option::Option::Some("ERROR"),
978 Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
979 Self::UnknownValue(u) => u.0.name(),
980 }
981 }
982 }
983
984 impl std::default::Default for State {
985 fn default() -> Self {
986 use std::convert::From;
987 Self::from(0)
988 }
989 }
990
991 impl std::fmt::Display for State {
992 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
993 wkt::internal::display_enum(f, self.name(), self.value())
994 }
995 }
996
997 impl std::convert::From<i32> for State {
998 fn from(value: i32) -> Self {
999 match value {
1000 0 => Self::Unspecified,
1001 1 => Self::Creating,
1002 2 => Self::Ready,
1003 3 => Self::Updating,
1004 4 => Self::InUse,
1005 5 => Self::Deleting,
1006 6 => Self::Error,
1007 7 => Self::Diagnosing,
1008 _ => Self::UnknownValue(state::UnknownValue(
1009 wkt::internal::UnknownEnumValue::Integer(value),
1010 )),
1011 }
1012 }
1013 }
1014
1015 impl std::convert::From<&str> for State {
1016 fn from(value: &str) -> Self {
1017 use std::string::ToString;
1018 match value {
1019 "STATE_UNSPECIFIED" => Self::Unspecified,
1020 "CREATING" => Self::Creating,
1021 "READY" => Self::Ready,
1022 "UPDATING" => Self::Updating,
1023 "IN_USE" => Self::InUse,
1024 "DELETING" => Self::Deleting,
1025 "ERROR" => Self::Error,
1026 "DIAGNOSING" => Self::Diagnosing,
1027 _ => Self::UnknownValue(state::UnknownValue(
1028 wkt::internal::UnknownEnumValue::String(value.to_string()),
1029 )),
1030 }
1031 }
1032 }
1033
1034 impl serde::ser::Serialize for State {
1035 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1036 where
1037 S: serde::Serializer,
1038 {
1039 match self {
1040 Self::Unspecified => serializer.serialize_i32(0),
1041 Self::Creating => serializer.serialize_i32(1),
1042 Self::Ready => serializer.serialize_i32(2),
1043 Self::Updating => serializer.serialize_i32(3),
1044 Self::InUse => serializer.serialize_i32(4),
1045 Self::Deleting => serializer.serialize_i32(5),
1046 Self::Error => serializer.serialize_i32(6),
1047 Self::Diagnosing => serializer.serialize_i32(7),
1048 Self::UnknownValue(u) => u.0.serialize(serializer),
1049 }
1050 }
1051 }
1052
1053 impl<'de> serde::de::Deserialize<'de> for State {
1054 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1055 where
1056 D: serde::Deserializer<'de>,
1057 {
1058 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1059 ".google.cloud.netapp.v1.ActiveDirectory.State",
1060 ))
1061 }
1062 }
1063}
1064
1065/// A NetApp Backup.
1066#[derive(Clone, Default, PartialEq)]
1067#[non_exhaustive]
1068pub struct Backup {
1069 /// Identifier. The resource name of the backup.
1070 /// Format:
1071 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1072 pub name: std::string::String,
1073
1074 /// Output only. The backup state.
1075 pub state: crate::model::backup::State,
1076
1077 /// A description of the backup with 2048 characters or less.
1078 /// Requests with longer descriptions will be rejected.
1079 pub description: std::string::String,
1080
1081 /// Output only. Size of the file system when the backup was created. When
1082 /// creating a new volume from the backup, the volume capacity will have to be
1083 /// at least as big.
1084 pub volume_usage_bytes: i64,
1085
1086 /// Output only. Type of backup, manually created or created by a backup
1087 /// policy.
1088 pub backup_type: crate::model::backup::Type,
1089
1090 /// Volume full name of this backup belongs to.
1091 /// Either source_volume or ontap_source should be provided.
1092 /// Format:
1093 /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1094 pub source_volume: std::string::String,
1095
1096 /// If specified, backup will be created from the given snapshot.
1097 /// If not specified, there will be a new snapshot taken to initiate the backup
1098 /// creation. Format:
1099 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1100 pub source_snapshot: std::option::Option<std::string::String>,
1101
1102 /// Output only. The time when the backup was created.
1103 pub create_time: std::option::Option<wkt::Timestamp>,
1104
1105 /// Resource labels to represent user provided metadata.
1106 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1107
1108 /// Output only. Total size of all backups in a chain in bytes = baseline
1109 /// backup size + sum(incremental backup size)
1110 pub chain_storage_bytes: i64,
1111
1112 /// Output only. Reserved for future use
1113 pub satisfies_pzs: bool,
1114
1115 /// Output only. Reserved for future use
1116 pub satisfies_pzi: bool,
1117
1118 /// Output only. Region of the volume from which the backup was created.
1119 /// Format: `projects/{project_id}/locations/{location}`
1120 pub volume_region: std::string::String,
1121
1122 /// Output only. Region in which backup is stored.
1123 /// Format: `projects/{project_id}/locations/{location}`
1124 pub backup_region: std::string::String,
1125
1126 /// Output only. The time until which the backup is not deletable.
1127 pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1128
1129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1130}
1131
1132impl Backup {
1133 pub fn new() -> Self {
1134 std::default::Default::default()
1135 }
1136
1137 /// Sets the value of [name][crate::model::Backup::name].
1138 ///
1139 /// # Example
1140 /// ```ignore,no_run
1141 /// # use google_cloud_netapp_v1::model::Backup;
1142 /// let x = Backup::new().set_name("example");
1143 /// ```
1144 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145 self.name = v.into();
1146 self
1147 }
1148
1149 /// Sets the value of [state][crate::model::Backup::state].
1150 ///
1151 /// # Example
1152 /// ```ignore,no_run
1153 /// # use google_cloud_netapp_v1::model::Backup;
1154 /// use google_cloud_netapp_v1::model::backup::State;
1155 /// let x0 = Backup::new().set_state(State::Creating);
1156 /// let x1 = Backup::new().set_state(State::Uploading);
1157 /// let x2 = Backup::new().set_state(State::Ready);
1158 /// ```
1159 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1160 self.state = v.into();
1161 self
1162 }
1163
1164 /// Sets the value of [description][crate::model::Backup::description].
1165 ///
1166 /// # Example
1167 /// ```ignore,no_run
1168 /// # use google_cloud_netapp_v1::model::Backup;
1169 /// let x = Backup::new().set_description("example");
1170 /// ```
1171 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.description = v.into();
1173 self
1174 }
1175
1176 /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1177 ///
1178 /// # Example
1179 /// ```ignore,no_run
1180 /// # use google_cloud_netapp_v1::model::Backup;
1181 /// let x = Backup::new().set_volume_usage_bytes(42);
1182 /// ```
1183 pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1184 self.volume_usage_bytes = v.into();
1185 self
1186 }
1187
1188 /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1189 ///
1190 /// # Example
1191 /// ```ignore,no_run
1192 /// # use google_cloud_netapp_v1::model::Backup;
1193 /// use google_cloud_netapp_v1::model::backup::Type;
1194 /// let x0 = Backup::new().set_backup_type(Type::Manual);
1195 /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1196 /// ```
1197 pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1198 mut self,
1199 v: T,
1200 ) -> Self {
1201 self.backup_type = v.into();
1202 self
1203 }
1204
1205 /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1206 ///
1207 /// # Example
1208 /// ```ignore,no_run
1209 /// # use google_cloud_netapp_v1::model::Backup;
1210 /// let x = Backup::new().set_source_volume("example");
1211 /// ```
1212 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1213 self.source_volume = v.into();
1214 self
1215 }
1216
1217 /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1218 ///
1219 /// # Example
1220 /// ```ignore,no_run
1221 /// # use google_cloud_netapp_v1::model::Backup;
1222 /// let x = Backup::new().set_source_snapshot("example");
1223 /// ```
1224 pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1225 where
1226 T: std::convert::Into<std::string::String>,
1227 {
1228 self.source_snapshot = std::option::Option::Some(v.into());
1229 self
1230 }
1231
1232 /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1233 ///
1234 /// # Example
1235 /// ```ignore,no_run
1236 /// # use google_cloud_netapp_v1::model::Backup;
1237 /// let x = Backup::new().set_or_clear_source_snapshot(Some("example"));
1238 /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1239 /// ```
1240 pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1241 where
1242 T: std::convert::Into<std::string::String>,
1243 {
1244 self.source_snapshot = v.map(|x| x.into());
1245 self
1246 }
1247
1248 /// Sets the value of [create_time][crate::model::Backup::create_time].
1249 ///
1250 /// # Example
1251 /// ```ignore,no_run
1252 /// # use google_cloud_netapp_v1::model::Backup;
1253 /// use wkt::Timestamp;
1254 /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1255 /// ```
1256 pub fn set_create_time<T>(mut self, v: T) -> Self
1257 where
1258 T: std::convert::Into<wkt::Timestamp>,
1259 {
1260 self.create_time = std::option::Option::Some(v.into());
1261 self
1262 }
1263
1264 /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1265 ///
1266 /// # Example
1267 /// ```ignore,no_run
1268 /// # use google_cloud_netapp_v1::model::Backup;
1269 /// use wkt::Timestamp;
1270 /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1271 /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1272 /// ```
1273 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1274 where
1275 T: std::convert::Into<wkt::Timestamp>,
1276 {
1277 self.create_time = v.map(|x| x.into());
1278 self
1279 }
1280
1281 /// Sets the value of [labels][crate::model::Backup::labels].
1282 ///
1283 /// # Example
1284 /// ```ignore,no_run
1285 /// # use google_cloud_netapp_v1::model::Backup;
1286 /// let x = Backup::new().set_labels([
1287 /// ("key0", "abc"),
1288 /// ("key1", "xyz"),
1289 /// ]);
1290 /// ```
1291 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1292 where
1293 T: std::iter::IntoIterator<Item = (K, V)>,
1294 K: std::convert::Into<std::string::String>,
1295 V: std::convert::Into<std::string::String>,
1296 {
1297 use std::iter::Iterator;
1298 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1299 self
1300 }
1301
1302 /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1303 ///
1304 /// # Example
1305 /// ```ignore,no_run
1306 /// # use google_cloud_netapp_v1::model::Backup;
1307 /// let x = Backup::new().set_chain_storage_bytes(42);
1308 /// ```
1309 pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1310 self.chain_storage_bytes = v.into();
1311 self
1312 }
1313
1314 /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1315 ///
1316 /// # Example
1317 /// ```ignore,no_run
1318 /// # use google_cloud_netapp_v1::model::Backup;
1319 /// let x = Backup::new().set_satisfies_pzs(true);
1320 /// ```
1321 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1322 self.satisfies_pzs = v.into();
1323 self
1324 }
1325
1326 /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1327 ///
1328 /// # Example
1329 /// ```ignore,no_run
1330 /// # use google_cloud_netapp_v1::model::Backup;
1331 /// let x = Backup::new().set_satisfies_pzi(true);
1332 /// ```
1333 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1334 self.satisfies_pzi = v.into();
1335 self
1336 }
1337
1338 /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1339 ///
1340 /// # Example
1341 /// ```ignore,no_run
1342 /// # use google_cloud_netapp_v1::model::Backup;
1343 /// let x = Backup::new().set_volume_region("example");
1344 /// ```
1345 pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1346 self.volume_region = v.into();
1347 self
1348 }
1349
1350 /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1351 ///
1352 /// # Example
1353 /// ```ignore,no_run
1354 /// # use google_cloud_netapp_v1::model::Backup;
1355 /// let x = Backup::new().set_backup_region("example");
1356 /// ```
1357 pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1358 self.backup_region = v.into();
1359 self
1360 }
1361
1362 /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1363 ///
1364 /// # Example
1365 /// ```ignore,no_run
1366 /// # use google_cloud_netapp_v1::model::Backup;
1367 /// use wkt::Timestamp;
1368 /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1369 /// ```
1370 pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1371 where
1372 T: std::convert::Into<wkt::Timestamp>,
1373 {
1374 self.enforced_retention_end_time = std::option::Option::Some(v.into());
1375 self
1376 }
1377
1378 /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1379 ///
1380 /// # Example
1381 /// ```ignore,no_run
1382 /// # use google_cloud_netapp_v1::model::Backup;
1383 /// use wkt::Timestamp;
1384 /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1385 /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1386 /// ```
1387 pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1388 where
1389 T: std::convert::Into<wkt::Timestamp>,
1390 {
1391 self.enforced_retention_end_time = v.map(|x| x.into());
1392 self
1393 }
1394}
1395
1396impl wkt::message::Message for Backup {
1397 fn typename() -> &'static str {
1398 "type.googleapis.com/google.cloud.netapp.v1.Backup"
1399 }
1400}
1401
1402/// Defines additional types related to [Backup].
1403pub mod backup {
1404 #[allow(unused_imports)]
1405 use super::*;
1406
1407 /// The Backup States
1408 ///
1409 /// # Working with unknown values
1410 ///
1411 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1412 /// additional enum variants at any time. Adding new variants is not considered
1413 /// a breaking change. Applications should write their code in anticipation of:
1414 ///
1415 /// - New values appearing in future releases of the client library, **and**
1416 /// - New values received dynamically, without application changes.
1417 ///
1418 /// Please consult the [Working with enums] section in the user guide for some
1419 /// guidelines.
1420 ///
1421 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1422 #[derive(Clone, Debug, PartialEq)]
1423 #[non_exhaustive]
1424 pub enum State {
1425 /// State not set.
1426 Unspecified,
1427 /// Backup is being created. While in this state, the snapshot for the backup
1428 /// point-in-time may not have been created yet, and so the point-in-time may
1429 /// not have been fixed.
1430 Creating,
1431 /// Backup is being uploaded. While in this state, none of the writes to the
1432 /// volume will be included in the backup.
1433 Uploading,
1434 /// Backup is available for use.
1435 Ready,
1436 /// Backup is being deleted.
1437 Deleting,
1438 /// Backup is not valid and cannot be used for creating new volumes or
1439 /// restoring existing volumes.
1440 Error,
1441 /// Backup is being updated.
1442 Updating,
1443 /// If set, the enum was initialized with an unknown value.
1444 ///
1445 /// Applications can examine the value using [State::value] or
1446 /// [State::name].
1447 UnknownValue(state::UnknownValue),
1448 }
1449
1450 #[doc(hidden)]
1451 pub mod state {
1452 #[allow(unused_imports)]
1453 use super::*;
1454 #[derive(Clone, Debug, PartialEq)]
1455 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1456 }
1457
1458 impl State {
1459 /// Gets the enum value.
1460 ///
1461 /// Returns `None` if the enum contains an unknown value deserialized from
1462 /// the string representation of enums.
1463 pub fn value(&self) -> std::option::Option<i32> {
1464 match self {
1465 Self::Unspecified => std::option::Option::Some(0),
1466 Self::Creating => std::option::Option::Some(1),
1467 Self::Uploading => std::option::Option::Some(2),
1468 Self::Ready => std::option::Option::Some(3),
1469 Self::Deleting => std::option::Option::Some(4),
1470 Self::Error => std::option::Option::Some(5),
1471 Self::Updating => std::option::Option::Some(6),
1472 Self::UnknownValue(u) => u.0.value(),
1473 }
1474 }
1475
1476 /// Gets the enum value as a string.
1477 ///
1478 /// Returns `None` if the enum contains an unknown value deserialized from
1479 /// the integer representation of enums.
1480 pub fn name(&self) -> std::option::Option<&str> {
1481 match self {
1482 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1483 Self::Creating => std::option::Option::Some("CREATING"),
1484 Self::Uploading => std::option::Option::Some("UPLOADING"),
1485 Self::Ready => std::option::Option::Some("READY"),
1486 Self::Deleting => std::option::Option::Some("DELETING"),
1487 Self::Error => std::option::Option::Some("ERROR"),
1488 Self::Updating => std::option::Option::Some("UPDATING"),
1489 Self::UnknownValue(u) => u.0.name(),
1490 }
1491 }
1492 }
1493
1494 impl std::default::Default for State {
1495 fn default() -> Self {
1496 use std::convert::From;
1497 Self::from(0)
1498 }
1499 }
1500
1501 impl std::fmt::Display for State {
1502 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1503 wkt::internal::display_enum(f, self.name(), self.value())
1504 }
1505 }
1506
1507 impl std::convert::From<i32> for State {
1508 fn from(value: i32) -> Self {
1509 match value {
1510 0 => Self::Unspecified,
1511 1 => Self::Creating,
1512 2 => Self::Uploading,
1513 3 => Self::Ready,
1514 4 => Self::Deleting,
1515 5 => Self::Error,
1516 6 => Self::Updating,
1517 _ => Self::UnknownValue(state::UnknownValue(
1518 wkt::internal::UnknownEnumValue::Integer(value),
1519 )),
1520 }
1521 }
1522 }
1523
1524 impl std::convert::From<&str> for State {
1525 fn from(value: &str) -> Self {
1526 use std::string::ToString;
1527 match value {
1528 "STATE_UNSPECIFIED" => Self::Unspecified,
1529 "CREATING" => Self::Creating,
1530 "UPLOADING" => Self::Uploading,
1531 "READY" => Self::Ready,
1532 "DELETING" => Self::Deleting,
1533 "ERROR" => Self::Error,
1534 "UPDATING" => Self::Updating,
1535 _ => Self::UnknownValue(state::UnknownValue(
1536 wkt::internal::UnknownEnumValue::String(value.to_string()),
1537 )),
1538 }
1539 }
1540 }
1541
1542 impl serde::ser::Serialize for State {
1543 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1544 where
1545 S: serde::Serializer,
1546 {
1547 match self {
1548 Self::Unspecified => serializer.serialize_i32(0),
1549 Self::Creating => serializer.serialize_i32(1),
1550 Self::Uploading => serializer.serialize_i32(2),
1551 Self::Ready => serializer.serialize_i32(3),
1552 Self::Deleting => serializer.serialize_i32(4),
1553 Self::Error => serializer.serialize_i32(5),
1554 Self::Updating => serializer.serialize_i32(6),
1555 Self::UnknownValue(u) => u.0.serialize(serializer),
1556 }
1557 }
1558 }
1559
1560 impl<'de> serde::de::Deserialize<'de> for State {
1561 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1562 where
1563 D: serde::Deserializer<'de>,
1564 {
1565 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1566 ".google.cloud.netapp.v1.Backup.State",
1567 ))
1568 }
1569 }
1570
1571 /// Backup types.
1572 ///
1573 /// # Working with unknown values
1574 ///
1575 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1576 /// additional enum variants at any time. Adding new variants is not considered
1577 /// a breaking change. Applications should write their code in anticipation of:
1578 ///
1579 /// - New values appearing in future releases of the client library, **and**
1580 /// - New values received dynamically, without application changes.
1581 ///
1582 /// Please consult the [Working with enums] section in the user guide for some
1583 /// guidelines.
1584 ///
1585 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1586 #[derive(Clone, Debug, PartialEq)]
1587 #[non_exhaustive]
1588 pub enum Type {
1589 /// Unspecified backup type.
1590 Unspecified,
1591 /// Manual backup type.
1592 Manual,
1593 /// Scheduled backup type.
1594 Scheduled,
1595 /// If set, the enum was initialized with an unknown value.
1596 ///
1597 /// Applications can examine the value using [Type::value] or
1598 /// [Type::name].
1599 UnknownValue(r#type::UnknownValue),
1600 }
1601
1602 #[doc(hidden)]
1603 pub mod r#type {
1604 #[allow(unused_imports)]
1605 use super::*;
1606 #[derive(Clone, Debug, PartialEq)]
1607 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1608 }
1609
1610 impl Type {
1611 /// Gets the enum value.
1612 ///
1613 /// Returns `None` if the enum contains an unknown value deserialized from
1614 /// the string representation of enums.
1615 pub fn value(&self) -> std::option::Option<i32> {
1616 match self {
1617 Self::Unspecified => std::option::Option::Some(0),
1618 Self::Manual => std::option::Option::Some(1),
1619 Self::Scheduled => std::option::Option::Some(2),
1620 Self::UnknownValue(u) => u.0.value(),
1621 }
1622 }
1623
1624 /// Gets the enum value as a string.
1625 ///
1626 /// Returns `None` if the enum contains an unknown value deserialized from
1627 /// the integer representation of enums.
1628 pub fn name(&self) -> std::option::Option<&str> {
1629 match self {
1630 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1631 Self::Manual => std::option::Option::Some("MANUAL"),
1632 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1633 Self::UnknownValue(u) => u.0.name(),
1634 }
1635 }
1636 }
1637
1638 impl std::default::Default for Type {
1639 fn default() -> Self {
1640 use std::convert::From;
1641 Self::from(0)
1642 }
1643 }
1644
1645 impl std::fmt::Display for Type {
1646 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1647 wkt::internal::display_enum(f, self.name(), self.value())
1648 }
1649 }
1650
1651 impl std::convert::From<i32> for Type {
1652 fn from(value: i32) -> Self {
1653 match value {
1654 0 => Self::Unspecified,
1655 1 => Self::Manual,
1656 2 => Self::Scheduled,
1657 _ => Self::UnknownValue(r#type::UnknownValue(
1658 wkt::internal::UnknownEnumValue::Integer(value),
1659 )),
1660 }
1661 }
1662 }
1663
1664 impl std::convert::From<&str> for Type {
1665 fn from(value: &str) -> Self {
1666 use std::string::ToString;
1667 match value {
1668 "TYPE_UNSPECIFIED" => Self::Unspecified,
1669 "MANUAL" => Self::Manual,
1670 "SCHEDULED" => Self::Scheduled,
1671 _ => Self::UnknownValue(r#type::UnknownValue(
1672 wkt::internal::UnknownEnumValue::String(value.to_string()),
1673 )),
1674 }
1675 }
1676 }
1677
1678 impl serde::ser::Serialize for Type {
1679 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1680 where
1681 S: serde::Serializer,
1682 {
1683 match self {
1684 Self::Unspecified => serializer.serialize_i32(0),
1685 Self::Manual => serializer.serialize_i32(1),
1686 Self::Scheduled => serializer.serialize_i32(2),
1687 Self::UnknownValue(u) => u.0.serialize(serializer),
1688 }
1689 }
1690 }
1691
1692 impl<'de> serde::de::Deserialize<'de> for Type {
1693 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1694 where
1695 D: serde::Deserializer<'de>,
1696 {
1697 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1698 ".google.cloud.netapp.v1.Backup.Type",
1699 ))
1700 }
1701 }
1702}
1703
1704/// ListBackupsRequest lists backups.
1705#[derive(Clone, Default, PartialEq)]
1706#[non_exhaustive]
1707pub struct ListBackupsRequest {
1708 /// Required. The backupVault for which to retrieve backup information,
1709 /// in the format
1710 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1711 /// To retrieve backup information for all locations, use "-" for the
1712 /// `{location}` value.
1713 /// To retrieve backup information for all backupVaults, use "-" for the
1714 /// `{backup_vault_id}` value.
1715 /// To retrieve backup information for a volume, use "-" for the
1716 /// `{backup_vault_id}` value and specify volume full name with the filter.
1717 pub parent: std::string::String,
1718
1719 /// The maximum number of items to return. The service may return fewer
1720 /// than this value. The maximum value
1721 /// is 1000; values above 1000 will be coerced to 1000.
1722 pub page_size: i32,
1723
1724 /// The next_page_token value to use if there are additional
1725 /// results to retrieve for this list request.
1726 pub page_token: std::string::String,
1727
1728 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1729 pub order_by: std::string::String,
1730
1731 /// The standard list filter.
1732 /// If specified, backups will be returned based on the attribute name that
1733 /// matches the filter expression. If empty, then no backups are filtered out.
1734 /// See <https://google.aip.dev/160>
1735 pub filter: std::string::String,
1736
1737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1738}
1739
1740impl ListBackupsRequest {
1741 pub fn new() -> Self {
1742 std::default::Default::default()
1743 }
1744
1745 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1746 ///
1747 /// # Example
1748 /// ```ignore,no_run
1749 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1750 /// let x = ListBackupsRequest::new().set_parent("example");
1751 /// ```
1752 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1753 self.parent = v.into();
1754 self
1755 }
1756
1757 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1758 ///
1759 /// # Example
1760 /// ```ignore,no_run
1761 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1762 /// let x = ListBackupsRequest::new().set_page_size(42);
1763 /// ```
1764 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1765 self.page_size = v.into();
1766 self
1767 }
1768
1769 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1770 ///
1771 /// # Example
1772 /// ```ignore,no_run
1773 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1774 /// let x = ListBackupsRequest::new().set_page_token("example");
1775 /// ```
1776 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1777 self.page_token = v.into();
1778 self
1779 }
1780
1781 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1782 ///
1783 /// # Example
1784 /// ```ignore,no_run
1785 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1786 /// let x = ListBackupsRequest::new().set_order_by("example");
1787 /// ```
1788 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1789 self.order_by = v.into();
1790 self
1791 }
1792
1793 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1794 ///
1795 /// # Example
1796 /// ```ignore,no_run
1797 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1798 /// let x = ListBackupsRequest::new().set_filter("example");
1799 /// ```
1800 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1801 self.filter = v.into();
1802 self
1803 }
1804}
1805
1806impl wkt::message::Message for ListBackupsRequest {
1807 fn typename() -> &'static str {
1808 "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1809 }
1810}
1811
1812/// ListBackupsResponse is the result of ListBackupsRequest.
1813#[derive(Clone, Default, PartialEq)]
1814#[non_exhaustive]
1815pub struct ListBackupsResponse {
1816 /// A list of backups in the project.
1817 pub backups: std::vec::Vec<crate::model::Backup>,
1818
1819 /// The token you can use to retrieve the next page of results. Not returned
1820 /// if there are no more results in the list.
1821 pub next_page_token: std::string::String,
1822
1823 /// Locations that could not be reached.
1824 pub unreachable: std::vec::Vec<std::string::String>,
1825
1826 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1827}
1828
1829impl ListBackupsResponse {
1830 pub fn new() -> Self {
1831 std::default::Default::default()
1832 }
1833
1834 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1835 ///
1836 /// # Example
1837 /// ```ignore,no_run
1838 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1839 /// use google_cloud_netapp_v1::model::Backup;
1840 /// let x = ListBackupsResponse::new()
1841 /// .set_backups([
1842 /// Backup::default()/* use setters */,
1843 /// Backup::default()/* use (different) setters */,
1844 /// ]);
1845 /// ```
1846 pub fn set_backups<T, V>(mut self, v: T) -> Self
1847 where
1848 T: std::iter::IntoIterator<Item = V>,
1849 V: std::convert::Into<crate::model::Backup>,
1850 {
1851 use std::iter::Iterator;
1852 self.backups = v.into_iter().map(|i| i.into()).collect();
1853 self
1854 }
1855
1856 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1857 ///
1858 /// # Example
1859 /// ```ignore,no_run
1860 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1861 /// let x = ListBackupsResponse::new().set_next_page_token("example");
1862 /// ```
1863 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1864 self.next_page_token = v.into();
1865 self
1866 }
1867
1868 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1873 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1874 /// ```
1875 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1876 where
1877 T: std::iter::IntoIterator<Item = V>,
1878 V: std::convert::Into<std::string::String>,
1879 {
1880 use std::iter::Iterator;
1881 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1882 self
1883 }
1884}
1885
1886impl wkt::message::Message for ListBackupsResponse {
1887 fn typename() -> &'static str {
1888 "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1889 }
1890}
1891
1892#[doc(hidden)]
1893impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1894 type PageItem = crate::model::Backup;
1895
1896 fn items(self) -> std::vec::Vec<Self::PageItem> {
1897 self.backups
1898 }
1899
1900 fn next_page_token(&self) -> std::string::String {
1901 use std::clone::Clone;
1902 self.next_page_token.clone()
1903 }
1904}
1905
1906/// GetBackupRequest gets the state of a backup.
1907#[derive(Clone, Default, PartialEq)]
1908#[non_exhaustive]
1909pub struct GetBackupRequest {
1910 /// Required. The backup resource name, in the format
1911 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1912 pub name: std::string::String,
1913
1914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1915}
1916
1917impl GetBackupRequest {
1918 pub fn new() -> Self {
1919 std::default::Default::default()
1920 }
1921
1922 /// Sets the value of [name][crate::model::GetBackupRequest::name].
1923 ///
1924 /// # Example
1925 /// ```ignore,no_run
1926 /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1927 /// let x = GetBackupRequest::new().set_name("example");
1928 /// ```
1929 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1930 self.name = v.into();
1931 self
1932 }
1933}
1934
1935impl wkt::message::Message for GetBackupRequest {
1936 fn typename() -> &'static str {
1937 "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1938 }
1939}
1940
1941/// CreateBackupRequest creates a backup.
1942#[derive(Clone, Default, PartialEq)]
1943#[non_exhaustive]
1944pub struct CreateBackupRequest {
1945 /// Required. The NetApp backupVault to create the backups of, in the format
1946 /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1947 pub parent: std::string::String,
1948
1949 /// Required. The ID to use for the backup.
1950 /// The ID must be unique within the specified backupVault.
1951 /// Must contain only letters, numbers and hyphen, with the first
1952 /// character a letter, the last a letter or a
1953 /// number, and a 63 character maximum.
1954 pub backup_id: std::string::String,
1955
1956 /// Required. A backup resource
1957 pub backup: std::option::Option<crate::model::Backup>,
1958
1959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1960}
1961
1962impl CreateBackupRequest {
1963 pub fn new() -> Self {
1964 std::default::Default::default()
1965 }
1966
1967 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1968 ///
1969 /// # Example
1970 /// ```ignore,no_run
1971 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1972 /// let x = CreateBackupRequest::new().set_parent("example");
1973 /// ```
1974 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1975 self.parent = v.into();
1976 self
1977 }
1978
1979 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1980 ///
1981 /// # Example
1982 /// ```ignore,no_run
1983 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1984 /// let x = CreateBackupRequest::new().set_backup_id("example");
1985 /// ```
1986 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1987 self.backup_id = v.into();
1988 self
1989 }
1990
1991 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
1992 ///
1993 /// # Example
1994 /// ```ignore,no_run
1995 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1996 /// use google_cloud_netapp_v1::model::Backup;
1997 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1998 /// ```
1999 pub fn set_backup<T>(mut self, v: T) -> Self
2000 where
2001 T: std::convert::Into<crate::model::Backup>,
2002 {
2003 self.backup = std::option::Option::Some(v.into());
2004 self
2005 }
2006
2007 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2008 ///
2009 /// # Example
2010 /// ```ignore,no_run
2011 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2012 /// use google_cloud_netapp_v1::model::Backup;
2013 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2014 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2015 /// ```
2016 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2017 where
2018 T: std::convert::Into<crate::model::Backup>,
2019 {
2020 self.backup = v.map(|x| x.into());
2021 self
2022 }
2023}
2024
2025impl wkt::message::Message for CreateBackupRequest {
2026 fn typename() -> &'static str {
2027 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2028 }
2029}
2030
2031/// DeleteBackupRequest deletes a backup.
2032#[derive(Clone, Default, PartialEq)]
2033#[non_exhaustive]
2034pub struct DeleteBackupRequest {
2035 /// Required. The backup resource name, in the format
2036 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2037 pub name: std::string::String,
2038
2039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2040}
2041
2042impl DeleteBackupRequest {
2043 pub fn new() -> Self {
2044 std::default::Default::default()
2045 }
2046
2047 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2048 ///
2049 /// # Example
2050 /// ```ignore,no_run
2051 /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2052 /// let x = DeleteBackupRequest::new().set_name("example");
2053 /// ```
2054 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055 self.name = v.into();
2056 self
2057 }
2058}
2059
2060impl wkt::message::Message for DeleteBackupRequest {
2061 fn typename() -> &'static str {
2062 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2063 }
2064}
2065
2066/// UpdateBackupRequest updates description and/or labels for a backup.
2067#[derive(Clone, Default, PartialEq)]
2068#[non_exhaustive]
2069pub struct UpdateBackupRequest {
2070 /// Required. Field mask is used to specify the fields to be overwritten in the
2071 /// Backup resource to be updated.
2072 /// The fields specified in the update_mask are relative to the resource, not
2073 /// the full request. A field will be overwritten if it is in the mask. If the
2074 /// user does not provide a mask then all fields will be overwritten.
2075 pub update_mask: std::option::Option<wkt::FieldMask>,
2076
2077 /// Required. The backup being updated
2078 pub backup: std::option::Option<crate::model::Backup>,
2079
2080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2081}
2082
2083impl UpdateBackupRequest {
2084 pub fn new() -> Self {
2085 std::default::Default::default()
2086 }
2087
2088 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2089 ///
2090 /// # Example
2091 /// ```ignore,no_run
2092 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2093 /// use wkt::FieldMask;
2094 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2095 /// ```
2096 pub fn set_update_mask<T>(mut self, v: T) -> Self
2097 where
2098 T: std::convert::Into<wkt::FieldMask>,
2099 {
2100 self.update_mask = std::option::Option::Some(v.into());
2101 self
2102 }
2103
2104 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2105 ///
2106 /// # Example
2107 /// ```ignore,no_run
2108 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2109 /// use wkt::FieldMask;
2110 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2111 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2112 /// ```
2113 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2114 where
2115 T: std::convert::Into<wkt::FieldMask>,
2116 {
2117 self.update_mask = v.map(|x| x.into());
2118 self
2119 }
2120
2121 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2122 ///
2123 /// # Example
2124 /// ```ignore,no_run
2125 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2126 /// use google_cloud_netapp_v1::model::Backup;
2127 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2128 /// ```
2129 pub fn set_backup<T>(mut self, v: T) -> Self
2130 where
2131 T: std::convert::Into<crate::model::Backup>,
2132 {
2133 self.backup = std::option::Option::Some(v.into());
2134 self
2135 }
2136
2137 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2138 ///
2139 /// # Example
2140 /// ```ignore,no_run
2141 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2142 /// use google_cloud_netapp_v1::model::Backup;
2143 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2144 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2145 /// ```
2146 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2147 where
2148 T: std::convert::Into<crate::model::Backup>,
2149 {
2150 self.backup = v.map(|x| x.into());
2151 self
2152 }
2153}
2154
2155impl wkt::message::Message for UpdateBackupRequest {
2156 fn typename() -> &'static str {
2157 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2158 }
2159}
2160
2161/// Backup Policy.
2162#[derive(Clone, Default, PartialEq)]
2163#[non_exhaustive]
2164pub struct BackupPolicy {
2165 /// Identifier. The resource name of the backup policy.
2166 /// Format:
2167 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2168 pub name: std::string::String,
2169
2170 /// Number of daily backups to keep. Note that the minimum daily backup limit
2171 /// is 2.
2172 pub daily_backup_limit: std::option::Option<i32>,
2173
2174 /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2175 /// monthly backups should be greater than 1.
2176 pub weekly_backup_limit: std::option::Option<i32>,
2177
2178 /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2179 /// monthly backups should be greater than 1.
2180 pub monthly_backup_limit: std::option::Option<i32>,
2181
2182 /// Description of the backup policy.
2183 pub description: std::option::Option<std::string::String>,
2184
2185 /// If enabled, make backups automatically according to the schedules.
2186 /// This will be applied to all volumes that have this policy attached and
2187 /// enforced on volume level. If not specified, default is true.
2188 pub enabled: std::option::Option<bool>,
2189
2190 /// Output only. The total number of volumes assigned by this backup policy.
2191 pub assigned_volume_count: std::option::Option<i32>,
2192
2193 /// Output only. The time when the backup policy was created.
2194 pub create_time: std::option::Option<wkt::Timestamp>,
2195
2196 /// Resource labels to represent user provided metadata.
2197 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2198
2199 /// Output only. The backup policy state.
2200 pub state: crate::model::backup_policy::State,
2201
2202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2203}
2204
2205impl BackupPolicy {
2206 pub fn new() -> Self {
2207 std::default::Default::default()
2208 }
2209
2210 /// Sets the value of [name][crate::model::BackupPolicy::name].
2211 ///
2212 /// # Example
2213 /// ```ignore,no_run
2214 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2215 /// let x = BackupPolicy::new().set_name("example");
2216 /// ```
2217 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2218 self.name = v.into();
2219 self
2220 }
2221
2222 /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2223 ///
2224 /// # Example
2225 /// ```ignore,no_run
2226 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2227 /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2228 /// ```
2229 pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2230 where
2231 T: std::convert::Into<i32>,
2232 {
2233 self.daily_backup_limit = std::option::Option::Some(v.into());
2234 self
2235 }
2236
2237 /// Sets or clears 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_or_clear_daily_backup_limit(Some(42));
2243 /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2244 /// ```
2245 pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2246 where
2247 T: std::convert::Into<i32>,
2248 {
2249 self.daily_backup_limit = v.map(|x| x.into());
2250 self
2251 }
2252
2253 /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2254 ///
2255 /// # Example
2256 /// ```ignore,no_run
2257 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2258 /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2259 /// ```
2260 pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2261 where
2262 T: std::convert::Into<i32>,
2263 {
2264 self.weekly_backup_limit = std::option::Option::Some(v.into());
2265 self
2266 }
2267
2268 /// Sets or clears 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_or_clear_weekly_backup_limit(Some(42));
2274 /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2275 /// ```
2276 pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2277 where
2278 T: std::convert::Into<i32>,
2279 {
2280 self.weekly_backup_limit = v.map(|x| x.into());
2281 self
2282 }
2283
2284 /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2285 ///
2286 /// # Example
2287 /// ```ignore,no_run
2288 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2289 /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2290 /// ```
2291 pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2292 where
2293 T: std::convert::Into<i32>,
2294 {
2295 self.monthly_backup_limit = std::option::Option::Some(v.into());
2296 self
2297 }
2298
2299 /// Sets or clears 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_or_clear_monthly_backup_limit(Some(42));
2305 /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2306 /// ```
2307 pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2308 where
2309 T: std::convert::Into<i32>,
2310 {
2311 self.monthly_backup_limit = v.map(|x| x.into());
2312 self
2313 }
2314
2315 /// Sets the value of [description][crate::model::BackupPolicy::description].
2316 ///
2317 /// # Example
2318 /// ```ignore,no_run
2319 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2320 /// let x = BackupPolicy::new().set_description("example");
2321 /// ```
2322 pub fn set_description<T>(mut self, v: T) -> Self
2323 where
2324 T: std::convert::Into<std::string::String>,
2325 {
2326 self.description = std::option::Option::Some(v.into());
2327 self
2328 }
2329
2330 /// Sets or clears 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_or_clear_description(Some("example"));
2336 /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2337 /// ```
2338 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2339 where
2340 T: std::convert::Into<std::string::String>,
2341 {
2342 self.description = v.map(|x| x.into());
2343 self
2344 }
2345
2346 /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2347 ///
2348 /// # Example
2349 /// ```ignore,no_run
2350 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2351 /// let x = BackupPolicy::new().set_enabled(true);
2352 /// ```
2353 pub fn set_enabled<T>(mut self, v: T) -> Self
2354 where
2355 T: std::convert::Into<bool>,
2356 {
2357 self.enabled = std::option::Option::Some(v.into());
2358 self
2359 }
2360
2361 /// Sets or clears 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_or_clear_enabled(Some(false));
2367 /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2368 /// ```
2369 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2370 where
2371 T: std::convert::Into<bool>,
2372 {
2373 self.enabled = v.map(|x| x.into());
2374 self
2375 }
2376
2377 /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2378 ///
2379 /// # Example
2380 /// ```ignore,no_run
2381 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2382 /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2383 /// ```
2384 pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2385 where
2386 T: std::convert::Into<i32>,
2387 {
2388 self.assigned_volume_count = std::option::Option::Some(v.into());
2389 self
2390 }
2391
2392 /// Sets or clears 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_or_clear_assigned_volume_count(Some(42));
2398 /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2399 /// ```
2400 pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2401 where
2402 T: std::convert::Into<i32>,
2403 {
2404 self.assigned_volume_count = v.map(|x| x.into());
2405 self
2406 }
2407
2408 /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2409 ///
2410 /// # Example
2411 /// ```ignore,no_run
2412 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2413 /// use wkt::Timestamp;
2414 /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2415 /// ```
2416 pub fn set_create_time<T>(mut self, v: T) -> Self
2417 where
2418 T: std::convert::Into<wkt::Timestamp>,
2419 {
2420 self.create_time = std::option::Option::Some(v.into());
2421 self
2422 }
2423
2424 /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2425 ///
2426 /// # Example
2427 /// ```ignore,no_run
2428 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2429 /// use wkt::Timestamp;
2430 /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2431 /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2432 /// ```
2433 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2434 where
2435 T: std::convert::Into<wkt::Timestamp>,
2436 {
2437 self.create_time = v.map(|x| x.into());
2438 self
2439 }
2440
2441 /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2442 ///
2443 /// # Example
2444 /// ```ignore,no_run
2445 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2446 /// let x = BackupPolicy::new().set_labels([
2447 /// ("key0", "abc"),
2448 /// ("key1", "xyz"),
2449 /// ]);
2450 /// ```
2451 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2452 where
2453 T: std::iter::IntoIterator<Item = (K, V)>,
2454 K: std::convert::Into<std::string::String>,
2455 V: std::convert::Into<std::string::String>,
2456 {
2457 use std::iter::Iterator;
2458 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2459 self
2460 }
2461
2462 /// Sets the value of [state][crate::model::BackupPolicy::state].
2463 ///
2464 /// # Example
2465 /// ```ignore,no_run
2466 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2467 /// use google_cloud_netapp_v1::model::backup_policy::State;
2468 /// let x0 = BackupPolicy::new().set_state(State::Creating);
2469 /// let x1 = BackupPolicy::new().set_state(State::Ready);
2470 /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2471 /// ```
2472 pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2473 mut self,
2474 v: T,
2475 ) -> Self {
2476 self.state = v.into();
2477 self
2478 }
2479}
2480
2481impl wkt::message::Message for BackupPolicy {
2482 fn typename() -> &'static str {
2483 "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2484 }
2485}
2486
2487/// Defines additional types related to [BackupPolicy].
2488pub mod backup_policy {
2489 #[allow(unused_imports)]
2490 use super::*;
2491
2492 ///
2493 /// # Working with unknown values
2494 ///
2495 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2496 /// additional enum variants at any time. Adding new variants is not considered
2497 /// a breaking change. Applications should write their code in anticipation of:
2498 ///
2499 /// - New values appearing in future releases of the client library, **and**
2500 /// - New values received dynamically, without application changes.
2501 ///
2502 /// Please consult the [Working with enums] section in the user guide for some
2503 /// guidelines.
2504 ///
2505 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2506 #[derive(Clone, Debug, PartialEq)]
2507 #[non_exhaustive]
2508 pub enum State {
2509 /// State not set.
2510 Unspecified,
2511 /// BackupPolicy is being created.
2512 Creating,
2513 /// BackupPolicy is available for use.
2514 Ready,
2515 /// BackupPolicy is being deleted.
2516 Deleting,
2517 /// BackupPolicy is not valid and cannot be used.
2518 Error,
2519 /// BackupPolicy is being updated.
2520 Updating,
2521 /// If set, the enum was initialized with an unknown value.
2522 ///
2523 /// Applications can examine the value using [State::value] or
2524 /// [State::name].
2525 UnknownValue(state::UnknownValue),
2526 }
2527
2528 #[doc(hidden)]
2529 pub mod state {
2530 #[allow(unused_imports)]
2531 use super::*;
2532 #[derive(Clone, Debug, PartialEq)]
2533 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2534 }
2535
2536 impl State {
2537 /// Gets the enum value.
2538 ///
2539 /// Returns `None` if the enum contains an unknown value deserialized from
2540 /// the string representation of enums.
2541 pub fn value(&self) -> std::option::Option<i32> {
2542 match self {
2543 Self::Unspecified => std::option::Option::Some(0),
2544 Self::Creating => std::option::Option::Some(1),
2545 Self::Ready => std::option::Option::Some(2),
2546 Self::Deleting => std::option::Option::Some(3),
2547 Self::Error => std::option::Option::Some(4),
2548 Self::Updating => std::option::Option::Some(5),
2549 Self::UnknownValue(u) => u.0.value(),
2550 }
2551 }
2552
2553 /// Gets the enum value as a string.
2554 ///
2555 /// Returns `None` if the enum contains an unknown value deserialized from
2556 /// the integer representation of enums.
2557 pub fn name(&self) -> std::option::Option<&str> {
2558 match self {
2559 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2560 Self::Creating => std::option::Option::Some("CREATING"),
2561 Self::Ready => std::option::Option::Some("READY"),
2562 Self::Deleting => std::option::Option::Some("DELETING"),
2563 Self::Error => std::option::Option::Some("ERROR"),
2564 Self::Updating => std::option::Option::Some("UPDATING"),
2565 Self::UnknownValue(u) => u.0.name(),
2566 }
2567 }
2568 }
2569
2570 impl std::default::Default for State {
2571 fn default() -> Self {
2572 use std::convert::From;
2573 Self::from(0)
2574 }
2575 }
2576
2577 impl std::fmt::Display for State {
2578 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2579 wkt::internal::display_enum(f, self.name(), self.value())
2580 }
2581 }
2582
2583 impl std::convert::From<i32> for State {
2584 fn from(value: i32) -> Self {
2585 match value {
2586 0 => Self::Unspecified,
2587 1 => Self::Creating,
2588 2 => Self::Ready,
2589 3 => Self::Deleting,
2590 4 => Self::Error,
2591 5 => Self::Updating,
2592 _ => Self::UnknownValue(state::UnknownValue(
2593 wkt::internal::UnknownEnumValue::Integer(value),
2594 )),
2595 }
2596 }
2597 }
2598
2599 impl std::convert::From<&str> for State {
2600 fn from(value: &str) -> Self {
2601 use std::string::ToString;
2602 match value {
2603 "STATE_UNSPECIFIED" => Self::Unspecified,
2604 "CREATING" => Self::Creating,
2605 "READY" => Self::Ready,
2606 "DELETING" => Self::Deleting,
2607 "ERROR" => Self::Error,
2608 "UPDATING" => Self::Updating,
2609 _ => Self::UnknownValue(state::UnknownValue(
2610 wkt::internal::UnknownEnumValue::String(value.to_string()),
2611 )),
2612 }
2613 }
2614 }
2615
2616 impl serde::ser::Serialize for State {
2617 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2618 where
2619 S: serde::Serializer,
2620 {
2621 match self {
2622 Self::Unspecified => serializer.serialize_i32(0),
2623 Self::Creating => serializer.serialize_i32(1),
2624 Self::Ready => serializer.serialize_i32(2),
2625 Self::Deleting => serializer.serialize_i32(3),
2626 Self::Error => serializer.serialize_i32(4),
2627 Self::Updating => serializer.serialize_i32(5),
2628 Self::UnknownValue(u) => u.0.serialize(serializer),
2629 }
2630 }
2631 }
2632
2633 impl<'de> serde::de::Deserialize<'de> for State {
2634 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2635 where
2636 D: serde::Deserializer<'de>,
2637 {
2638 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2639 ".google.cloud.netapp.v1.BackupPolicy.State",
2640 ))
2641 }
2642 }
2643}
2644
2645/// CreateBackupPolicyRequest creates a backupPolicy.
2646#[derive(Clone, Default, PartialEq)]
2647#[non_exhaustive]
2648pub struct CreateBackupPolicyRequest {
2649 /// Required. The location to create the backup policies of, in the format
2650 /// `projects/{project_id}/locations/{location}`
2651 pub parent: std::string::String,
2652
2653 /// Required. A backupPolicy resource
2654 pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2655
2656 /// Required. The ID to use for the backup policy.
2657 /// The ID must be unique within the specified location.
2658 /// Must contain only letters, numbers and hyphen, with the first
2659 /// character a letter, the last a letter or a
2660 /// number, and a 63 character maximum.
2661 pub backup_policy_id: std::string::String,
2662
2663 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2664}
2665
2666impl CreateBackupPolicyRequest {
2667 pub fn new() -> Self {
2668 std::default::Default::default()
2669 }
2670
2671 /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2672 ///
2673 /// # Example
2674 /// ```ignore,no_run
2675 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2676 /// let x = CreateBackupPolicyRequest::new().set_parent("example");
2677 /// ```
2678 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2679 self.parent = v.into();
2680 self
2681 }
2682
2683 /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2684 ///
2685 /// # Example
2686 /// ```ignore,no_run
2687 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2688 /// use google_cloud_netapp_v1::model::BackupPolicy;
2689 /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2690 /// ```
2691 pub fn set_backup_policy<T>(mut self, v: T) -> Self
2692 where
2693 T: std::convert::Into<crate::model::BackupPolicy>,
2694 {
2695 self.backup_policy = std::option::Option::Some(v.into());
2696 self
2697 }
2698
2699 /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2700 ///
2701 /// # Example
2702 /// ```ignore,no_run
2703 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2704 /// use google_cloud_netapp_v1::model::BackupPolicy;
2705 /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2706 /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2707 /// ```
2708 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2709 where
2710 T: std::convert::Into<crate::model::BackupPolicy>,
2711 {
2712 self.backup_policy = v.map(|x| x.into());
2713 self
2714 }
2715
2716 /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2717 ///
2718 /// # Example
2719 /// ```ignore,no_run
2720 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2721 /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2722 /// ```
2723 pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2724 mut self,
2725 v: T,
2726 ) -> Self {
2727 self.backup_policy_id = v.into();
2728 self
2729 }
2730}
2731
2732impl wkt::message::Message for CreateBackupPolicyRequest {
2733 fn typename() -> &'static str {
2734 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2735 }
2736}
2737
2738/// GetBackupPolicyRequest gets the state of a backupPolicy.
2739#[derive(Clone, Default, PartialEq)]
2740#[non_exhaustive]
2741pub struct GetBackupPolicyRequest {
2742 /// Required. The backupPolicy resource name, in the format
2743 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2744 pub name: std::string::String,
2745
2746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2747}
2748
2749impl GetBackupPolicyRequest {
2750 pub fn new() -> Self {
2751 std::default::Default::default()
2752 }
2753
2754 /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2755 ///
2756 /// # Example
2757 /// ```ignore,no_run
2758 /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2759 /// let x = GetBackupPolicyRequest::new().set_name("example");
2760 /// ```
2761 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762 self.name = v.into();
2763 self
2764 }
2765}
2766
2767impl wkt::message::Message for GetBackupPolicyRequest {
2768 fn typename() -> &'static str {
2769 "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2770 }
2771}
2772
2773/// ListBackupPoliciesRequest for requesting multiple backup policies.
2774#[derive(Clone, Default, PartialEq)]
2775#[non_exhaustive]
2776pub struct ListBackupPoliciesRequest {
2777 /// Required. Parent value for ListBackupPoliciesRequest
2778 pub parent: std::string::String,
2779
2780 /// Requested page size. Server may return fewer items than requested.
2781 /// If unspecified, the server will pick an appropriate default.
2782 pub page_size: i32,
2783
2784 /// A token identifying a page of results the server should return.
2785 pub page_token: std::string::String,
2786
2787 /// Filtering results
2788 pub filter: std::string::String,
2789
2790 /// Hint for how to order the results
2791 pub order_by: std::string::String,
2792
2793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2794}
2795
2796impl ListBackupPoliciesRequest {
2797 pub fn new() -> Self {
2798 std::default::Default::default()
2799 }
2800
2801 /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2802 ///
2803 /// # Example
2804 /// ```ignore,no_run
2805 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2806 /// let x = ListBackupPoliciesRequest::new().set_parent("example");
2807 /// ```
2808 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2809 self.parent = v.into();
2810 self
2811 }
2812
2813 /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2814 ///
2815 /// # Example
2816 /// ```ignore,no_run
2817 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2818 /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2819 /// ```
2820 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2821 self.page_size = v.into();
2822 self
2823 }
2824
2825 /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2826 ///
2827 /// # Example
2828 /// ```ignore,no_run
2829 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2830 /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2831 /// ```
2832 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2833 self.page_token = v.into();
2834 self
2835 }
2836
2837 /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2838 ///
2839 /// # Example
2840 /// ```ignore,no_run
2841 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2842 /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2843 /// ```
2844 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2845 self.filter = v.into();
2846 self
2847 }
2848
2849 /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2850 ///
2851 /// # Example
2852 /// ```ignore,no_run
2853 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2854 /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2855 /// ```
2856 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2857 self.order_by = v.into();
2858 self
2859 }
2860}
2861
2862impl wkt::message::Message for ListBackupPoliciesRequest {
2863 fn typename() -> &'static str {
2864 "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2865 }
2866}
2867
2868/// ListBackupPoliciesResponse contains all the backup policies requested.
2869#[derive(Clone, Default, PartialEq)]
2870#[non_exhaustive]
2871pub struct ListBackupPoliciesResponse {
2872 /// The list of backup policies.
2873 pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2874
2875 /// A token identifying a page of results the server should return.
2876 pub next_page_token: std::string::String,
2877
2878 /// Locations that could not be reached.
2879 pub unreachable: std::vec::Vec<std::string::String>,
2880
2881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2882}
2883
2884impl ListBackupPoliciesResponse {
2885 pub fn new() -> Self {
2886 std::default::Default::default()
2887 }
2888
2889 /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2890 ///
2891 /// # Example
2892 /// ```ignore,no_run
2893 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2894 /// use google_cloud_netapp_v1::model::BackupPolicy;
2895 /// let x = ListBackupPoliciesResponse::new()
2896 /// .set_backup_policies([
2897 /// BackupPolicy::default()/* use setters */,
2898 /// BackupPolicy::default()/* use (different) setters */,
2899 /// ]);
2900 /// ```
2901 pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2902 where
2903 T: std::iter::IntoIterator<Item = V>,
2904 V: std::convert::Into<crate::model::BackupPolicy>,
2905 {
2906 use std::iter::Iterator;
2907 self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2908 self
2909 }
2910
2911 /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2912 ///
2913 /// # Example
2914 /// ```ignore,no_run
2915 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2916 /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2917 /// ```
2918 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2919 self.next_page_token = v.into();
2920 self
2921 }
2922
2923 /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2924 ///
2925 /// # Example
2926 /// ```ignore,no_run
2927 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2928 /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
2929 /// ```
2930 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2931 where
2932 T: std::iter::IntoIterator<Item = V>,
2933 V: std::convert::Into<std::string::String>,
2934 {
2935 use std::iter::Iterator;
2936 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2937 self
2938 }
2939}
2940
2941impl wkt::message::Message for ListBackupPoliciesResponse {
2942 fn typename() -> &'static str {
2943 "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
2944 }
2945}
2946
2947#[doc(hidden)]
2948impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
2949 type PageItem = crate::model::BackupPolicy;
2950
2951 fn items(self) -> std::vec::Vec<Self::PageItem> {
2952 self.backup_policies
2953 }
2954
2955 fn next_page_token(&self) -> std::string::String {
2956 use std::clone::Clone;
2957 self.next_page_token.clone()
2958 }
2959}
2960
2961/// UpdateBackupPolicyRequest for updating a backup policy.
2962#[derive(Clone, Default, PartialEq)]
2963#[non_exhaustive]
2964pub struct UpdateBackupPolicyRequest {
2965 /// Required. Field mask is used to specify the fields to be overwritten in the
2966 /// Backup Policy resource by the update.
2967 /// The fields specified in the update_mask are relative to the resource, not
2968 /// the full request. A field will be overwritten if it is in the mask. If the
2969 /// user does not provide a mask then all fields will be overwritten.
2970 pub update_mask: std::option::Option<wkt::FieldMask>,
2971
2972 /// Required. The backup policy being updated
2973 pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2974
2975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2976}
2977
2978impl UpdateBackupPolicyRequest {
2979 pub fn new() -> Self {
2980 std::default::Default::default()
2981 }
2982
2983 /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
2984 ///
2985 /// # Example
2986 /// ```ignore,no_run
2987 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
2988 /// use wkt::FieldMask;
2989 /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2990 /// ```
2991 pub fn set_update_mask<T>(mut self, v: T) -> Self
2992 where
2993 T: std::convert::Into<wkt::FieldMask>,
2994 {
2995 self.update_mask = std::option::Option::Some(v.into());
2996 self
2997 }
2998
2999 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3000 ///
3001 /// # Example
3002 /// ```ignore,no_run
3003 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3004 /// use wkt::FieldMask;
3005 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3006 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3007 /// ```
3008 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3009 where
3010 T: std::convert::Into<wkt::FieldMask>,
3011 {
3012 self.update_mask = v.map(|x| x.into());
3013 self
3014 }
3015
3016 /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3017 ///
3018 /// # Example
3019 /// ```ignore,no_run
3020 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3021 /// use google_cloud_netapp_v1::model::BackupPolicy;
3022 /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3023 /// ```
3024 pub fn set_backup_policy<T>(mut self, v: T) -> Self
3025 where
3026 T: std::convert::Into<crate::model::BackupPolicy>,
3027 {
3028 self.backup_policy = std::option::Option::Some(v.into());
3029 self
3030 }
3031
3032 /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3033 ///
3034 /// # Example
3035 /// ```ignore,no_run
3036 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3037 /// use google_cloud_netapp_v1::model::BackupPolicy;
3038 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3039 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3040 /// ```
3041 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3042 where
3043 T: std::convert::Into<crate::model::BackupPolicy>,
3044 {
3045 self.backup_policy = v.map(|x| x.into());
3046 self
3047 }
3048}
3049
3050impl wkt::message::Message for UpdateBackupPolicyRequest {
3051 fn typename() -> &'static str {
3052 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3053 }
3054}
3055
3056/// DeleteBackupPolicyRequest deletes a backup policy.
3057#[derive(Clone, Default, PartialEq)]
3058#[non_exhaustive]
3059pub struct DeleteBackupPolicyRequest {
3060 /// Required. The backup policy resource name, in the format
3061 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3062 pub name: std::string::String,
3063
3064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3065}
3066
3067impl DeleteBackupPolicyRequest {
3068 pub fn new() -> Self {
3069 std::default::Default::default()
3070 }
3071
3072 /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3073 ///
3074 /// # Example
3075 /// ```ignore,no_run
3076 /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3077 /// let x = DeleteBackupPolicyRequest::new().set_name("example");
3078 /// ```
3079 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080 self.name = v.into();
3081 self
3082 }
3083}
3084
3085impl wkt::message::Message for DeleteBackupPolicyRequest {
3086 fn typename() -> &'static str {
3087 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3088 }
3089}
3090
3091/// A NetApp BackupVault.
3092#[derive(Clone, Default, PartialEq)]
3093#[non_exhaustive]
3094pub struct BackupVault {
3095 /// Identifier. The resource name of the backup vault.
3096 /// Format:
3097 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3098 pub name: std::string::String,
3099
3100 /// Output only. The backup vault state.
3101 pub state: crate::model::backup_vault::State,
3102
3103 /// Output only. Create time of the backup vault.
3104 pub create_time: std::option::Option<wkt::Timestamp>,
3105
3106 /// Description of the backup vault.
3107 pub description: std::string::String,
3108
3109 /// Resource labels to represent user provided metadata.
3110 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3111
3112 /// Optional. Type of backup vault to be created.
3113 /// Default is IN_REGION.
3114 pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3115
3116 /// Output only. Region in which the backup vault is created.
3117 /// Format: `projects/{project_id}/locations/{location}`
3118 pub source_region: std::string::String,
3119
3120 /// Optional. Region where the backups are stored.
3121 /// Format: `projects/{project_id}/locations/{location}`
3122 pub backup_region: std::string::String,
3123
3124 /// Output only. Name of the Backup vault created in source region.
3125 /// Format:
3126 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3127 pub source_backup_vault: std::string::String,
3128
3129 /// Output only. Name of the Backup vault created in backup region.
3130 /// Format:
3131 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3132 pub destination_backup_vault: std::string::String,
3133
3134 /// Optional. Backup retention policy defining the retention of backups.
3135 pub backup_retention_policy:
3136 std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3137
3138 /// Optional. Specifies the Key Management System (KMS) configuration to be
3139 /// used for backup encryption. Format:
3140 /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3141 pub kms_config: std::string::String,
3142
3143 /// Output only. Field indicating encryption state of CMEK backups.
3144 pub encryption_state: crate::model::backup_vault::EncryptionState,
3145
3146 /// Output only. The crypto key version used to encrypt the backup vault.
3147 /// Format:
3148 /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3149 pub backups_crypto_key_version: std::string::String,
3150
3151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3152}
3153
3154impl BackupVault {
3155 pub fn new() -> Self {
3156 std::default::Default::default()
3157 }
3158
3159 /// Sets the value of [name][crate::model::BackupVault::name].
3160 ///
3161 /// # Example
3162 /// ```ignore,no_run
3163 /// # use google_cloud_netapp_v1::model::BackupVault;
3164 /// let x = BackupVault::new().set_name("example");
3165 /// ```
3166 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3167 self.name = v.into();
3168 self
3169 }
3170
3171 /// Sets the value of [state][crate::model::BackupVault::state].
3172 ///
3173 /// # Example
3174 /// ```ignore,no_run
3175 /// # use google_cloud_netapp_v1::model::BackupVault;
3176 /// use google_cloud_netapp_v1::model::backup_vault::State;
3177 /// let x0 = BackupVault::new().set_state(State::Creating);
3178 /// let x1 = BackupVault::new().set_state(State::Ready);
3179 /// let x2 = BackupVault::new().set_state(State::Deleting);
3180 /// ```
3181 pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3182 mut self,
3183 v: T,
3184 ) -> Self {
3185 self.state = v.into();
3186 self
3187 }
3188
3189 /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3190 ///
3191 /// # Example
3192 /// ```ignore,no_run
3193 /// # use google_cloud_netapp_v1::model::BackupVault;
3194 /// use wkt::Timestamp;
3195 /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3196 /// ```
3197 pub fn set_create_time<T>(mut self, v: T) -> Self
3198 where
3199 T: std::convert::Into<wkt::Timestamp>,
3200 {
3201 self.create_time = std::option::Option::Some(v.into());
3202 self
3203 }
3204
3205 /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3206 ///
3207 /// # Example
3208 /// ```ignore,no_run
3209 /// # use google_cloud_netapp_v1::model::BackupVault;
3210 /// use wkt::Timestamp;
3211 /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3212 /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3213 /// ```
3214 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3215 where
3216 T: std::convert::Into<wkt::Timestamp>,
3217 {
3218 self.create_time = v.map(|x| x.into());
3219 self
3220 }
3221
3222 /// Sets the value of [description][crate::model::BackupVault::description].
3223 ///
3224 /// # Example
3225 /// ```ignore,no_run
3226 /// # use google_cloud_netapp_v1::model::BackupVault;
3227 /// let x = BackupVault::new().set_description("example");
3228 /// ```
3229 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3230 self.description = v.into();
3231 self
3232 }
3233
3234 /// Sets the value of [labels][crate::model::BackupVault::labels].
3235 ///
3236 /// # Example
3237 /// ```ignore,no_run
3238 /// # use google_cloud_netapp_v1::model::BackupVault;
3239 /// let x = BackupVault::new().set_labels([
3240 /// ("key0", "abc"),
3241 /// ("key1", "xyz"),
3242 /// ]);
3243 /// ```
3244 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3245 where
3246 T: std::iter::IntoIterator<Item = (K, V)>,
3247 K: std::convert::Into<std::string::String>,
3248 V: std::convert::Into<std::string::String>,
3249 {
3250 use std::iter::Iterator;
3251 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3252 self
3253 }
3254
3255 /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3256 ///
3257 /// # Example
3258 /// ```ignore,no_run
3259 /// # use google_cloud_netapp_v1::model::BackupVault;
3260 /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3261 /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3262 /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3263 /// ```
3264 pub fn set_backup_vault_type<
3265 T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3266 >(
3267 mut self,
3268 v: T,
3269 ) -> Self {
3270 self.backup_vault_type = v.into();
3271 self
3272 }
3273
3274 /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3275 ///
3276 /// # Example
3277 /// ```ignore,no_run
3278 /// # use google_cloud_netapp_v1::model::BackupVault;
3279 /// let x = BackupVault::new().set_source_region("example");
3280 /// ```
3281 pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3282 self.source_region = v.into();
3283 self
3284 }
3285
3286 /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3287 ///
3288 /// # Example
3289 /// ```ignore,no_run
3290 /// # use google_cloud_netapp_v1::model::BackupVault;
3291 /// let x = BackupVault::new().set_backup_region("example");
3292 /// ```
3293 pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3294 self.backup_region = v.into();
3295 self
3296 }
3297
3298 /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3299 ///
3300 /// # Example
3301 /// ```ignore,no_run
3302 /// # use google_cloud_netapp_v1::model::BackupVault;
3303 /// let x = BackupVault::new().set_source_backup_vault("example");
3304 /// ```
3305 pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3306 mut self,
3307 v: T,
3308 ) -> Self {
3309 self.source_backup_vault = v.into();
3310 self
3311 }
3312
3313 /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3314 ///
3315 /// # Example
3316 /// ```ignore,no_run
3317 /// # use google_cloud_netapp_v1::model::BackupVault;
3318 /// let x = BackupVault::new().set_destination_backup_vault("example");
3319 /// ```
3320 pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3321 mut self,
3322 v: T,
3323 ) -> Self {
3324 self.destination_backup_vault = v.into();
3325 self
3326 }
3327
3328 /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3329 ///
3330 /// # Example
3331 /// ```ignore,no_run
3332 /// # use google_cloud_netapp_v1::model::BackupVault;
3333 /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3334 /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3335 /// ```
3336 pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3337 where
3338 T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3339 {
3340 self.backup_retention_policy = std::option::Option::Some(v.into());
3341 self
3342 }
3343
3344 /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3345 ///
3346 /// # Example
3347 /// ```ignore,no_run
3348 /// # use google_cloud_netapp_v1::model::BackupVault;
3349 /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3350 /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3351 /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3352 /// ```
3353 pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3354 where
3355 T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3356 {
3357 self.backup_retention_policy = v.map(|x| x.into());
3358 self
3359 }
3360
3361 /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3362 ///
3363 /// # Example
3364 /// ```ignore,no_run
3365 /// # use google_cloud_netapp_v1::model::BackupVault;
3366 /// let x = BackupVault::new().set_kms_config("example");
3367 /// ```
3368 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3369 self.kms_config = v.into();
3370 self
3371 }
3372
3373 /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3374 ///
3375 /// # Example
3376 /// ```ignore,no_run
3377 /// # use google_cloud_netapp_v1::model::BackupVault;
3378 /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3379 /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3380 /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3381 /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3382 /// ```
3383 pub fn set_encryption_state<
3384 T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3385 >(
3386 mut self,
3387 v: T,
3388 ) -> Self {
3389 self.encryption_state = v.into();
3390 self
3391 }
3392
3393 /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3394 ///
3395 /// # Example
3396 /// ```ignore,no_run
3397 /// # use google_cloud_netapp_v1::model::BackupVault;
3398 /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3399 /// ```
3400 pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3401 mut self,
3402 v: T,
3403 ) -> Self {
3404 self.backups_crypto_key_version = v.into();
3405 self
3406 }
3407}
3408
3409impl wkt::message::Message for BackupVault {
3410 fn typename() -> &'static str {
3411 "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3412 }
3413}
3414
3415/// Defines additional types related to [BackupVault].
3416pub mod backup_vault {
3417 #[allow(unused_imports)]
3418 use super::*;
3419
3420 /// Retention policy for backups in the backup vault
3421 #[derive(Clone, Default, PartialEq)]
3422 #[non_exhaustive]
3423 pub struct BackupRetentionPolicy {
3424 /// Required. Minimum retention duration in days for backups in the backup
3425 /// vault.
3426 pub backup_minimum_enforced_retention_days: i32,
3427
3428 /// Optional. Indicates if the daily backups are immutable.
3429 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3430 /// monthly_backup_immutable and manual_backup_immutable must be true.
3431 pub daily_backup_immutable: bool,
3432
3433 /// Optional. Indicates if the weekly backups are immutable.
3434 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3435 /// monthly_backup_immutable and manual_backup_immutable must be true.
3436 pub weekly_backup_immutable: bool,
3437
3438 /// Optional. Indicates if the monthly backups are immutable.
3439 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3440 /// monthly_backup_immutable and manual_backup_immutable must be true.
3441 pub monthly_backup_immutable: bool,
3442
3443 /// Optional. Indicates if the manual backups are immutable.
3444 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3445 /// monthly_backup_immutable and manual_backup_immutable must be true.
3446 pub manual_backup_immutable: bool,
3447
3448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3449 }
3450
3451 impl BackupRetentionPolicy {
3452 pub fn new() -> Self {
3453 std::default::Default::default()
3454 }
3455
3456 /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3457 ///
3458 /// # Example
3459 /// ```ignore,no_run
3460 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3461 /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3462 /// ```
3463 pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3464 mut self,
3465 v: T,
3466 ) -> Self {
3467 self.backup_minimum_enforced_retention_days = v.into();
3468 self
3469 }
3470
3471 /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3472 ///
3473 /// # Example
3474 /// ```ignore,no_run
3475 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3476 /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3477 /// ```
3478 pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3479 self.daily_backup_immutable = v.into();
3480 self
3481 }
3482
3483 /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3484 ///
3485 /// # Example
3486 /// ```ignore,no_run
3487 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3488 /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3489 /// ```
3490 pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3491 self.weekly_backup_immutable = v.into();
3492 self
3493 }
3494
3495 /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_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_monthly_backup_immutable(true);
3501 /// ```
3502 pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3503 self.monthly_backup_immutable = v.into();
3504 self
3505 }
3506
3507 /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_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_manual_backup_immutable(true);
3513 /// ```
3514 pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3515 self.manual_backup_immutable = v.into();
3516 self
3517 }
3518 }
3519
3520 impl wkt::message::Message for BackupRetentionPolicy {
3521 fn typename() -> &'static str {
3522 "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3523 }
3524 }
3525
3526 /// The Backup Vault States
3527 ///
3528 /// # Working with unknown values
3529 ///
3530 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3531 /// additional enum variants at any time. Adding new variants is not considered
3532 /// a breaking change. Applications should write their code in anticipation of:
3533 ///
3534 /// - New values appearing in future releases of the client library, **and**
3535 /// - New values received dynamically, without application changes.
3536 ///
3537 /// Please consult the [Working with enums] section in the user guide for some
3538 /// guidelines.
3539 ///
3540 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3541 #[derive(Clone, Debug, PartialEq)]
3542 #[non_exhaustive]
3543 pub enum State {
3544 /// State not set.
3545 Unspecified,
3546 /// BackupVault is being created.
3547 Creating,
3548 /// BackupVault is available for use.
3549 Ready,
3550 /// BackupVault is being deleted.
3551 Deleting,
3552 /// BackupVault is not valid and cannot be used.
3553 Error,
3554 /// BackupVault is being updated.
3555 Updating,
3556 /// If set, the enum was initialized with an unknown value.
3557 ///
3558 /// Applications can examine the value using [State::value] or
3559 /// [State::name].
3560 UnknownValue(state::UnknownValue),
3561 }
3562
3563 #[doc(hidden)]
3564 pub mod state {
3565 #[allow(unused_imports)]
3566 use super::*;
3567 #[derive(Clone, Debug, PartialEq)]
3568 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3569 }
3570
3571 impl State {
3572 /// Gets the enum value.
3573 ///
3574 /// Returns `None` if the enum contains an unknown value deserialized from
3575 /// the string representation of enums.
3576 pub fn value(&self) -> std::option::Option<i32> {
3577 match self {
3578 Self::Unspecified => std::option::Option::Some(0),
3579 Self::Creating => std::option::Option::Some(1),
3580 Self::Ready => std::option::Option::Some(2),
3581 Self::Deleting => std::option::Option::Some(3),
3582 Self::Error => std::option::Option::Some(4),
3583 Self::Updating => std::option::Option::Some(5),
3584 Self::UnknownValue(u) => u.0.value(),
3585 }
3586 }
3587
3588 /// Gets the enum value as a string.
3589 ///
3590 /// Returns `None` if the enum contains an unknown value deserialized from
3591 /// the integer representation of enums.
3592 pub fn name(&self) -> std::option::Option<&str> {
3593 match self {
3594 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3595 Self::Creating => std::option::Option::Some("CREATING"),
3596 Self::Ready => std::option::Option::Some("READY"),
3597 Self::Deleting => std::option::Option::Some("DELETING"),
3598 Self::Error => std::option::Option::Some("ERROR"),
3599 Self::Updating => std::option::Option::Some("UPDATING"),
3600 Self::UnknownValue(u) => u.0.name(),
3601 }
3602 }
3603 }
3604
3605 impl std::default::Default for State {
3606 fn default() -> Self {
3607 use std::convert::From;
3608 Self::from(0)
3609 }
3610 }
3611
3612 impl std::fmt::Display for State {
3613 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3614 wkt::internal::display_enum(f, self.name(), self.value())
3615 }
3616 }
3617
3618 impl std::convert::From<i32> for State {
3619 fn from(value: i32) -> Self {
3620 match value {
3621 0 => Self::Unspecified,
3622 1 => Self::Creating,
3623 2 => Self::Ready,
3624 3 => Self::Deleting,
3625 4 => Self::Error,
3626 5 => Self::Updating,
3627 _ => Self::UnknownValue(state::UnknownValue(
3628 wkt::internal::UnknownEnumValue::Integer(value),
3629 )),
3630 }
3631 }
3632 }
3633
3634 impl std::convert::From<&str> for State {
3635 fn from(value: &str) -> Self {
3636 use std::string::ToString;
3637 match value {
3638 "STATE_UNSPECIFIED" => Self::Unspecified,
3639 "CREATING" => Self::Creating,
3640 "READY" => Self::Ready,
3641 "DELETING" => Self::Deleting,
3642 "ERROR" => Self::Error,
3643 "UPDATING" => Self::Updating,
3644 _ => Self::UnknownValue(state::UnknownValue(
3645 wkt::internal::UnknownEnumValue::String(value.to_string()),
3646 )),
3647 }
3648 }
3649 }
3650
3651 impl serde::ser::Serialize for State {
3652 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3653 where
3654 S: serde::Serializer,
3655 {
3656 match self {
3657 Self::Unspecified => serializer.serialize_i32(0),
3658 Self::Creating => serializer.serialize_i32(1),
3659 Self::Ready => serializer.serialize_i32(2),
3660 Self::Deleting => serializer.serialize_i32(3),
3661 Self::Error => serializer.serialize_i32(4),
3662 Self::Updating => serializer.serialize_i32(5),
3663 Self::UnknownValue(u) => u.0.serialize(serializer),
3664 }
3665 }
3666 }
3667
3668 impl<'de> serde::de::Deserialize<'de> for State {
3669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3670 where
3671 D: serde::Deserializer<'de>,
3672 {
3673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3674 ".google.cloud.netapp.v1.BackupVault.State",
3675 ))
3676 }
3677 }
3678
3679 /// Backup Vault Type.
3680 ///
3681 /// # Working with unknown values
3682 ///
3683 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3684 /// additional enum variants at any time. Adding new variants is not considered
3685 /// a breaking change. Applications should write their code in anticipation of:
3686 ///
3687 /// - New values appearing in future releases of the client library, **and**
3688 /// - New values received dynamically, without application changes.
3689 ///
3690 /// Please consult the [Working with enums] section in the user guide for some
3691 /// guidelines.
3692 ///
3693 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3694 #[derive(Clone, Debug, PartialEq)]
3695 #[non_exhaustive]
3696 pub enum BackupVaultType {
3697 /// BackupVault type not set.
3698 Unspecified,
3699 /// BackupVault type is IN_REGION.
3700 InRegion,
3701 /// BackupVault type is CROSS_REGION.
3702 CrossRegion,
3703 /// If set, the enum was initialized with an unknown value.
3704 ///
3705 /// Applications can examine the value using [BackupVaultType::value] or
3706 /// [BackupVaultType::name].
3707 UnknownValue(backup_vault_type::UnknownValue),
3708 }
3709
3710 #[doc(hidden)]
3711 pub mod backup_vault_type {
3712 #[allow(unused_imports)]
3713 use super::*;
3714 #[derive(Clone, Debug, PartialEq)]
3715 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3716 }
3717
3718 impl BackupVaultType {
3719 /// Gets the enum value.
3720 ///
3721 /// Returns `None` if the enum contains an unknown value deserialized from
3722 /// the string representation of enums.
3723 pub fn value(&self) -> std::option::Option<i32> {
3724 match self {
3725 Self::Unspecified => std::option::Option::Some(0),
3726 Self::InRegion => std::option::Option::Some(1),
3727 Self::CrossRegion => std::option::Option::Some(2),
3728 Self::UnknownValue(u) => u.0.value(),
3729 }
3730 }
3731
3732 /// Gets the enum value as a string.
3733 ///
3734 /// Returns `None` if the enum contains an unknown value deserialized from
3735 /// the integer representation of enums.
3736 pub fn name(&self) -> std::option::Option<&str> {
3737 match self {
3738 Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3739 Self::InRegion => std::option::Option::Some("IN_REGION"),
3740 Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3741 Self::UnknownValue(u) => u.0.name(),
3742 }
3743 }
3744 }
3745
3746 impl std::default::Default for BackupVaultType {
3747 fn default() -> Self {
3748 use std::convert::From;
3749 Self::from(0)
3750 }
3751 }
3752
3753 impl std::fmt::Display for BackupVaultType {
3754 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3755 wkt::internal::display_enum(f, self.name(), self.value())
3756 }
3757 }
3758
3759 impl std::convert::From<i32> for BackupVaultType {
3760 fn from(value: i32) -> Self {
3761 match value {
3762 0 => Self::Unspecified,
3763 1 => Self::InRegion,
3764 2 => Self::CrossRegion,
3765 _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3766 wkt::internal::UnknownEnumValue::Integer(value),
3767 )),
3768 }
3769 }
3770 }
3771
3772 impl std::convert::From<&str> for BackupVaultType {
3773 fn from(value: &str) -> Self {
3774 use std::string::ToString;
3775 match value {
3776 "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3777 "IN_REGION" => Self::InRegion,
3778 "CROSS_REGION" => Self::CrossRegion,
3779 _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3780 wkt::internal::UnknownEnumValue::String(value.to_string()),
3781 )),
3782 }
3783 }
3784 }
3785
3786 impl serde::ser::Serialize for BackupVaultType {
3787 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3788 where
3789 S: serde::Serializer,
3790 {
3791 match self {
3792 Self::Unspecified => serializer.serialize_i32(0),
3793 Self::InRegion => serializer.serialize_i32(1),
3794 Self::CrossRegion => serializer.serialize_i32(2),
3795 Self::UnknownValue(u) => u.0.serialize(serializer),
3796 }
3797 }
3798 }
3799
3800 impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3801 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3802 where
3803 D: serde::Deserializer<'de>,
3804 {
3805 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3806 ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3807 ))
3808 }
3809 }
3810
3811 /// Encryption state of customer-managed encryption keys (CMEK) backups.
3812 ///
3813 /// # Working with unknown values
3814 ///
3815 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3816 /// additional enum variants at any time. Adding new variants is not considered
3817 /// a breaking change. Applications should write their code in anticipation of:
3818 ///
3819 /// - New values appearing in future releases of the client library, **and**
3820 /// - New values received dynamically, without application changes.
3821 ///
3822 /// Please consult the [Working with enums] section in the user guide for some
3823 /// guidelines.
3824 ///
3825 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3826 #[derive(Clone, Debug, PartialEq)]
3827 #[non_exhaustive]
3828 pub enum EncryptionState {
3829 /// Encryption state not set.
3830 Unspecified,
3831 /// Encryption state is pending.
3832 Pending,
3833 /// Encryption is complete.
3834 Completed,
3835 /// Encryption is in progress.
3836 InProgress,
3837 /// Encryption has failed.
3838 Failed,
3839 /// If set, the enum was initialized with an unknown value.
3840 ///
3841 /// Applications can examine the value using [EncryptionState::value] or
3842 /// [EncryptionState::name].
3843 UnknownValue(encryption_state::UnknownValue),
3844 }
3845
3846 #[doc(hidden)]
3847 pub mod encryption_state {
3848 #[allow(unused_imports)]
3849 use super::*;
3850 #[derive(Clone, Debug, PartialEq)]
3851 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3852 }
3853
3854 impl EncryptionState {
3855 /// Gets the enum value.
3856 ///
3857 /// Returns `None` if the enum contains an unknown value deserialized from
3858 /// the string representation of enums.
3859 pub fn value(&self) -> std::option::Option<i32> {
3860 match self {
3861 Self::Unspecified => std::option::Option::Some(0),
3862 Self::Pending => std::option::Option::Some(1),
3863 Self::Completed => std::option::Option::Some(2),
3864 Self::InProgress => std::option::Option::Some(3),
3865 Self::Failed => std::option::Option::Some(4),
3866 Self::UnknownValue(u) => u.0.value(),
3867 }
3868 }
3869
3870 /// Gets the enum value as a string.
3871 ///
3872 /// Returns `None` if the enum contains an unknown value deserialized from
3873 /// the integer representation of enums.
3874 pub fn name(&self) -> std::option::Option<&str> {
3875 match self {
3876 Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3877 Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3878 Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3879 Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3880 Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3881 Self::UnknownValue(u) => u.0.name(),
3882 }
3883 }
3884 }
3885
3886 impl std::default::Default for EncryptionState {
3887 fn default() -> Self {
3888 use std::convert::From;
3889 Self::from(0)
3890 }
3891 }
3892
3893 impl std::fmt::Display for EncryptionState {
3894 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3895 wkt::internal::display_enum(f, self.name(), self.value())
3896 }
3897 }
3898
3899 impl std::convert::From<i32> for EncryptionState {
3900 fn from(value: i32) -> Self {
3901 match value {
3902 0 => Self::Unspecified,
3903 1 => Self::Pending,
3904 2 => Self::Completed,
3905 3 => Self::InProgress,
3906 4 => Self::Failed,
3907 _ => Self::UnknownValue(encryption_state::UnknownValue(
3908 wkt::internal::UnknownEnumValue::Integer(value),
3909 )),
3910 }
3911 }
3912 }
3913
3914 impl std::convert::From<&str> for EncryptionState {
3915 fn from(value: &str) -> Self {
3916 use std::string::ToString;
3917 match value {
3918 "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
3919 "ENCRYPTION_STATE_PENDING" => Self::Pending,
3920 "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
3921 "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
3922 "ENCRYPTION_STATE_FAILED" => Self::Failed,
3923 _ => Self::UnknownValue(encryption_state::UnknownValue(
3924 wkt::internal::UnknownEnumValue::String(value.to_string()),
3925 )),
3926 }
3927 }
3928 }
3929
3930 impl serde::ser::Serialize for EncryptionState {
3931 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3932 where
3933 S: serde::Serializer,
3934 {
3935 match self {
3936 Self::Unspecified => serializer.serialize_i32(0),
3937 Self::Pending => serializer.serialize_i32(1),
3938 Self::Completed => serializer.serialize_i32(2),
3939 Self::InProgress => serializer.serialize_i32(3),
3940 Self::Failed => serializer.serialize_i32(4),
3941 Self::UnknownValue(u) => u.0.serialize(serializer),
3942 }
3943 }
3944 }
3945
3946 impl<'de> serde::de::Deserialize<'de> for EncryptionState {
3947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3948 where
3949 D: serde::Deserializer<'de>,
3950 {
3951 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
3952 ".google.cloud.netapp.v1.BackupVault.EncryptionState",
3953 ))
3954 }
3955 }
3956}
3957
3958/// GetBackupVaultRequest gets the state of a backupVault.
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct GetBackupVaultRequest {
3962 /// Required. The backupVault resource name, in the format
3963 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3964 pub name: std::string::String,
3965
3966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3967}
3968
3969impl GetBackupVaultRequest {
3970 pub fn new() -> Self {
3971 std::default::Default::default()
3972 }
3973
3974 /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
3975 ///
3976 /// # Example
3977 /// ```ignore,no_run
3978 /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
3979 /// let x = GetBackupVaultRequest::new().set_name("example");
3980 /// ```
3981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.name = v.into();
3983 self
3984 }
3985}
3986
3987impl wkt::message::Message for GetBackupVaultRequest {
3988 fn typename() -> &'static str {
3989 "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
3990 }
3991}
3992
3993/// ListBackupVaultsRequest lists backupVaults.
3994#[derive(Clone, Default, PartialEq)]
3995#[non_exhaustive]
3996pub struct ListBackupVaultsRequest {
3997 /// Required. The location for which to retrieve backupVault information,
3998 /// in the format
3999 /// `projects/{project_id}/locations/{location}`.
4000 pub parent: std::string::String,
4001
4002 /// The maximum number of items to return.
4003 pub page_size: i32,
4004
4005 /// The next_page_token value to use if there are additional
4006 /// results to retrieve for this list request.
4007 pub page_token: std::string::String,
4008
4009 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4010 pub order_by: std::string::String,
4011
4012 /// List filter.
4013 pub filter: std::string::String,
4014
4015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4016}
4017
4018impl ListBackupVaultsRequest {
4019 pub fn new() -> Self {
4020 std::default::Default::default()
4021 }
4022
4023 /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4024 ///
4025 /// # Example
4026 /// ```ignore,no_run
4027 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4028 /// let x = ListBackupVaultsRequest::new().set_parent("example");
4029 /// ```
4030 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4031 self.parent = v.into();
4032 self
4033 }
4034
4035 /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4036 ///
4037 /// # Example
4038 /// ```ignore,no_run
4039 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4040 /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4041 /// ```
4042 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4043 self.page_size = v.into();
4044 self
4045 }
4046
4047 /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4048 ///
4049 /// # Example
4050 /// ```ignore,no_run
4051 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4052 /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4053 /// ```
4054 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4055 self.page_token = v.into();
4056 self
4057 }
4058
4059 /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4060 ///
4061 /// # Example
4062 /// ```ignore,no_run
4063 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4064 /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4065 /// ```
4066 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4067 self.order_by = v.into();
4068 self
4069 }
4070
4071 /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4072 ///
4073 /// # Example
4074 /// ```ignore,no_run
4075 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4076 /// let x = ListBackupVaultsRequest::new().set_filter("example");
4077 /// ```
4078 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4079 self.filter = v.into();
4080 self
4081 }
4082}
4083
4084impl wkt::message::Message for ListBackupVaultsRequest {
4085 fn typename() -> &'static str {
4086 "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4087 }
4088}
4089
4090/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4091#[derive(Clone, Default, PartialEq)]
4092#[non_exhaustive]
4093pub struct ListBackupVaultsResponse {
4094 /// A list of backupVaults in the project for the specified location.
4095 pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4096
4097 /// The token you can use to retrieve the next page of results. Not returned
4098 /// if there are no more results in the list.
4099 pub next_page_token: std::string::String,
4100
4101 /// Locations that could not be reached.
4102 pub unreachable: std::vec::Vec<std::string::String>,
4103
4104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4105}
4106
4107impl ListBackupVaultsResponse {
4108 pub fn new() -> Self {
4109 std::default::Default::default()
4110 }
4111
4112 /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4113 ///
4114 /// # Example
4115 /// ```ignore,no_run
4116 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4117 /// use google_cloud_netapp_v1::model::BackupVault;
4118 /// let x = ListBackupVaultsResponse::new()
4119 /// .set_backup_vaults([
4120 /// BackupVault::default()/* use setters */,
4121 /// BackupVault::default()/* use (different) setters */,
4122 /// ]);
4123 /// ```
4124 pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4125 where
4126 T: std::iter::IntoIterator<Item = V>,
4127 V: std::convert::Into<crate::model::BackupVault>,
4128 {
4129 use std::iter::Iterator;
4130 self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4131 self
4132 }
4133
4134 /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4135 ///
4136 /// # Example
4137 /// ```ignore,no_run
4138 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4139 /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4140 /// ```
4141 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4142 self.next_page_token = v.into();
4143 self
4144 }
4145
4146 /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4147 ///
4148 /// # Example
4149 /// ```ignore,no_run
4150 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4151 /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4152 /// ```
4153 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4154 where
4155 T: std::iter::IntoIterator<Item = V>,
4156 V: std::convert::Into<std::string::String>,
4157 {
4158 use std::iter::Iterator;
4159 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4160 self
4161 }
4162}
4163
4164impl wkt::message::Message for ListBackupVaultsResponse {
4165 fn typename() -> &'static str {
4166 "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4167 }
4168}
4169
4170#[doc(hidden)]
4171impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4172 type PageItem = crate::model::BackupVault;
4173
4174 fn items(self) -> std::vec::Vec<Self::PageItem> {
4175 self.backup_vaults
4176 }
4177
4178 fn next_page_token(&self) -> std::string::String {
4179 use std::clone::Clone;
4180 self.next_page_token.clone()
4181 }
4182}
4183
4184/// CreateBackupVaultRequest creates a backup vault.
4185#[derive(Clone, Default, PartialEq)]
4186#[non_exhaustive]
4187pub struct CreateBackupVaultRequest {
4188 /// Required. The location to create the backup vaults, in the format
4189 /// `projects/{project_id}/locations/{location}`
4190 pub parent: std::string::String,
4191
4192 /// Required. The ID to use for the backupVault.
4193 /// The ID must be unique within the specified location.
4194 /// Must contain only letters, numbers and hyphen, with the first
4195 /// character a letter, the last a letter or a
4196 /// number, and a 63 character maximum.
4197 pub backup_vault_id: std::string::String,
4198
4199 /// Required. A backupVault resource
4200 pub backup_vault: std::option::Option<crate::model::BackupVault>,
4201
4202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4203}
4204
4205impl CreateBackupVaultRequest {
4206 pub fn new() -> Self {
4207 std::default::Default::default()
4208 }
4209
4210 /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4211 ///
4212 /// # Example
4213 /// ```ignore,no_run
4214 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4215 /// let x = CreateBackupVaultRequest::new().set_parent("example");
4216 /// ```
4217 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4218 self.parent = v.into();
4219 self
4220 }
4221
4222 /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4223 ///
4224 /// # Example
4225 /// ```ignore,no_run
4226 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4227 /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4228 /// ```
4229 pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4230 self.backup_vault_id = v.into();
4231 self
4232 }
4233
4234 /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4235 ///
4236 /// # Example
4237 /// ```ignore,no_run
4238 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4239 /// use google_cloud_netapp_v1::model::BackupVault;
4240 /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4241 /// ```
4242 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4243 where
4244 T: std::convert::Into<crate::model::BackupVault>,
4245 {
4246 self.backup_vault = std::option::Option::Some(v.into());
4247 self
4248 }
4249
4250 /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4255 /// use google_cloud_netapp_v1::model::BackupVault;
4256 /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4257 /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4258 /// ```
4259 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4260 where
4261 T: std::convert::Into<crate::model::BackupVault>,
4262 {
4263 self.backup_vault = v.map(|x| x.into());
4264 self
4265 }
4266}
4267
4268impl wkt::message::Message for CreateBackupVaultRequest {
4269 fn typename() -> &'static str {
4270 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4271 }
4272}
4273
4274/// DeleteBackupVaultRequest deletes a backupVault.
4275#[derive(Clone, Default, PartialEq)]
4276#[non_exhaustive]
4277pub struct DeleteBackupVaultRequest {
4278 /// Required. The backupVault resource name, in the format
4279 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4280 pub name: std::string::String,
4281
4282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4283}
4284
4285impl DeleteBackupVaultRequest {
4286 pub fn new() -> Self {
4287 std::default::Default::default()
4288 }
4289
4290 /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4291 ///
4292 /// # Example
4293 /// ```ignore,no_run
4294 /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4295 /// let x = DeleteBackupVaultRequest::new().set_name("example");
4296 /// ```
4297 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4298 self.name = v.into();
4299 self
4300 }
4301}
4302
4303impl wkt::message::Message for DeleteBackupVaultRequest {
4304 fn typename() -> &'static str {
4305 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4306 }
4307}
4308
4309/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4310#[derive(Clone, Default, PartialEq)]
4311#[non_exhaustive]
4312pub struct UpdateBackupVaultRequest {
4313 /// Required. Field mask is used to specify the fields to be overwritten in the
4314 /// Backup resource to be updated.
4315 /// The fields specified in the update_mask are relative to the resource, not
4316 /// the full request. A field will be overwritten if it is in the mask. If the
4317 /// user does not provide a mask then all fields will be overwritten.
4318 pub update_mask: std::option::Option<wkt::FieldMask>,
4319
4320 /// Required. The backupVault being updated
4321 pub backup_vault: std::option::Option<crate::model::BackupVault>,
4322
4323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4324}
4325
4326impl UpdateBackupVaultRequest {
4327 pub fn new() -> Self {
4328 std::default::Default::default()
4329 }
4330
4331 /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4332 ///
4333 /// # Example
4334 /// ```ignore,no_run
4335 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4336 /// use wkt::FieldMask;
4337 /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4338 /// ```
4339 pub fn set_update_mask<T>(mut self, v: T) -> Self
4340 where
4341 T: std::convert::Into<wkt::FieldMask>,
4342 {
4343 self.update_mask = std::option::Option::Some(v.into());
4344 self
4345 }
4346
4347 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4348 ///
4349 /// # Example
4350 /// ```ignore,no_run
4351 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4352 /// use wkt::FieldMask;
4353 /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4354 /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4355 /// ```
4356 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4357 where
4358 T: std::convert::Into<wkt::FieldMask>,
4359 {
4360 self.update_mask = v.map(|x| x.into());
4361 self
4362 }
4363
4364 /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4365 ///
4366 /// # Example
4367 /// ```ignore,no_run
4368 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4369 /// use google_cloud_netapp_v1::model::BackupVault;
4370 /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4371 /// ```
4372 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4373 where
4374 T: std::convert::Into<crate::model::BackupVault>,
4375 {
4376 self.backup_vault = std::option::Option::Some(v.into());
4377 self
4378 }
4379
4380 /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4381 ///
4382 /// # Example
4383 /// ```ignore,no_run
4384 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4385 /// use google_cloud_netapp_v1::model::BackupVault;
4386 /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4387 /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4388 /// ```
4389 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4390 where
4391 T: std::convert::Into<crate::model::BackupVault>,
4392 {
4393 self.backup_vault = v.map(|x| x.into());
4394 self
4395 }
4396}
4397
4398impl wkt::message::Message for UpdateBackupVaultRequest {
4399 fn typename() -> &'static str {
4400 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4401 }
4402}
4403
4404/// Represents the metadata of the long-running operation.
4405#[derive(Clone, Default, PartialEq)]
4406#[non_exhaustive]
4407pub struct OperationMetadata {
4408 /// Output only. The time the operation was created.
4409 pub create_time: std::option::Option<wkt::Timestamp>,
4410
4411 /// Output only. The time the operation finished running.
4412 pub end_time: std::option::Option<wkt::Timestamp>,
4413
4414 /// Output only. Server-defined resource path for the target of the operation.
4415 pub target: std::string::String,
4416
4417 /// Output only. Name of the verb executed by the operation.
4418 pub verb: std::string::String,
4419
4420 /// Output only. Human-readable status of the operation, if any.
4421 pub status_message: std::string::String,
4422
4423 /// Output only. Identifies whether the user has requested cancellation
4424 /// of the operation. Operations that have been canceled successfully
4425 /// have [Operation.error][] value with a
4426 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4427 /// `Code.CANCELLED`.
4428 ///
4429 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4430 pub requested_cancellation: bool,
4431
4432 /// Output only. API version used to start the operation.
4433 pub api_version: std::string::String,
4434
4435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4436}
4437
4438impl OperationMetadata {
4439 pub fn new() -> Self {
4440 std::default::Default::default()
4441 }
4442
4443 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4444 ///
4445 /// # Example
4446 /// ```ignore,no_run
4447 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4448 /// use wkt::Timestamp;
4449 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4450 /// ```
4451 pub fn set_create_time<T>(mut self, v: T) -> Self
4452 where
4453 T: std::convert::Into<wkt::Timestamp>,
4454 {
4455 self.create_time = std::option::Option::Some(v.into());
4456 self
4457 }
4458
4459 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4460 ///
4461 /// # Example
4462 /// ```ignore,no_run
4463 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4464 /// use wkt::Timestamp;
4465 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4466 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4467 /// ```
4468 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4469 where
4470 T: std::convert::Into<wkt::Timestamp>,
4471 {
4472 self.create_time = v.map(|x| x.into());
4473 self
4474 }
4475
4476 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4477 ///
4478 /// # Example
4479 /// ```ignore,no_run
4480 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4481 /// use wkt::Timestamp;
4482 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4483 /// ```
4484 pub fn set_end_time<T>(mut self, v: T) -> Self
4485 where
4486 T: std::convert::Into<wkt::Timestamp>,
4487 {
4488 self.end_time = std::option::Option::Some(v.into());
4489 self
4490 }
4491
4492 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4493 ///
4494 /// # Example
4495 /// ```ignore,no_run
4496 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4497 /// use wkt::Timestamp;
4498 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4499 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4500 /// ```
4501 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4502 where
4503 T: std::convert::Into<wkt::Timestamp>,
4504 {
4505 self.end_time = v.map(|x| x.into());
4506 self
4507 }
4508
4509 /// Sets the value of [target][crate::model::OperationMetadata::target].
4510 ///
4511 /// # Example
4512 /// ```ignore,no_run
4513 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4514 /// let x = OperationMetadata::new().set_target("example");
4515 /// ```
4516 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4517 self.target = v.into();
4518 self
4519 }
4520
4521 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4522 ///
4523 /// # Example
4524 /// ```ignore,no_run
4525 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4526 /// let x = OperationMetadata::new().set_verb("example");
4527 /// ```
4528 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4529 self.verb = v.into();
4530 self
4531 }
4532
4533 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4534 ///
4535 /// # Example
4536 /// ```ignore,no_run
4537 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4538 /// let x = OperationMetadata::new().set_status_message("example");
4539 /// ```
4540 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541 self.status_message = v.into();
4542 self
4543 }
4544
4545 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4546 ///
4547 /// # Example
4548 /// ```ignore,no_run
4549 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4550 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4551 /// ```
4552 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4553 self.requested_cancellation = v.into();
4554 self
4555 }
4556
4557 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4558 ///
4559 /// # Example
4560 /// ```ignore,no_run
4561 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4562 /// let x = OperationMetadata::new().set_api_version("example");
4563 /// ```
4564 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4565 self.api_version = v.into();
4566 self
4567 }
4568}
4569
4570impl wkt::message::Message for OperationMetadata {
4571 fn typename() -> &'static str {
4572 "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4573 }
4574}
4575
4576/// Metadata for a given
4577/// [google.cloud.location.Location][google.cloud.location.Location].
4578///
4579/// [google.cloud.location.Location]: google_cloud_location::model::Location
4580#[derive(Clone, Default, PartialEq)]
4581#[non_exhaustive]
4582pub struct LocationMetadata {
4583 /// Output only. Supported service levels in a location.
4584 pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4585
4586 /// Output only. Supported flex performance in a location.
4587 pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4588
4589 /// Output only. Indicates if the location has VCP support.
4590 pub has_vcp: bool,
4591
4592 /// Output only. Indicates if the location has ONTAP Proxy support.
4593 pub has_ontap_proxy: bool,
4594
4595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4596}
4597
4598impl LocationMetadata {
4599 pub fn new() -> Self {
4600 std::default::Default::default()
4601 }
4602
4603 /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4604 ///
4605 /// # Example
4606 /// ```ignore,no_run
4607 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4608 /// use google_cloud_netapp_v1::model::ServiceLevel;
4609 /// let x = LocationMetadata::new().set_supported_service_levels([
4610 /// ServiceLevel::Premium,
4611 /// ServiceLevel::Extreme,
4612 /// ServiceLevel::Standard,
4613 /// ]);
4614 /// ```
4615 pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4616 where
4617 T: std::iter::IntoIterator<Item = V>,
4618 V: std::convert::Into<crate::model::ServiceLevel>,
4619 {
4620 use std::iter::Iterator;
4621 self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4622 self
4623 }
4624
4625 /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4626 ///
4627 /// # Example
4628 /// ```ignore,no_run
4629 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4630 /// use google_cloud_netapp_v1::model::FlexPerformance;
4631 /// let x = LocationMetadata::new().set_supported_flex_performance([
4632 /// FlexPerformance::Default,
4633 /// FlexPerformance::Custom,
4634 /// ]);
4635 /// ```
4636 pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4637 where
4638 T: std::iter::IntoIterator<Item = V>,
4639 V: std::convert::Into<crate::model::FlexPerformance>,
4640 {
4641 use std::iter::Iterator;
4642 self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4643 self
4644 }
4645
4646 /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4647 ///
4648 /// # Example
4649 /// ```ignore,no_run
4650 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4651 /// let x = LocationMetadata::new().set_has_vcp(true);
4652 /// ```
4653 pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4654 self.has_vcp = v.into();
4655 self
4656 }
4657
4658 /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4659 ///
4660 /// # Example
4661 /// ```ignore,no_run
4662 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4663 /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4664 /// ```
4665 pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4666 self.has_ontap_proxy = v.into();
4667 self
4668 }
4669}
4670
4671impl wkt::message::Message for LocationMetadata {
4672 fn typename() -> &'static str {
4673 "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4674 }
4675}
4676
4677/// UserCommands contains the commands to be executed by the customer.
4678#[derive(Clone, Default, PartialEq)]
4679#[non_exhaustive]
4680pub struct UserCommands {
4681 /// Output only. List of commands to be executed by the customer.
4682 pub commands: std::vec::Vec<std::string::String>,
4683
4684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4685}
4686
4687impl UserCommands {
4688 pub fn new() -> Self {
4689 std::default::Default::default()
4690 }
4691
4692 /// Sets the value of [commands][crate::model::UserCommands::commands].
4693 ///
4694 /// # Example
4695 /// ```ignore,no_run
4696 /// # use google_cloud_netapp_v1::model::UserCommands;
4697 /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4698 /// ```
4699 pub fn set_commands<T, V>(mut self, v: T) -> Self
4700 where
4701 T: std::iter::IntoIterator<Item = V>,
4702 V: std::convert::Into<std::string::String>,
4703 {
4704 use std::iter::Iterator;
4705 self.commands = v.into_iter().map(|i| i.into()).collect();
4706 self
4707 }
4708}
4709
4710impl wkt::message::Message for UserCommands {
4711 fn typename() -> &'static str {
4712 "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4713 }
4714}
4715
4716/// ListHostGroupsRequest for listing host groups.
4717#[derive(Clone, Default, PartialEq)]
4718#[non_exhaustive]
4719pub struct ListHostGroupsRequest {
4720 /// Required. Parent value for ListHostGroupsRequest
4721 pub parent: std::string::String,
4722
4723 /// Optional. Requested page size. Server may return fewer items than
4724 /// requested. If unspecified, the server will pick an appropriate default.
4725 pub page_size: i32,
4726
4727 /// Optional. A token identifying a page of results the server should return.
4728 pub page_token: std::string::String,
4729
4730 /// Optional. Filter to apply to the request.
4731 pub filter: std::string::String,
4732
4733 /// Optional. Hint for how to order the results
4734 pub order_by: std::string::String,
4735
4736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4737}
4738
4739impl ListHostGroupsRequest {
4740 pub fn new() -> Self {
4741 std::default::Default::default()
4742 }
4743
4744 /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4745 ///
4746 /// # Example
4747 /// ```ignore,no_run
4748 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4749 /// let x = ListHostGroupsRequest::new().set_parent("example");
4750 /// ```
4751 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4752 self.parent = v.into();
4753 self
4754 }
4755
4756 /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4757 ///
4758 /// # Example
4759 /// ```ignore,no_run
4760 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4761 /// let x = ListHostGroupsRequest::new().set_page_size(42);
4762 /// ```
4763 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4764 self.page_size = v.into();
4765 self
4766 }
4767
4768 /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4769 ///
4770 /// # Example
4771 /// ```ignore,no_run
4772 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4773 /// let x = ListHostGroupsRequest::new().set_page_token("example");
4774 /// ```
4775 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4776 self.page_token = v.into();
4777 self
4778 }
4779
4780 /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4781 ///
4782 /// # Example
4783 /// ```ignore,no_run
4784 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4785 /// let x = ListHostGroupsRequest::new().set_filter("example");
4786 /// ```
4787 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4788 self.filter = v.into();
4789 self
4790 }
4791
4792 /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4793 ///
4794 /// # Example
4795 /// ```ignore,no_run
4796 /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4797 /// let x = ListHostGroupsRequest::new().set_order_by("example");
4798 /// ```
4799 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4800 self.order_by = v.into();
4801 self
4802 }
4803}
4804
4805impl wkt::message::Message for ListHostGroupsRequest {
4806 fn typename() -> &'static str {
4807 "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4808 }
4809}
4810
4811/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4812#[derive(Clone, Default, PartialEq)]
4813#[non_exhaustive]
4814pub struct ListHostGroupsResponse {
4815 /// The list of host groups.
4816 pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4817
4818 /// A token identifying a page of results the server should return.
4819 pub next_page_token: std::string::String,
4820
4821 /// Locations that could not be reached.
4822 pub unreachable: std::vec::Vec<std::string::String>,
4823
4824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4825}
4826
4827impl ListHostGroupsResponse {
4828 pub fn new() -> Self {
4829 std::default::Default::default()
4830 }
4831
4832 /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4833 ///
4834 /// # Example
4835 /// ```ignore,no_run
4836 /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4837 /// use google_cloud_netapp_v1::model::HostGroup;
4838 /// let x = ListHostGroupsResponse::new()
4839 /// .set_host_groups([
4840 /// HostGroup::default()/* use setters */,
4841 /// HostGroup::default()/* use (different) setters */,
4842 /// ]);
4843 /// ```
4844 pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4845 where
4846 T: std::iter::IntoIterator<Item = V>,
4847 V: std::convert::Into<crate::model::HostGroup>,
4848 {
4849 use std::iter::Iterator;
4850 self.host_groups = v.into_iter().map(|i| i.into()).collect();
4851 self
4852 }
4853
4854 /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4855 ///
4856 /// # Example
4857 /// ```ignore,no_run
4858 /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4859 /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4860 /// ```
4861 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4862 self.next_page_token = v.into();
4863 self
4864 }
4865
4866 /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4867 ///
4868 /// # Example
4869 /// ```ignore,no_run
4870 /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4871 /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4872 /// ```
4873 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4874 where
4875 T: std::iter::IntoIterator<Item = V>,
4876 V: std::convert::Into<std::string::String>,
4877 {
4878 use std::iter::Iterator;
4879 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4880 self
4881 }
4882}
4883
4884impl wkt::message::Message for ListHostGroupsResponse {
4885 fn typename() -> &'static str {
4886 "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
4887 }
4888}
4889
4890#[doc(hidden)]
4891impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
4892 type PageItem = crate::model::HostGroup;
4893
4894 fn items(self) -> std::vec::Vec<Self::PageItem> {
4895 self.host_groups
4896 }
4897
4898 fn next_page_token(&self) -> std::string::String {
4899 use std::clone::Clone;
4900 self.next_page_token.clone()
4901 }
4902}
4903
4904/// GetHostGroupRequest for getting a host group.
4905#[derive(Clone, Default, PartialEq)]
4906#[non_exhaustive]
4907pub struct GetHostGroupRequest {
4908 /// Required. The resource name of the host group.
4909 /// Format:
4910 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
4911 pub name: std::string::String,
4912
4913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4914}
4915
4916impl GetHostGroupRequest {
4917 pub fn new() -> Self {
4918 std::default::Default::default()
4919 }
4920
4921 /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
4922 ///
4923 /// # Example
4924 /// ```ignore,no_run
4925 /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
4926 /// let x = GetHostGroupRequest::new().set_name("example");
4927 /// ```
4928 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4929 self.name = v.into();
4930 self
4931 }
4932}
4933
4934impl wkt::message::Message for GetHostGroupRequest {
4935 fn typename() -> &'static str {
4936 "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
4937 }
4938}
4939
4940/// CreateHostGroupRequest for creating a host group.
4941#[derive(Clone, Default, PartialEq)]
4942#[non_exhaustive]
4943pub struct CreateHostGroupRequest {
4944 /// Required. Parent value for CreateHostGroupRequest
4945 pub parent: std::string::String,
4946
4947 /// Required. Fields of the host group to create.
4948 pub host_group: std::option::Option<crate::model::HostGroup>,
4949
4950 /// Required. ID of the host group to create. Must be unique within the parent
4951 /// resource. Must contain only letters, numbers, and hyphen, with
4952 /// the first character a letter or underscore, the last a letter or underscore
4953 /// or a number, and a 63 character maximum.
4954 pub host_group_id: std::string::String,
4955
4956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4957}
4958
4959impl CreateHostGroupRequest {
4960 pub fn new() -> Self {
4961 std::default::Default::default()
4962 }
4963
4964 /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
4965 ///
4966 /// # Example
4967 /// ```ignore,no_run
4968 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4969 /// let x = CreateHostGroupRequest::new().set_parent("example");
4970 /// ```
4971 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4972 self.parent = v.into();
4973 self
4974 }
4975
4976 /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4977 ///
4978 /// # Example
4979 /// ```ignore,no_run
4980 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4981 /// use google_cloud_netapp_v1::model::HostGroup;
4982 /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
4983 /// ```
4984 pub fn set_host_group<T>(mut self, v: T) -> Self
4985 where
4986 T: std::convert::Into<crate::model::HostGroup>,
4987 {
4988 self.host_group = std::option::Option::Some(v.into());
4989 self
4990 }
4991
4992 /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4993 ///
4994 /// # Example
4995 /// ```ignore,no_run
4996 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4997 /// use google_cloud_netapp_v1::model::HostGroup;
4998 /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
4999 /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5000 /// ```
5001 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5002 where
5003 T: std::convert::Into<crate::model::HostGroup>,
5004 {
5005 self.host_group = v.map(|x| x.into());
5006 self
5007 }
5008
5009 /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5010 ///
5011 /// # Example
5012 /// ```ignore,no_run
5013 /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5014 /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5015 /// ```
5016 pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5017 self.host_group_id = v.into();
5018 self
5019 }
5020}
5021
5022impl wkt::message::Message for CreateHostGroupRequest {
5023 fn typename() -> &'static str {
5024 "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5025 }
5026}
5027
5028/// UpdateHostGroupRequest for updating a host group.
5029#[derive(Clone, Default, PartialEq)]
5030#[non_exhaustive]
5031pub struct UpdateHostGroupRequest {
5032 /// Required. The host group to update.
5033 /// The host group's `name` field is used to identify the host group.
5034 /// Format:
5035 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5036 pub host_group: std::option::Option<crate::model::HostGroup>,
5037
5038 /// Optional. The list of fields to update.
5039 pub update_mask: std::option::Option<wkt::FieldMask>,
5040
5041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5042}
5043
5044impl UpdateHostGroupRequest {
5045 pub fn new() -> Self {
5046 std::default::Default::default()
5047 }
5048
5049 /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5050 ///
5051 /// # Example
5052 /// ```ignore,no_run
5053 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5054 /// use google_cloud_netapp_v1::model::HostGroup;
5055 /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5056 /// ```
5057 pub fn set_host_group<T>(mut self, v: T) -> Self
5058 where
5059 T: std::convert::Into<crate::model::HostGroup>,
5060 {
5061 self.host_group = std::option::Option::Some(v.into());
5062 self
5063 }
5064
5065 /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5066 ///
5067 /// # Example
5068 /// ```ignore,no_run
5069 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5070 /// use google_cloud_netapp_v1::model::HostGroup;
5071 /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5072 /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5073 /// ```
5074 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5075 where
5076 T: std::convert::Into<crate::model::HostGroup>,
5077 {
5078 self.host_group = v.map(|x| x.into());
5079 self
5080 }
5081
5082 /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5083 ///
5084 /// # Example
5085 /// ```ignore,no_run
5086 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5087 /// use wkt::FieldMask;
5088 /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5089 /// ```
5090 pub fn set_update_mask<T>(mut self, v: T) -> Self
5091 where
5092 T: std::convert::Into<wkt::FieldMask>,
5093 {
5094 self.update_mask = std::option::Option::Some(v.into());
5095 self
5096 }
5097
5098 /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5099 ///
5100 /// # Example
5101 /// ```ignore,no_run
5102 /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5103 /// use wkt::FieldMask;
5104 /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5105 /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5106 /// ```
5107 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5108 where
5109 T: std::convert::Into<wkt::FieldMask>,
5110 {
5111 self.update_mask = v.map(|x| x.into());
5112 self
5113 }
5114}
5115
5116impl wkt::message::Message for UpdateHostGroupRequest {
5117 fn typename() -> &'static str {
5118 "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5119 }
5120}
5121
5122/// DeleteHostGroupRequest for deleting a single host group.
5123#[derive(Clone, Default, PartialEq)]
5124#[non_exhaustive]
5125pub struct DeleteHostGroupRequest {
5126 /// Required. The resource name of the host group.
5127 /// Format:
5128 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5129 pub name: std::string::String,
5130
5131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5132}
5133
5134impl DeleteHostGroupRequest {
5135 pub fn new() -> Self {
5136 std::default::Default::default()
5137 }
5138
5139 /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5140 ///
5141 /// # Example
5142 /// ```ignore,no_run
5143 /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5144 /// let x = DeleteHostGroupRequest::new().set_name("example");
5145 /// ```
5146 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5147 self.name = v.into();
5148 self
5149 }
5150}
5151
5152impl wkt::message::Message for DeleteHostGroupRequest {
5153 fn typename() -> &'static str {
5154 "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5155 }
5156}
5157
5158/// Host group is a collection of hosts that can be used for accessing a Block
5159/// Volume.
5160#[derive(Clone, Default, PartialEq)]
5161#[non_exhaustive]
5162pub struct HostGroup {
5163 /// Identifier. The resource name of the host group.
5164 /// Format:
5165 /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5166 pub name: std::string::String,
5167
5168 /// Required. Type of the host group.
5169 pub r#type: crate::model::host_group::Type,
5170
5171 /// Output only. State of the host group.
5172 pub state: crate::model::host_group::State,
5173
5174 /// Output only. Create time of the host group.
5175 pub create_time: std::option::Option<wkt::Timestamp>,
5176
5177 /// Required. The list of hosts associated with the host group.
5178 pub hosts: std::vec::Vec<std::string::String>,
5179
5180 /// Required. The OS type of the host group. It indicates the type of operating
5181 /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5182 /// must be of the same OS type. This can be set only when creating a
5183 /// HostGroup.
5184 pub os_type: crate::model::OsType,
5185
5186 /// Optional. Description of the host group.
5187 pub description: std::string::String,
5188
5189 /// Optional. Labels of the host group.
5190 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5191
5192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5193}
5194
5195impl HostGroup {
5196 pub fn new() -> Self {
5197 std::default::Default::default()
5198 }
5199
5200 /// Sets the value of [name][crate::model::HostGroup::name].
5201 ///
5202 /// # Example
5203 /// ```ignore,no_run
5204 /// # use google_cloud_netapp_v1::model::HostGroup;
5205 /// let x = HostGroup::new().set_name("example");
5206 /// ```
5207 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5208 self.name = v.into();
5209 self
5210 }
5211
5212 /// Sets the value of [r#type][crate::model::HostGroup::type].
5213 ///
5214 /// # Example
5215 /// ```ignore,no_run
5216 /// # use google_cloud_netapp_v1::model::HostGroup;
5217 /// use google_cloud_netapp_v1::model::host_group::Type;
5218 /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5219 /// ```
5220 pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5221 self.r#type = v.into();
5222 self
5223 }
5224
5225 /// Sets the value of [state][crate::model::HostGroup::state].
5226 ///
5227 /// # Example
5228 /// ```ignore,no_run
5229 /// # use google_cloud_netapp_v1::model::HostGroup;
5230 /// use google_cloud_netapp_v1::model::host_group::State;
5231 /// let x0 = HostGroup::new().set_state(State::Creating);
5232 /// let x1 = HostGroup::new().set_state(State::Ready);
5233 /// let x2 = HostGroup::new().set_state(State::Updating);
5234 /// ```
5235 pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5236 mut self,
5237 v: T,
5238 ) -> Self {
5239 self.state = v.into();
5240 self
5241 }
5242
5243 /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5244 ///
5245 /// # Example
5246 /// ```ignore,no_run
5247 /// # use google_cloud_netapp_v1::model::HostGroup;
5248 /// use wkt::Timestamp;
5249 /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5250 /// ```
5251 pub fn set_create_time<T>(mut self, v: T) -> Self
5252 where
5253 T: std::convert::Into<wkt::Timestamp>,
5254 {
5255 self.create_time = std::option::Option::Some(v.into());
5256 self
5257 }
5258
5259 /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5260 ///
5261 /// # Example
5262 /// ```ignore,no_run
5263 /// # use google_cloud_netapp_v1::model::HostGroup;
5264 /// use wkt::Timestamp;
5265 /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5266 /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5267 /// ```
5268 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5269 where
5270 T: std::convert::Into<wkt::Timestamp>,
5271 {
5272 self.create_time = v.map(|x| x.into());
5273 self
5274 }
5275
5276 /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5277 ///
5278 /// # Example
5279 /// ```ignore,no_run
5280 /// # use google_cloud_netapp_v1::model::HostGroup;
5281 /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5282 /// ```
5283 pub fn set_hosts<T, V>(mut self, v: T) -> Self
5284 where
5285 T: std::iter::IntoIterator<Item = V>,
5286 V: std::convert::Into<std::string::String>,
5287 {
5288 use std::iter::Iterator;
5289 self.hosts = v.into_iter().map(|i| i.into()).collect();
5290 self
5291 }
5292
5293 /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5294 ///
5295 /// # Example
5296 /// ```ignore,no_run
5297 /// # use google_cloud_netapp_v1::model::HostGroup;
5298 /// use google_cloud_netapp_v1::model::OsType;
5299 /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5300 /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5301 /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5302 /// ```
5303 pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5304 self.os_type = v.into();
5305 self
5306 }
5307
5308 /// Sets the value of [description][crate::model::HostGroup::description].
5309 ///
5310 /// # Example
5311 /// ```ignore,no_run
5312 /// # use google_cloud_netapp_v1::model::HostGroup;
5313 /// let x = HostGroup::new().set_description("example");
5314 /// ```
5315 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5316 self.description = v.into();
5317 self
5318 }
5319
5320 /// Sets the value of [labels][crate::model::HostGroup::labels].
5321 ///
5322 /// # Example
5323 /// ```ignore,no_run
5324 /// # use google_cloud_netapp_v1::model::HostGroup;
5325 /// let x = HostGroup::new().set_labels([
5326 /// ("key0", "abc"),
5327 /// ("key1", "xyz"),
5328 /// ]);
5329 /// ```
5330 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5331 where
5332 T: std::iter::IntoIterator<Item = (K, V)>,
5333 K: std::convert::Into<std::string::String>,
5334 V: std::convert::Into<std::string::String>,
5335 {
5336 use std::iter::Iterator;
5337 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5338 self
5339 }
5340}
5341
5342impl wkt::message::Message for HostGroup {
5343 fn typename() -> &'static str {
5344 "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5345 }
5346}
5347
5348/// Defines additional types related to [HostGroup].
5349pub mod host_group {
5350 #[allow(unused_imports)]
5351 use super::*;
5352
5353 /// Types of host group.
5354 ///
5355 /// # Working with unknown values
5356 ///
5357 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5358 /// additional enum variants at any time. Adding new variants is not considered
5359 /// a breaking change. Applications should write their code in anticipation of:
5360 ///
5361 /// - New values appearing in future releases of the client library, **and**
5362 /// - New values received dynamically, without application changes.
5363 ///
5364 /// Please consult the [Working with enums] section in the user guide for some
5365 /// guidelines.
5366 ///
5367 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5368 #[derive(Clone, Debug, PartialEq)]
5369 #[non_exhaustive]
5370 pub enum Type {
5371 /// Unspecified type for host group.
5372 Unspecified,
5373 /// iSCSI initiator host group.
5374 IscsiInitiator,
5375 /// If set, the enum was initialized with an unknown value.
5376 ///
5377 /// Applications can examine the value using [Type::value] or
5378 /// [Type::name].
5379 UnknownValue(r#type::UnknownValue),
5380 }
5381
5382 #[doc(hidden)]
5383 pub mod r#type {
5384 #[allow(unused_imports)]
5385 use super::*;
5386 #[derive(Clone, Debug, PartialEq)]
5387 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5388 }
5389
5390 impl Type {
5391 /// Gets the enum value.
5392 ///
5393 /// Returns `None` if the enum contains an unknown value deserialized from
5394 /// the string representation of enums.
5395 pub fn value(&self) -> std::option::Option<i32> {
5396 match self {
5397 Self::Unspecified => std::option::Option::Some(0),
5398 Self::IscsiInitiator => std::option::Option::Some(1),
5399 Self::UnknownValue(u) => u.0.value(),
5400 }
5401 }
5402
5403 /// Gets the enum value as a string.
5404 ///
5405 /// Returns `None` if the enum contains an unknown value deserialized from
5406 /// the integer representation of enums.
5407 pub fn name(&self) -> std::option::Option<&str> {
5408 match self {
5409 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5410 Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5411 Self::UnknownValue(u) => u.0.name(),
5412 }
5413 }
5414 }
5415
5416 impl std::default::Default for Type {
5417 fn default() -> Self {
5418 use std::convert::From;
5419 Self::from(0)
5420 }
5421 }
5422
5423 impl std::fmt::Display for Type {
5424 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5425 wkt::internal::display_enum(f, self.name(), self.value())
5426 }
5427 }
5428
5429 impl std::convert::From<i32> for Type {
5430 fn from(value: i32) -> Self {
5431 match value {
5432 0 => Self::Unspecified,
5433 1 => Self::IscsiInitiator,
5434 _ => Self::UnknownValue(r#type::UnknownValue(
5435 wkt::internal::UnknownEnumValue::Integer(value),
5436 )),
5437 }
5438 }
5439 }
5440
5441 impl std::convert::From<&str> for Type {
5442 fn from(value: &str) -> Self {
5443 use std::string::ToString;
5444 match value {
5445 "TYPE_UNSPECIFIED" => Self::Unspecified,
5446 "ISCSI_INITIATOR" => Self::IscsiInitiator,
5447 _ => Self::UnknownValue(r#type::UnknownValue(
5448 wkt::internal::UnknownEnumValue::String(value.to_string()),
5449 )),
5450 }
5451 }
5452 }
5453
5454 impl serde::ser::Serialize for Type {
5455 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5456 where
5457 S: serde::Serializer,
5458 {
5459 match self {
5460 Self::Unspecified => serializer.serialize_i32(0),
5461 Self::IscsiInitiator => serializer.serialize_i32(1),
5462 Self::UnknownValue(u) => u.0.serialize(serializer),
5463 }
5464 }
5465 }
5466
5467 impl<'de> serde::de::Deserialize<'de> for Type {
5468 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5469 where
5470 D: serde::Deserializer<'de>,
5471 {
5472 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5473 ".google.cloud.netapp.v1.HostGroup.Type",
5474 ))
5475 }
5476 }
5477
5478 /// Host group states.
5479 ///
5480 /// # Working with unknown values
5481 ///
5482 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5483 /// additional enum variants at any time. Adding new variants is not considered
5484 /// a breaking change. Applications should write their code in anticipation of:
5485 ///
5486 /// - New values appearing in future releases of the client library, **and**
5487 /// - New values received dynamically, without application changes.
5488 ///
5489 /// Please consult the [Working with enums] section in the user guide for some
5490 /// guidelines.
5491 ///
5492 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5493 #[derive(Clone, Debug, PartialEq)]
5494 #[non_exhaustive]
5495 pub enum State {
5496 /// Unspecified state for host group.
5497 Unspecified,
5498 /// Host group is creating.
5499 Creating,
5500 /// Host group is ready.
5501 Ready,
5502 /// Host group is updating.
5503 Updating,
5504 /// Host group is deleting.
5505 Deleting,
5506 /// Host group is disabled.
5507 Disabled,
5508 /// If set, the enum was initialized with an unknown value.
5509 ///
5510 /// Applications can examine the value using [State::value] or
5511 /// [State::name].
5512 UnknownValue(state::UnknownValue),
5513 }
5514
5515 #[doc(hidden)]
5516 pub mod state {
5517 #[allow(unused_imports)]
5518 use super::*;
5519 #[derive(Clone, Debug, PartialEq)]
5520 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5521 }
5522
5523 impl State {
5524 /// Gets the enum value.
5525 ///
5526 /// Returns `None` if the enum contains an unknown value deserialized from
5527 /// the string representation of enums.
5528 pub fn value(&self) -> std::option::Option<i32> {
5529 match self {
5530 Self::Unspecified => std::option::Option::Some(0),
5531 Self::Creating => std::option::Option::Some(1),
5532 Self::Ready => std::option::Option::Some(2),
5533 Self::Updating => std::option::Option::Some(3),
5534 Self::Deleting => std::option::Option::Some(4),
5535 Self::Disabled => std::option::Option::Some(5),
5536 Self::UnknownValue(u) => u.0.value(),
5537 }
5538 }
5539
5540 /// Gets the enum value as a string.
5541 ///
5542 /// Returns `None` if the enum contains an unknown value deserialized from
5543 /// the integer representation of enums.
5544 pub fn name(&self) -> std::option::Option<&str> {
5545 match self {
5546 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5547 Self::Creating => std::option::Option::Some("CREATING"),
5548 Self::Ready => std::option::Option::Some("READY"),
5549 Self::Updating => std::option::Option::Some("UPDATING"),
5550 Self::Deleting => std::option::Option::Some("DELETING"),
5551 Self::Disabled => std::option::Option::Some("DISABLED"),
5552 Self::UnknownValue(u) => u.0.name(),
5553 }
5554 }
5555 }
5556
5557 impl std::default::Default for State {
5558 fn default() -> Self {
5559 use std::convert::From;
5560 Self::from(0)
5561 }
5562 }
5563
5564 impl std::fmt::Display for State {
5565 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5566 wkt::internal::display_enum(f, self.name(), self.value())
5567 }
5568 }
5569
5570 impl std::convert::From<i32> for State {
5571 fn from(value: i32) -> Self {
5572 match value {
5573 0 => Self::Unspecified,
5574 1 => Self::Creating,
5575 2 => Self::Ready,
5576 3 => Self::Updating,
5577 4 => Self::Deleting,
5578 5 => Self::Disabled,
5579 _ => Self::UnknownValue(state::UnknownValue(
5580 wkt::internal::UnknownEnumValue::Integer(value),
5581 )),
5582 }
5583 }
5584 }
5585
5586 impl std::convert::From<&str> for State {
5587 fn from(value: &str) -> Self {
5588 use std::string::ToString;
5589 match value {
5590 "STATE_UNSPECIFIED" => Self::Unspecified,
5591 "CREATING" => Self::Creating,
5592 "READY" => Self::Ready,
5593 "UPDATING" => Self::Updating,
5594 "DELETING" => Self::Deleting,
5595 "DISABLED" => Self::Disabled,
5596 _ => Self::UnknownValue(state::UnknownValue(
5597 wkt::internal::UnknownEnumValue::String(value.to_string()),
5598 )),
5599 }
5600 }
5601 }
5602
5603 impl serde::ser::Serialize for State {
5604 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5605 where
5606 S: serde::Serializer,
5607 {
5608 match self {
5609 Self::Unspecified => serializer.serialize_i32(0),
5610 Self::Creating => serializer.serialize_i32(1),
5611 Self::Ready => serializer.serialize_i32(2),
5612 Self::Updating => serializer.serialize_i32(3),
5613 Self::Deleting => serializer.serialize_i32(4),
5614 Self::Disabled => serializer.serialize_i32(5),
5615 Self::UnknownValue(u) => u.0.serialize(serializer),
5616 }
5617 }
5618 }
5619
5620 impl<'de> serde::de::Deserialize<'de> for State {
5621 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5622 where
5623 D: serde::Deserializer<'de>,
5624 {
5625 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5626 ".google.cloud.netapp.v1.HostGroup.State",
5627 ))
5628 }
5629 }
5630}
5631
5632/// GetKmsConfigRequest gets a KMS Config.
5633#[derive(Clone, Default, PartialEq)]
5634#[non_exhaustive]
5635pub struct GetKmsConfigRequest {
5636 /// Required. Name of the KmsConfig
5637 pub name: std::string::String,
5638
5639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5640}
5641
5642impl GetKmsConfigRequest {
5643 pub fn new() -> Self {
5644 std::default::Default::default()
5645 }
5646
5647 /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5648 ///
5649 /// # Example
5650 /// ```ignore,no_run
5651 /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5652 /// let x = GetKmsConfigRequest::new().set_name("example");
5653 /// ```
5654 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5655 self.name = v.into();
5656 self
5657 }
5658}
5659
5660impl wkt::message::Message for GetKmsConfigRequest {
5661 fn typename() -> &'static str {
5662 "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5663 }
5664}
5665
5666/// ListKmsConfigsRequest lists KMS Configs.
5667#[derive(Clone, Default, PartialEq)]
5668#[non_exhaustive]
5669pub struct ListKmsConfigsRequest {
5670 /// Required. Parent value
5671 pub parent: std::string::String,
5672
5673 /// The maximum number of items to return.
5674 pub page_size: i32,
5675
5676 /// The next_page_token value to use if there are additional
5677 /// results to retrieve for this list request.
5678 pub page_token: std::string::String,
5679
5680 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5681 pub order_by: std::string::String,
5682
5683 /// List filter.
5684 pub filter: std::string::String,
5685
5686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5687}
5688
5689impl ListKmsConfigsRequest {
5690 pub fn new() -> Self {
5691 std::default::Default::default()
5692 }
5693
5694 /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5695 ///
5696 /// # Example
5697 /// ```ignore,no_run
5698 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5699 /// let x = ListKmsConfigsRequest::new().set_parent("example");
5700 /// ```
5701 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5702 self.parent = v.into();
5703 self
5704 }
5705
5706 /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5707 ///
5708 /// # Example
5709 /// ```ignore,no_run
5710 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5711 /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5712 /// ```
5713 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5714 self.page_size = v.into();
5715 self
5716 }
5717
5718 /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5719 ///
5720 /// # Example
5721 /// ```ignore,no_run
5722 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5723 /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5724 /// ```
5725 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5726 self.page_token = v.into();
5727 self
5728 }
5729
5730 /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5731 ///
5732 /// # Example
5733 /// ```ignore,no_run
5734 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5735 /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5736 /// ```
5737 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5738 self.order_by = v.into();
5739 self
5740 }
5741
5742 /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5743 ///
5744 /// # Example
5745 /// ```ignore,no_run
5746 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5747 /// let x = ListKmsConfigsRequest::new().set_filter("example");
5748 /// ```
5749 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5750 self.filter = v.into();
5751 self
5752 }
5753}
5754
5755impl wkt::message::Message for ListKmsConfigsRequest {
5756 fn typename() -> &'static str {
5757 "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5758 }
5759}
5760
5761/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5762#[derive(Clone, Default, PartialEq)]
5763#[non_exhaustive]
5764pub struct ListKmsConfigsResponse {
5765 /// The list of KmsConfigs
5766 pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5767
5768 /// A token identifying a page of results the server should return.
5769 pub next_page_token: std::string::String,
5770
5771 /// Locations that could not be reached.
5772 pub unreachable: std::vec::Vec<std::string::String>,
5773
5774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5775}
5776
5777impl ListKmsConfigsResponse {
5778 pub fn new() -> Self {
5779 std::default::Default::default()
5780 }
5781
5782 /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5783 ///
5784 /// # Example
5785 /// ```ignore,no_run
5786 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5787 /// use google_cloud_netapp_v1::model::KmsConfig;
5788 /// let x = ListKmsConfigsResponse::new()
5789 /// .set_kms_configs([
5790 /// KmsConfig::default()/* use setters */,
5791 /// KmsConfig::default()/* use (different) setters */,
5792 /// ]);
5793 /// ```
5794 pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5795 where
5796 T: std::iter::IntoIterator<Item = V>,
5797 V: std::convert::Into<crate::model::KmsConfig>,
5798 {
5799 use std::iter::Iterator;
5800 self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5801 self
5802 }
5803
5804 /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5805 ///
5806 /// # Example
5807 /// ```ignore,no_run
5808 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5809 /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5810 /// ```
5811 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5812 self.next_page_token = v.into();
5813 self
5814 }
5815
5816 /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5817 ///
5818 /// # Example
5819 /// ```ignore,no_run
5820 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5821 /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5822 /// ```
5823 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5824 where
5825 T: std::iter::IntoIterator<Item = V>,
5826 V: std::convert::Into<std::string::String>,
5827 {
5828 use std::iter::Iterator;
5829 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5830 self
5831 }
5832}
5833
5834impl wkt::message::Message for ListKmsConfigsResponse {
5835 fn typename() -> &'static str {
5836 "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5837 }
5838}
5839
5840#[doc(hidden)]
5841impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5842 type PageItem = crate::model::KmsConfig;
5843
5844 fn items(self) -> std::vec::Vec<Self::PageItem> {
5845 self.kms_configs
5846 }
5847
5848 fn next_page_token(&self) -> std::string::String {
5849 use std::clone::Clone;
5850 self.next_page_token.clone()
5851 }
5852}
5853
5854/// CreateKmsConfigRequest creates a KMS Config.
5855#[derive(Clone, Default, PartialEq)]
5856#[non_exhaustive]
5857pub struct CreateKmsConfigRequest {
5858 /// Required. Value for parent.
5859 pub parent: std::string::String,
5860
5861 /// Required. Id of the requesting KmsConfig. Must be unique within the parent
5862 /// resource. Must contain only letters, numbers and hyphen, with the first
5863 /// character a letter, the last a letter or a
5864 /// number, and a 63 character maximum.
5865 pub kms_config_id: std::string::String,
5866
5867 /// Required. The required parameters to create a new KmsConfig.
5868 pub kms_config: std::option::Option<crate::model::KmsConfig>,
5869
5870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5871}
5872
5873impl CreateKmsConfigRequest {
5874 pub fn new() -> Self {
5875 std::default::Default::default()
5876 }
5877
5878 /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
5879 ///
5880 /// # Example
5881 /// ```ignore,no_run
5882 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5883 /// let x = CreateKmsConfigRequest::new().set_parent("example");
5884 /// ```
5885 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5886 self.parent = v.into();
5887 self
5888 }
5889
5890 /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
5891 ///
5892 /// # Example
5893 /// ```ignore,no_run
5894 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5895 /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
5896 /// ```
5897 pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5898 self.kms_config_id = v.into();
5899 self
5900 }
5901
5902 /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5903 ///
5904 /// # Example
5905 /// ```ignore,no_run
5906 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5907 /// use google_cloud_netapp_v1::model::KmsConfig;
5908 /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
5909 /// ```
5910 pub fn set_kms_config<T>(mut self, v: T) -> Self
5911 where
5912 T: std::convert::Into<crate::model::KmsConfig>,
5913 {
5914 self.kms_config = std::option::Option::Some(v.into());
5915 self
5916 }
5917
5918 /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5919 ///
5920 /// # Example
5921 /// ```ignore,no_run
5922 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5923 /// use google_cloud_netapp_v1::model::KmsConfig;
5924 /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
5925 /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
5926 /// ```
5927 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
5928 where
5929 T: std::convert::Into<crate::model::KmsConfig>,
5930 {
5931 self.kms_config = v.map(|x| x.into());
5932 self
5933 }
5934}
5935
5936impl wkt::message::Message for CreateKmsConfigRequest {
5937 fn typename() -> &'static str {
5938 "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
5939 }
5940}
5941
5942/// UpdateKmsConfigRequest updates a KMS Config.
5943#[derive(Clone, Default, PartialEq)]
5944#[non_exhaustive]
5945pub struct UpdateKmsConfigRequest {
5946 /// Required. Field mask is used to specify the fields to be overwritten in the
5947 /// KmsConfig resource by the update.
5948 /// The fields specified in the update_mask are relative to the resource, not
5949 /// the full request. A field will be overwritten if it is in the mask. If the
5950 /// user does not provide a mask then all fields will be overwritten.
5951 pub update_mask: std::option::Option<wkt::FieldMask>,
5952
5953 /// Required. The KmsConfig being updated
5954 pub kms_config: std::option::Option<crate::model::KmsConfig>,
5955
5956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5957}
5958
5959impl UpdateKmsConfigRequest {
5960 pub fn new() -> Self {
5961 std::default::Default::default()
5962 }
5963
5964 /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5965 ///
5966 /// # Example
5967 /// ```ignore,no_run
5968 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5969 /// use wkt::FieldMask;
5970 /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5971 /// ```
5972 pub fn set_update_mask<T>(mut self, v: T) -> Self
5973 where
5974 T: std::convert::Into<wkt::FieldMask>,
5975 {
5976 self.update_mask = std::option::Option::Some(v.into());
5977 self
5978 }
5979
5980 /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5981 ///
5982 /// # Example
5983 /// ```ignore,no_run
5984 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5985 /// use wkt::FieldMask;
5986 /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5987 /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5988 /// ```
5989 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5990 where
5991 T: std::convert::Into<wkt::FieldMask>,
5992 {
5993 self.update_mask = v.map(|x| x.into());
5994 self
5995 }
5996
5997 /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
5998 ///
5999 /// # Example
6000 /// ```ignore,no_run
6001 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6002 /// use google_cloud_netapp_v1::model::KmsConfig;
6003 /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6004 /// ```
6005 pub fn set_kms_config<T>(mut self, v: T) -> Self
6006 where
6007 T: std::convert::Into<crate::model::KmsConfig>,
6008 {
6009 self.kms_config = std::option::Option::Some(v.into());
6010 self
6011 }
6012
6013 /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6018 /// use google_cloud_netapp_v1::model::KmsConfig;
6019 /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6020 /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6021 /// ```
6022 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6023 where
6024 T: std::convert::Into<crate::model::KmsConfig>,
6025 {
6026 self.kms_config = v.map(|x| x.into());
6027 self
6028 }
6029}
6030
6031impl wkt::message::Message for UpdateKmsConfigRequest {
6032 fn typename() -> &'static str {
6033 "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6034 }
6035}
6036
6037/// DeleteKmsConfigRequest deletes a KMS Config.
6038#[derive(Clone, Default, PartialEq)]
6039#[non_exhaustive]
6040pub struct DeleteKmsConfigRequest {
6041 /// Required. Name of the KmsConfig.
6042 pub name: std::string::String,
6043
6044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6045}
6046
6047impl DeleteKmsConfigRequest {
6048 pub fn new() -> Self {
6049 std::default::Default::default()
6050 }
6051
6052 /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6053 ///
6054 /// # Example
6055 /// ```ignore,no_run
6056 /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6057 /// let x = DeleteKmsConfigRequest::new().set_name("example");
6058 /// ```
6059 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6060 self.name = v.into();
6061 self
6062 }
6063}
6064
6065impl wkt::message::Message for DeleteKmsConfigRequest {
6066 fn typename() -> &'static str {
6067 "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6068 }
6069}
6070
6071/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6072#[derive(Clone, Default, PartialEq)]
6073#[non_exhaustive]
6074pub struct EncryptVolumesRequest {
6075 /// Required. Name of the KmsConfig.
6076 pub name: std::string::String,
6077
6078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6079}
6080
6081impl EncryptVolumesRequest {
6082 pub fn new() -> Self {
6083 std::default::Default::default()
6084 }
6085
6086 /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6087 ///
6088 /// # Example
6089 /// ```ignore,no_run
6090 /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6091 /// let x = EncryptVolumesRequest::new().set_name("example");
6092 /// ```
6093 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6094 self.name = v.into();
6095 self
6096 }
6097}
6098
6099impl wkt::message::Message for EncryptVolumesRequest {
6100 fn typename() -> &'static str {
6101 "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6102 }
6103}
6104
6105/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6106#[derive(Clone, Default, PartialEq)]
6107#[non_exhaustive]
6108pub struct VerifyKmsConfigRequest {
6109 /// Required. Name of the KMS Config to be verified.
6110 pub name: std::string::String,
6111
6112 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6113}
6114
6115impl VerifyKmsConfigRequest {
6116 pub fn new() -> Self {
6117 std::default::Default::default()
6118 }
6119
6120 /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6121 ///
6122 /// # Example
6123 /// ```ignore,no_run
6124 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6125 /// let x = VerifyKmsConfigRequest::new().set_name("example");
6126 /// ```
6127 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6128 self.name = v.into();
6129 self
6130 }
6131}
6132
6133impl wkt::message::Message for VerifyKmsConfigRequest {
6134 fn typename() -> &'static str {
6135 "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6136 }
6137}
6138
6139/// VerifyKmsConfigResponse contains the information if the config is correctly
6140/// and error message.
6141#[derive(Clone, Default, PartialEq)]
6142#[non_exhaustive]
6143pub struct VerifyKmsConfigResponse {
6144 /// Output only. If the customer key configured correctly to the encrypt
6145 /// volume.
6146 pub healthy: bool,
6147
6148 /// Output only. Error message if config is not healthy.
6149 pub health_error: std::string::String,
6150
6151 /// Output only. Instructions for the customers to provide the access to the
6152 /// encryption key.
6153 pub instructions: std::string::String,
6154
6155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6156}
6157
6158impl VerifyKmsConfigResponse {
6159 pub fn new() -> Self {
6160 std::default::Default::default()
6161 }
6162
6163 /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6164 ///
6165 /// # Example
6166 /// ```ignore,no_run
6167 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6168 /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6169 /// ```
6170 pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6171 self.healthy = v.into();
6172 self
6173 }
6174
6175 /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6176 ///
6177 /// # Example
6178 /// ```ignore,no_run
6179 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6180 /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6181 /// ```
6182 pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6183 self.health_error = v.into();
6184 self
6185 }
6186
6187 /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6188 ///
6189 /// # Example
6190 /// ```ignore,no_run
6191 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6192 /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6193 /// ```
6194 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6195 self.instructions = v.into();
6196 self
6197 }
6198}
6199
6200impl wkt::message::Message for VerifyKmsConfigResponse {
6201 fn typename() -> &'static str {
6202 "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6203 }
6204}
6205
6206/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6207#[derive(Clone, Default, PartialEq)]
6208#[non_exhaustive]
6209pub struct KmsConfig {
6210 /// Identifier. Name of the KmsConfig.
6211 /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6212 pub name: std::string::String,
6213
6214 /// Required. Customer-managed crypto key resource full name. Format:
6215 /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6216 pub crypto_key_name: std::string::String,
6217
6218 /// Output only. State of the KmsConfig.
6219 pub state: crate::model::kms_config::State,
6220
6221 /// Output only. State details of the KmsConfig.
6222 pub state_details: std::string::String,
6223
6224 /// Output only. Create time of the KmsConfig.
6225 pub create_time: std::option::Option<wkt::Timestamp>,
6226
6227 /// Description of the KmsConfig.
6228 pub description: std::string::String,
6229
6230 /// Labels as key value pairs
6231 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6232
6233 /// Output only. Instructions to provide the access to the customer provided
6234 /// encryption key.
6235 pub instructions: std::string::String,
6236
6237 /// Output only. The Service account which will have access to the customer
6238 /// provided encryption key.
6239 pub service_account: std::string::String,
6240
6241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6242}
6243
6244impl KmsConfig {
6245 pub fn new() -> Self {
6246 std::default::Default::default()
6247 }
6248
6249 /// Sets the value of [name][crate::model::KmsConfig::name].
6250 ///
6251 /// # Example
6252 /// ```ignore,no_run
6253 /// # use google_cloud_netapp_v1::model::KmsConfig;
6254 /// let x = KmsConfig::new().set_name("example");
6255 /// ```
6256 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6257 self.name = v.into();
6258 self
6259 }
6260
6261 /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6262 ///
6263 /// # Example
6264 /// ```ignore,no_run
6265 /// # use google_cloud_netapp_v1::model::KmsConfig;
6266 /// let x = KmsConfig::new().set_crypto_key_name("example");
6267 /// ```
6268 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6269 self.crypto_key_name = v.into();
6270 self
6271 }
6272
6273 /// Sets the value of [state][crate::model::KmsConfig::state].
6274 ///
6275 /// # Example
6276 /// ```ignore,no_run
6277 /// # use google_cloud_netapp_v1::model::KmsConfig;
6278 /// use google_cloud_netapp_v1::model::kms_config::State;
6279 /// let x0 = KmsConfig::new().set_state(State::Ready);
6280 /// let x1 = KmsConfig::new().set_state(State::Creating);
6281 /// let x2 = KmsConfig::new().set_state(State::Deleting);
6282 /// ```
6283 pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6284 mut self,
6285 v: T,
6286 ) -> Self {
6287 self.state = v.into();
6288 self
6289 }
6290
6291 /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6292 ///
6293 /// # Example
6294 /// ```ignore,no_run
6295 /// # use google_cloud_netapp_v1::model::KmsConfig;
6296 /// let x = KmsConfig::new().set_state_details("example");
6297 /// ```
6298 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6299 self.state_details = v.into();
6300 self
6301 }
6302
6303 /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6304 ///
6305 /// # Example
6306 /// ```ignore,no_run
6307 /// # use google_cloud_netapp_v1::model::KmsConfig;
6308 /// use wkt::Timestamp;
6309 /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6310 /// ```
6311 pub fn set_create_time<T>(mut self, v: T) -> Self
6312 where
6313 T: std::convert::Into<wkt::Timestamp>,
6314 {
6315 self.create_time = std::option::Option::Some(v.into());
6316 self
6317 }
6318
6319 /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6320 ///
6321 /// # Example
6322 /// ```ignore,no_run
6323 /// # use google_cloud_netapp_v1::model::KmsConfig;
6324 /// use wkt::Timestamp;
6325 /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6326 /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6327 /// ```
6328 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6329 where
6330 T: std::convert::Into<wkt::Timestamp>,
6331 {
6332 self.create_time = v.map(|x| x.into());
6333 self
6334 }
6335
6336 /// Sets the value of [description][crate::model::KmsConfig::description].
6337 ///
6338 /// # Example
6339 /// ```ignore,no_run
6340 /// # use google_cloud_netapp_v1::model::KmsConfig;
6341 /// let x = KmsConfig::new().set_description("example");
6342 /// ```
6343 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6344 self.description = v.into();
6345 self
6346 }
6347
6348 /// Sets the value of [labels][crate::model::KmsConfig::labels].
6349 ///
6350 /// # Example
6351 /// ```ignore,no_run
6352 /// # use google_cloud_netapp_v1::model::KmsConfig;
6353 /// let x = KmsConfig::new().set_labels([
6354 /// ("key0", "abc"),
6355 /// ("key1", "xyz"),
6356 /// ]);
6357 /// ```
6358 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6359 where
6360 T: std::iter::IntoIterator<Item = (K, V)>,
6361 K: std::convert::Into<std::string::String>,
6362 V: std::convert::Into<std::string::String>,
6363 {
6364 use std::iter::Iterator;
6365 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6366 self
6367 }
6368
6369 /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6370 ///
6371 /// # Example
6372 /// ```ignore,no_run
6373 /// # use google_cloud_netapp_v1::model::KmsConfig;
6374 /// let x = KmsConfig::new().set_instructions("example");
6375 /// ```
6376 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6377 self.instructions = v.into();
6378 self
6379 }
6380
6381 /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6382 ///
6383 /// # Example
6384 /// ```ignore,no_run
6385 /// # use google_cloud_netapp_v1::model::KmsConfig;
6386 /// let x = KmsConfig::new().set_service_account("example");
6387 /// ```
6388 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6389 self.service_account = v.into();
6390 self
6391 }
6392}
6393
6394impl wkt::message::Message for KmsConfig {
6395 fn typename() -> &'static str {
6396 "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6397 }
6398}
6399
6400/// Defines additional types related to [KmsConfig].
6401pub mod kms_config {
6402 #[allow(unused_imports)]
6403 use super::*;
6404
6405 /// The KmsConfig States
6406 ///
6407 /// # Working with unknown values
6408 ///
6409 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6410 /// additional enum variants at any time. Adding new variants is not considered
6411 /// a breaking change. Applications should write their code in anticipation of:
6412 ///
6413 /// - New values appearing in future releases of the client library, **and**
6414 /// - New values received dynamically, without application changes.
6415 ///
6416 /// Please consult the [Working with enums] section in the user guide for some
6417 /// guidelines.
6418 ///
6419 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6420 #[derive(Clone, Debug, PartialEq)]
6421 #[non_exhaustive]
6422 pub enum State {
6423 /// Unspecified KmsConfig State
6424 Unspecified,
6425 /// KmsConfig State is Ready
6426 Ready,
6427 /// KmsConfig State is Creating
6428 Creating,
6429 /// KmsConfig State is Deleting
6430 Deleting,
6431 /// KmsConfig State is Updating
6432 Updating,
6433 /// KmsConfig State is In Use.
6434 InUse,
6435 /// KmsConfig State is Error
6436 Error,
6437 /// KmsConfig State is Pending to verify crypto key access.
6438 KeyCheckPending,
6439 /// KmsConfig State is Not accessbile by the SDE service account to the
6440 /// crypto key.
6441 KeyNotReachable,
6442 /// KmsConfig State is Disabling.
6443 Disabling,
6444 /// KmsConfig State is Disabled.
6445 Disabled,
6446 /// KmsConfig State is Migrating.
6447 /// The existing volumes are migrating from SMEK to CMEK.
6448 Migrating,
6449 /// If set, the enum was initialized with an unknown value.
6450 ///
6451 /// Applications can examine the value using [State::value] or
6452 /// [State::name].
6453 UnknownValue(state::UnknownValue),
6454 }
6455
6456 #[doc(hidden)]
6457 pub mod state {
6458 #[allow(unused_imports)]
6459 use super::*;
6460 #[derive(Clone, Debug, PartialEq)]
6461 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6462 }
6463
6464 impl State {
6465 /// Gets the enum value.
6466 ///
6467 /// Returns `None` if the enum contains an unknown value deserialized from
6468 /// the string representation of enums.
6469 pub fn value(&self) -> std::option::Option<i32> {
6470 match self {
6471 Self::Unspecified => std::option::Option::Some(0),
6472 Self::Ready => std::option::Option::Some(1),
6473 Self::Creating => std::option::Option::Some(2),
6474 Self::Deleting => std::option::Option::Some(3),
6475 Self::Updating => std::option::Option::Some(4),
6476 Self::InUse => std::option::Option::Some(5),
6477 Self::Error => std::option::Option::Some(6),
6478 Self::KeyCheckPending => std::option::Option::Some(7),
6479 Self::KeyNotReachable => std::option::Option::Some(8),
6480 Self::Disabling => std::option::Option::Some(9),
6481 Self::Disabled => std::option::Option::Some(10),
6482 Self::Migrating => std::option::Option::Some(11),
6483 Self::UnknownValue(u) => u.0.value(),
6484 }
6485 }
6486
6487 /// Gets the enum value as a string.
6488 ///
6489 /// Returns `None` if the enum contains an unknown value deserialized from
6490 /// the integer representation of enums.
6491 pub fn name(&self) -> std::option::Option<&str> {
6492 match self {
6493 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6494 Self::Ready => std::option::Option::Some("READY"),
6495 Self::Creating => std::option::Option::Some("CREATING"),
6496 Self::Deleting => std::option::Option::Some("DELETING"),
6497 Self::Updating => std::option::Option::Some("UPDATING"),
6498 Self::InUse => std::option::Option::Some("IN_USE"),
6499 Self::Error => std::option::Option::Some("ERROR"),
6500 Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6501 Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6502 Self::Disabling => std::option::Option::Some("DISABLING"),
6503 Self::Disabled => std::option::Option::Some("DISABLED"),
6504 Self::Migrating => std::option::Option::Some("MIGRATING"),
6505 Self::UnknownValue(u) => u.0.name(),
6506 }
6507 }
6508 }
6509
6510 impl std::default::Default for State {
6511 fn default() -> Self {
6512 use std::convert::From;
6513 Self::from(0)
6514 }
6515 }
6516
6517 impl std::fmt::Display for State {
6518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6519 wkt::internal::display_enum(f, self.name(), self.value())
6520 }
6521 }
6522
6523 impl std::convert::From<i32> for State {
6524 fn from(value: i32) -> Self {
6525 match value {
6526 0 => Self::Unspecified,
6527 1 => Self::Ready,
6528 2 => Self::Creating,
6529 3 => Self::Deleting,
6530 4 => Self::Updating,
6531 5 => Self::InUse,
6532 6 => Self::Error,
6533 7 => Self::KeyCheckPending,
6534 8 => Self::KeyNotReachable,
6535 9 => Self::Disabling,
6536 10 => Self::Disabled,
6537 11 => Self::Migrating,
6538 _ => Self::UnknownValue(state::UnknownValue(
6539 wkt::internal::UnknownEnumValue::Integer(value),
6540 )),
6541 }
6542 }
6543 }
6544
6545 impl std::convert::From<&str> for State {
6546 fn from(value: &str) -> Self {
6547 use std::string::ToString;
6548 match value {
6549 "STATE_UNSPECIFIED" => Self::Unspecified,
6550 "READY" => Self::Ready,
6551 "CREATING" => Self::Creating,
6552 "DELETING" => Self::Deleting,
6553 "UPDATING" => Self::Updating,
6554 "IN_USE" => Self::InUse,
6555 "ERROR" => Self::Error,
6556 "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6557 "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6558 "DISABLING" => Self::Disabling,
6559 "DISABLED" => Self::Disabled,
6560 "MIGRATING" => Self::Migrating,
6561 _ => Self::UnknownValue(state::UnknownValue(
6562 wkt::internal::UnknownEnumValue::String(value.to_string()),
6563 )),
6564 }
6565 }
6566 }
6567
6568 impl serde::ser::Serialize for State {
6569 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6570 where
6571 S: serde::Serializer,
6572 {
6573 match self {
6574 Self::Unspecified => serializer.serialize_i32(0),
6575 Self::Ready => serializer.serialize_i32(1),
6576 Self::Creating => serializer.serialize_i32(2),
6577 Self::Deleting => serializer.serialize_i32(3),
6578 Self::Updating => serializer.serialize_i32(4),
6579 Self::InUse => serializer.serialize_i32(5),
6580 Self::Error => serializer.serialize_i32(6),
6581 Self::KeyCheckPending => serializer.serialize_i32(7),
6582 Self::KeyNotReachable => serializer.serialize_i32(8),
6583 Self::Disabling => serializer.serialize_i32(9),
6584 Self::Disabled => serializer.serialize_i32(10),
6585 Self::Migrating => serializer.serialize_i32(11),
6586 Self::UnknownValue(u) => u.0.serialize(serializer),
6587 }
6588 }
6589 }
6590
6591 impl<'de> serde::de::Deserialize<'de> for State {
6592 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6593 where
6594 D: serde::Deserializer<'de>,
6595 {
6596 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6597 ".google.cloud.netapp.v1.KmsConfig.State",
6598 ))
6599 }
6600 }
6601}
6602
6603/// Request message for `ExecuteOntapPost` API.
6604#[derive(Clone, Default, PartialEq)]
6605#[non_exhaustive]
6606pub struct ExecuteOntapPostRequest {
6607 /// Required. The raw `JSON` body of the request.
6608 /// The body should be in the format of the ONTAP resource.
6609 /// For example:
6610 ///
6611 /// ```norust
6612 /// {
6613 /// "body": {
6614 /// "field1": "value1",
6615 /// "field2": "value2",
6616 /// }
6617 /// }
6618 /// ```
6619 pub body: std::option::Option<wkt::Struct>,
6620
6621 /// Required. The resource path of the ONTAP resource.
6622 /// Format:
6623 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6624 /// For example:
6625 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6626 pub ontap_path: std::string::String,
6627
6628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6629}
6630
6631impl ExecuteOntapPostRequest {
6632 pub fn new() -> Self {
6633 std::default::Default::default()
6634 }
6635
6636 /// Sets the value of [body][crate::model::ExecuteOntapPostRequest::body].
6637 ///
6638 /// # Example
6639 /// ```ignore,no_run
6640 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6641 /// use wkt::Struct;
6642 /// let x = ExecuteOntapPostRequest::new().set_body(Struct::default()/* use setters */);
6643 /// ```
6644 pub fn set_body<T>(mut self, v: T) -> Self
6645 where
6646 T: std::convert::Into<wkt::Struct>,
6647 {
6648 self.body = std::option::Option::Some(v.into());
6649 self
6650 }
6651
6652 /// Sets or clears the value of [body][crate::model::ExecuteOntapPostRequest::body].
6653 ///
6654 /// # Example
6655 /// ```ignore,no_run
6656 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6657 /// use wkt::Struct;
6658 /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6659 /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(None::<Struct>);
6660 /// ```
6661 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6662 where
6663 T: std::convert::Into<wkt::Struct>,
6664 {
6665 self.body = v.map(|x| x.into());
6666 self
6667 }
6668
6669 /// Sets the value of [ontap_path][crate::model::ExecuteOntapPostRequest::ontap_path].
6670 ///
6671 /// # Example
6672 /// ```ignore,no_run
6673 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6674 /// let x = ExecuteOntapPostRequest::new().set_ontap_path("example");
6675 /// ```
6676 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6677 self.ontap_path = v.into();
6678 self
6679 }
6680}
6681
6682impl wkt::message::Message for ExecuteOntapPostRequest {
6683 fn typename() -> &'static str {
6684 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostRequest"
6685 }
6686}
6687
6688/// Response message for `ExecuteOntapPost` API.
6689#[derive(Clone, Default, PartialEq)]
6690#[non_exhaustive]
6691pub struct ExecuteOntapPostResponse {
6692 /// The raw `JSON` body of the response.
6693 pub body: std::option::Option<wkt::Struct>,
6694
6695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6696}
6697
6698impl ExecuteOntapPostResponse {
6699 pub fn new() -> Self {
6700 std::default::Default::default()
6701 }
6702
6703 /// Sets the value of [body][crate::model::ExecuteOntapPostResponse::body].
6704 ///
6705 /// # Example
6706 /// ```ignore,no_run
6707 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6708 /// use wkt::Struct;
6709 /// let x = ExecuteOntapPostResponse::new().set_body(Struct::default()/* use setters */);
6710 /// ```
6711 pub fn set_body<T>(mut self, v: T) -> Self
6712 where
6713 T: std::convert::Into<wkt::Struct>,
6714 {
6715 self.body = std::option::Option::Some(v.into());
6716 self
6717 }
6718
6719 /// Sets or clears the value of [body][crate::model::ExecuteOntapPostResponse::body].
6720 ///
6721 /// # Example
6722 /// ```ignore,no_run
6723 /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6724 /// use wkt::Struct;
6725 /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6726 /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(None::<Struct>);
6727 /// ```
6728 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6729 where
6730 T: std::convert::Into<wkt::Struct>,
6731 {
6732 self.body = v.map(|x| x.into());
6733 self
6734 }
6735}
6736
6737impl wkt::message::Message for ExecuteOntapPostResponse {
6738 fn typename() -> &'static str {
6739 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostResponse"
6740 }
6741}
6742
6743/// Request message for `ExecuteOntapGet` API.
6744#[derive(Clone, Default, PartialEq)]
6745#[non_exhaustive]
6746pub struct ExecuteOntapGetRequest {
6747 /// Required. The resource path of the ONTAP resource.
6748 /// Format:
6749 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6750 /// For example:
6751 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6752 pub ontap_path: std::string::String,
6753
6754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6755}
6756
6757impl ExecuteOntapGetRequest {
6758 pub fn new() -> Self {
6759 std::default::Default::default()
6760 }
6761
6762 /// Sets the value of [ontap_path][crate::model::ExecuteOntapGetRequest::ontap_path].
6763 ///
6764 /// # Example
6765 /// ```ignore,no_run
6766 /// # use google_cloud_netapp_v1::model::ExecuteOntapGetRequest;
6767 /// let x = ExecuteOntapGetRequest::new().set_ontap_path("example");
6768 /// ```
6769 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6770 self.ontap_path = v.into();
6771 self
6772 }
6773}
6774
6775impl wkt::message::Message for ExecuteOntapGetRequest {
6776 fn typename() -> &'static str {
6777 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetRequest"
6778 }
6779}
6780
6781/// Response message for `ExecuteOntapGet` API.
6782#[derive(Clone, Default, PartialEq)]
6783#[non_exhaustive]
6784pub struct ExecuteOntapGetResponse {
6785 /// The raw `JSON` body of the response.
6786 pub body: std::option::Option<wkt::Struct>,
6787
6788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6789}
6790
6791impl ExecuteOntapGetResponse {
6792 pub fn new() -> Self {
6793 std::default::Default::default()
6794 }
6795
6796 /// Sets the value of [body][crate::model::ExecuteOntapGetResponse::body].
6797 ///
6798 /// # Example
6799 /// ```ignore,no_run
6800 /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6801 /// use wkt::Struct;
6802 /// let x = ExecuteOntapGetResponse::new().set_body(Struct::default()/* use setters */);
6803 /// ```
6804 pub fn set_body<T>(mut self, v: T) -> Self
6805 where
6806 T: std::convert::Into<wkt::Struct>,
6807 {
6808 self.body = std::option::Option::Some(v.into());
6809 self
6810 }
6811
6812 /// Sets or clears the value of [body][crate::model::ExecuteOntapGetResponse::body].
6813 ///
6814 /// # Example
6815 /// ```ignore,no_run
6816 /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6817 /// use wkt::Struct;
6818 /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6819 /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(None::<Struct>);
6820 /// ```
6821 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6822 where
6823 T: std::convert::Into<wkt::Struct>,
6824 {
6825 self.body = v.map(|x| x.into());
6826 self
6827 }
6828}
6829
6830impl wkt::message::Message for ExecuteOntapGetResponse {
6831 fn typename() -> &'static str {
6832 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetResponse"
6833 }
6834}
6835
6836/// Request message for `ExecuteOntapDelete` API.
6837#[derive(Clone, Default, PartialEq)]
6838#[non_exhaustive]
6839pub struct ExecuteOntapDeleteRequest {
6840 /// Required. The resource path of the ONTAP resource.
6841 /// Format:
6842 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6843 /// For example:
6844 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6845 pub ontap_path: std::string::String,
6846
6847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6848}
6849
6850impl ExecuteOntapDeleteRequest {
6851 pub fn new() -> Self {
6852 std::default::Default::default()
6853 }
6854
6855 /// Sets the value of [ontap_path][crate::model::ExecuteOntapDeleteRequest::ontap_path].
6856 ///
6857 /// # Example
6858 /// ```ignore,no_run
6859 /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteRequest;
6860 /// let x = ExecuteOntapDeleteRequest::new().set_ontap_path("example");
6861 /// ```
6862 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6863 self.ontap_path = v.into();
6864 self
6865 }
6866}
6867
6868impl wkt::message::Message for ExecuteOntapDeleteRequest {
6869 fn typename() -> &'static str {
6870 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteRequest"
6871 }
6872}
6873
6874/// Response message for `ExecuteOntapDelete` API.
6875#[derive(Clone, Default, PartialEq)]
6876#[non_exhaustive]
6877pub struct ExecuteOntapDeleteResponse {
6878 /// The raw `JSON` body of the response.
6879 pub body: std::option::Option<wkt::Struct>,
6880
6881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6882}
6883
6884impl ExecuteOntapDeleteResponse {
6885 pub fn new() -> Self {
6886 std::default::Default::default()
6887 }
6888
6889 /// Sets the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
6890 ///
6891 /// # Example
6892 /// ```ignore,no_run
6893 /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
6894 /// use wkt::Struct;
6895 /// let x = ExecuteOntapDeleteResponse::new().set_body(Struct::default()/* use setters */);
6896 /// ```
6897 pub fn set_body<T>(mut self, v: T) -> Self
6898 where
6899 T: std::convert::Into<wkt::Struct>,
6900 {
6901 self.body = std::option::Option::Some(v.into());
6902 self
6903 }
6904
6905 /// Sets or clears the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
6906 ///
6907 /// # Example
6908 /// ```ignore,no_run
6909 /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
6910 /// use wkt::Struct;
6911 /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6912 /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(None::<Struct>);
6913 /// ```
6914 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6915 where
6916 T: std::convert::Into<wkt::Struct>,
6917 {
6918 self.body = v.map(|x| x.into());
6919 self
6920 }
6921}
6922
6923impl wkt::message::Message for ExecuteOntapDeleteResponse {
6924 fn typename() -> &'static str {
6925 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteResponse"
6926 }
6927}
6928
6929/// Request message for `ExecuteOntapPatch` API.
6930#[derive(Clone, Default, PartialEq)]
6931#[non_exhaustive]
6932pub struct ExecuteOntapPatchRequest {
6933 /// Required. The raw `JSON` body of the request.
6934 /// The body should be in the format of the ONTAP resource.
6935 /// For example:
6936 ///
6937 /// ```norust
6938 /// {
6939 /// "body": {
6940 /// "field1": "value1",
6941 /// "field2": "value2",
6942 /// }
6943 /// }
6944 /// ```
6945 pub body: std::option::Option<wkt::Struct>,
6946
6947 /// Required. The resource path of the ONTAP resource.
6948 /// Format:
6949 /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6950 /// For example:
6951 /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6952 pub ontap_path: std::string::String,
6953
6954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6955}
6956
6957impl ExecuteOntapPatchRequest {
6958 pub fn new() -> Self {
6959 std::default::Default::default()
6960 }
6961
6962 /// Sets the value of [body][crate::model::ExecuteOntapPatchRequest::body].
6963 ///
6964 /// # Example
6965 /// ```ignore,no_run
6966 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
6967 /// use wkt::Struct;
6968 /// let x = ExecuteOntapPatchRequest::new().set_body(Struct::default()/* use setters */);
6969 /// ```
6970 pub fn set_body<T>(mut self, v: T) -> Self
6971 where
6972 T: std::convert::Into<wkt::Struct>,
6973 {
6974 self.body = std::option::Option::Some(v.into());
6975 self
6976 }
6977
6978 /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchRequest::body].
6979 ///
6980 /// # Example
6981 /// ```ignore,no_run
6982 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
6983 /// use wkt::Struct;
6984 /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6985 /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(None::<Struct>);
6986 /// ```
6987 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6988 where
6989 T: std::convert::Into<wkt::Struct>,
6990 {
6991 self.body = v.map(|x| x.into());
6992 self
6993 }
6994
6995 /// Sets the value of [ontap_path][crate::model::ExecuteOntapPatchRequest::ontap_path].
6996 ///
6997 /// # Example
6998 /// ```ignore,no_run
6999 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7000 /// let x = ExecuteOntapPatchRequest::new().set_ontap_path("example");
7001 /// ```
7002 pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7003 self.ontap_path = v.into();
7004 self
7005 }
7006}
7007
7008impl wkt::message::Message for ExecuteOntapPatchRequest {
7009 fn typename() -> &'static str {
7010 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchRequest"
7011 }
7012}
7013
7014/// Response message for `ExecuteOntapPatch` API.
7015#[derive(Clone, Default, PartialEq)]
7016#[non_exhaustive]
7017pub struct ExecuteOntapPatchResponse {
7018 /// The raw `JSON` body of the response.
7019 pub body: std::option::Option<wkt::Struct>,
7020
7021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7022}
7023
7024impl ExecuteOntapPatchResponse {
7025 pub fn new() -> Self {
7026 std::default::Default::default()
7027 }
7028
7029 /// Sets the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7030 ///
7031 /// # Example
7032 /// ```ignore,no_run
7033 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7034 /// use wkt::Struct;
7035 /// let x = ExecuteOntapPatchResponse::new().set_body(Struct::default()/* use setters */);
7036 /// ```
7037 pub fn set_body<T>(mut self, v: T) -> Self
7038 where
7039 T: std::convert::Into<wkt::Struct>,
7040 {
7041 self.body = std::option::Option::Some(v.into());
7042 self
7043 }
7044
7045 /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7046 ///
7047 /// # Example
7048 /// ```ignore,no_run
7049 /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7050 /// use wkt::Struct;
7051 /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7052 /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(None::<Struct>);
7053 /// ```
7054 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7055 where
7056 T: std::convert::Into<wkt::Struct>,
7057 {
7058 self.body = v.map(|x| x.into());
7059 self
7060 }
7061}
7062
7063impl wkt::message::Message for ExecuteOntapPatchResponse {
7064 fn typename() -> &'static str {
7065 "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchResponse"
7066 }
7067}
7068
7069/// ListQuotaRulesRequest for listing quota rules.
7070#[derive(Clone, Default, PartialEq)]
7071#[non_exhaustive]
7072pub struct ListQuotaRulesRequest {
7073 /// Required. Parent value for ListQuotaRulesRequest
7074 pub parent: std::string::String,
7075
7076 /// Optional. Requested page size. Server may return fewer items than
7077 /// requested. If unspecified, the server will pick an appropriate default.
7078 pub page_size: i32,
7079
7080 /// Optional. A token identifying a page of results the server should return.
7081 pub page_token: std::string::String,
7082
7083 /// Optional. Filtering results
7084 pub filter: std::string::String,
7085
7086 /// Optional. Hint for how to order the results
7087 pub order_by: std::string::String,
7088
7089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7090}
7091
7092impl ListQuotaRulesRequest {
7093 pub fn new() -> Self {
7094 std::default::Default::default()
7095 }
7096
7097 /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
7098 ///
7099 /// # Example
7100 /// ```ignore,no_run
7101 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7102 /// let x = ListQuotaRulesRequest::new().set_parent("example");
7103 /// ```
7104 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7105 self.parent = v.into();
7106 self
7107 }
7108
7109 /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
7110 ///
7111 /// # Example
7112 /// ```ignore,no_run
7113 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7114 /// let x = ListQuotaRulesRequest::new().set_page_size(42);
7115 /// ```
7116 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7117 self.page_size = v.into();
7118 self
7119 }
7120
7121 /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
7122 ///
7123 /// # Example
7124 /// ```ignore,no_run
7125 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7126 /// let x = ListQuotaRulesRequest::new().set_page_token("example");
7127 /// ```
7128 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7129 self.page_token = v.into();
7130 self
7131 }
7132
7133 /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
7134 ///
7135 /// # Example
7136 /// ```ignore,no_run
7137 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7138 /// let x = ListQuotaRulesRequest::new().set_filter("example");
7139 /// ```
7140 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7141 self.filter = v.into();
7142 self
7143 }
7144
7145 /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
7146 ///
7147 /// # Example
7148 /// ```ignore,no_run
7149 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7150 /// let x = ListQuotaRulesRequest::new().set_order_by("example");
7151 /// ```
7152 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7153 self.order_by = v.into();
7154 self
7155 }
7156}
7157
7158impl wkt::message::Message for ListQuotaRulesRequest {
7159 fn typename() -> &'static str {
7160 "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
7161 }
7162}
7163
7164/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
7165#[derive(Clone, Default, PartialEq)]
7166#[non_exhaustive]
7167pub struct ListQuotaRulesResponse {
7168 /// List of quota rules
7169 pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
7170
7171 /// A token identifying a page of results the server should return.
7172 pub next_page_token: std::string::String,
7173
7174 /// Locations that could not be reached.
7175 pub unreachable: std::vec::Vec<std::string::String>,
7176
7177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7178}
7179
7180impl ListQuotaRulesResponse {
7181 pub fn new() -> Self {
7182 std::default::Default::default()
7183 }
7184
7185 /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7190 /// use google_cloud_netapp_v1::model::QuotaRule;
7191 /// let x = ListQuotaRulesResponse::new()
7192 /// .set_quota_rules([
7193 /// QuotaRule::default()/* use setters */,
7194 /// QuotaRule::default()/* use (different) setters */,
7195 /// ]);
7196 /// ```
7197 pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
7198 where
7199 T: std::iter::IntoIterator<Item = V>,
7200 V: std::convert::Into<crate::model::QuotaRule>,
7201 {
7202 use std::iter::Iterator;
7203 self.quota_rules = v.into_iter().map(|i| i.into()).collect();
7204 self
7205 }
7206
7207 /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
7208 ///
7209 /// # Example
7210 /// ```ignore,no_run
7211 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7212 /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
7213 /// ```
7214 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7215 self.next_page_token = v.into();
7216 self
7217 }
7218
7219 /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
7220 ///
7221 /// # Example
7222 /// ```ignore,no_run
7223 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7224 /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
7225 /// ```
7226 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7227 where
7228 T: std::iter::IntoIterator<Item = V>,
7229 V: std::convert::Into<std::string::String>,
7230 {
7231 use std::iter::Iterator;
7232 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7233 self
7234 }
7235}
7236
7237impl wkt::message::Message for ListQuotaRulesResponse {
7238 fn typename() -> &'static str {
7239 "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
7240 }
7241}
7242
7243#[doc(hidden)]
7244impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
7245 type PageItem = crate::model::QuotaRule;
7246
7247 fn items(self) -> std::vec::Vec<Self::PageItem> {
7248 self.quota_rules
7249 }
7250
7251 fn next_page_token(&self) -> std::string::String {
7252 use std::clone::Clone;
7253 self.next_page_token.clone()
7254 }
7255}
7256
7257/// GetQuotaRuleRequest for getting a quota rule.
7258#[derive(Clone, Default, PartialEq)]
7259#[non_exhaustive]
7260pub struct GetQuotaRuleRequest {
7261 /// Required. Name of the quota rule
7262 pub name: std::string::String,
7263
7264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7265}
7266
7267impl GetQuotaRuleRequest {
7268 pub fn new() -> Self {
7269 std::default::Default::default()
7270 }
7271
7272 /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
7273 ///
7274 /// # Example
7275 /// ```ignore,no_run
7276 /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
7277 /// let x = GetQuotaRuleRequest::new().set_name("example");
7278 /// ```
7279 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7280 self.name = v.into();
7281 self
7282 }
7283}
7284
7285impl wkt::message::Message for GetQuotaRuleRequest {
7286 fn typename() -> &'static str {
7287 "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
7288 }
7289}
7290
7291/// CreateQuotaRuleRequest for creating a quota rule.
7292#[derive(Clone, Default, PartialEq)]
7293#[non_exhaustive]
7294pub struct CreateQuotaRuleRequest {
7295 /// Required. Parent value for CreateQuotaRuleRequest
7296 pub parent: std::string::String,
7297
7298 /// Required. Fields of the to be created quota rule.
7299 pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7300
7301 /// Required. ID of the quota rule to create. Must be unique within the parent
7302 /// resource. Must contain only letters, numbers, underscore and hyphen, with
7303 /// the first character a letter or underscore, the last a letter or underscore
7304 /// or a number, and a 63 character maximum.
7305 pub quota_rule_id: std::string::String,
7306
7307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7308}
7309
7310impl CreateQuotaRuleRequest {
7311 pub fn new() -> Self {
7312 std::default::Default::default()
7313 }
7314
7315 /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
7316 ///
7317 /// # Example
7318 /// ```ignore,no_run
7319 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7320 /// let x = CreateQuotaRuleRequest::new().set_parent("example");
7321 /// ```
7322 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7323 self.parent = v.into();
7324 self
7325 }
7326
7327 /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7328 ///
7329 /// # Example
7330 /// ```ignore,no_run
7331 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7332 /// use google_cloud_netapp_v1::model::QuotaRule;
7333 /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7334 /// ```
7335 pub fn set_quota_rule<T>(mut self, v: T) -> Self
7336 where
7337 T: std::convert::Into<crate::model::QuotaRule>,
7338 {
7339 self.quota_rule = std::option::Option::Some(v.into());
7340 self
7341 }
7342
7343 /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7344 ///
7345 /// # Example
7346 /// ```ignore,no_run
7347 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7348 /// use google_cloud_netapp_v1::model::QuotaRule;
7349 /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7350 /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7351 /// ```
7352 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7353 where
7354 T: std::convert::Into<crate::model::QuotaRule>,
7355 {
7356 self.quota_rule = v.map(|x| x.into());
7357 self
7358 }
7359
7360 /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
7361 ///
7362 /// # Example
7363 /// ```ignore,no_run
7364 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7365 /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
7366 /// ```
7367 pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7368 self.quota_rule_id = v.into();
7369 self
7370 }
7371}
7372
7373impl wkt::message::Message for CreateQuotaRuleRequest {
7374 fn typename() -> &'static str {
7375 "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
7376 }
7377}
7378
7379/// UpdateQuotaRuleRequest for updating a quota rule.
7380#[derive(Clone, Default, PartialEq)]
7381#[non_exhaustive]
7382pub struct UpdateQuotaRuleRequest {
7383 /// Optional. Field mask is used to specify the fields to be overwritten in the
7384 /// Quota Rule resource by the update.
7385 /// The fields specified in the update_mask are relative to the resource, not
7386 /// the full request. A field will be overwritten if it is in the mask. If the
7387 /// user does not provide a mask then all fields will be overwritten.
7388 pub update_mask: std::option::Option<wkt::FieldMask>,
7389
7390 /// Required. The quota rule being updated
7391 pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7392
7393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7394}
7395
7396impl UpdateQuotaRuleRequest {
7397 pub fn new() -> Self {
7398 std::default::Default::default()
7399 }
7400
7401 /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7402 ///
7403 /// # Example
7404 /// ```ignore,no_run
7405 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7406 /// use wkt::FieldMask;
7407 /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7408 /// ```
7409 pub fn set_update_mask<T>(mut self, v: T) -> Self
7410 where
7411 T: std::convert::Into<wkt::FieldMask>,
7412 {
7413 self.update_mask = std::option::Option::Some(v.into());
7414 self
7415 }
7416
7417 /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7418 ///
7419 /// # Example
7420 /// ```ignore,no_run
7421 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7422 /// use wkt::FieldMask;
7423 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7424 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7425 /// ```
7426 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7427 where
7428 T: std::convert::Into<wkt::FieldMask>,
7429 {
7430 self.update_mask = v.map(|x| x.into());
7431 self
7432 }
7433
7434 /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7435 ///
7436 /// # Example
7437 /// ```ignore,no_run
7438 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7439 /// use google_cloud_netapp_v1::model::QuotaRule;
7440 /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7441 /// ```
7442 pub fn set_quota_rule<T>(mut self, v: T) -> Self
7443 where
7444 T: std::convert::Into<crate::model::QuotaRule>,
7445 {
7446 self.quota_rule = std::option::Option::Some(v.into());
7447 self
7448 }
7449
7450 /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7451 ///
7452 /// # Example
7453 /// ```ignore,no_run
7454 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7455 /// use google_cloud_netapp_v1::model::QuotaRule;
7456 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7457 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7458 /// ```
7459 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7460 where
7461 T: std::convert::Into<crate::model::QuotaRule>,
7462 {
7463 self.quota_rule = v.map(|x| x.into());
7464 self
7465 }
7466}
7467
7468impl wkt::message::Message for UpdateQuotaRuleRequest {
7469 fn typename() -> &'static str {
7470 "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7471 }
7472}
7473
7474/// DeleteQuotaRuleRequest for deleting a single quota rule.
7475#[derive(Clone, Default, PartialEq)]
7476#[non_exhaustive]
7477pub struct DeleteQuotaRuleRequest {
7478 /// Required. Name of the quota rule.
7479 pub name: std::string::String,
7480
7481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7482}
7483
7484impl DeleteQuotaRuleRequest {
7485 pub fn new() -> Self {
7486 std::default::Default::default()
7487 }
7488
7489 /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7490 ///
7491 /// # Example
7492 /// ```ignore,no_run
7493 /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7494 /// let x = DeleteQuotaRuleRequest::new().set_name("example");
7495 /// ```
7496 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7497 self.name = v.into();
7498 self
7499 }
7500}
7501
7502impl wkt::message::Message for DeleteQuotaRuleRequest {
7503 fn typename() -> &'static str {
7504 "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7505 }
7506}
7507
7508/// QuotaRule specifies the maximum disk space a user or group can use within a
7509/// volume. They can be used for creating default and individual quota rules.
7510#[derive(Clone, Default, PartialEq)]
7511#[non_exhaustive]
7512pub struct QuotaRule {
7513 /// Identifier. The resource name of the quota rule.
7514 /// Format:
7515 /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7516 pub name: std::string::String,
7517
7518 /// Optional. The quota rule applies to the specified user or group, identified
7519 /// by a Unix UID/GID, Windows SID, or null for default.
7520 pub target: std::string::String,
7521
7522 /// Required. The type of quota rule.
7523 pub r#type: crate::model::quota_rule::Type,
7524
7525 /// Required. The maximum allowed disk space in MiB.
7526 pub disk_limit_mib: i32,
7527
7528 /// Output only. State of the quota rule
7529 pub state: crate::model::quota_rule::State,
7530
7531 /// Output only. State details of the quota rule
7532 pub state_details: std::string::String,
7533
7534 /// Output only. Create time of the quota rule
7535 pub create_time: std::option::Option<wkt::Timestamp>,
7536
7537 /// Optional. Description of the quota rule
7538 pub description: std::string::String,
7539
7540 /// Optional. Labels of the quota rule
7541 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7542
7543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7544}
7545
7546impl QuotaRule {
7547 pub fn new() -> Self {
7548 std::default::Default::default()
7549 }
7550
7551 /// Sets the value of [name][crate::model::QuotaRule::name].
7552 ///
7553 /// # Example
7554 /// ```ignore,no_run
7555 /// # use google_cloud_netapp_v1::model::QuotaRule;
7556 /// let x = QuotaRule::new().set_name("example");
7557 /// ```
7558 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7559 self.name = v.into();
7560 self
7561 }
7562
7563 /// Sets the value of [target][crate::model::QuotaRule::target].
7564 ///
7565 /// # Example
7566 /// ```ignore,no_run
7567 /// # use google_cloud_netapp_v1::model::QuotaRule;
7568 /// let x = QuotaRule::new().set_target("example");
7569 /// ```
7570 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7571 self.target = v.into();
7572 self
7573 }
7574
7575 /// Sets the value of [r#type][crate::model::QuotaRule::type].
7576 ///
7577 /// # Example
7578 /// ```ignore,no_run
7579 /// # use google_cloud_netapp_v1::model::QuotaRule;
7580 /// use google_cloud_netapp_v1::model::quota_rule::Type;
7581 /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7582 /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7583 /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7584 /// ```
7585 pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7586 self.r#type = v.into();
7587 self
7588 }
7589
7590 /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7591 ///
7592 /// # Example
7593 /// ```ignore,no_run
7594 /// # use google_cloud_netapp_v1::model::QuotaRule;
7595 /// let x = QuotaRule::new().set_disk_limit_mib(42);
7596 /// ```
7597 pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7598 self.disk_limit_mib = v.into();
7599 self
7600 }
7601
7602 /// Sets the value of [state][crate::model::QuotaRule::state].
7603 ///
7604 /// # Example
7605 /// ```ignore,no_run
7606 /// # use google_cloud_netapp_v1::model::QuotaRule;
7607 /// use google_cloud_netapp_v1::model::quota_rule::State;
7608 /// let x0 = QuotaRule::new().set_state(State::Creating);
7609 /// let x1 = QuotaRule::new().set_state(State::Updating);
7610 /// let x2 = QuotaRule::new().set_state(State::Deleting);
7611 /// ```
7612 pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7613 mut self,
7614 v: T,
7615 ) -> Self {
7616 self.state = v.into();
7617 self
7618 }
7619
7620 /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7621 ///
7622 /// # Example
7623 /// ```ignore,no_run
7624 /// # use google_cloud_netapp_v1::model::QuotaRule;
7625 /// let x = QuotaRule::new().set_state_details("example");
7626 /// ```
7627 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7628 self.state_details = v.into();
7629 self
7630 }
7631
7632 /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7633 ///
7634 /// # Example
7635 /// ```ignore,no_run
7636 /// # use google_cloud_netapp_v1::model::QuotaRule;
7637 /// use wkt::Timestamp;
7638 /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7639 /// ```
7640 pub fn set_create_time<T>(mut self, v: T) -> Self
7641 where
7642 T: std::convert::Into<wkt::Timestamp>,
7643 {
7644 self.create_time = std::option::Option::Some(v.into());
7645 self
7646 }
7647
7648 /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7649 ///
7650 /// # Example
7651 /// ```ignore,no_run
7652 /// # use google_cloud_netapp_v1::model::QuotaRule;
7653 /// use wkt::Timestamp;
7654 /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7655 /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7656 /// ```
7657 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7658 where
7659 T: std::convert::Into<wkt::Timestamp>,
7660 {
7661 self.create_time = v.map(|x| x.into());
7662 self
7663 }
7664
7665 /// Sets the value of [description][crate::model::QuotaRule::description].
7666 ///
7667 /// # Example
7668 /// ```ignore,no_run
7669 /// # use google_cloud_netapp_v1::model::QuotaRule;
7670 /// let x = QuotaRule::new().set_description("example");
7671 /// ```
7672 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7673 self.description = v.into();
7674 self
7675 }
7676
7677 /// Sets the value of [labels][crate::model::QuotaRule::labels].
7678 ///
7679 /// # Example
7680 /// ```ignore,no_run
7681 /// # use google_cloud_netapp_v1::model::QuotaRule;
7682 /// let x = QuotaRule::new().set_labels([
7683 /// ("key0", "abc"),
7684 /// ("key1", "xyz"),
7685 /// ]);
7686 /// ```
7687 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7688 where
7689 T: std::iter::IntoIterator<Item = (K, V)>,
7690 K: std::convert::Into<std::string::String>,
7691 V: std::convert::Into<std::string::String>,
7692 {
7693 use std::iter::Iterator;
7694 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7695 self
7696 }
7697}
7698
7699impl wkt::message::Message for QuotaRule {
7700 fn typename() -> &'static str {
7701 "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7702 }
7703}
7704
7705/// Defines additional types related to [QuotaRule].
7706pub mod quota_rule {
7707 #[allow(unused_imports)]
7708 use super::*;
7709
7710 /// Types of Quota Rule
7711 ///
7712 /// # Working with unknown values
7713 ///
7714 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7715 /// additional enum variants at any time. Adding new variants is not considered
7716 /// a breaking change. Applications should write their code in anticipation of:
7717 ///
7718 /// - New values appearing in future releases of the client library, **and**
7719 /// - New values received dynamically, without application changes.
7720 ///
7721 /// Please consult the [Working with enums] section in the user guide for some
7722 /// guidelines.
7723 ///
7724 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7725 #[derive(Clone, Debug, PartialEq)]
7726 #[non_exhaustive]
7727 pub enum Type {
7728 /// Unspecified type for quota rule
7729 Unspecified,
7730 /// Individual user quota rule
7731 IndividualUserQuota,
7732 /// Individual group quota rule
7733 IndividualGroupQuota,
7734 /// Default user quota rule
7735 DefaultUserQuota,
7736 /// Default group quota rule
7737 DefaultGroupQuota,
7738 /// If set, the enum was initialized with an unknown value.
7739 ///
7740 /// Applications can examine the value using [Type::value] or
7741 /// [Type::name].
7742 UnknownValue(r#type::UnknownValue),
7743 }
7744
7745 #[doc(hidden)]
7746 pub mod r#type {
7747 #[allow(unused_imports)]
7748 use super::*;
7749 #[derive(Clone, Debug, PartialEq)]
7750 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7751 }
7752
7753 impl Type {
7754 /// Gets the enum value.
7755 ///
7756 /// Returns `None` if the enum contains an unknown value deserialized from
7757 /// the string representation of enums.
7758 pub fn value(&self) -> std::option::Option<i32> {
7759 match self {
7760 Self::Unspecified => std::option::Option::Some(0),
7761 Self::IndividualUserQuota => std::option::Option::Some(1),
7762 Self::IndividualGroupQuota => std::option::Option::Some(2),
7763 Self::DefaultUserQuota => std::option::Option::Some(3),
7764 Self::DefaultGroupQuota => std::option::Option::Some(4),
7765 Self::UnknownValue(u) => u.0.value(),
7766 }
7767 }
7768
7769 /// Gets the enum value as a string.
7770 ///
7771 /// Returns `None` if the enum contains an unknown value deserialized from
7772 /// the integer representation of enums.
7773 pub fn name(&self) -> std::option::Option<&str> {
7774 match self {
7775 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7776 Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7777 Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7778 Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7779 Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7780 Self::UnknownValue(u) => u.0.name(),
7781 }
7782 }
7783 }
7784
7785 impl std::default::Default for Type {
7786 fn default() -> Self {
7787 use std::convert::From;
7788 Self::from(0)
7789 }
7790 }
7791
7792 impl std::fmt::Display for Type {
7793 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7794 wkt::internal::display_enum(f, self.name(), self.value())
7795 }
7796 }
7797
7798 impl std::convert::From<i32> for Type {
7799 fn from(value: i32) -> Self {
7800 match value {
7801 0 => Self::Unspecified,
7802 1 => Self::IndividualUserQuota,
7803 2 => Self::IndividualGroupQuota,
7804 3 => Self::DefaultUserQuota,
7805 4 => Self::DefaultGroupQuota,
7806 _ => Self::UnknownValue(r#type::UnknownValue(
7807 wkt::internal::UnknownEnumValue::Integer(value),
7808 )),
7809 }
7810 }
7811 }
7812
7813 impl std::convert::From<&str> for Type {
7814 fn from(value: &str) -> Self {
7815 use std::string::ToString;
7816 match value {
7817 "TYPE_UNSPECIFIED" => Self::Unspecified,
7818 "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
7819 "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
7820 "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
7821 "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
7822 _ => Self::UnknownValue(r#type::UnknownValue(
7823 wkt::internal::UnknownEnumValue::String(value.to_string()),
7824 )),
7825 }
7826 }
7827 }
7828
7829 impl serde::ser::Serialize for Type {
7830 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7831 where
7832 S: serde::Serializer,
7833 {
7834 match self {
7835 Self::Unspecified => serializer.serialize_i32(0),
7836 Self::IndividualUserQuota => serializer.serialize_i32(1),
7837 Self::IndividualGroupQuota => serializer.serialize_i32(2),
7838 Self::DefaultUserQuota => serializer.serialize_i32(3),
7839 Self::DefaultGroupQuota => serializer.serialize_i32(4),
7840 Self::UnknownValue(u) => u.0.serialize(serializer),
7841 }
7842 }
7843 }
7844
7845 impl<'de> serde::de::Deserialize<'de> for Type {
7846 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7847 where
7848 D: serde::Deserializer<'de>,
7849 {
7850 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7851 ".google.cloud.netapp.v1.QuotaRule.Type",
7852 ))
7853 }
7854 }
7855
7856 /// Quota Rule states
7857 ///
7858 /// # Working with unknown values
7859 ///
7860 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7861 /// additional enum variants at any time. Adding new variants is not considered
7862 /// a breaking change. Applications should write their code in anticipation of:
7863 ///
7864 /// - New values appearing in future releases of the client library, **and**
7865 /// - New values received dynamically, without application changes.
7866 ///
7867 /// Please consult the [Working with enums] section in the user guide for some
7868 /// guidelines.
7869 ///
7870 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7871 #[derive(Clone, Debug, PartialEq)]
7872 #[non_exhaustive]
7873 pub enum State {
7874 /// Unspecified state for quota rule
7875 Unspecified,
7876 /// Quota rule is creating
7877 Creating,
7878 /// Quota rule is updating
7879 Updating,
7880 /// Quota rule is deleting
7881 Deleting,
7882 /// Quota rule is ready
7883 Ready,
7884 /// Quota rule is in error state.
7885 Error,
7886 /// If set, the enum was initialized with an unknown value.
7887 ///
7888 /// Applications can examine the value using [State::value] or
7889 /// [State::name].
7890 UnknownValue(state::UnknownValue),
7891 }
7892
7893 #[doc(hidden)]
7894 pub mod state {
7895 #[allow(unused_imports)]
7896 use super::*;
7897 #[derive(Clone, Debug, PartialEq)]
7898 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7899 }
7900
7901 impl State {
7902 /// Gets the enum value.
7903 ///
7904 /// Returns `None` if the enum contains an unknown value deserialized from
7905 /// the string representation of enums.
7906 pub fn value(&self) -> std::option::Option<i32> {
7907 match self {
7908 Self::Unspecified => std::option::Option::Some(0),
7909 Self::Creating => std::option::Option::Some(1),
7910 Self::Updating => std::option::Option::Some(2),
7911 Self::Deleting => std::option::Option::Some(3),
7912 Self::Ready => std::option::Option::Some(4),
7913 Self::Error => std::option::Option::Some(5),
7914 Self::UnknownValue(u) => u.0.value(),
7915 }
7916 }
7917
7918 /// Gets the enum value as a string.
7919 ///
7920 /// Returns `None` if the enum contains an unknown value deserialized from
7921 /// the integer representation of enums.
7922 pub fn name(&self) -> std::option::Option<&str> {
7923 match self {
7924 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7925 Self::Creating => std::option::Option::Some("CREATING"),
7926 Self::Updating => std::option::Option::Some("UPDATING"),
7927 Self::Deleting => std::option::Option::Some("DELETING"),
7928 Self::Ready => std::option::Option::Some("READY"),
7929 Self::Error => std::option::Option::Some("ERROR"),
7930 Self::UnknownValue(u) => u.0.name(),
7931 }
7932 }
7933 }
7934
7935 impl std::default::Default for State {
7936 fn default() -> Self {
7937 use std::convert::From;
7938 Self::from(0)
7939 }
7940 }
7941
7942 impl std::fmt::Display for State {
7943 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7944 wkt::internal::display_enum(f, self.name(), self.value())
7945 }
7946 }
7947
7948 impl std::convert::From<i32> for State {
7949 fn from(value: i32) -> Self {
7950 match value {
7951 0 => Self::Unspecified,
7952 1 => Self::Creating,
7953 2 => Self::Updating,
7954 3 => Self::Deleting,
7955 4 => Self::Ready,
7956 5 => Self::Error,
7957 _ => Self::UnknownValue(state::UnknownValue(
7958 wkt::internal::UnknownEnumValue::Integer(value),
7959 )),
7960 }
7961 }
7962 }
7963
7964 impl std::convert::From<&str> for State {
7965 fn from(value: &str) -> Self {
7966 use std::string::ToString;
7967 match value {
7968 "STATE_UNSPECIFIED" => Self::Unspecified,
7969 "CREATING" => Self::Creating,
7970 "UPDATING" => Self::Updating,
7971 "DELETING" => Self::Deleting,
7972 "READY" => Self::Ready,
7973 "ERROR" => Self::Error,
7974 _ => Self::UnknownValue(state::UnknownValue(
7975 wkt::internal::UnknownEnumValue::String(value.to_string()),
7976 )),
7977 }
7978 }
7979 }
7980
7981 impl serde::ser::Serialize for State {
7982 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7983 where
7984 S: serde::Serializer,
7985 {
7986 match self {
7987 Self::Unspecified => serializer.serialize_i32(0),
7988 Self::Creating => serializer.serialize_i32(1),
7989 Self::Updating => serializer.serialize_i32(2),
7990 Self::Deleting => serializer.serialize_i32(3),
7991 Self::Ready => serializer.serialize_i32(4),
7992 Self::Error => serializer.serialize_i32(5),
7993 Self::UnknownValue(u) => u.0.serialize(serializer),
7994 }
7995 }
7996 }
7997
7998 impl<'de> serde::de::Deserialize<'de> for State {
7999 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8000 where
8001 D: serde::Deserializer<'de>,
8002 {
8003 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8004 ".google.cloud.netapp.v1.QuotaRule.State",
8005 ))
8006 }
8007 }
8008}
8009
8010/// TransferStats reports all statistics related to replication transfer.
8011#[derive(Clone, Default, PartialEq)]
8012#[non_exhaustive]
8013pub struct TransferStats {
8014 /// Cumulative bytes transferred so far for the replication relationship.
8015 pub transfer_bytes: std::option::Option<i64>,
8016
8017 /// Cumulative time taken across all transfers for the replication
8018 /// relationship.
8019 pub total_transfer_duration: std::option::Option<wkt::Duration>,
8020
8021 /// Last transfer size in bytes.
8022 pub last_transfer_bytes: std::option::Option<i64>,
8023
8024 /// Time taken during last transfer.
8025 pub last_transfer_duration: std::option::Option<wkt::Duration>,
8026
8027 /// Lag duration indicates the duration by which Destination region volume
8028 /// content lags behind the primary region volume content.
8029 pub lag_duration: std::option::Option<wkt::Duration>,
8030
8031 /// Time when progress was updated last.
8032 pub update_time: std::option::Option<wkt::Timestamp>,
8033
8034 /// Time when last transfer completed.
8035 pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
8036
8037 /// A message describing the cause of the last transfer failure.
8038 pub last_transfer_error: std::option::Option<std::string::String>,
8039
8040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8041}
8042
8043impl TransferStats {
8044 pub fn new() -> Self {
8045 std::default::Default::default()
8046 }
8047
8048 /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8049 ///
8050 /// # Example
8051 /// ```ignore,no_run
8052 /// # use google_cloud_netapp_v1::model::TransferStats;
8053 /// let x = TransferStats::new().set_transfer_bytes(42);
8054 /// ```
8055 pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
8056 where
8057 T: std::convert::Into<i64>,
8058 {
8059 self.transfer_bytes = std::option::Option::Some(v.into());
8060 self
8061 }
8062
8063 /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8064 ///
8065 /// # Example
8066 /// ```ignore,no_run
8067 /// # use google_cloud_netapp_v1::model::TransferStats;
8068 /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
8069 /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
8070 /// ```
8071 pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8072 where
8073 T: std::convert::Into<i64>,
8074 {
8075 self.transfer_bytes = v.map(|x| x.into());
8076 self
8077 }
8078
8079 /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8080 ///
8081 /// # Example
8082 /// ```ignore,no_run
8083 /// # use google_cloud_netapp_v1::model::TransferStats;
8084 /// use wkt::Duration;
8085 /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
8086 /// ```
8087 pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
8088 where
8089 T: std::convert::Into<wkt::Duration>,
8090 {
8091 self.total_transfer_duration = std::option::Option::Some(v.into());
8092 self
8093 }
8094
8095 /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8096 ///
8097 /// # Example
8098 /// ```ignore,no_run
8099 /// # use google_cloud_netapp_v1::model::TransferStats;
8100 /// use wkt::Duration;
8101 /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
8102 /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
8103 /// ```
8104 pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8105 where
8106 T: std::convert::Into<wkt::Duration>,
8107 {
8108 self.total_transfer_duration = v.map(|x| x.into());
8109 self
8110 }
8111
8112 /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8113 ///
8114 /// # Example
8115 /// ```ignore,no_run
8116 /// # use google_cloud_netapp_v1::model::TransferStats;
8117 /// let x = TransferStats::new().set_last_transfer_bytes(42);
8118 /// ```
8119 pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
8120 where
8121 T: std::convert::Into<i64>,
8122 {
8123 self.last_transfer_bytes = std::option::Option::Some(v.into());
8124 self
8125 }
8126
8127 /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8128 ///
8129 /// # Example
8130 /// ```ignore,no_run
8131 /// # use google_cloud_netapp_v1::model::TransferStats;
8132 /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
8133 /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
8134 /// ```
8135 pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8136 where
8137 T: std::convert::Into<i64>,
8138 {
8139 self.last_transfer_bytes = v.map(|x| x.into());
8140 self
8141 }
8142
8143 /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8144 ///
8145 /// # Example
8146 /// ```ignore,no_run
8147 /// # use google_cloud_netapp_v1::model::TransferStats;
8148 /// use wkt::Duration;
8149 /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
8150 /// ```
8151 pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
8152 where
8153 T: std::convert::Into<wkt::Duration>,
8154 {
8155 self.last_transfer_duration = std::option::Option::Some(v.into());
8156 self
8157 }
8158
8159 /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8160 ///
8161 /// # Example
8162 /// ```ignore,no_run
8163 /// # use google_cloud_netapp_v1::model::TransferStats;
8164 /// use wkt::Duration;
8165 /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
8166 /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
8167 /// ```
8168 pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8169 where
8170 T: std::convert::Into<wkt::Duration>,
8171 {
8172 self.last_transfer_duration = v.map(|x| x.into());
8173 self
8174 }
8175
8176 /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
8177 ///
8178 /// # Example
8179 /// ```ignore,no_run
8180 /// # use google_cloud_netapp_v1::model::TransferStats;
8181 /// use wkt::Duration;
8182 /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
8183 /// ```
8184 pub fn set_lag_duration<T>(mut self, v: T) -> Self
8185 where
8186 T: std::convert::Into<wkt::Duration>,
8187 {
8188 self.lag_duration = std::option::Option::Some(v.into());
8189 self
8190 }
8191
8192 /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
8193 ///
8194 /// # Example
8195 /// ```ignore,no_run
8196 /// # use google_cloud_netapp_v1::model::TransferStats;
8197 /// use wkt::Duration;
8198 /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
8199 /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
8200 /// ```
8201 pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
8202 where
8203 T: std::convert::Into<wkt::Duration>,
8204 {
8205 self.lag_duration = v.map(|x| x.into());
8206 self
8207 }
8208
8209 /// Sets the value of [update_time][crate::model::TransferStats::update_time].
8210 ///
8211 /// # Example
8212 /// ```ignore,no_run
8213 /// # use google_cloud_netapp_v1::model::TransferStats;
8214 /// use wkt::Timestamp;
8215 /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
8216 /// ```
8217 pub fn set_update_time<T>(mut self, v: T) -> Self
8218 where
8219 T: std::convert::Into<wkt::Timestamp>,
8220 {
8221 self.update_time = std::option::Option::Some(v.into());
8222 self
8223 }
8224
8225 /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
8226 ///
8227 /// # Example
8228 /// ```ignore,no_run
8229 /// # use google_cloud_netapp_v1::model::TransferStats;
8230 /// use wkt::Timestamp;
8231 /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8232 /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
8233 /// ```
8234 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8235 where
8236 T: std::convert::Into<wkt::Timestamp>,
8237 {
8238 self.update_time = v.map(|x| x.into());
8239 self
8240 }
8241
8242 /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8243 ///
8244 /// # Example
8245 /// ```ignore,no_run
8246 /// # use google_cloud_netapp_v1::model::TransferStats;
8247 /// use wkt::Timestamp;
8248 /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
8249 /// ```
8250 pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
8251 where
8252 T: std::convert::Into<wkt::Timestamp>,
8253 {
8254 self.last_transfer_end_time = std::option::Option::Some(v.into());
8255 self
8256 }
8257
8258 /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8259 ///
8260 /// # Example
8261 /// ```ignore,no_run
8262 /// # use google_cloud_netapp_v1::model::TransferStats;
8263 /// use wkt::Timestamp;
8264 /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
8265 /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
8266 /// ```
8267 pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8268 where
8269 T: std::convert::Into<wkt::Timestamp>,
8270 {
8271 self.last_transfer_end_time = v.map(|x| x.into());
8272 self
8273 }
8274
8275 /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8276 ///
8277 /// # Example
8278 /// ```ignore,no_run
8279 /// # use google_cloud_netapp_v1::model::TransferStats;
8280 /// let x = TransferStats::new().set_last_transfer_error("example");
8281 /// ```
8282 pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
8283 where
8284 T: std::convert::Into<std::string::String>,
8285 {
8286 self.last_transfer_error = std::option::Option::Some(v.into());
8287 self
8288 }
8289
8290 /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8291 ///
8292 /// # Example
8293 /// ```ignore,no_run
8294 /// # use google_cloud_netapp_v1::model::TransferStats;
8295 /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
8296 /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
8297 /// ```
8298 pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
8299 where
8300 T: std::convert::Into<std::string::String>,
8301 {
8302 self.last_transfer_error = v.map(|x| x.into());
8303 self
8304 }
8305}
8306
8307impl wkt::message::Message for TransferStats {
8308 fn typename() -> &'static str {
8309 "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
8310 }
8311}
8312
8313/// Replication is a nested resource under Volume, that describes a
8314/// cross-region replication relationship between 2 volumes in different
8315/// regions.
8316#[derive(Clone, Default, PartialEq)]
8317#[non_exhaustive]
8318pub struct Replication {
8319 /// Identifier. The resource name of the Replication.
8320 /// Format:
8321 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
8322 pub name: std::string::String,
8323
8324 /// Output only. State of the replication.
8325 pub state: crate::model::replication::State,
8326
8327 /// Output only. State details of the replication.
8328 pub state_details: std::string::String,
8329
8330 /// Output only. Indicates whether this points to source or destination.
8331 pub role: crate::model::replication::ReplicationRole,
8332
8333 /// Required. Indicates the schedule for replication.
8334 pub replication_schedule: crate::model::replication::ReplicationSchedule,
8335
8336 /// Output only. Indicates the state of mirroring.
8337 pub mirror_state: crate::model::replication::MirrorState,
8338
8339 /// Output only. Condition of the relationship. Can be one of the following:
8340 ///
8341 /// - true: The replication relationship is healthy. It has not missed the most
8342 /// recent scheduled transfer.
8343 /// - false: The replication relationship is not healthy. It has missed the
8344 /// most recent scheduled transfer.
8345 pub healthy: std::option::Option<bool>,
8346
8347 /// Output only. Replication create time.
8348 pub create_time: std::option::Option<wkt::Timestamp>,
8349
8350 /// Output only. Full name of destination volume resource.
8351 /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8352 pub destination_volume: std::string::String,
8353
8354 /// Output only. Replication transfer statistics.
8355 pub transfer_stats: std::option::Option<crate::model::TransferStats>,
8356
8357 /// Resource labels to represent user provided metadata.
8358 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8359
8360 /// A description about this replication relationship.
8361 pub description: std::option::Option<std::string::String>,
8362
8363 /// Required. Input only. Destination volume parameters
8364 pub destination_volume_parameters:
8365 std::option::Option<crate::model::DestinationVolumeParameters>,
8366
8367 /// Output only. Full name of source volume resource.
8368 /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8369 pub source_volume: std::string::String,
8370
8371 /// Output only. Hybrid peering details.
8372 pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
8373
8374 /// Optional. Location of the user cluster.
8375 pub cluster_location: std::string::String,
8376
8377 /// Output only. Type of the hybrid replication.
8378 pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
8379
8380 /// Output only. Copy pastable snapmirror commands to be executed on onprem
8381 /// cluster by the customer.
8382 pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
8383
8384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8385}
8386
8387impl Replication {
8388 pub fn new() -> Self {
8389 std::default::Default::default()
8390 }
8391
8392 /// Sets the value of [name][crate::model::Replication::name].
8393 ///
8394 /// # Example
8395 /// ```ignore,no_run
8396 /// # use google_cloud_netapp_v1::model::Replication;
8397 /// let x = Replication::new().set_name("example");
8398 /// ```
8399 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8400 self.name = v.into();
8401 self
8402 }
8403
8404 /// Sets the value of [state][crate::model::Replication::state].
8405 ///
8406 /// # Example
8407 /// ```ignore,no_run
8408 /// # use google_cloud_netapp_v1::model::Replication;
8409 /// use google_cloud_netapp_v1::model::replication::State;
8410 /// let x0 = Replication::new().set_state(State::Creating);
8411 /// let x1 = Replication::new().set_state(State::Ready);
8412 /// let x2 = Replication::new().set_state(State::Updating);
8413 /// ```
8414 pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
8415 mut self,
8416 v: T,
8417 ) -> Self {
8418 self.state = v.into();
8419 self
8420 }
8421
8422 /// Sets the value of [state_details][crate::model::Replication::state_details].
8423 ///
8424 /// # Example
8425 /// ```ignore,no_run
8426 /// # use google_cloud_netapp_v1::model::Replication;
8427 /// let x = Replication::new().set_state_details("example");
8428 /// ```
8429 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8430 self.state_details = v.into();
8431 self
8432 }
8433
8434 /// Sets the value of [role][crate::model::Replication::role].
8435 ///
8436 /// # Example
8437 /// ```ignore,no_run
8438 /// # use google_cloud_netapp_v1::model::Replication;
8439 /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
8440 /// let x0 = Replication::new().set_role(ReplicationRole::Source);
8441 /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
8442 /// ```
8443 pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
8444 mut self,
8445 v: T,
8446 ) -> Self {
8447 self.role = v.into();
8448 self
8449 }
8450
8451 /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
8452 ///
8453 /// # Example
8454 /// ```ignore,no_run
8455 /// # use google_cloud_netapp_v1::model::Replication;
8456 /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
8457 /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
8458 /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
8459 /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
8460 /// ```
8461 pub fn set_replication_schedule<
8462 T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
8463 >(
8464 mut self,
8465 v: T,
8466 ) -> Self {
8467 self.replication_schedule = v.into();
8468 self
8469 }
8470
8471 /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8472 ///
8473 /// # Example
8474 /// ```ignore,no_run
8475 /// # use google_cloud_netapp_v1::model::Replication;
8476 /// use google_cloud_netapp_v1::model::replication::MirrorState;
8477 /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8478 /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8479 /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8480 /// ```
8481 pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8482 mut self,
8483 v: T,
8484 ) -> Self {
8485 self.mirror_state = v.into();
8486 self
8487 }
8488
8489 /// Sets the value of [healthy][crate::model::Replication::healthy].
8490 ///
8491 /// # Example
8492 /// ```ignore,no_run
8493 /// # use google_cloud_netapp_v1::model::Replication;
8494 /// let x = Replication::new().set_healthy(true);
8495 /// ```
8496 pub fn set_healthy<T>(mut self, v: T) -> Self
8497 where
8498 T: std::convert::Into<bool>,
8499 {
8500 self.healthy = std::option::Option::Some(v.into());
8501 self
8502 }
8503
8504 /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8505 ///
8506 /// # Example
8507 /// ```ignore,no_run
8508 /// # use google_cloud_netapp_v1::model::Replication;
8509 /// let x = Replication::new().set_or_clear_healthy(Some(false));
8510 /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8511 /// ```
8512 pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8513 where
8514 T: std::convert::Into<bool>,
8515 {
8516 self.healthy = v.map(|x| x.into());
8517 self
8518 }
8519
8520 /// Sets the value of [create_time][crate::model::Replication::create_time].
8521 ///
8522 /// # Example
8523 /// ```ignore,no_run
8524 /// # use google_cloud_netapp_v1::model::Replication;
8525 /// use wkt::Timestamp;
8526 /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8527 /// ```
8528 pub fn set_create_time<T>(mut self, v: T) -> Self
8529 where
8530 T: std::convert::Into<wkt::Timestamp>,
8531 {
8532 self.create_time = std::option::Option::Some(v.into());
8533 self
8534 }
8535
8536 /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8537 ///
8538 /// # Example
8539 /// ```ignore,no_run
8540 /// # use google_cloud_netapp_v1::model::Replication;
8541 /// use wkt::Timestamp;
8542 /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8543 /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8544 /// ```
8545 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8546 where
8547 T: std::convert::Into<wkt::Timestamp>,
8548 {
8549 self.create_time = v.map(|x| x.into());
8550 self
8551 }
8552
8553 /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8554 ///
8555 /// # Example
8556 /// ```ignore,no_run
8557 /// # use google_cloud_netapp_v1::model::Replication;
8558 /// let x = Replication::new().set_destination_volume("example");
8559 /// ```
8560 pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8561 mut self,
8562 v: T,
8563 ) -> Self {
8564 self.destination_volume = v.into();
8565 self
8566 }
8567
8568 /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8569 ///
8570 /// # Example
8571 /// ```ignore,no_run
8572 /// # use google_cloud_netapp_v1::model::Replication;
8573 /// use google_cloud_netapp_v1::model::TransferStats;
8574 /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8575 /// ```
8576 pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8577 where
8578 T: std::convert::Into<crate::model::TransferStats>,
8579 {
8580 self.transfer_stats = std::option::Option::Some(v.into());
8581 self
8582 }
8583
8584 /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8585 ///
8586 /// # Example
8587 /// ```ignore,no_run
8588 /// # use google_cloud_netapp_v1::model::Replication;
8589 /// use google_cloud_netapp_v1::model::TransferStats;
8590 /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8591 /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8592 /// ```
8593 pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8594 where
8595 T: std::convert::Into<crate::model::TransferStats>,
8596 {
8597 self.transfer_stats = v.map(|x| x.into());
8598 self
8599 }
8600
8601 /// Sets the value of [labels][crate::model::Replication::labels].
8602 ///
8603 /// # Example
8604 /// ```ignore,no_run
8605 /// # use google_cloud_netapp_v1::model::Replication;
8606 /// let x = Replication::new().set_labels([
8607 /// ("key0", "abc"),
8608 /// ("key1", "xyz"),
8609 /// ]);
8610 /// ```
8611 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8612 where
8613 T: std::iter::IntoIterator<Item = (K, V)>,
8614 K: std::convert::Into<std::string::String>,
8615 V: std::convert::Into<std::string::String>,
8616 {
8617 use std::iter::Iterator;
8618 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8619 self
8620 }
8621
8622 /// Sets the value of [description][crate::model::Replication::description].
8623 ///
8624 /// # Example
8625 /// ```ignore,no_run
8626 /// # use google_cloud_netapp_v1::model::Replication;
8627 /// let x = Replication::new().set_description("example");
8628 /// ```
8629 pub fn set_description<T>(mut self, v: T) -> Self
8630 where
8631 T: std::convert::Into<std::string::String>,
8632 {
8633 self.description = std::option::Option::Some(v.into());
8634 self
8635 }
8636
8637 /// Sets or clears the value of [description][crate::model::Replication::description].
8638 ///
8639 /// # Example
8640 /// ```ignore,no_run
8641 /// # use google_cloud_netapp_v1::model::Replication;
8642 /// let x = Replication::new().set_or_clear_description(Some("example"));
8643 /// let x = Replication::new().set_or_clear_description(None::<String>);
8644 /// ```
8645 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8646 where
8647 T: std::convert::Into<std::string::String>,
8648 {
8649 self.description = v.map(|x| x.into());
8650 self
8651 }
8652
8653 /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8654 ///
8655 /// # Example
8656 /// ```ignore,no_run
8657 /// # use google_cloud_netapp_v1::model::Replication;
8658 /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8659 /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8660 /// ```
8661 pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8662 where
8663 T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8664 {
8665 self.destination_volume_parameters = std::option::Option::Some(v.into());
8666 self
8667 }
8668
8669 /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8670 ///
8671 /// # Example
8672 /// ```ignore,no_run
8673 /// # use google_cloud_netapp_v1::model::Replication;
8674 /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8675 /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8676 /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8677 /// ```
8678 pub fn set_or_clear_destination_volume_parameters<T>(
8679 mut self,
8680 v: std::option::Option<T>,
8681 ) -> Self
8682 where
8683 T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8684 {
8685 self.destination_volume_parameters = v.map(|x| x.into());
8686 self
8687 }
8688
8689 /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8690 ///
8691 /// # Example
8692 /// ```ignore,no_run
8693 /// # use google_cloud_netapp_v1::model::Replication;
8694 /// let x = Replication::new().set_source_volume("example");
8695 /// ```
8696 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8697 self.source_volume = v.into();
8698 self
8699 }
8700
8701 /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8702 ///
8703 /// # Example
8704 /// ```ignore,no_run
8705 /// # use google_cloud_netapp_v1::model::Replication;
8706 /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8707 /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8708 /// ```
8709 pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8710 where
8711 T: std::convert::Into<crate::model::HybridPeeringDetails>,
8712 {
8713 self.hybrid_peering_details = std::option::Option::Some(v.into());
8714 self
8715 }
8716
8717 /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8718 ///
8719 /// # Example
8720 /// ```ignore,no_run
8721 /// # use google_cloud_netapp_v1::model::Replication;
8722 /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8723 /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8724 /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8725 /// ```
8726 pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8727 where
8728 T: std::convert::Into<crate::model::HybridPeeringDetails>,
8729 {
8730 self.hybrid_peering_details = v.map(|x| x.into());
8731 self
8732 }
8733
8734 /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8735 ///
8736 /// # Example
8737 /// ```ignore,no_run
8738 /// # use google_cloud_netapp_v1::model::Replication;
8739 /// let x = Replication::new().set_cluster_location("example");
8740 /// ```
8741 pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8742 mut self,
8743 v: T,
8744 ) -> Self {
8745 self.cluster_location = v.into();
8746 self
8747 }
8748
8749 /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8750 ///
8751 /// # Example
8752 /// ```ignore,no_run
8753 /// # use google_cloud_netapp_v1::model::Replication;
8754 /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8755 /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8756 /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8757 /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8758 /// ```
8759 pub fn set_hybrid_replication_type<
8760 T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8761 >(
8762 mut self,
8763 v: T,
8764 ) -> Self {
8765 self.hybrid_replication_type = v.into();
8766 self
8767 }
8768
8769 /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8770 ///
8771 /// # Example
8772 /// ```ignore,no_run
8773 /// # use google_cloud_netapp_v1::model::Replication;
8774 /// use google_cloud_netapp_v1::model::UserCommands;
8775 /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8776 /// ```
8777 pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8778 where
8779 T: std::convert::Into<crate::model::UserCommands>,
8780 {
8781 self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8782 self
8783 }
8784
8785 /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8786 ///
8787 /// # Example
8788 /// ```ignore,no_run
8789 /// # use google_cloud_netapp_v1::model::Replication;
8790 /// use google_cloud_netapp_v1::model::UserCommands;
8791 /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8792 /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8793 /// ```
8794 pub fn set_or_clear_hybrid_replication_user_commands<T>(
8795 mut self,
8796 v: std::option::Option<T>,
8797 ) -> Self
8798 where
8799 T: std::convert::Into<crate::model::UserCommands>,
8800 {
8801 self.hybrid_replication_user_commands = v.map(|x| x.into());
8802 self
8803 }
8804}
8805
8806impl wkt::message::Message for Replication {
8807 fn typename() -> &'static str {
8808 "type.googleapis.com/google.cloud.netapp.v1.Replication"
8809 }
8810}
8811
8812/// Defines additional types related to [Replication].
8813pub mod replication {
8814 #[allow(unused_imports)]
8815 use super::*;
8816
8817 /// The replication states
8818 /// New enum values may be added in future to indicate possible new states.
8819 ///
8820 /// # Working with unknown values
8821 ///
8822 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8823 /// additional enum variants at any time. Adding new variants is not considered
8824 /// a breaking change. Applications should write their code in anticipation of:
8825 ///
8826 /// - New values appearing in future releases of the client library, **and**
8827 /// - New values received dynamically, without application changes.
8828 ///
8829 /// Please consult the [Working with enums] section in the user guide for some
8830 /// guidelines.
8831 ///
8832 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8833 #[derive(Clone, Debug, PartialEq)]
8834 #[non_exhaustive]
8835 pub enum State {
8836 /// Unspecified replication State
8837 Unspecified,
8838 /// Replication is creating.
8839 Creating,
8840 /// Replication is ready.
8841 Ready,
8842 /// Replication is updating.
8843 Updating,
8844 /// Replication is deleting.
8845 Deleting,
8846 /// Replication is in error state.
8847 Error,
8848 /// Replication is waiting for cluster peering to be established.
8849 PendingClusterPeering,
8850 /// Replication is waiting for SVM peering to be established.
8851 PendingSvmPeering,
8852 /// Replication is waiting for Commands to be executed on Onprem ONTAP.
8853 PendingRemoteResync,
8854 /// Onprem ONTAP is destination and Replication can only be managed from
8855 /// Onprem.
8856 ExternallyManagedReplication,
8857 /// If set, the enum was initialized with an unknown value.
8858 ///
8859 /// Applications can examine the value using [State::value] or
8860 /// [State::name].
8861 UnknownValue(state::UnknownValue),
8862 }
8863
8864 #[doc(hidden)]
8865 pub mod state {
8866 #[allow(unused_imports)]
8867 use super::*;
8868 #[derive(Clone, Debug, PartialEq)]
8869 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8870 }
8871
8872 impl State {
8873 /// Gets the enum value.
8874 ///
8875 /// Returns `None` if the enum contains an unknown value deserialized from
8876 /// the string representation of enums.
8877 pub fn value(&self) -> std::option::Option<i32> {
8878 match self {
8879 Self::Unspecified => std::option::Option::Some(0),
8880 Self::Creating => std::option::Option::Some(1),
8881 Self::Ready => std::option::Option::Some(2),
8882 Self::Updating => std::option::Option::Some(3),
8883 Self::Deleting => std::option::Option::Some(5),
8884 Self::Error => std::option::Option::Some(6),
8885 Self::PendingClusterPeering => std::option::Option::Some(8),
8886 Self::PendingSvmPeering => std::option::Option::Some(9),
8887 Self::PendingRemoteResync => std::option::Option::Some(10),
8888 Self::ExternallyManagedReplication => std::option::Option::Some(11),
8889 Self::UnknownValue(u) => u.0.value(),
8890 }
8891 }
8892
8893 /// Gets the enum value as a string.
8894 ///
8895 /// Returns `None` if the enum contains an unknown value deserialized from
8896 /// the integer representation of enums.
8897 pub fn name(&self) -> std::option::Option<&str> {
8898 match self {
8899 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8900 Self::Creating => std::option::Option::Some("CREATING"),
8901 Self::Ready => std::option::Option::Some("READY"),
8902 Self::Updating => std::option::Option::Some("UPDATING"),
8903 Self::Deleting => std::option::Option::Some("DELETING"),
8904 Self::Error => std::option::Option::Some("ERROR"),
8905 Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
8906 Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
8907 Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
8908 Self::ExternallyManagedReplication => {
8909 std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
8910 }
8911 Self::UnknownValue(u) => u.0.name(),
8912 }
8913 }
8914 }
8915
8916 impl std::default::Default for State {
8917 fn default() -> Self {
8918 use std::convert::From;
8919 Self::from(0)
8920 }
8921 }
8922
8923 impl std::fmt::Display for State {
8924 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8925 wkt::internal::display_enum(f, self.name(), self.value())
8926 }
8927 }
8928
8929 impl std::convert::From<i32> for State {
8930 fn from(value: i32) -> Self {
8931 match value {
8932 0 => Self::Unspecified,
8933 1 => Self::Creating,
8934 2 => Self::Ready,
8935 3 => Self::Updating,
8936 5 => Self::Deleting,
8937 6 => Self::Error,
8938 8 => Self::PendingClusterPeering,
8939 9 => Self::PendingSvmPeering,
8940 10 => Self::PendingRemoteResync,
8941 11 => Self::ExternallyManagedReplication,
8942 _ => Self::UnknownValue(state::UnknownValue(
8943 wkt::internal::UnknownEnumValue::Integer(value),
8944 )),
8945 }
8946 }
8947 }
8948
8949 impl std::convert::From<&str> for State {
8950 fn from(value: &str) -> Self {
8951 use std::string::ToString;
8952 match value {
8953 "STATE_UNSPECIFIED" => Self::Unspecified,
8954 "CREATING" => Self::Creating,
8955 "READY" => Self::Ready,
8956 "UPDATING" => Self::Updating,
8957 "DELETING" => Self::Deleting,
8958 "ERROR" => Self::Error,
8959 "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
8960 "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
8961 "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
8962 "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
8963 _ => Self::UnknownValue(state::UnknownValue(
8964 wkt::internal::UnknownEnumValue::String(value.to_string()),
8965 )),
8966 }
8967 }
8968 }
8969
8970 impl serde::ser::Serialize for State {
8971 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8972 where
8973 S: serde::Serializer,
8974 {
8975 match self {
8976 Self::Unspecified => serializer.serialize_i32(0),
8977 Self::Creating => serializer.serialize_i32(1),
8978 Self::Ready => serializer.serialize_i32(2),
8979 Self::Updating => serializer.serialize_i32(3),
8980 Self::Deleting => serializer.serialize_i32(5),
8981 Self::Error => serializer.serialize_i32(6),
8982 Self::PendingClusterPeering => serializer.serialize_i32(8),
8983 Self::PendingSvmPeering => serializer.serialize_i32(9),
8984 Self::PendingRemoteResync => serializer.serialize_i32(10),
8985 Self::ExternallyManagedReplication => serializer.serialize_i32(11),
8986 Self::UnknownValue(u) => u.0.serialize(serializer),
8987 }
8988 }
8989 }
8990
8991 impl<'de> serde::de::Deserialize<'de> for State {
8992 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8993 where
8994 D: serde::Deserializer<'de>,
8995 {
8996 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8997 ".google.cloud.netapp.v1.Replication.State",
8998 ))
8999 }
9000 }
9001
9002 /// New enum values may be added in future to support different replication
9003 /// topology.
9004 ///
9005 /// # Working with unknown values
9006 ///
9007 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9008 /// additional enum variants at any time. Adding new variants is not considered
9009 /// a breaking change. Applications should write their code in anticipation of:
9010 ///
9011 /// - New values appearing in future releases of the client library, **and**
9012 /// - New values received dynamically, without application changes.
9013 ///
9014 /// Please consult the [Working with enums] section in the user guide for some
9015 /// guidelines.
9016 ///
9017 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9018 #[derive(Clone, Debug, PartialEq)]
9019 #[non_exhaustive]
9020 pub enum ReplicationRole {
9021 /// Unspecified replication role
9022 Unspecified,
9023 /// Indicates Source volume.
9024 Source,
9025 /// Indicates Destination volume.
9026 Destination,
9027 /// If set, the enum was initialized with an unknown value.
9028 ///
9029 /// Applications can examine the value using [ReplicationRole::value] or
9030 /// [ReplicationRole::name].
9031 UnknownValue(replication_role::UnknownValue),
9032 }
9033
9034 #[doc(hidden)]
9035 pub mod replication_role {
9036 #[allow(unused_imports)]
9037 use super::*;
9038 #[derive(Clone, Debug, PartialEq)]
9039 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9040 }
9041
9042 impl ReplicationRole {
9043 /// Gets the enum value.
9044 ///
9045 /// Returns `None` if the enum contains an unknown value deserialized from
9046 /// the string representation of enums.
9047 pub fn value(&self) -> std::option::Option<i32> {
9048 match self {
9049 Self::Unspecified => std::option::Option::Some(0),
9050 Self::Source => std::option::Option::Some(1),
9051 Self::Destination => std::option::Option::Some(2),
9052 Self::UnknownValue(u) => u.0.value(),
9053 }
9054 }
9055
9056 /// Gets the enum value as a string.
9057 ///
9058 /// Returns `None` if the enum contains an unknown value deserialized from
9059 /// the integer representation of enums.
9060 pub fn name(&self) -> std::option::Option<&str> {
9061 match self {
9062 Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
9063 Self::Source => std::option::Option::Some("SOURCE"),
9064 Self::Destination => std::option::Option::Some("DESTINATION"),
9065 Self::UnknownValue(u) => u.0.name(),
9066 }
9067 }
9068 }
9069
9070 impl std::default::Default for ReplicationRole {
9071 fn default() -> Self {
9072 use std::convert::From;
9073 Self::from(0)
9074 }
9075 }
9076
9077 impl std::fmt::Display for ReplicationRole {
9078 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9079 wkt::internal::display_enum(f, self.name(), self.value())
9080 }
9081 }
9082
9083 impl std::convert::From<i32> for ReplicationRole {
9084 fn from(value: i32) -> Self {
9085 match value {
9086 0 => Self::Unspecified,
9087 1 => Self::Source,
9088 2 => Self::Destination,
9089 _ => Self::UnknownValue(replication_role::UnknownValue(
9090 wkt::internal::UnknownEnumValue::Integer(value),
9091 )),
9092 }
9093 }
9094 }
9095
9096 impl std::convert::From<&str> for ReplicationRole {
9097 fn from(value: &str) -> Self {
9098 use std::string::ToString;
9099 match value {
9100 "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
9101 "SOURCE" => Self::Source,
9102 "DESTINATION" => Self::Destination,
9103 _ => Self::UnknownValue(replication_role::UnknownValue(
9104 wkt::internal::UnknownEnumValue::String(value.to_string()),
9105 )),
9106 }
9107 }
9108 }
9109
9110 impl serde::ser::Serialize for ReplicationRole {
9111 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9112 where
9113 S: serde::Serializer,
9114 {
9115 match self {
9116 Self::Unspecified => serializer.serialize_i32(0),
9117 Self::Source => serializer.serialize_i32(1),
9118 Self::Destination => serializer.serialize_i32(2),
9119 Self::UnknownValue(u) => u.0.serialize(serializer),
9120 }
9121 }
9122 }
9123
9124 impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
9125 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9126 where
9127 D: serde::Deserializer<'de>,
9128 {
9129 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
9130 ".google.cloud.netapp.v1.Replication.ReplicationRole",
9131 ))
9132 }
9133 }
9134
9135 /// Schedule for Replication.
9136 /// New enum values may be added in future to support different frequency of
9137 /// replication.
9138 ///
9139 /// # Working with unknown values
9140 ///
9141 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9142 /// additional enum variants at any time. Adding new variants is not considered
9143 /// a breaking change. Applications should write their code in anticipation of:
9144 ///
9145 /// - New values appearing in future releases of the client library, **and**
9146 /// - New values received dynamically, without application changes.
9147 ///
9148 /// Please consult the [Working with enums] section in the user guide for some
9149 /// guidelines.
9150 ///
9151 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9152 #[derive(Clone, Debug, PartialEq)]
9153 #[non_exhaustive]
9154 pub enum ReplicationSchedule {
9155 /// Unspecified ReplicationSchedule
9156 Unspecified,
9157 /// Replication happens once every 10 minutes.
9158 Every10Minutes,
9159 /// Replication happens once every hour.
9160 Hourly,
9161 /// Replication happens once every day.
9162 Daily,
9163 /// If set, the enum was initialized with an unknown value.
9164 ///
9165 /// Applications can examine the value using [ReplicationSchedule::value] or
9166 /// [ReplicationSchedule::name].
9167 UnknownValue(replication_schedule::UnknownValue),
9168 }
9169
9170 #[doc(hidden)]
9171 pub mod replication_schedule {
9172 #[allow(unused_imports)]
9173 use super::*;
9174 #[derive(Clone, Debug, PartialEq)]
9175 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9176 }
9177
9178 impl ReplicationSchedule {
9179 /// Gets the enum value.
9180 ///
9181 /// Returns `None` if the enum contains an unknown value deserialized from
9182 /// the string representation of enums.
9183 pub fn value(&self) -> std::option::Option<i32> {
9184 match self {
9185 Self::Unspecified => std::option::Option::Some(0),
9186 Self::Every10Minutes => std::option::Option::Some(1),
9187 Self::Hourly => std::option::Option::Some(2),
9188 Self::Daily => std::option::Option::Some(3),
9189 Self::UnknownValue(u) => u.0.value(),
9190 }
9191 }
9192
9193 /// Gets the enum value as a string.
9194 ///
9195 /// Returns `None` if the enum contains an unknown value deserialized from
9196 /// the integer representation of enums.
9197 pub fn name(&self) -> std::option::Option<&str> {
9198 match self {
9199 Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
9200 Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
9201 Self::Hourly => std::option::Option::Some("HOURLY"),
9202 Self::Daily => std::option::Option::Some("DAILY"),
9203 Self::UnknownValue(u) => u.0.name(),
9204 }
9205 }
9206 }
9207
9208 impl std::default::Default for ReplicationSchedule {
9209 fn default() -> Self {
9210 use std::convert::From;
9211 Self::from(0)
9212 }
9213 }
9214
9215 impl std::fmt::Display for ReplicationSchedule {
9216 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9217 wkt::internal::display_enum(f, self.name(), self.value())
9218 }
9219 }
9220
9221 impl std::convert::From<i32> for ReplicationSchedule {
9222 fn from(value: i32) -> Self {
9223 match value {
9224 0 => Self::Unspecified,
9225 1 => Self::Every10Minutes,
9226 2 => Self::Hourly,
9227 3 => Self::Daily,
9228 _ => Self::UnknownValue(replication_schedule::UnknownValue(
9229 wkt::internal::UnknownEnumValue::Integer(value),
9230 )),
9231 }
9232 }
9233 }
9234
9235 impl std::convert::From<&str> for ReplicationSchedule {
9236 fn from(value: &str) -> Self {
9237 use std::string::ToString;
9238 match value {
9239 "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
9240 "EVERY_10_MINUTES" => Self::Every10Minutes,
9241 "HOURLY" => Self::Hourly,
9242 "DAILY" => Self::Daily,
9243 _ => Self::UnknownValue(replication_schedule::UnknownValue(
9244 wkt::internal::UnknownEnumValue::String(value.to_string()),
9245 )),
9246 }
9247 }
9248 }
9249
9250 impl serde::ser::Serialize for ReplicationSchedule {
9251 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9252 where
9253 S: serde::Serializer,
9254 {
9255 match self {
9256 Self::Unspecified => serializer.serialize_i32(0),
9257 Self::Every10Minutes => serializer.serialize_i32(1),
9258 Self::Hourly => serializer.serialize_i32(2),
9259 Self::Daily => serializer.serialize_i32(3),
9260 Self::UnknownValue(u) => u.0.serialize(serializer),
9261 }
9262 }
9263 }
9264
9265 impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
9266 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9267 where
9268 D: serde::Deserializer<'de>,
9269 {
9270 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
9271 ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
9272 ))
9273 }
9274 }
9275
9276 /// Mirroring states.
9277 /// No new value is expected to be added in future.
9278 ///
9279 /// # Working with unknown values
9280 ///
9281 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9282 /// additional enum variants at any time. Adding new variants is not considered
9283 /// a breaking change. Applications should write their code in anticipation of:
9284 ///
9285 /// - New values appearing in future releases of the client library, **and**
9286 /// - New values received dynamically, without application changes.
9287 ///
9288 /// Please consult the [Working with enums] section in the user guide for some
9289 /// guidelines.
9290 ///
9291 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9292 #[derive(Clone, Debug, PartialEq)]
9293 #[non_exhaustive]
9294 pub enum MirrorState {
9295 /// Unspecified MirrorState
9296 Unspecified,
9297 /// Destination volume is being prepared.
9298 Preparing,
9299 /// Destination volume has been initialized and is ready to receive
9300 /// replication transfers.
9301 Mirrored,
9302 /// Destination volume is not receiving replication transfers.
9303 Stopped,
9304 /// Incremental replication is in progress.
9305 Transferring,
9306 /// Baseline replication is in progress.
9307 BaselineTransferring,
9308 /// Replication is aborted.
9309 Aborted,
9310 /// Replication is being managed from Onprem ONTAP.
9311 ExternallyManaged,
9312 /// Peering is yet to be established.
9313 PendingPeering,
9314 /// If set, the enum was initialized with an unknown value.
9315 ///
9316 /// Applications can examine the value using [MirrorState::value] or
9317 /// [MirrorState::name].
9318 UnknownValue(mirror_state::UnknownValue),
9319 }
9320
9321 #[doc(hidden)]
9322 pub mod mirror_state {
9323 #[allow(unused_imports)]
9324 use super::*;
9325 #[derive(Clone, Debug, PartialEq)]
9326 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9327 }
9328
9329 impl MirrorState {
9330 /// Gets the enum value.
9331 ///
9332 /// Returns `None` if the enum contains an unknown value deserialized from
9333 /// the string representation of enums.
9334 pub fn value(&self) -> std::option::Option<i32> {
9335 match self {
9336 Self::Unspecified => std::option::Option::Some(0),
9337 Self::Preparing => std::option::Option::Some(1),
9338 Self::Mirrored => std::option::Option::Some(2),
9339 Self::Stopped => std::option::Option::Some(3),
9340 Self::Transferring => std::option::Option::Some(4),
9341 Self::BaselineTransferring => std::option::Option::Some(5),
9342 Self::Aborted => std::option::Option::Some(6),
9343 Self::ExternallyManaged => std::option::Option::Some(7),
9344 Self::PendingPeering => std::option::Option::Some(8),
9345 Self::UnknownValue(u) => u.0.value(),
9346 }
9347 }
9348
9349 /// Gets the enum value as a string.
9350 ///
9351 /// Returns `None` if the enum contains an unknown value deserialized from
9352 /// the integer representation of enums.
9353 pub fn name(&self) -> std::option::Option<&str> {
9354 match self {
9355 Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
9356 Self::Preparing => std::option::Option::Some("PREPARING"),
9357 Self::Mirrored => std::option::Option::Some("MIRRORED"),
9358 Self::Stopped => std::option::Option::Some("STOPPED"),
9359 Self::Transferring => std::option::Option::Some("TRANSFERRING"),
9360 Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
9361 Self::Aborted => std::option::Option::Some("ABORTED"),
9362 Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
9363 Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
9364 Self::UnknownValue(u) => u.0.name(),
9365 }
9366 }
9367 }
9368
9369 impl std::default::Default for MirrorState {
9370 fn default() -> Self {
9371 use std::convert::From;
9372 Self::from(0)
9373 }
9374 }
9375
9376 impl std::fmt::Display for MirrorState {
9377 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9378 wkt::internal::display_enum(f, self.name(), self.value())
9379 }
9380 }
9381
9382 impl std::convert::From<i32> for MirrorState {
9383 fn from(value: i32) -> Self {
9384 match value {
9385 0 => Self::Unspecified,
9386 1 => Self::Preparing,
9387 2 => Self::Mirrored,
9388 3 => Self::Stopped,
9389 4 => Self::Transferring,
9390 5 => Self::BaselineTransferring,
9391 6 => Self::Aborted,
9392 7 => Self::ExternallyManaged,
9393 8 => Self::PendingPeering,
9394 _ => Self::UnknownValue(mirror_state::UnknownValue(
9395 wkt::internal::UnknownEnumValue::Integer(value),
9396 )),
9397 }
9398 }
9399 }
9400
9401 impl std::convert::From<&str> for MirrorState {
9402 fn from(value: &str) -> Self {
9403 use std::string::ToString;
9404 match value {
9405 "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
9406 "PREPARING" => Self::Preparing,
9407 "MIRRORED" => Self::Mirrored,
9408 "STOPPED" => Self::Stopped,
9409 "TRANSFERRING" => Self::Transferring,
9410 "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
9411 "ABORTED" => Self::Aborted,
9412 "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
9413 "PENDING_PEERING" => Self::PendingPeering,
9414 _ => Self::UnknownValue(mirror_state::UnknownValue(
9415 wkt::internal::UnknownEnumValue::String(value.to_string()),
9416 )),
9417 }
9418 }
9419 }
9420
9421 impl serde::ser::Serialize for MirrorState {
9422 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9423 where
9424 S: serde::Serializer,
9425 {
9426 match self {
9427 Self::Unspecified => serializer.serialize_i32(0),
9428 Self::Preparing => serializer.serialize_i32(1),
9429 Self::Mirrored => serializer.serialize_i32(2),
9430 Self::Stopped => serializer.serialize_i32(3),
9431 Self::Transferring => serializer.serialize_i32(4),
9432 Self::BaselineTransferring => serializer.serialize_i32(5),
9433 Self::Aborted => serializer.serialize_i32(6),
9434 Self::ExternallyManaged => serializer.serialize_i32(7),
9435 Self::PendingPeering => serializer.serialize_i32(8),
9436 Self::UnknownValue(u) => u.0.serialize(serializer),
9437 }
9438 }
9439 }
9440
9441 impl<'de> serde::de::Deserialize<'de> for MirrorState {
9442 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9443 where
9444 D: serde::Deserializer<'de>,
9445 {
9446 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
9447 ".google.cloud.netapp.v1.Replication.MirrorState",
9448 ))
9449 }
9450 }
9451
9452 /// Hybrid replication type.
9453 ///
9454 /// # Working with unknown values
9455 ///
9456 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9457 /// additional enum variants at any time. Adding new variants is not considered
9458 /// a breaking change. Applications should write their code in anticipation of:
9459 ///
9460 /// - New values appearing in future releases of the client library, **and**
9461 /// - New values received dynamically, without application changes.
9462 ///
9463 /// Please consult the [Working with enums] section in the user guide for some
9464 /// guidelines.
9465 ///
9466 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9467 #[derive(Clone, Debug, PartialEq)]
9468 #[non_exhaustive]
9469 pub enum HybridReplicationType {
9470 /// Unspecified hybrid replication type.
9471 Unspecified,
9472 /// Hybrid replication type for migration.
9473 Migration,
9474 /// Hybrid replication type for continuous replication.
9475 ContinuousReplication,
9476 /// New field for reversible OnPrem replication, to be used for data
9477 /// protection.
9478 OnpremReplication,
9479 /// Hybrid replication type for incremental Transfer in the reverse direction
9480 /// (GCNV is source and Onprem is destination)
9481 ReverseOnpremReplication,
9482 /// If set, the enum was initialized with an unknown value.
9483 ///
9484 /// Applications can examine the value using [HybridReplicationType::value] or
9485 /// [HybridReplicationType::name].
9486 UnknownValue(hybrid_replication_type::UnknownValue),
9487 }
9488
9489 #[doc(hidden)]
9490 pub mod hybrid_replication_type {
9491 #[allow(unused_imports)]
9492 use super::*;
9493 #[derive(Clone, Debug, PartialEq)]
9494 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9495 }
9496
9497 impl HybridReplicationType {
9498 /// Gets the enum value.
9499 ///
9500 /// Returns `None` if the enum contains an unknown value deserialized from
9501 /// the string representation of enums.
9502 pub fn value(&self) -> std::option::Option<i32> {
9503 match self {
9504 Self::Unspecified => std::option::Option::Some(0),
9505 Self::Migration => std::option::Option::Some(1),
9506 Self::ContinuousReplication => std::option::Option::Some(2),
9507 Self::OnpremReplication => std::option::Option::Some(3),
9508 Self::ReverseOnpremReplication => std::option::Option::Some(4),
9509 Self::UnknownValue(u) => u.0.value(),
9510 }
9511 }
9512
9513 /// Gets the enum value as a string.
9514 ///
9515 /// Returns `None` if the enum contains an unknown value deserialized from
9516 /// the integer representation of enums.
9517 pub fn name(&self) -> std::option::Option<&str> {
9518 match self {
9519 Self::Unspecified => {
9520 std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9521 }
9522 Self::Migration => std::option::Option::Some("MIGRATION"),
9523 Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9524 Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9525 Self::ReverseOnpremReplication => {
9526 std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9527 }
9528 Self::UnknownValue(u) => u.0.name(),
9529 }
9530 }
9531 }
9532
9533 impl std::default::Default for HybridReplicationType {
9534 fn default() -> Self {
9535 use std::convert::From;
9536 Self::from(0)
9537 }
9538 }
9539
9540 impl std::fmt::Display for HybridReplicationType {
9541 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9542 wkt::internal::display_enum(f, self.name(), self.value())
9543 }
9544 }
9545
9546 impl std::convert::From<i32> for HybridReplicationType {
9547 fn from(value: i32) -> Self {
9548 match value {
9549 0 => Self::Unspecified,
9550 1 => Self::Migration,
9551 2 => Self::ContinuousReplication,
9552 3 => Self::OnpremReplication,
9553 4 => Self::ReverseOnpremReplication,
9554 _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9555 wkt::internal::UnknownEnumValue::Integer(value),
9556 )),
9557 }
9558 }
9559 }
9560
9561 impl std::convert::From<&str> for HybridReplicationType {
9562 fn from(value: &str) -> Self {
9563 use std::string::ToString;
9564 match value {
9565 "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9566 "MIGRATION" => Self::Migration,
9567 "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9568 "ONPREM_REPLICATION" => Self::OnpremReplication,
9569 "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9570 _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9571 wkt::internal::UnknownEnumValue::String(value.to_string()),
9572 )),
9573 }
9574 }
9575 }
9576
9577 impl serde::ser::Serialize for HybridReplicationType {
9578 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9579 where
9580 S: serde::Serializer,
9581 {
9582 match self {
9583 Self::Unspecified => serializer.serialize_i32(0),
9584 Self::Migration => serializer.serialize_i32(1),
9585 Self::ContinuousReplication => serializer.serialize_i32(2),
9586 Self::OnpremReplication => serializer.serialize_i32(3),
9587 Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9588 Self::UnknownValue(u) => u.0.serialize(serializer),
9589 }
9590 }
9591 }
9592
9593 impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9594 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9595 where
9596 D: serde::Deserializer<'de>,
9597 {
9598 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9599 ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9600 ))
9601 }
9602 }
9603}
9604
9605/// HybridPeeringDetails contains details about the hybrid peering.
9606#[derive(Clone, Default, PartialEq)]
9607#[non_exhaustive]
9608pub struct HybridPeeringDetails {
9609 /// Output only. IP address of the subnet.
9610 pub subnet_ip: std::string::String,
9611
9612 /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9613 /// peering requests.
9614 pub command: std::string::String,
9615
9616 /// Output only. Expiration time for the peering command to be executed on
9617 /// user's ONTAP.
9618 pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9619
9620 /// Output only. Temporary passphrase generated to accept cluster peering
9621 /// command.
9622 pub passphrase: std::string::String,
9623
9624 /// Output only. Name of the user's local source volume to be peered with the
9625 /// destination volume.
9626 pub peer_volume_name: std::string::String,
9627
9628 /// Output only. Name of the user's local source cluster to be peered with the
9629 /// destination cluster.
9630 pub peer_cluster_name: std::string::String,
9631
9632 /// Output only. Name of the user's local source vserver svm to be peered with
9633 /// the destination vserver svm.
9634 pub peer_svm_name: std::string::String,
9635
9636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9637}
9638
9639impl HybridPeeringDetails {
9640 pub fn new() -> Self {
9641 std::default::Default::default()
9642 }
9643
9644 /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9645 ///
9646 /// # Example
9647 /// ```ignore,no_run
9648 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9649 /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9650 /// ```
9651 pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9652 self.subnet_ip = v.into();
9653 self
9654 }
9655
9656 /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9657 ///
9658 /// # Example
9659 /// ```ignore,no_run
9660 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9661 /// let x = HybridPeeringDetails::new().set_command("example");
9662 /// ```
9663 pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9664 self.command = v.into();
9665 self
9666 }
9667
9668 /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9669 ///
9670 /// # Example
9671 /// ```ignore,no_run
9672 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9673 /// use wkt::Timestamp;
9674 /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9675 /// ```
9676 pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9677 where
9678 T: std::convert::Into<wkt::Timestamp>,
9679 {
9680 self.command_expiry_time = std::option::Option::Some(v.into());
9681 self
9682 }
9683
9684 /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9685 ///
9686 /// # Example
9687 /// ```ignore,no_run
9688 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9689 /// use wkt::Timestamp;
9690 /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9691 /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9692 /// ```
9693 pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9694 where
9695 T: std::convert::Into<wkt::Timestamp>,
9696 {
9697 self.command_expiry_time = v.map(|x| x.into());
9698 self
9699 }
9700
9701 /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9702 ///
9703 /// # Example
9704 /// ```ignore,no_run
9705 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9706 /// let x = HybridPeeringDetails::new().set_passphrase("example");
9707 /// ```
9708 pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9709 self.passphrase = v.into();
9710 self
9711 }
9712
9713 /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9714 ///
9715 /// # Example
9716 /// ```ignore,no_run
9717 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9718 /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9719 /// ```
9720 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9721 mut self,
9722 v: T,
9723 ) -> Self {
9724 self.peer_volume_name = v.into();
9725 self
9726 }
9727
9728 /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9729 ///
9730 /// # Example
9731 /// ```ignore,no_run
9732 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9733 /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9734 /// ```
9735 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9736 mut self,
9737 v: T,
9738 ) -> Self {
9739 self.peer_cluster_name = v.into();
9740 self
9741 }
9742
9743 /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9744 ///
9745 /// # Example
9746 /// ```ignore,no_run
9747 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9748 /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9749 /// ```
9750 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9751 self.peer_svm_name = v.into();
9752 self
9753 }
9754}
9755
9756impl wkt::message::Message for HybridPeeringDetails {
9757 fn typename() -> &'static str {
9758 "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9759 }
9760}
9761
9762/// ListReplications lists replications.
9763#[derive(Clone, Default, PartialEq)]
9764#[non_exhaustive]
9765pub struct ListReplicationsRequest {
9766 /// Required. The volume for which to retrieve replication information,
9767 /// in the format
9768 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9769 pub parent: std::string::String,
9770
9771 /// The maximum number of items to return.
9772 pub page_size: i32,
9773
9774 /// The next_page_token value to use if there are additional
9775 /// results to retrieve for this list request.
9776 pub page_token: std::string::String,
9777
9778 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9779 pub order_by: std::string::String,
9780
9781 /// List filter.
9782 pub filter: std::string::String,
9783
9784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9785}
9786
9787impl ListReplicationsRequest {
9788 pub fn new() -> Self {
9789 std::default::Default::default()
9790 }
9791
9792 /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9793 ///
9794 /// # Example
9795 /// ```ignore,no_run
9796 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9797 /// let x = ListReplicationsRequest::new().set_parent("example");
9798 /// ```
9799 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9800 self.parent = v.into();
9801 self
9802 }
9803
9804 /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
9805 ///
9806 /// # Example
9807 /// ```ignore,no_run
9808 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9809 /// let x = ListReplicationsRequest::new().set_page_size(42);
9810 /// ```
9811 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9812 self.page_size = v.into();
9813 self
9814 }
9815
9816 /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
9817 ///
9818 /// # Example
9819 /// ```ignore,no_run
9820 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9821 /// let x = ListReplicationsRequest::new().set_page_token("example");
9822 /// ```
9823 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9824 self.page_token = v.into();
9825 self
9826 }
9827
9828 /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
9829 ///
9830 /// # Example
9831 /// ```ignore,no_run
9832 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9833 /// let x = ListReplicationsRequest::new().set_order_by("example");
9834 /// ```
9835 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9836 self.order_by = v.into();
9837 self
9838 }
9839
9840 /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
9841 ///
9842 /// # Example
9843 /// ```ignore,no_run
9844 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9845 /// let x = ListReplicationsRequest::new().set_filter("example");
9846 /// ```
9847 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9848 self.filter = v.into();
9849 self
9850 }
9851}
9852
9853impl wkt::message::Message for ListReplicationsRequest {
9854 fn typename() -> &'static str {
9855 "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
9856 }
9857}
9858
9859/// ListReplicationsResponse is the result of ListReplicationsRequest.
9860#[derive(Clone, Default, PartialEq)]
9861#[non_exhaustive]
9862pub struct ListReplicationsResponse {
9863 /// A list of replications in the project for the specified volume.
9864 pub replications: std::vec::Vec<crate::model::Replication>,
9865
9866 /// The token you can use to retrieve the next page of results. Not returned
9867 /// if there are no more results in the list.
9868 pub next_page_token: std::string::String,
9869
9870 /// Locations that could not be reached.
9871 pub unreachable: std::vec::Vec<std::string::String>,
9872
9873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9874}
9875
9876impl ListReplicationsResponse {
9877 pub fn new() -> Self {
9878 std::default::Default::default()
9879 }
9880
9881 /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
9882 ///
9883 /// # Example
9884 /// ```ignore,no_run
9885 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9886 /// use google_cloud_netapp_v1::model::Replication;
9887 /// let x = ListReplicationsResponse::new()
9888 /// .set_replications([
9889 /// Replication::default()/* use setters */,
9890 /// Replication::default()/* use (different) setters */,
9891 /// ]);
9892 /// ```
9893 pub fn set_replications<T, V>(mut self, v: T) -> Self
9894 where
9895 T: std::iter::IntoIterator<Item = V>,
9896 V: std::convert::Into<crate::model::Replication>,
9897 {
9898 use std::iter::Iterator;
9899 self.replications = v.into_iter().map(|i| i.into()).collect();
9900 self
9901 }
9902
9903 /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
9904 ///
9905 /// # Example
9906 /// ```ignore,no_run
9907 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9908 /// let x = ListReplicationsResponse::new().set_next_page_token("example");
9909 /// ```
9910 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9911 self.next_page_token = v.into();
9912 self
9913 }
9914
9915 /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
9916 ///
9917 /// # Example
9918 /// ```ignore,no_run
9919 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9920 /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
9921 /// ```
9922 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9923 where
9924 T: std::iter::IntoIterator<Item = V>,
9925 V: std::convert::Into<std::string::String>,
9926 {
9927 use std::iter::Iterator;
9928 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9929 self
9930 }
9931}
9932
9933impl wkt::message::Message for ListReplicationsResponse {
9934 fn typename() -> &'static str {
9935 "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
9936 }
9937}
9938
9939#[doc(hidden)]
9940impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
9941 type PageItem = crate::model::Replication;
9942
9943 fn items(self) -> std::vec::Vec<Self::PageItem> {
9944 self.replications
9945 }
9946
9947 fn next_page_token(&self) -> std::string::String {
9948 use std::clone::Clone;
9949 self.next_page_token.clone()
9950 }
9951}
9952
9953/// GetReplicationRequest gets the state of a replication.
9954#[derive(Clone, Default, PartialEq)]
9955#[non_exhaustive]
9956pub struct GetReplicationRequest {
9957 /// Required. The replication resource name, in the format
9958 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
9959 pub name: std::string::String,
9960
9961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9962}
9963
9964impl GetReplicationRequest {
9965 pub fn new() -> Self {
9966 std::default::Default::default()
9967 }
9968
9969 /// Sets the value of [name][crate::model::GetReplicationRequest::name].
9970 ///
9971 /// # Example
9972 /// ```ignore,no_run
9973 /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
9974 /// let x = GetReplicationRequest::new().set_name("example");
9975 /// ```
9976 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9977 self.name = v.into();
9978 self
9979 }
9980}
9981
9982impl wkt::message::Message for GetReplicationRequest {
9983 fn typename() -> &'static str {
9984 "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
9985 }
9986}
9987
9988/// DestinationVolumeParameters specify input parameters used for creating
9989/// destination volume.
9990#[derive(Clone, Default, PartialEq)]
9991#[non_exhaustive]
9992pub struct DestinationVolumeParameters {
9993 /// Required. Existing destination StoragePool name.
9994 pub storage_pool: std::string::String,
9995
9996 /// Desired destination volume resource id. If not specified, source volume's
9997 /// resource id will be used.
9998 /// This value must start with a lowercase letter followed by up to 62
9999 /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
10000 pub volume_id: std::string::String,
10001
10002 /// Destination volume's share name. If not specified, source volume's share
10003 /// name will be used.
10004 pub share_name: std::string::String,
10005
10006 /// Description for the destination volume.
10007 pub description: std::option::Option<std::string::String>,
10008
10009 /// Optional. Tiering policy for the volume.
10010 pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
10011
10012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10013}
10014
10015impl DestinationVolumeParameters {
10016 pub fn new() -> Self {
10017 std::default::Default::default()
10018 }
10019
10020 /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
10021 ///
10022 /// # Example
10023 /// ```ignore,no_run
10024 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10025 /// let x = DestinationVolumeParameters::new().set_storage_pool("example");
10026 /// ```
10027 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10028 self.storage_pool = v.into();
10029 self
10030 }
10031
10032 /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
10033 ///
10034 /// # Example
10035 /// ```ignore,no_run
10036 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10037 /// let x = DestinationVolumeParameters::new().set_volume_id("example");
10038 /// ```
10039 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10040 self.volume_id = v.into();
10041 self
10042 }
10043
10044 /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
10045 ///
10046 /// # Example
10047 /// ```ignore,no_run
10048 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10049 /// let x = DestinationVolumeParameters::new().set_share_name("example");
10050 /// ```
10051 pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10052 self.share_name = v.into();
10053 self
10054 }
10055
10056 /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
10057 ///
10058 /// # Example
10059 /// ```ignore,no_run
10060 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10061 /// let x = DestinationVolumeParameters::new().set_description("example");
10062 /// ```
10063 pub fn set_description<T>(mut self, v: T) -> Self
10064 where
10065 T: std::convert::Into<std::string::String>,
10066 {
10067 self.description = std::option::Option::Some(v.into());
10068 self
10069 }
10070
10071 /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
10072 ///
10073 /// # Example
10074 /// ```ignore,no_run
10075 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10076 /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
10077 /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
10078 /// ```
10079 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
10080 where
10081 T: std::convert::Into<std::string::String>,
10082 {
10083 self.description = v.map(|x| x.into());
10084 self
10085 }
10086
10087 /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10088 ///
10089 /// # Example
10090 /// ```ignore,no_run
10091 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10092 /// use google_cloud_netapp_v1::model::TieringPolicy;
10093 /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
10094 /// ```
10095 pub fn set_tiering_policy<T>(mut self, v: T) -> Self
10096 where
10097 T: std::convert::Into<crate::model::TieringPolicy>,
10098 {
10099 self.tiering_policy = std::option::Option::Some(v.into());
10100 self
10101 }
10102
10103 /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10104 ///
10105 /// # Example
10106 /// ```ignore,no_run
10107 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10108 /// use google_cloud_netapp_v1::model::TieringPolicy;
10109 /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
10110 /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
10111 /// ```
10112 pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
10113 where
10114 T: std::convert::Into<crate::model::TieringPolicy>,
10115 {
10116 self.tiering_policy = v.map(|x| x.into());
10117 self
10118 }
10119}
10120
10121impl wkt::message::Message for DestinationVolumeParameters {
10122 fn typename() -> &'static str {
10123 "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
10124 }
10125}
10126
10127/// CreateReplicationRequest creates a replication.
10128#[derive(Clone, Default, PartialEq)]
10129#[non_exhaustive]
10130pub struct CreateReplicationRequest {
10131 /// Required. The NetApp volume to create the replications of, in the format
10132 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10133 pub parent: std::string::String,
10134
10135 /// Required. A replication resource
10136 pub replication: std::option::Option<crate::model::Replication>,
10137
10138 /// Required. ID of the replication to create. Must be unique within the parent
10139 /// resource. Must contain only letters, numbers and hyphen, with the first
10140 /// character a letter, the last a letter or a
10141 /// number, and a 63 character maximum.
10142 pub replication_id: std::string::String,
10143
10144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10145}
10146
10147impl CreateReplicationRequest {
10148 pub fn new() -> Self {
10149 std::default::Default::default()
10150 }
10151
10152 /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
10153 ///
10154 /// # Example
10155 /// ```ignore,no_run
10156 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10157 /// let x = CreateReplicationRequest::new().set_parent("example");
10158 /// ```
10159 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10160 self.parent = v.into();
10161 self
10162 }
10163
10164 /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
10165 ///
10166 /// # Example
10167 /// ```ignore,no_run
10168 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10169 /// use google_cloud_netapp_v1::model::Replication;
10170 /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10171 /// ```
10172 pub fn set_replication<T>(mut self, v: T) -> Self
10173 where
10174 T: std::convert::Into<crate::model::Replication>,
10175 {
10176 self.replication = std::option::Option::Some(v.into());
10177 self
10178 }
10179
10180 /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
10181 ///
10182 /// # Example
10183 /// ```ignore,no_run
10184 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10185 /// use google_cloud_netapp_v1::model::Replication;
10186 /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10187 /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10188 /// ```
10189 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10190 where
10191 T: std::convert::Into<crate::model::Replication>,
10192 {
10193 self.replication = v.map(|x| x.into());
10194 self
10195 }
10196
10197 /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
10198 ///
10199 /// # Example
10200 /// ```ignore,no_run
10201 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10202 /// let x = CreateReplicationRequest::new().set_replication_id("example");
10203 /// ```
10204 pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10205 self.replication_id = v.into();
10206 self
10207 }
10208}
10209
10210impl wkt::message::Message for CreateReplicationRequest {
10211 fn typename() -> &'static str {
10212 "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
10213 }
10214}
10215
10216/// DeleteReplicationRequest deletes a replication.
10217#[derive(Clone, Default, PartialEq)]
10218#[non_exhaustive]
10219pub struct DeleteReplicationRequest {
10220 /// Required. The replication resource name, in the format
10221 /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
10222 pub name: std::string::String,
10223
10224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10225}
10226
10227impl DeleteReplicationRequest {
10228 pub fn new() -> Self {
10229 std::default::Default::default()
10230 }
10231
10232 /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
10233 ///
10234 /// # Example
10235 /// ```ignore,no_run
10236 /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
10237 /// let x = DeleteReplicationRequest::new().set_name("example");
10238 /// ```
10239 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10240 self.name = v.into();
10241 self
10242 }
10243}
10244
10245impl wkt::message::Message for DeleteReplicationRequest {
10246 fn typename() -> &'static str {
10247 "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
10248 }
10249}
10250
10251/// UpdateReplicationRequest updates description and/or labels for a replication.
10252#[derive(Clone, Default, PartialEq)]
10253#[non_exhaustive]
10254pub struct UpdateReplicationRequest {
10255 /// Required. Mask of fields to update. At least one path must be supplied in
10256 /// this field.
10257 pub update_mask: std::option::Option<wkt::FieldMask>,
10258
10259 /// Required. A replication resource
10260 pub replication: std::option::Option<crate::model::Replication>,
10261
10262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10263}
10264
10265impl UpdateReplicationRequest {
10266 pub fn new() -> Self {
10267 std::default::Default::default()
10268 }
10269
10270 /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10271 ///
10272 /// # Example
10273 /// ```ignore,no_run
10274 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10275 /// use wkt::FieldMask;
10276 /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10277 /// ```
10278 pub fn set_update_mask<T>(mut self, v: T) -> Self
10279 where
10280 T: std::convert::Into<wkt::FieldMask>,
10281 {
10282 self.update_mask = std::option::Option::Some(v.into());
10283 self
10284 }
10285
10286 /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10287 ///
10288 /// # Example
10289 /// ```ignore,no_run
10290 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10291 /// use wkt::FieldMask;
10292 /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10293 /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10294 /// ```
10295 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10296 where
10297 T: std::convert::Into<wkt::FieldMask>,
10298 {
10299 self.update_mask = v.map(|x| x.into());
10300 self
10301 }
10302
10303 /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
10304 ///
10305 /// # Example
10306 /// ```ignore,no_run
10307 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10308 /// use google_cloud_netapp_v1::model::Replication;
10309 /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10310 /// ```
10311 pub fn set_replication<T>(mut self, v: T) -> Self
10312 where
10313 T: std::convert::Into<crate::model::Replication>,
10314 {
10315 self.replication = std::option::Option::Some(v.into());
10316 self
10317 }
10318
10319 /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
10320 ///
10321 /// # Example
10322 /// ```ignore,no_run
10323 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10324 /// use google_cloud_netapp_v1::model::Replication;
10325 /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10326 /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10327 /// ```
10328 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10329 where
10330 T: std::convert::Into<crate::model::Replication>,
10331 {
10332 self.replication = v.map(|x| x.into());
10333 self
10334 }
10335}
10336
10337impl wkt::message::Message for UpdateReplicationRequest {
10338 fn typename() -> &'static str {
10339 "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
10340 }
10341}
10342
10343/// StopReplicationRequest stops a replication until resumed.
10344#[derive(Clone, Default, PartialEq)]
10345#[non_exhaustive]
10346pub struct StopReplicationRequest {
10347 /// Required. The resource name of the replication, in the format of
10348 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10349 pub name: std::string::String,
10350
10351 /// Indicates whether to stop replication forcefully while data transfer is in
10352 /// progress.
10353 /// Warning! if force is true, this will abort any current transfers
10354 /// and can lead to data loss due to partial transfer.
10355 /// If force is false, stop replication will fail while data transfer is in
10356 /// progress and you will need to retry later.
10357 pub force: bool,
10358
10359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10360}
10361
10362impl StopReplicationRequest {
10363 pub fn new() -> Self {
10364 std::default::Default::default()
10365 }
10366
10367 /// Sets the value of [name][crate::model::StopReplicationRequest::name].
10368 ///
10369 /// # Example
10370 /// ```ignore,no_run
10371 /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10372 /// let x = StopReplicationRequest::new().set_name("example");
10373 /// ```
10374 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10375 self.name = v.into();
10376 self
10377 }
10378
10379 /// Sets the value of [force][crate::model::StopReplicationRequest::force].
10380 ///
10381 /// # Example
10382 /// ```ignore,no_run
10383 /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10384 /// let x = StopReplicationRequest::new().set_force(true);
10385 /// ```
10386 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10387 self.force = v.into();
10388 self
10389 }
10390}
10391
10392impl wkt::message::Message for StopReplicationRequest {
10393 fn typename() -> &'static str {
10394 "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
10395 }
10396}
10397
10398/// ResumeReplicationRequest resumes a stopped replication.
10399#[derive(Clone, Default, PartialEq)]
10400#[non_exhaustive]
10401pub struct ResumeReplicationRequest {
10402 /// Required. The resource name of the replication, in the format of
10403 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10404 pub name: std::string::String,
10405
10406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10407}
10408
10409impl ResumeReplicationRequest {
10410 pub fn new() -> Self {
10411 std::default::Default::default()
10412 }
10413
10414 /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
10415 ///
10416 /// # Example
10417 /// ```ignore,no_run
10418 /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
10419 /// let x = ResumeReplicationRequest::new().set_name("example");
10420 /// ```
10421 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10422 self.name = v.into();
10423 self
10424 }
10425}
10426
10427impl wkt::message::Message for ResumeReplicationRequest {
10428 fn typename() -> &'static str {
10429 "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
10430 }
10431}
10432
10433/// ReverseReplicationDirectionRequest reverses direction of replication. Source
10434/// becomes destination and destination becomes source.
10435#[derive(Clone, Default, PartialEq)]
10436#[non_exhaustive]
10437pub struct ReverseReplicationDirectionRequest {
10438 /// Required. The resource name of the replication, in the format of
10439 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10440 pub name: std::string::String,
10441
10442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10443}
10444
10445impl ReverseReplicationDirectionRequest {
10446 pub fn new() -> Self {
10447 std::default::Default::default()
10448 }
10449
10450 /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
10451 ///
10452 /// # Example
10453 /// ```ignore,no_run
10454 /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
10455 /// let x = ReverseReplicationDirectionRequest::new().set_name("example");
10456 /// ```
10457 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10458 self.name = v.into();
10459 self
10460 }
10461}
10462
10463impl wkt::message::Message for ReverseReplicationDirectionRequest {
10464 fn typename() -> &'static str {
10465 "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
10466 }
10467}
10468
10469/// EstablishPeeringRequest establishes cluster and svm peerings between the
10470/// source and the destination replications.
10471#[derive(Clone, Default, PartialEq)]
10472#[non_exhaustive]
10473pub struct EstablishPeeringRequest {
10474 /// Required. The resource name of the replication, in the format of
10475 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10476 pub name: std::string::String,
10477
10478 /// Required. Name of the user's local source cluster to be peered with the
10479 /// destination cluster.
10480 pub peer_cluster_name: std::string::String,
10481
10482 /// Required. Name of the user's local source vserver svm to be peered with the
10483 /// destination vserver svm.
10484 pub peer_svm_name: std::string::String,
10485
10486 /// Optional. List of IPv4 ip addresses to be used for peering.
10487 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10488
10489 /// Required. Name of the user's local source volume to be peered with the
10490 /// destination volume.
10491 pub peer_volume_name: std::string::String,
10492
10493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10494}
10495
10496impl EstablishPeeringRequest {
10497 pub fn new() -> Self {
10498 std::default::Default::default()
10499 }
10500
10501 /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10502 ///
10503 /// # Example
10504 /// ```ignore,no_run
10505 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10506 /// let x = EstablishPeeringRequest::new().set_name("example");
10507 /// ```
10508 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10509 self.name = v.into();
10510 self
10511 }
10512
10513 /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10514 ///
10515 /// # Example
10516 /// ```ignore,no_run
10517 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10518 /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10519 /// ```
10520 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10521 mut self,
10522 v: T,
10523 ) -> Self {
10524 self.peer_cluster_name = v.into();
10525 self
10526 }
10527
10528 /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10529 ///
10530 /// # Example
10531 /// ```ignore,no_run
10532 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10533 /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10534 /// ```
10535 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10536 self.peer_svm_name = v.into();
10537 self
10538 }
10539
10540 /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10541 ///
10542 /// # Example
10543 /// ```ignore,no_run
10544 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10545 /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10546 /// ```
10547 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10548 where
10549 T: std::iter::IntoIterator<Item = V>,
10550 V: std::convert::Into<std::string::String>,
10551 {
10552 use std::iter::Iterator;
10553 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10554 self
10555 }
10556
10557 /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10558 ///
10559 /// # Example
10560 /// ```ignore,no_run
10561 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10562 /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10563 /// ```
10564 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10565 mut self,
10566 v: T,
10567 ) -> Self {
10568 self.peer_volume_name = v.into();
10569 self
10570 }
10571}
10572
10573impl wkt::message::Message for EstablishPeeringRequest {
10574 fn typename() -> &'static str {
10575 "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10576 }
10577}
10578
10579/// SyncReplicationRequest syncs the replication from source to destination.
10580#[derive(Clone, Default, PartialEq)]
10581#[non_exhaustive]
10582pub struct SyncReplicationRequest {
10583 /// Required. The resource name of the replication, in the format of
10584 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10585 pub name: std::string::String,
10586
10587 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10588}
10589
10590impl SyncReplicationRequest {
10591 pub fn new() -> Self {
10592 std::default::Default::default()
10593 }
10594
10595 /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10596 ///
10597 /// # Example
10598 /// ```ignore,no_run
10599 /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10600 /// let x = SyncReplicationRequest::new().set_name("example");
10601 /// ```
10602 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10603 self.name = v.into();
10604 self
10605 }
10606}
10607
10608impl wkt::message::Message for SyncReplicationRequest {
10609 fn typename() -> &'static str {
10610 "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10611 }
10612}
10613
10614/// ListSnapshotsRequest lists snapshots.
10615#[derive(Clone, Default, PartialEq)]
10616#[non_exhaustive]
10617pub struct ListSnapshotsRequest {
10618 /// Required. The volume for which to retrieve snapshot information,
10619 /// in the format
10620 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10621 pub parent: std::string::String,
10622
10623 /// The maximum number of items to return.
10624 pub page_size: i32,
10625
10626 /// The next_page_token value to use if there are additional
10627 /// results to retrieve for this list request.
10628 pub page_token: std::string::String,
10629
10630 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10631 pub order_by: std::string::String,
10632
10633 /// List filter.
10634 pub filter: std::string::String,
10635
10636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10637}
10638
10639impl ListSnapshotsRequest {
10640 pub fn new() -> Self {
10641 std::default::Default::default()
10642 }
10643
10644 /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10645 ///
10646 /// # Example
10647 /// ```ignore,no_run
10648 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10649 /// let x = ListSnapshotsRequest::new().set_parent("example");
10650 /// ```
10651 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10652 self.parent = v.into();
10653 self
10654 }
10655
10656 /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10657 ///
10658 /// # Example
10659 /// ```ignore,no_run
10660 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10661 /// let x = ListSnapshotsRequest::new().set_page_size(42);
10662 /// ```
10663 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10664 self.page_size = v.into();
10665 self
10666 }
10667
10668 /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10669 ///
10670 /// # Example
10671 /// ```ignore,no_run
10672 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10673 /// let x = ListSnapshotsRequest::new().set_page_token("example");
10674 /// ```
10675 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10676 self.page_token = v.into();
10677 self
10678 }
10679
10680 /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10681 ///
10682 /// # Example
10683 /// ```ignore,no_run
10684 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10685 /// let x = ListSnapshotsRequest::new().set_order_by("example");
10686 /// ```
10687 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10688 self.order_by = v.into();
10689 self
10690 }
10691
10692 /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10693 ///
10694 /// # Example
10695 /// ```ignore,no_run
10696 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10697 /// let x = ListSnapshotsRequest::new().set_filter("example");
10698 /// ```
10699 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10700 self.filter = v.into();
10701 self
10702 }
10703}
10704
10705impl wkt::message::Message for ListSnapshotsRequest {
10706 fn typename() -> &'static str {
10707 "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10708 }
10709}
10710
10711/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10712#[derive(Clone, Default, PartialEq)]
10713#[non_exhaustive]
10714pub struct ListSnapshotsResponse {
10715 /// A list of snapshots in the project for the specified volume.
10716 pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10717
10718 /// The token you can use to retrieve the next page of results. Not returned
10719 /// if there are no more results in the list.
10720 pub next_page_token: std::string::String,
10721
10722 /// Locations that could not be reached.
10723 pub unreachable: std::vec::Vec<std::string::String>,
10724
10725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10726}
10727
10728impl ListSnapshotsResponse {
10729 pub fn new() -> Self {
10730 std::default::Default::default()
10731 }
10732
10733 /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10734 ///
10735 /// # Example
10736 /// ```ignore,no_run
10737 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10738 /// use google_cloud_netapp_v1::model::Snapshot;
10739 /// let x = ListSnapshotsResponse::new()
10740 /// .set_snapshots([
10741 /// Snapshot::default()/* use setters */,
10742 /// Snapshot::default()/* use (different) setters */,
10743 /// ]);
10744 /// ```
10745 pub fn set_snapshots<T, V>(mut self, v: T) -> Self
10746 where
10747 T: std::iter::IntoIterator<Item = V>,
10748 V: std::convert::Into<crate::model::Snapshot>,
10749 {
10750 use std::iter::Iterator;
10751 self.snapshots = v.into_iter().map(|i| i.into()).collect();
10752 self
10753 }
10754
10755 /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
10756 ///
10757 /// # Example
10758 /// ```ignore,no_run
10759 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10760 /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
10761 /// ```
10762 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10763 self.next_page_token = v.into();
10764 self
10765 }
10766
10767 /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
10768 ///
10769 /// # Example
10770 /// ```ignore,no_run
10771 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10772 /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
10773 /// ```
10774 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10775 where
10776 T: std::iter::IntoIterator<Item = V>,
10777 V: std::convert::Into<std::string::String>,
10778 {
10779 use std::iter::Iterator;
10780 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10781 self
10782 }
10783}
10784
10785impl wkt::message::Message for ListSnapshotsResponse {
10786 fn typename() -> &'static str {
10787 "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
10788 }
10789}
10790
10791#[doc(hidden)]
10792impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
10793 type PageItem = crate::model::Snapshot;
10794
10795 fn items(self) -> std::vec::Vec<Self::PageItem> {
10796 self.snapshots
10797 }
10798
10799 fn next_page_token(&self) -> std::string::String {
10800 use std::clone::Clone;
10801 self.next_page_token.clone()
10802 }
10803}
10804
10805/// GetSnapshotRequest gets the state of a snapshot.
10806#[derive(Clone, Default, PartialEq)]
10807#[non_exhaustive]
10808pub struct GetSnapshotRequest {
10809 /// Required. The snapshot resource name, in the format
10810 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
10811 pub name: std::string::String,
10812
10813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10814}
10815
10816impl GetSnapshotRequest {
10817 pub fn new() -> Self {
10818 std::default::Default::default()
10819 }
10820
10821 /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
10822 ///
10823 /// # Example
10824 /// ```ignore,no_run
10825 /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
10826 /// let x = GetSnapshotRequest::new().set_name("example");
10827 /// ```
10828 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10829 self.name = v.into();
10830 self
10831 }
10832}
10833
10834impl wkt::message::Message for GetSnapshotRequest {
10835 fn typename() -> &'static str {
10836 "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
10837 }
10838}
10839
10840/// CreateSnapshotRequest creates a snapshot.
10841#[derive(Clone, Default, PartialEq)]
10842#[non_exhaustive]
10843pub struct CreateSnapshotRequest {
10844 /// Required. The NetApp volume to create the snapshots of, in the format
10845 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10846 pub parent: std::string::String,
10847
10848 /// Required. A snapshot resource
10849 pub snapshot: std::option::Option<crate::model::Snapshot>,
10850
10851 /// Required. ID of the snapshot to create. Must be unique within the parent
10852 /// resource. Must contain only letters, numbers and hyphen, with the first
10853 /// character a letter, the last a letter or a
10854 /// number, and a 63 character maximum.
10855 pub snapshot_id: std::string::String,
10856
10857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10858}
10859
10860impl CreateSnapshotRequest {
10861 pub fn new() -> Self {
10862 std::default::Default::default()
10863 }
10864
10865 /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
10866 ///
10867 /// # Example
10868 /// ```ignore,no_run
10869 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10870 /// let x = CreateSnapshotRequest::new().set_parent("example");
10871 /// ```
10872 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10873 self.parent = v.into();
10874 self
10875 }
10876
10877 /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10878 ///
10879 /// # Example
10880 /// ```ignore,no_run
10881 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10882 /// use google_cloud_netapp_v1::model::Snapshot;
10883 /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10884 /// ```
10885 pub fn set_snapshot<T>(mut self, v: T) -> Self
10886 where
10887 T: std::convert::Into<crate::model::Snapshot>,
10888 {
10889 self.snapshot = std::option::Option::Some(v.into());
10890 self
10891 }
10892
10893 /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10894 ///
10895 /// # Example
10896 /// ```ignore,no_run
10897 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10898 /// use google_cloud_netapp_v1::model::Snapshot;
10899 /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10900 /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10901 /// ```
10902 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10903 where
10904 T: std::convert::Into<crate::model::Snapshot>,
10905 {
10906 self.snapshot = v.map(|x| x.into());
10907 self
10908 }
10909
10910 /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
10911 ///
10912 /// # Example
10913 /// ```ignore,no_run
10914 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10915 /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
10916 /// ```
10917 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10918 self.snapshot_id = v.into();
10919 self
10920 }
10921}
10922
10923impl wkt::message::Message for CreateSnapshotRequest {
10924 fn typename() -> &'static str {
10925 "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
10926 }
10927}
10928
10929/// DeleteSnapshotRequest deletes a snapshot.
10930#[derive(Clone, Default, PartialEq)]
10931#[non_exhaustive]
10932pub struct DeleteSnapshotRequest {
10933 /// Required. The snapshot resource name, in the format
10934 /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
10935 pub name: std::string::String,
10936
10937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10938}
10939
10940impl DeleteSnapshotRequest {
10941 pub fn new() -> Self {
10942 std::default::Default::default()
10943 }
10944
10945 /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
10946 ///
10947 /// # Example
10948 /// ```ignore,no_run
10949 /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
10950 /// let x = DeleteSnapshotRequest::new().set_name("example");
10951 /// ```
10952 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10953 self.name = v.into();
10954 self
10955 }
10956}
10957
10958impl wkt::message::Message for DeleteSnapshotRequest {
10959 fn typename() -> &'static str {
10960 "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
10961 }
10962}
10963
10964/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
10965#[derive(Clone, Default, PartialEq)]
10966#[non_exhaustive]
10967pub struct UpdateSnapshotRequest {
10968 /// Required. Mask of fields to update. At least one path must be supplied in
10969 /// this field.
10970 pub update_mask: std::option::Option<wkt::FieldMask>,
10971
10972 /// Required. A snapshot resource
10973 pub snapshot: std::option::Option<crate::model::Snapshot>,
10974
10975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10976}
10977
10978impl UpdateSnapshotRequest {
10979 pub fn new() -> Self {
10980 std::default::Default::default()
10981 }
10982
10983 /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10984 ///
10985 /// # Example
10986 /// ```ignore,no_run
10987 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10988 /// use wkt::FieldMask;
10989 /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10990 /// ```
10991 pub fn set_update_mask<T>(mut self, v: T) -> Self
10992 where
10993 T: std::convert::Into<wkt::FieldMask>,
10994 {
10995 self.update_mask = std::option::Option::Some(v.into());
10996 self
10997 }
10998
10999 /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11000 ///
11001 /// # Example
11002 /// ```ignore,no_run
11003 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11004 /// use wkt::FieldMask;
11005 /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11006 /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11007 /// ```
11008 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11009 where
11010 T: std::convert::Into<wkt::FieldMask>,
11011 {
11012 self.update_mask = v.map(|x| x.into());
11013 self
11014 }
11015
11016 /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11017 ///
11018 /// # Example
11019 /// ```ignore,no_run
11020 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11021 /// use google_cloud_netapp_v1::model::Snapshot;
11022 /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
11023 /// ```
11024 pub fn set_snapshot<T>(mut self, v: T) -> Self
11025 where
11026 T: std::convert::Into<crate::model::Snapshot>,
11027 {
11028 self.snapshot = std::option::Option::Some(v.into());
11029 self
11030 }
11031
11032 /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11033 ///
11034 /// # Example
11035 /// ```ignore,no_run
11036 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11037 /// use google_cloud_netapp_v1::model::Snapshot;
11038 /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
11039 /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
11040 /// ```
11041 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
11042 where
11043 T: std::convert::Into<crate::model::Snapshot>,
11044 {
11045 self.snapshot = v.map(|x| x.into());
11046 self
11047 }
11048}
11049
11050impl wkt::message::Message for UpdateSnapshotRequest {
11051 fn typename() -> &'static str {
11052 "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
11053 }
11054}
11055
11056/// Snapshot is a point-in-time version of a Volume's content.
11057#[derive(Clone, Default, PartialEq)]
11058#[non_exhaustive]
11059pub struct Snapshot {
11060 /// Identifier. The resource name of the snapshot.
11061 /// Format:
11062 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
11063 pub name: std::string::String,
11064
11065 /// Output only. The snapshot state.
11066 pub state: crate::model::snapshot::State,
11067
11068 /// Output only. State details of the storage pool
11069 pub state_details: std::string::String,
11070
11071 /// A description of the snapshot with 2048 characters or less.
11072 /// Requests with longer descriptions will be rejected.
11073 pub description: std::string::String,
11074
11075 /// Output only. Current storage usage for the snapshot in bytes.
11076 pub used_bytes: f64,
11077
11078 /// Output only. The time when the snapshot was created.
11079 pub create_time: std::option::Option<wkt::Timestamp>,
11080
11081 /// Resource labels to represent user provided metadata.
11082 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11083
11084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11085}
11086
11087impl Snapshot {
11088 pub fn new() -> Self {
11089 std::default::Default::default()
11090 }
11091
11092 /// Sets the value of [name][crate::model::Snapshot::name].
11093 ///
11094 /// # Example
11095 /// ```ignore,no_run
11096 /// # use google_cloud_netapp_v1::model::Snapshot;
11097 /// let x = Snapshot::new().set_name("example");
11098 /// ```
11099 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11100 self.name = v.into();
11101 self
11102 }
11103
11104 /// Sets the value of [state][crate::model::Snapshot::state].
11105 ///
11106 /// # Example
11107 /// ```ignore,no_run
11108 /// # use google_cloud_netapp_v1::model::Snapshot;
11109 /// use google_cloud_netapp_v1::model::snapshot::State;
11110 /// let x0 = Snapshot::new().set_state(State::Ready);
11111 /// let x1 = Snapshot::new().set_state(State::Creating);
11112 /// let x2 = Snapshot::new().set_state(State::Deleting);
11113 /// ```
11114 pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
11115 self.state = v.into();
11116 self
11117 }
11118
11119 /// Sets the value of [state_details][crate::model::Snapshot::state_details].
11120 ///
11121 /// # Example
11122 /// ```ignore,no_run
11123 /// # use google_cloud_netapp_v1::model::Snapshot;
11124 /// let x = Snapshot::new().set_state_details("example");
11125 /// ```
11126 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11127 self.state_details = v.into();
11128 self
11129 }
11130
11131 /// Sets the value of [description][crate::model::Snapshot::description].
11132 ///
11133 /// # Example
11134 /// ```ignore,no_run
11135 /// # use google_cloud_netapp_v1::model::Snapshot;
11136 /// let x = Snapshot::new().set_description("example");
11137 /// ```
11138 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11139 self.description = v.into();
11140 self
11141 }
11142
11143 /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
11144 ///
11145 /// # Example
11146 /// ```ignore,no_run
11147 /// # use google_cloud_netapp_v1::model::Snapshot;
11148 /// let x = Snapshot::new().set_used_bytes(42.0);
11149 /// ```
11150 pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11151 self.used_bytes = v.into();
11152 self
11153 }
11154
11155 /// Sets the value of [create_time][crate::model::Snapshot::create_time].
11156 ///
11157 /// # Example
11158 /// ```ignore,no_run
11159 /// # use google_cloud_netapp_v1::model::Snapshot;
11160 /// use wkt::Timestamp;
11161 /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
11162 /// ```
11163 pub fn set_create_time<T>(mut self, v: T) -> Self
11164 where
11165 T: std::convert::Into<wkt::Timestamp>,
11166 {
11167 self.create_time = std::option::Option::Some(v.into());
11168 self
11169 }
11170
11171 /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
11172 ///
11173 /// # Example
11174 /// ```ignore,no_run
11175 /// # use google_cloud_netapp_v1::model::Snapshot;
11176 /// use wkt::Timestamp;
11177 /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11178 /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
11179 /// ```
11180 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11181 where
11182 T: std::convert::Into<wkt::Timestamp>,
11183 {
11184 self.create_time = v.map(|x| x.into());
11185 self
11186 }
11187
11188 /// Sets the value of [labels][crate::model::Snapshot::labels].
11189 ///
11190 /// # Example
11191 /// ```ignore,no_run
11192 /// # use google_cloud_netapp_v1::model::Snapshot;
11193 /// let x = Snapshot::new().set_labels([
11194 /// ("key0", "abc"),
11195 /// ("key1", "xyz"),
11196 /// ]);
11197 /// ```
11198 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11199 where
11200 T: std::iter::IntoIterator<Item = (K, V)>,
11201 K: std::convert::Into<std::string::String>,
11202 V: std::convert::Into<std::string::String>,
11203 {
11204 use std::iter::Iterator;
11205 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11206 self
11207 }
11208}
11209
11210impl wkt::message::Message for Snapshot {
11211 fn typename() -> &'static str {
11212 "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
11213 }
11214}
11215
11216/// Defines additional types related to [Snapshot].
11217pub mod snapshot {
11218 #[allow(unused_imports)]
11219 use super::*;
11220
11221 /// The Snapshot States
11222 ///
11223 /// # Working with unknown values
11224 ///
11225 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11226 /// additional enum variants at any time. Adding new variants is not considered
11227 /// a breaking change. Applications should write their code in anticipation of:
11228 ///
11229 /// - New values appearing in future releases of the client library, **and**
11230 /// - New values received dynamically, without application changes.
11231 ///
11232 /// Please consult the [Working with enums] section in the user guide for some
11233 /// guidelines.
11234 ///
11235 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11236 #[derive(Clone, Debug, PartialEq)]
11237 #[non_exhaustive]
11238 pub enum State {
11239 /// Unspecified Snapshot State
11240 Unspecified,
11241 /// Snapshot State is Ready
11242 Ready,
11243 /// Snapshot State is Creating
11244 Creating,
11245 /// Snapshot State is Deleting
11246 Deleting,
11247 /// Snapshot State is Updating
11248 Updating,
11249 /// Snapshot State is Disabled
11250 Disabled,
11251 /// Snapshot State is Error
11252 Error,
11253 /// If set, the enum was initialized with an unknown value.
11254 ///
11255 /// Applications can examine the value using [State::value] or
11256 /// [State::name].
11257 UnknownValue(state::UnknownValue),
11258 }
11259
11260 #[doc(hidden)]
11261 pub mod state {
11262 #[allow(unused_imports)]
11263 use super::*;
11264 #[derive(Clone, Debug, PartialEq)]
11265 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11266 }
11267
11268 impl State {
11269 /// Gets the enum value.
11270 ///
11271 /// Returns `None` if the enum contains an unknown value deserialized from
11272 /// the string representation of enums.
11273 pub fn value(&self) -> std::option::Option<i32> {
11274 match self {
11275 Self::Unspecified => std::option::Option::Some(0),
11276 Self::Ready => std::option::Option::Some(1),
11277 Self::Creating => std::option::Option::Some(2),
11278 Self::Deleting => std::option::Option::Some(3),
11279 Self::Updating => std::option::Option::Some(4),
11280 Self::Disabled => std::option::Option::Some(5),
11281 Self::Error => std::option::Option::Some(6),
11282 Self::UnknownValue(u) => u.0.value(),
11283 }
11284 }
11285
11286 /// Gets the enum value as a string.
11287 ///
11288 /// Returns `None` if the enum contains an unknown value deserialized from
11289 /// the integer representation of enums.
11290 pub fn name(&self) -> std::option::Option<&str> {
11291 match self {
11292 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11293 Self::Ready => std::option::Option::Some("READY"),
11294 Self::Creating => std::option::Option::Some("CREATING"),
11295 Self::Deleting => std::option::Option::Some("DELETING"),
11296 Self::Updating => std::option::Option::Some("UPDATING"),
11297 Self::Disabled => std::option::Option::Some("DISABLED"),
11298 Self::Error => std::option::Option::Some("ERROR"),
11299 Self::UnknownValue(u) => u.0.name(),
11300 }
11301 }
11302 }
11303
11304 impl std::default::Default for State {
11305 fn default() -> Self {
11306 use std::convert::From;
11307 Self::from(0)
11308 }
11309 }
11310
11311 impl std::fmt::Display for State {
11312 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11313 wkt::internal::display_enum(f, self.name(), self.value())
11314 }
11315 }
11316
11317 impl std::convert::From<i32> for State {
11318 fn from(value: i32) -> Self {
11319 match value {
11320 0 => Self::Unspecified,
11321 1 => Self::Ready,
11322 2 => Self::Creating,
11323 3 => Self::Deleting,
11324 4 => Self::Updating,
11325 5 => Self::Disabled,
11326 6 => Self::Error,
11327 _ => Self::UnknownValue(state::UnknownValue(
11328 wkt::internal::UnknownEnumValue::Integer(value),
11329 )),
11330 }
11331 }
11332 }
11333
11334 impl std::convert::From<&str> for State {
11335 fn from(value: &str) -> Self {
11336 use std::string::ToString;
11337 match value {
11338 "STATE_UNSPECIFIED" => Self::Unspecified,
11339 "READY" => Self::Ready,
11340 "CREATING" => Self::Creating,
11341 "DELETING" => Self::Deleting,
11342 "UPDATING" => Self::Updating,
11343 "DISABLED" => Self::Disabled,
11344 "ERROR" => Self::Error,
11345 _ => Self::UnknownValue(state::UnknownValue(
11346 wkt::internal::UnknownEnumValue::String(value.to_string()),
11347 )),
11348 }
11349 }
11350 }
11351
11352 impl serde::ser::Serialize for State {
11353 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11354 where
11355 S: serde::Serializer,
11356 {
11357 match self {
11358 Self::Unspecified => serializer.serialize_i32(0),
11359 Self::Ready => serializer.serialize_i32(1),
11360 Self::Creating => serializer.serialize_i32(2),
11361 Self::Deleting => serializer.serialize_i32(3),
11362 Self::Updating => serializer.serialize_i32(4),
11363 Self::Disabled => serializer.serialize_i32(5),
11364 Self::Error => serializer.serialize_i32(6),
11365 Self::UnknownValue(u) => u.0.serialize(serializer),
11366 }
11367 }
11368 }
11369
11370 impl<'de> serde::de::Deserialize<'de> for State {
11371 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11372 where
11373 D: serde::Deserializer<'de>,
11374 {
11375 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11376 ".google.cloud.netapp.v1.Snapshot.State",
11377 ))
11378 }
11379 }
11380}
11381
11382/// GetStoragePoolRequest gets a Storage Pool.
11383#[derive(Clone, Default, PartialEq)]
11384#[non_exhaustive]
11385pub struct GetStoragePoolRequest {
11386 /// Required. Name of the storage pool
11387 pub name: std::string::String,
11388
11389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11390}
11391
11392impl GetStoragePoolRequest {
11393 pub fn new() -> Self {
11394 std::default::Default::default()
11395 }
11396
11397 /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
11398 ///
11399 /// # Example
11400 /// ```ignore,no_run
11401 /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
11402 /// let x = GetStoragePoolRequest::new().set_name("example");
11403 /// ```
11404 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11405 self.name = v.into();
11406 self
11407 }
11408}
11409
11410impl wkt::message::Message for GetStoragePoolRequest {
11411 fn typename() -> &'static str {
11412 "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
11413 }
11414}
11415
11416/// ListStoragePoolsRequest lists Storage Pools.
11417#[derive(Clone, Default, PartialEq)]
11418#[non_exhaustive]
11419pub struct ListStoragePoolsRequest {
11420 /// Required. Parent value
11421 pub parent: std::string::String,
11422
11423 /// Optional. The maximum number of items to return.
11424 pub page_size: i32,
11425
11426 /// Optional. The next_page_token value to use if there are additional
11427 /// results to retrieve for this list request.
11428 pub page_token: std::string::String,
11429
11430 /// Optional. Sort results. Supported values are "name", "name desc" or ""
11431 /// (unsorted).
11432 pub order_by: std::string::String,
11433
11434 /// Optional. List filter.
11435 pub filter: std::string::String,
11436
11437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11438}
11439
11440impl ListStoragePoolsRequest {
11441 pub fn new() -> Self {
11442 std::default::Default::default()
11443 }
11444
11445 /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
11446 ///
11447 /// # Example
11448 /// ```ignore,no_run
11449 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11450 /// let x = ListStoragePoolsRequest::new().set_parent("example");
11451 /// ```
11452 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11453 self.parent = v.into();
11454 self
11455 }
11456
11457 /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
11458 ///
11459 /// # Example
11460 /// ```ignore,no_run
11461 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11462 /// let x = ListStoragePoolsRequest::new().set_page_size(42);
11463 /// ```
11464 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11465 self.page_size = v.into();
11466 self
11467 }
11468
11469 /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11470 ///
11471 /// # Example
11472 /// ```ignore,no_run
11473 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11474 /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11475 /// ```
11476 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11477 self.page_token = v.into();
11478 self
11479 }
11480
11481 /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11482 ///
11483 /// # Example
11484 /// ```ignore,no_run
11485 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11486 /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11487 /// ```
11488 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11489 self.order_by = v.into();
11490 self
11491 }
11492
11493 /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11494 ///
11495 /// # Example
11496 /// ```ignore,no_run
11497 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11498 /// let x = ListStoragePoolsRequest::new().set_filter("example");
11499 /// ```
11500 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11501 self.filter = v.into();
11502 self
11503 }
11504}
11505
11506impl wkt::message::Message for ListStoragePoolsRequest {
11507 fn typename() -> &'static str {
11508 "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11509 }
11510}
11511
11512/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11513#[derive(Clone, Default, PartialEq)]
11514#[non_exhaustive]
11515pub struct ListStoragePoolsResponse {
11516 /// The list of StoragePools
11517 pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11518
11519 /// A token identifying a page of results the server should return.
11520 pub next_page_token: std::string::String,
11521
11522 /// Locations that could not be reached.
11523 pub unreachable: std::vec::Vec<std::string::String>,
11524
11525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11526}
11527
11528impl ListStoragePoolsResponse {
11529 pub fn new() -> Self {
11530 std::default::Default::default()
11531 }
11532
11533 /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11534 ///
11535 /// # Example
11536 /// ```ignore,no_run
11537 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11538 /// use google_cloud_netapp_v1::model::StoragePool;
11539 /// let x = ListStoragePoolsResponse::new()
11540 /// .set_storage_pools([
11541 /// StoragePool::default()/* use setters */,
11542 /// StoragePool::default()/* use (different) setters */,
11543 /// ]);
11544 /// ```
11545 pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11546 where
11547 T: std::iter::IntoIterator<Item = V>,
11548 V: std::convert::Into<crate::model::StoragePool>,
11549 {
11550 use std::iter::Iterator;
11551 self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11552 self
11553 }
11554
11555 /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11556 ///
11557 /// # Example
11558 /// ```ignore,no_run
11559 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11560 /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11561 /// ```
11562 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11563 self.next_page_token = v.into();
11564 self
11565 }
11566
11567 /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11568 ///
11569 /// # Example
11570 /// ```ignore,no_run
11571 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11572 /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11573 /// ```
11574 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11575 where
11576 T: std::iter::IntoIterator<Item = V>,
11577 V: std::convert::Into<std::string::String>,
11578 {
11579 use std::iter::Iterator;
11580 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11581 self
11582 }
11583}
11584
11585impl wkt::message::Message for ListStoragePoolsResponse {
11586 fn typename() -> &'static str {
11587 "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11588 }
11589}
11590
11591#[doc(hidden)]
11592impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11593 type PageItem = crate::model::StoragePool;
11594
11595 fn items(self) -> std::vec::Vec<Self::PageItem> {
11596 self.storage_pools
11597 }
11598
11599 fn next_page_token(&self) -> std::string::String {
11600 use std::clone::Clone;
11601 self.next_page_token.clone()
11602 }
11603}
11604
11605/// CreateStoragePoolRequest creates a Storage Pool.
11606#[derive(Clone, Default, PartialEq)]
11607#[non_exhaustive]
11608pub struct CreateStoragePoolRequest {
11609 /// Required. Value for parent.
11610 pub parent: std::string::String,
11611
11612 /// Required. Id of the requesting storage pool. Must be unique within the
11613 /// parent resource. Must contain only letters, numbers and hyphen, with the
11614 /// first character a letter, the last a letter or a number, and a 63 character
11615 /// maximum.
11616 pub storage_pool_id: std::string::String,
11617
11618 /// Required. The required parameters to create a new storage pool.
11619 pub storage_pool: std::option::Option<crate::model::StoragePool>,
11620
11621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11622}
11623
11624impl CreateStoragePoolRequest {
11625 pub fn new() -> Self {
11626 std::default::Default::default()
11627 }
11628
11629 /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11630 ///
11631 /// # Example
11632 /// ```ignore,no_run
11633 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11634 /// let x = CreateStoragePoolRequest::new().set_parent("example");
11635 /// ```
11636 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11637 self.parent = v.into();
11638 self
11639 }
11640
11641 /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11642 ///
11643 /// # Example
11644 /// ```ignore,no_run
11645 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11646 /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11647 /// ```
11648 pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11649 self.storage_pool_id = v.into();
11650 self
11651 }
11652
11653 /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11654 ///
11655 /// # Example
11656 /// ```ignore,no_run
11657 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11658 /// use google_cloud_netapp_v1::model::StoragePool;
11659 /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11660 /// ```
11661 pub fn set_storage_pool<T>(mut self, v: T) -> Self
11662 where
11663 T: std::convert::Into<crate::model::StoragePool>,
11664 {
11665 self.storage_pool = std::option::Option::Some(v.into());
11666 self
11667 }
11668
11669 /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11670 ///
11671 /// # Example
11672 /// ```ignore,no_run
11673 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11674 /// use google_cloud_netapp_v1::model::StoragePool;
11675 /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11676 /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11677 /// ```
11678 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11679 where
11680 T: std::convert::Into<crate::model::StoragePool>,
11681 {
11682 self.storage_pool = v.map(|x| x.into());
11683 self
11684 }
11685}
11686
11687impl wkt::message::Message for CreateStoragePoolRequest {
11688 fn typename() -> &'static str {
11689 "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11690 }
11691}
11692
11693/// UpdateStoragePoolRequest updates a Storage Pool.
11694#[derive(Clone, Default, PartialEq)]
11695#[non_exhaustive]
11696pub struct UpdateStoragePoolRequest {
11697 /// Required. Field mask is used to specify the fields to be overwritten in the
11698 /// StoragePool resource by the update.
11699 /// The fields specified in the update_mask are relative to the resource, not
11700 /// the full request. A field will be overwritten if it is in the mask. If the
11701 /// user does not provide a mask then all fields will be overwritten.
11702 pub update_mask: std::option::Option<wkt::FieldMask>,
11703
11704 /// Required. The pool being updated
11705 pub storage_pool: std::option::Option<crate::model::StoragePool>,
11706
11707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11708}
11709
11710impl UpdateStoragePoolRequest {
11711 pub fn new() -> Self {
11712 std::default::Default::default()
11713 }
11714
11715 /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11716 ///
11717 /// # Example
11718 /// ```ignore,no_run
11719 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11720 /// use wkt::FieldMask;
11721 /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11722 /// ```
11723 pub fn set_update_mask<T>(mut self, v: T) -> Self
11724 where
11725 T: std::convert::Into<wkt::FieldMask>,
11726 {
11727 self.update_mask = std::option::Option::Some(v.into());
11728 self
11729 }
11730
11731 /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11732 ///
11733 /// # Example
11734 /// ```ignore,no_run
11735 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11736 /// use wkt::FieldMask;
11737 /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11738 /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11739 /// ```
11740 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11741 where
11742 T: std::convert::Into<wkt::FieldMask>,
11743 {
11744 self.update_mask = v.map(|x| x.into());
11745 self
11746 }
11747
11748 /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11749 ///
11750 /// # Example
11751 /// ```ignore,no_run
11752 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11753 /// use google_cloud_netapp_v1::model::StoragePool;
11754 /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11755 /// ```
11756 pub fn set_storage_pool<T>(mut self, v: T) -> Self
11757 where
11758 T: std::convert::Into<crate::model::StoragePool>,
11759 {
11760 self.storage_pool = std::option::Option::Some(v.into());
11761 self
11762 }
11763
11764 /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11765 ///
11766 /// # Example
11767 /// ```ignore,no_run
11768 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11769 /// use google_cloud_netapp_v1::model::StoragePool;
11770 /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11771 /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11772 /// ```
11773 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11774 where
11775 T: std::convert::Into<crate::model::StoragePool>,
11776 {
11777 self.storage_pool = v.map(|x| x.into());
11778 self
11779 }
11780}
11781
11782impl wkt::message::Message for UpdateStoragePoolRequest {
11783 fn typename() -> &'static str {
11784 "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
11785 }
11786}
11787
11788/// DeleteStoragePoolRequest deletes a Storage Pool.
11789#[derive(Clone, Default, PartialEq)]
11790#[non_exhaustive]
11791pub struct DeleteStoragePoolRequest {
11792 /// Required. Name of the storage pool
11793 pub name: std::string::String,
11794
11795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11796}
11797
11798impl DeleteStoragePoolRequest {
11799 pub fn new() -> Self {
11800 std::default::Default::default()
11801 }
11802
11803 /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
11804 ///
11805 /// # Example
11806 /// ```ignore,no_run
11807 /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
11808 /// let x = DeleteStoragePoolRequest::new().set_name("example");
11809 /// ```
11810 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11811 self.name = v.into();
11812 self
11813 }
11814}
11815
11816impl wkt::message::Message for DeleteStoragePoolRequest {
11817 fn typename() -> &'static str {
11818 "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
11819 }
11820}
11821
11822/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
11823/// storagePool.
11824#[derive(Clone, Default, PartialEq)]
11825#[non_exhaustive]
11826pub struct SwitchActiveReplicaZoneRequest {
11827 /// Required. Name of the storage pool
11828 pub name: std::string::String,
11829
11830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11831}
11832
11833impl SwitchActiveReplicaZoneRequest {
11834 pub fn new() -> Self {
11835 std::default::Default::default()
11836 }
11837
11838 /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
11839 ///
11840 /// # Example
11841 /// ```ignore,no_run
11842 /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
11843 /// let x = SwitchActiveReplicaZoneRequest::new().set_name("example");
11844 /// ```
11845 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11846 self.name = v.into();
11847 self
11848 }
11849}
11850
11851impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
11852 fn typename() -> &'static str {
11853 "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
11854 }
11855}
11856
11857/// StoragePool is a container for volumes with a service level and capacity.
11858/// Volumes can be created in a pool of sufficient available capacity.
11859/// StoragePool capacity is what you are billed for.
11860#[derive(Clone, Default, PartialEq)]
11861#[non_exhaustive]
11862pub struct StoragePool {
11863 /// Identifier. Name of the storage pool
11864 pub name: std::string::String,
11865
11866 /// Required. Service level of the storage pool
11867 pub service_level: crate::model::ServiceLevel,
11868
11869 /// Required. Capacity in GIB of the pool
11870 pub capacity_gib: i64,
11871
11872 /// Output only. Allocated size of all volumes in GIB in the storage pool
11873 pub volume_capacity_gib: i64,
11874
11875 /// Output only. Volume count of the storage pool
11876 pub volume_count: i32,
11877
11878 /// Output only. State of the storage pool
11879 pub state: crate::model::storage_pool::State,
11880
11881 /// Output only. State details of the storage pool
11882 pub state_details: std::string::String,
11883
11884 /// Output only. Create time of the storage pool
11885 pub create_time: std::option::Option<wkt::Timestamp>,
11886
11887 /// Optional. Description of the storage pool
11888 pub description: std::string::String,
11889
11890 /// Optional. Labels as key value pairs
11891 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11892
11893 /// Required. VPC Network name.
11894 /// Format: projects/{project}/global/networks/{network}
11895 pub network: std::string::String,
11896
11897 /// Optional. Specifies the Active Directory to be used for creating a SMB
11898 /// volume.
11899 pub active_directory: std::string::String,
11900
11901 /// Optional. Specifies the KMS config to be used for volume encryption.
11902 pub kms_config: std::string::String,
11903
11904 /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
11905 pub ldap_enabled: bool,
11906
11907 /// Optional. This field is not implemented. The values provided in this field
11908 /// are ignored.
11909 pub psa_range: std::string::String,
11910
11911 /// Output only. Specifies the current pool encryption key source.
11912 pub encryption_type: crate::model::EncryptionType,
11913
11914 /// Deprecated. Used to allow SO pool to access AD or DNS server from other
11915 /// regions.
11916 #[deprecated]
11917 pub global_access_allowed: std::option::Option<bool>,
11918
11919 /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
11920 /// Default is false. Auto-tiering can be enabled after storage pool creation
11921 /// but it can't be disabled once enabled.
11922 pub allow_auto_tiering: bool,
11923
11924 /// Optional. Specifies the replica zone for regional storagePool.
11925 pub replica_zone: std::string::String,
11926
11927 /// Optional. Specifies the active zone for regional storagePool.
11928 pub zone: std::string::String,
11929
11930 /// Output only. Reserved for future use
11931 pub satisfies_pzs: bool,
11932
11933 /// Output only. Reserved for future use
11934 pub satisfies_pzi: bool,
11935
11936 /// Optional. True if using Independent Scaling of capacity and performance
11937 /// (Hyperdisk) By default set to false
11938 pub custom_performance_enabled: bool,
11939
11940 /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
11941 pub total_throughput_mibps: i64,
11942
11943 /// Optional. Custom Performance Total IOPS of the pool
11944 /// if not provided, it will be calculated based on the total_throughput_mibps
11945 pub total_iops: i64,
11946
11947 /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
11948 /// only to Flex service level. It should be less than the minimum storage pool
11949 /// size and cannot be more than the current storage pool size. It cannot be
11950 /// decreased once set.
11951 pub hot_tier_size_gib: i64,
11952
11953 /// Optional. Flag indicating that the hot-tier threshold will be
11954 /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
11955 /// The increment will kick in only if the new size after increment is
11956 /// still less than or equal to storage pool size.
11957 pub enable_hot_tier_auto_resize: std::option::Option<bool>,
11958
11959 /// Optional. QoS (Quality of Service) Type of the storage pool
11960 pub qos_type: crate::model::QosType,
11961
11962 /// Output only. Available throughput of the storage pool (in MiB/s).
11963 pub available_throughput_mibps: f64,
11964
11965 /// Output only. Total cold tier data rounded down to the nearest GiB used by
11966 /// the storage pool.
11967 pub cold_tier_size_used_gib: i64,
11968
11969 /// Output only. Total hot tier data rounded down to the nearest GiB used by
11970 /// the storage pool.
11971 pub hot_tier_size_used_gib: i64,
11972
11973 /// Optional. Type of the storage pool. This field is used to control whether
11974 /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
11975 /// `BLOCK`) volumes. If not specified during creation, it defaults to `FILE`.
11976 pub r#type: std::option::Option<crate::model::StoragePoolType>,
11977
11978 /// Optional. Mode of the storage pool. This field is used to control whether
11979 /// the user can perform the ONTAP operations on the storage pool using the
11980 /// GCNV ONTAP Mode APIs. If not specified during creation, it defaults to
11981 /// `DEFAULT`.
11982 pub mode: std::option::Option<crate::model::Mode>,
11983
11984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11985}
11986
11987impl StoragePool {
11988 pub fn new() -> Self {
11989 std::default::Default::default()
11990 }
11991
11992 /// Sets the value of [name][crate::model::StoragePool::name].
11993 ///
11994 /// # Example
11995 /// ```ignore,no_run
11996 /// # use google_cloud_netapp_v1::model::StoragePool;
11997 /// let x = StoragePool::new().set_name("example");
11998 /// ```
11999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12000 self.name = v.into();
12001 self
12002 }
12003
12004 /// Sets the value of [service_level][crate::model::StoragePool::service_level].
12005 ///
12006 /// # Example
12007 /// ```ignore,no_run
12008 /// # use google_cloud_netapp_v1::model::StoragePool;
12009 /// use google_cloud_netapp_v1::model::ServiceLevel;
12010 /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
12011 /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
12012 /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
12013 /// ```
12014 pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
12015 mut self,
12016 v: T,
12017 ) -> Self {
12018 self.service_level = v.into();
12019 self
12020 }
12021
12022 /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
12023 ///
12024 /// # Example
12025 /// ```ignore,no_run
12026 /// # use google_cloud_netapp_v1::model::StoragePool;
12027 /// let x = StoragePool::new().set_capacity_gib(42);
12028 /// ```
12029 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12030 self.capacity_gib = v.into();
12031 self
12032 }
12033
12034 /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
12035 ///
12036 /// # Example
12037 /// ```ignore,no_run
12038 /// # use google_cloud_netapp_v1::model::StoragePool;
12039 /// let x = StoragePool::new().set_volume_capacity_gib(42);
12040 /// ```
12041 pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12042 self.volume_capacity_gib = v.into();
12043 self
12044 }
12045
12046 /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
12047 ///
12048 /// # Example
12049 /// ```ignore,no_run
12050 /// # use google_cloud_netapp_v1::model::StoragePool;
12051 /// let x = StoragePool::new().set_volume_count(42);
12052 /// ```
12053 pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12054 self.volume_count = v.into();
12055 self
12056 }
12057
12058 /// Sets the value of [state][crate::model::StoragePool::state].
12059 ///
12060 /// # Example
12061 /// ```ignore,no_run
12062 /// # use google_cloud_netapp_v1::model::StoragePool;
12063 /// use google_cloud_netapp_v1::model::storage_pool::State;
12064 /// let x0 = StoragePool::new().set_state(State::Ready);
12065 /// let x1 = StoragePool::new().set_state(State::Creating);
12066 /// let x2 = StoragePool::new().set_state(State::Deleting);
12067 /// ```
12068 pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
12069 mut self,
12070 v: T,
12071 ) -> Self {
12072 self.state = v.into();
12073 self
12074 }
12075
12076 /// Sets the value of [state_details][crate::model::StoragePool::state_details].
12077 ///
12078 /// # Example
12079 /// ```ignore,no_run
12080 /// # use google_cloud_netapp_v1::model::StoragePool;
12081 /// let x = StoragePool::new().set_state_details("example");
12082 /// ```
12083 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12084 self.state_details = v.into();
12085 self
12086 }
12087
12088 /// Sets the value of [create_time][crate::model::StoragePool::create_time].
12089 ///
12090 /// # Example
12091 /// ```ignore,no_run
12092 /// # use google_cloud_netapp_v1::model::StoragePool;
12093 /// use wkt::Timestamp;
12094 /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
12095 /// ```
12096 pub fn set_create_time<T>(mut self, v: T) -> Self
12097 where
12098 T: std::convert::Into<wkt::Timestamp>,
12099 {
12100 self.create_time = std::option::Option::Some(v.into());
12101 self
12102 }
12103
12104 /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
12105 ///
12106 /// # Example
12107 /// ```ignore,no_run
12108 /// # use google_cloud_netapp_v1::model::StoragePool;
12109 /// use wkt::Timestamp;
12110 /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12111 /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
12112 /// ```
12113 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12114 where
12115 T: std::convert::Into<wkt::Timestamp>,
12116 {
12117 self.create_time = v.map(|x| x.into());
12118 self
12119 }
12120
12121 /// Sets the value of [description][crate::model::StoragePool::description].
12122 ///
12123 /// # Example
12124 /// ```ignore,no_run
12125 /// # use google_cloud_netapp_v1::model::StoragePool;
12126 /// let x = StoragePool::new().set_description("example");
12127 /// ```
12128 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12129 self.description = v.into();
12130 self
12131 }
12132
12133 /// Sets the value of [labels][crate::model::StoragePool::labels].
12134 ///
12135 /// # Example
12136 /// ```ignore,no_run
12137 /// # use google_cloud_netapp_v1::model::StoragePool;
12138 /// let x = StoragePool::new().set_labels([
12139 /// ("key0", "abc"),
12140 /// ("key1", "xyz"),
12141 /// ]);
12142 /// ```
12143 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12144 where
12145 T: std::iter::IntoIterator<Item = (K, V)>,
12146 K: std::convert::Into<std::string::String>,
12147 V: std::convert::Into<std::string::String>,
12148 {
12149 use std::iter::Iterator;
12150 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12151 self
12152 }
12153
12154 /// Sets the value of [network][crate::model::StoragePool::network].
12155 ///
12156 /// # Example
12157 /// ```ignore,no_run
12158 /// # use google_cloud_netapp_v1::model::StoragePool;
12159 /// let x = StoragePool::new().set_network("example");
12160 /// ```
12161 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12162 self.network = v.into();
12163 self
12164 }
12165
12166 /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
12167 ///
12168 /// # Example
12169 /// ```ignore,no_run
12170 /// # use google_cloud_netapp_v1::model::StoragePool;
12171 /// let x = StoragePool::new().set_active_directory("example");
12172 /// ```
12173 pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
12174 mut self,
12175 v: T,
12176 ) -> Self {
12177 self.active_directory = v.into();
12178 self
12179 }
12180
12181 /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
12182 ///
12183 /// # Example
12184 /// ```ignore,no_run
12185 /// # use google_cloud_netapp_v1::model::StoragePool;
12186 /// let x = StoragePool::new().set_kms_config("example");
12187 /// ```
12188 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12189 self.kms_config = v.into();
12190 self
12191 }
12192
12193 /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
12194 ///
12195 /// # Example
12196 /// ```ignore,no_run
12197 /// # use google_cloud_netapp_v1::model::StoragePool;
12198 /// let x = StoragePool::new().set_ldap_enabled(true);
12199 /// ```
12200 pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12201 self.ldap_enabled = v.into();
12202 self
12203 }
12204
12205 /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
12206 ///
12207 /// # Example
12208 /// ```ignore,no_run
12209 /// # use google_cloud_netapp_v1::model::StoragePool;
12210 /// let x = StoragePool::new().set_psa_range("example");
12211 /// ```
12212 pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12213 self.psa_range = v.into();
12214 self
12215 }
12216
12217 /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
12218 ///
12219 /// # Example
12220 /// ```ignore,no_run
12221 /// # use google_cloud_netapp_v1::model::StoragePool;
12222 /// use google_cloud_netapp_v1::model::EncryptionType;
12223 /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
12224 /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
12225 /// ```
12226 pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
12227 mut self,
12228 v: T,
12229 ) -> Self {
12230 self.encryption_type = v.into();
12231 self
12232 }
12233
12234 /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12235 ///
12236 /// # Example
12237 /// ```ignore,no_run
12238 /// # use google_cloud_netapp_v1::model::StoragePool;
12239 /// let x = StoragePool::new().set_global_access_allowed(true);
12240 /// ```
12241 #[deprecated]
12242 pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
12243 where
12244 T: std::convert::Into<bool>,
12245 {
12246 self.global_access_allowed = std::option::Option::Some(v.into());
12247 self
12248 }
12249
12250 /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12251 ///
12252 /// # Example
12253 /// ```ignore,no_run
12254 /// # use google_cloud_netapp_v1::model::StoragePool;
12255 /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
12256 /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
12257 /// ```
12258 #[deprecated]
12259 pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
12260 where
12261 T: std::convert::Into<bool>,
12262 {
12263 self.global_access_allowed = v.map(|x| x.into());
12264 self
12265 }
12266
12267 /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
12268 ///
12269 /// # Example
12270 /// ```ignore,no_run
12271 /// # use google_cloud_netapp_v1::model::StoragePool;
12272 /// let x = StoragePool::new().set_allow_auto_tiering(true);
12273 /// ```
12274 pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12275 self.allow_auto_tiering = v.into();
12276 self
12277 }
12278
12279 /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
12280 ///
12281 /// # Example
12282 /// ```ignore,no_run
12283 /// # use google_cloud_netapp_v1::model::StoragePool;
12284 /// let x = StoragePool::new().set_replica_zone("example");
12285 /// ```
12286 pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12287 self.replica_zone = v.into();
12288 self
12289 }
12290
12291 /// Sets the value of [zone][crate::model::StoragePool::zone].
12292 ///
12293 /// # Example
12294 /// ```ignore,no_run
12295 /// # use google_cloud_netapp_v1::model::StoragePool;
12296 /// let x = StoragePool::new().set_zone("example");
12297 /// ```
12298 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12299 self.zone = v.into();
12300 self
12301 }
12302
12303 /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
12304 ///
12305 /// # Example
12306 /// ```ignore,no_run
12307 /// # use google_cloud_netapp_v1::model::StoragePool;
12308 /// let x = StoragePool::new().set_satisfies_pzs(true);
12309 /// ```
12310 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12311 self.satisfies_pzs = v.into();
12312 self
12313 }
12314
12315 /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
12316 ///
12317 /// # Example
12318 /// ```ignore,no_run
12319 /// # use google_cloud_netapp_v1::model::StoragePool;
12320 /// let x = StoragePool::new().set_satisfies_pzi(true);
12321 /// ```
12322 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12323 self.satisfies_pzi = v.into();
12324 self
12325 }
12326
12327 /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
12328 ///
12329 /// # Example
12330 /// ```ignore,no_run
12331 /// # use google_cloud_netapp_v1::model::StoragePool;
12332 /// let x = StoragePool::new().set_custom_performance_enabled(true);
12333 /// ```
12334 pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12335 self.custom_performance_enabled = v.into();
12336 self
12337 }
12338
12339 /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
12340 ///
12341 /// # Example
12342 /// ```ignore,no_run
12343 /// # use google_cloud_netapp_v1::model::StoragePool;
12344 /// let x = StoragePool::new().set_total_throughput_mibps(42);
12345 /// ```
12346 pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12347 self.total_throughput_mibps = v.into();
12348 self
12349 }
12350
12351 /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
12352 ///
12353 /// # Example
12354 /// ```ignore,no_run
12355 /// # use google_cloud_netapp_v1::model::StoragePool;
12356 /// let x = StoragePool::new().set_total_iops(42);
12357 /// ```
12358 pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12359 self.total_iops = v.into();
12360 self
12361 }
12362
12363 /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
12364 ///
12365 /// # Example
12366 /// ```ignore,no_run
12367 /// # use google_cloud_netapp_v1::model::StoragePool;
12368 /// let x = StoragePool::new().set_hot_tier_size_gib(42);
12369 /// ```
12370 pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12371 self.hot_tier_size_gib = v.into();
12372 self
12373 }
12374
12375 /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12376 ///
12377 /// # Example
12378 /// ```ignore,no_run
12379 /// # use google_cloud_netapp_v1::model::StoragePool;
12380 /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
12381 /// ```
12382 pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
12383 where
12384 T: std::convert::Into<bool>,
12385 {
12386 self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
12387 self
12388 }
12389
12390 /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12391 ///
12392 /// # Example
12393 /// ```ignore,no_run
12394 /// # use google_cloud_netapp_v1::model::StoragePool;
12395 /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
12396 /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
12397 /// ```
12398 pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
12399 where
12400 T: std::convert::Into<bool>,
12401 {
12402 self.enable_hot_tier_auto_resize = v.map(|x| x.into());
12403 self
12404 }
12405
12406 /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
12407 ///
12408 /// # Example
12409 /// ```ignore,no_run
12410 /// # use google_cloud_netapp_v1::model::StoragePool;
12411 /// use google_cloud_netapp_v1::model::QosType;
12412 /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
12413 /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
12414 /// ```
12415 pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
12416 self.qos_type = v.into();
12417 self
12418 }
12419
12420 /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
12421 ///
12422 /// # Example
12423 /// ```ignore,no_run
12424 /// # use google_cloud_netapp_v1::model::StoragePool;
12425 /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
12426 /// ```
12427 pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12428 self.available_throughput_mibps = v.into();
12429 self
12430 }
12431
12432 /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
12433 ///
12434 /// # Example
12435 /// ```ignore,no_run
12436 /// # use google_cloud_netapp_v1::model::StoragePool;
12437 /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
12438 /// ```
12439 pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12440 self.cold_tier_size_used_gib = v.into();
12441 self
12442 }
12443
12444 /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
12445 ///
12446 /// # Example
12447 /// ```ignore,no_run
12448 /// # use google_cloud_netapp_v1::model::StoragePool;
12449 /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
12450 /// ```
12451 pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12452 self.hot_tier_size_used_gib = v.into();
12453 self
12454 }
12455
12456 /// Sets the value of [r#type][crate::model::StoragePool::type].
12457 ///
12458 /// # Example
12459 /// ```ignore,no_run
12460 /// # use google_cloud_netapp_v1::model::StoragePool;
12461 /// use google_cloud_netapp_v1::model::StoragePoolType;
12462 /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
12463 /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
12464 /// ```
12465 pub fn set_type<T>(mut self, v: T) -> Self
12466 where
12467 T: std::convert::Into<crate::model::StoragePoolType>,
12468 {
12469 self.r#type = std::option::Option::Some(v.into());
12470 self
12471 }
12472
12473 /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12474 ///
12475 /// # Example
12476 /// ```ignore,no_run
12477 /// # use google_cloud_netapp_v1::model::StoragePool;
12478 /// use google_cloud_netapp_v1::model::StoragePoolType;
12479 /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12480 /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12481 /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12482 /// ```
12483 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12484 where
12485 T: std::convert::Into<crate::model::StoragePoolType>,
12486 {
12487 self.r#type = v.map(|x| x.into());
12488 self
12489 }
12490
12491 /// Sets the value of [mode][crate::model::StoragePool::mode].
12492 ///
12493 /// # Example
12494 /// ```ignore,no_run
12495 /// # use google_cloud_netapp_v1::model::StoragePool;
12496 /// use google_cloud_netapp_v1::model::Mode;
12497 /// let x0 = StoragePool::new().set_mode(Mode::Default);
12498 /// let x1 = StoragePool::new().set_mode(Mode::Ontap);
12499 /// ```
12500 pub fn set_mode<T>(mut self, v: T) -> Self
12501 where
12502 T: std::convert::Into<crate::model::Mode>,
12503 {
12504 self.mode = std::option::Option::Some(v.into());
12505 self
12506 }
12507
12508 /// Sets or clears the value of [mode][crate::model::StoragePool::mode].
12509 ///
12510 /// # Example
12511 /// ```ignore,no_run
12512 /// # use google_cloud_netapp_v1::model::StoragePool;
12513 /// use google_cloud_netapp_v1::model::Mode;
12514 /// let x0 = StoragePool::new().set_or_clear_mode(Some(Mode::Default));
12515 /// let x1 = StoragePool::new().set_or_clear_mode(Some(Mode::Ontap));
12516 /// let x_none = StoragePool::new().set_or_clear_mode(None::<Mode>);
12517 /// ```
12518 pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
12519 where
12520 T: std::convert::Into<crate::model::Mode>,
12521 {
12522 self.mode = v.map(|x| x.into());
12523 self
12524 }
12525}
12526
12527impl wkt::message::Message for StoragePool {
12528 fn typename() -> &'static str {
12529 "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12530 }
12531}
12532
12533/// Defines additional types related to [StoragePool].
12534pub mod storage_pool {
12535 #[allow(unused_imports)]
12536 use super::*;
12537
12538 /// The Storage Pool States
12539 ///
12540 /// # Working with unknown values
12541 ///
12542 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12543 /// additional enum variants at any time. Adding new variants is not considered
12544 /// a breaking change. Applications should write their code in anticipation of:
12545 ///
12546 /// - New values appearing in future releases of the client library, **and**
12547 /// - New values received dynamically, without application changes.
12548 ///
12549 /// Please consult the [Working with enums] section in the user guide for some
12550 /// guidelines.
12551 ///
12552 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12553 #[derive(Clone, Debug, PartialEq)]
12554 #[non_exhaustive]
12555 pub enum State {
12556 /// Unspecified Storage Pool State
12557 Unspecified,
12558 /// Storage Pool State is Ready
12559 Ready,
12560 /// Storage Pool State is Creating
12561 Creating,
12562 /// Storage Pool State is Deleting
12563 Deleting,
12564 /// Storage Pool State is Updating
12565 Updating,
12566 /// Storage Pool State is Restoring
12567 Restoring,
12568 /// Storage Pool State is Disabled
12569 Disabled,
12570 /// Storage Pool State is Error
12571 Error,
12572 /// If set, the enum was initialized with an unknown value.
12573 ///
12574 /// Applications can examine the value using [State::value] or
12575 /// [State::name].
12576 UnknownValue(state::UnknownValue),
12577 }
12578
12579 #[doc(hidden)]
12580 pub mod state {
12581 #[allow(unused_imports)]
12582 use super::*;
12583 #[derive(Clone, Debug, PartialEq)]
12584 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12585 }
12586
12587 impl State {
12588 /// Gets the enum value.
12589 ///
12590 /// Returns `None` if the enum contains an unknown value deserialized from
12591 /// the string representation of enums.
12592 pub fn value(&self) -> std::option::Option<i32> {
12593 match self {
12594 Self::Unspecified => std::option::Option::Some(0),
12595 Self::Ready => std::option::Option::Some(1),
12596 Self::Creating => std::option::Option::Some(2),
12597 Self::Deleting => std::option::Option::Some(3),
12598 Self::Updating => std::option::Option::Some(4),
12599 Self::Restoring => std::option::Option::Some(5),
12600 Self::Disabled => std::option::Option::Some(6),
12601 Self::Error => std::option::Option::Some(7),
12602 Self::UnknownValue(u) => u.0.value(),
12603 }
12604 }
12605
12606 /// Gets the enum value as a string.
12607 ///
12608 /// Returns `None` if the enum contains an unknown value deserialized from
12609 /// the integer representation of enums.
12610 pub fn name(&self) -> std::option::Option<&str> {
12611 match self {
12612 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12613 Self::Ready => std::option::Option::Some("READY"),
12614 Self::Creating => std::option::Option::Some("CREATING"),
12615 Self::Deleting => std::option::Option::Some("DELETING"),
12616 Self::Updating => std::option::Option::Some("UPDATING"),
12617 Self::Restoring => std::option::Option::Some("RESTORING"),
12618 Self::Disabled => std::option::Option::Some("DISABLED"),
12619 Self::Error => std::option::Option::Some("ERROR"),
12620 Self::UnknownValue(u) => u.0.name(),
12621 }
12622 }
12623 }
12624
12625 impl std::default::Default for State {
12626 fn default() -> Self {
12627 use std::convert::From;
12628 Self::from(0)
12629 }
12630 }
12631
12632 impl std::fmt::Display for State {
12633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12634 wkt::internal::display_enum(f, self.name(), self.value())
12635 }
12636 }
12637
12638 impl std::convert::From<i32> for State {
12639 fn from(value: i32) -> Self {
12640 match value {
12641 0 => Self::Unspecified,
12642 1 => Self::Ready,
12643 2 => Self::Creating,
12644 3 => Self::Deleting,
12645 4 => Self::Updating,
12646 5 => Self::Restoring,
12647 6 => Self::Disabled,
12648 7 => Self::Error,
12649 _ => Self::UnknownValue(state::UnknownValue(
12650 wkt::internal::UnknownEnumValue::Integer(value),
12651 )),
12652 }
12653 }
12654 }
12655
12656 impl std::convert::From<&str> for State {
12657 fn from(value: &str) -> Self {
12658 use std::string::ToString;
12659 match value {
12660 "STATE_UNSPECIFIED" => Self::Unspecified,
12661 "READY" => Self::Ready,
12662 "CREATING" => Self::Creating,
12663 "DELETING" => Self::Deleting,
12664 "UPDATING" => Self::Updating,
12665 "RESTORING" => Self::Restoring,
12666 "DISABLED" => Self::Disabled,
12667 "ERROR" => Self::Error,
12668 _ => Self::UnknownValue(state::UnknownValue(
12669 wkt::internal::UnknownEnumValue::String(value.to_string()),
12670 )),
12671 }
12672 }
12673 }
12674
12675 impl serde::ser::Serialize for State {
12676 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12677 where
12678 S: serde::Serializer,
12679 {
12680 match self {
12681 Self::Unspecified => serializer.serialize_i32(0),
12682 Self::Ready => serializer.serialize_i32(1),
12683 Self::Creating => serializer.serialize_i32(2),
12684 Self::Deleting => serializer.serialize_i32(3),
12685 Self::Updating => serializer.serialize_i32(4),
12686 Self::Restoring => serializer.serialize_i32(5),
12687 Self::Disabled => serializer.serialize_i32(6),
12688 Self::Error => serializer.serialize_i32(7),
12689 Self::UnknownValue(u) => u.0.serialize(serializer),
12690 }
12691 }
12692 }
12693
12694 impl<'de> serde::de::Deserialize<'de> for State {
12695 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12696 where
12697 D: serde::Deserializer<'de>,
12698 {
12699 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12700 ".google.cloud.netapp.v1.StoragePool.State",
12701 ))
12702 }
12703 }
12704}
12705
12706/// ValidateDirectoryServiceRequest validates the directory service policy
12707/// attached to the storage pool.
12708#[derive(Clone, Default, PartialEq)]
12709#[non_exhaustive]
12710pub struct ValidateDirectoryServiceRequest {
12711 /// Required. Name of the storage pool
12712 pub name: std::string::String,
12713
12714 /// Type of directory service policy attached to the storage pool.
12715 pub directory_service_type: crate::model::DirectoryServiceType,
12716
12717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12718}
12719
12720impl ValidateDirectoryServiceRequest {
12721 pub fn new() -> Self {
12722 std::default::Default::default()
12723 }
12724
12725 /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
12726 ///
12727 /// # Example
12728 /// ```ignore,no_run
12729 /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12730 /// let x = ValidateDirectoryServiceRequest::new().set_name("example");
12731 /// ```
12732 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12733 self.name = v.into();
12734 self
12735 }
12736
12737 /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
12738 ///
12739 /// # Example
12740 /// ```ignore,no_run
12741 /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12742 /// use google_cloud_netapp_v1::model::DirectoryServiceType;
12743 /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
12744 /// ```
12745 pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
12746 mut self,
12747 v: T,
12748 ) -> Self {
12749 self.directory_service_type = v.into();
12750 self
12751 }
12752}
12753
12754impl wkt::message::Message for ValidateDirectoryServiceRequest {
12755 fn typename() -> &'static str {
12756 "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
12757 }
12758}
12759
12760/// Message for requesting list of Volumes
12761#[derive(Clone, Default, PartialEq)]
12762#[non_exhaustive]
12763pub struct ListVolumesRequest {
12764 /// Required. Parent value for ListVolumesRequest
12765 pub parent: std::string::String,
12766
12767 /// Requested page size. Server may return fewer items than requested.
12768 /// If unspecified, the server will pick an appropriate default.
12769 pub page_size: i32,
12770
12771 /// A token identifying a page of results the server should return.
12772 pub page_token: std::string::String,
12773
12774 /// Filtering results
12775 pub filter: std::string::String,
12776
12777 /// Hint for how to order the results
12778 pub order_by: std::string::String,
12779
12780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12781}
12782
12783impl ListVolumesRequest {
12784 pub fn new() -> Self {
12785 std::default::Default::default()
12786 }
12787
12788 /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
12789 ///
12790 /// # Example
12791 /// ```ignore,no_run
12792 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12793 /// let x = ListVolumesRequest::new().set_parent("example");
12794 /// ```
12795 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12796 self.parent = v.into();
12797 self
12798 }
12799
12800 /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
12801 ///
12802 /// # Example
12803 /// ```ignore,no_run
12804 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12805 /// let x = ListVolumesRequest::new().set_page_size(42);
12806 /// ```
12807 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12808 self.page_size = v.into();
12809 self
12810 }
12811
12812 /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
12813 ///
12814 /// # Example
12815 /// ```ignore,no_run
12816 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12817 /// let x = ListVolumesRequest::new().set_page_token("example");
12818 /// ```
12819 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12820 self.page_token = v.into();
12821 self
12822 }
12823
12824 /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
12825 ///
12826 /// # Example
12827 /// ```ignore,no_run
12828 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12829 /// let x = ListVolumesRequest::new().set_filter("example");
12830 /// ```
12831 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12832 self.filter = v.into();
12833 self
12834 }
12835
12836 /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
12837 ///
12838 /// # Example
12839 /// ```ignore,no_run
12840 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12841 /// let x = ListVolumesRequest::new().set_order_by("example");
12842 /// ```
12843 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12844 self.order_by = v.into();
12845 self
12846 }
12847}
12848
12849impl wkt::message::Message for ListVolumesRequest {
12850 fn typename() -> &'static str {
12851 "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
12852 }
12853}
12854
12855/// Message for response to listing Volumes
12856#[derive(Clone, Default, PartialEq)]
12857#[non_exhaustive]
12858pub struct ListVolumesResponse {
12859 /// The list of Volume
12860 pub volumes: std::vec::Vec<crate::model::Volume>,
12861
12862 /// A token identifying a page of results the server should return.
12863 pub next_page_token: std::string::String,
12864
12865 /// Locations that could not be reached.
12866 pub unreachable: std::vec::Vec<std::string::String>,
12867
12868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12869}
12870
12871impl ListVolumesResponse {
12872 pub fn new() -> Self {
12873 std::default::Default::default()
12874 }
12875
12876 /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
12877 ///
12878 /// # Example
12879 /// ```ignore,no_run
12880 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12881 /// use google_cloud_netapp_v1::model::Volume;
12882 /// let x = ListVolumesResponse::new()
12883 /// .set_volumes([
12884 /// Volume::default()/* use setters */,
12885 /// Volume::default()/* use (different) setters */,
12886 /// ]);
12887 /// ```
12888 pub fn set_volumes<T, V>(mut self, v: T) -> Self
12889 where
12890 T: std::iter::IntoIterator<Item = V>,
12891 V: std::convert::Into<crate::model::Volume>,
12892 {
12893 use std::iter::Iterator;
12894 self.volumes = v.into_iter().map(|i| i.into()).collect();
12895 self
12896 }
12897
12898 /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
12899 ///
12900 /// # Example
12901 /// ```ignore,no_run
12902 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12903 /// let x = ListVolumesResponse::new().set_next_page_token("example");
12904 /// ```
12905 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12906 self.next_page_token = v.into();
12907 self
12908 }
12909
12910 /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
12911 ///
12912 /// # Example
12913 /// ```ignore,no_run
12914 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12915 /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
12916 /// ```
12917 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12918 where
12919 T: std::iter::IntoIterator<Item = V>,
12920 V: std::convert::Into<std::string::String>,
12921 {
12922 use std::iter::Iterator;
12923 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12924 self
12925 }
12926}
12927
12928impl wkt::message::Message for ListVolumesResponse {
12929 fn typename() -> &'static str {
12930 "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
12931 }
12932}
12933
12934#[doc(hidden)]
12935impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
12936 type PageItem = crate::model::Volume;
12937
12938 fn items(self) -> std::vec::Vec<Self::PageItem> {
12939 self.volumes
12940 }
12941
12942 fn next_page_token(&self) -> std::string::String {
12943 use std::clone::Clone;
12944 self.next_page_token.clone()
12945 }
12946}
12947
12948/// Message for getting a Volume
12949#[derive(Clone, Default, PartialEq)]
12950#[non_exhaustive]
12951pub struct GetVolumeRequest {
12952 /// Required. Name of the volume
12953 pub name: std::string::String,
12954
12955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12956}
12957
12958impl GetVolumeRequest {
12959 pub fn new() -> Self {
12960 std::default::Default::default()
12961 }
12962
12963 /// Sets the value of [name][crate::model::GetVolumeRequest::name].
12964 ///
12965 /// # Example
12966 /// ```ignore,no_run
12967 /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
12968 /// let x = GetVolumeRequest::new().set_name("example");
12969 /// ```
12970 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12971 self.name = v.into();
12972 self
12973 }
12974}
12975
12976impl wkt::message::Message for GetVolumeRequest {
12977 fn typename() -> &'static str {
12978 "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
12979 }
12980}
12981
12982/// Message for creating a Volume
12983#[derive(Clone, Default, PartialEq)]
12984#[non_exhaustive]
12985pub struct CreateVolumeRequest {
12986 /// Required. Value for parent.
12987 pub parent: std::string::String,
12988
12989 /// Required. Id of the requesting volume. Must be unique within the parent
12990 /// resource. Must contain only letters, numbers and hyphen, with the first
12991 /// character a letter, the last a letter or a number,
12992 /// and a 63 character maximum.
12993 pub volume_id: std::string::String,
12994
12995 /// Required. The volume being created.
12996 pub volume: std::option::Option<crate::model::Volume>,
12997
12998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12999}
13000
13001impl CreateVolumeRequest {
13002 pub fn new() -> Self {
13003 std::default::Default::default()
13004 }
13005
13006 /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
13007 ///
13008 /// # Example
13009 /// ```ignore,no_run
13010 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13011 /// let x = CreateVolumeRequest::new().set_parent("example");
13012 /// ```
13013 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13014 self.parent = v.into();
13015 self
13016 }
13017
13018 /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
13019 ///
13020 /// # Example
13021 /// ```ignore,no_run
13022 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13023 /// let x = CreateVolumeRequest::new().set_volume_id("example");
13024 /// ```
13025 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13026 self.volume_id = v.into();
13027 self
13028 }
13029
13030 /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
13031 ///
13032 /// # Example
13033 /// ```ignore,no_run
13034 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13035 /// use google_cloud_netapp_v1::model::Volume;
13036 /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13037 /// ```
13038 pub fn set_volume<T>(mut self, v: T) -> Self
13039 where
13040 T: std::convert::Into<crate::model::Volume>,
13041 {
13042 self.volume = std::option::Option::Some(v.into());
13043 self
13044 }
13045
13046 /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
13047 ///
13048 /// # Example
13049 /// ```ignore,no_run
13050 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13051 /// use google_cloud_netapp_v1::model::Volume;
13052 /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13053 /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13054 /// ```
13055 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13056 where
13057 T: std::convert::Into<crate::model::Volume>,
13058 {
13059 self.volume = v.map(|x| x.into());
13060 self
13061 }
13062}
13063
13064impl wkt::message::Message for CreateVolumeRequest {
13065 fn typename() -> &'static str {
13066 "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
13067 }
13068}
13069
13070/// Message for updating a Volume
13071#[derive(Clone, Default, PartialEq)]
13072#[non_exhaustive]
13073pub struct UpdateVolumeRequest {
13074 /// Required. Field mask is used to specify the fields to be overwritten in the
13075 /// Volume resource by the update.
13076 /// The fields specified in the update_mask are relative to the resource, not
13077 /// the full request. A field will be overwritten if it is in the mask. If the
13078 /// user does not provide a mask then all fields will be overwritten.
13079 pub update_mask: std::option::Option<wkt::FieldMask>,
13080
13081 /// Required. The volume being updated
13082 pub volume: std::option::Option<crate::model::Volume>,
13083
13084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13085}
13086
13087impl UpdateVolumeRequest {
13088 pub fn new() -> Self {
13089 std::default::Default::default()
13090 }
13091
13092 /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13093 ///
13094 /// # Example
13095 /// ```ignore,no_run
13096 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13097 /// use wkt::FieldMask;
13098 /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13099 /// ```
13100 pub fn set_update_mask<T>(mut self, v: T) -> Self
13101 where
13102 T: std::convert::Into<wkt::FieldMask>,
13103 {
13104 self.update_mask = std::option::Option::Some(v.into());
13105 self
13106 }
13107
13108 /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13109 ///
13110 /// # Example
13111 /// ```ignore,no_run
13112 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13113 /// use wkt::FieldMask;
13114 /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13115 /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13116 /// ```
13117 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13118 where
13119 T: std::convert::Into<wkt::FieldMask>,
13120 {
13121 self.update_mask = v.map(|x| x.into());
13122 self
13123 }
13124
13125 /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
13126 ///
13127 /// # Example
13128 /// ```ignore,no_run
13129 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13130 /// use google_cloud_netapp_v1::model::Volume;
13131 /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13132 /// ```
13133 pub fn set_volume<T>(mut self, v: T) -> Self
13134 where
13135 T: std::convert::Into<crate::model::Volume>,
13136 {
13137 self.volume = std::option::Option::Some(v.into());
13138 self
13139 }
13140
13141 /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
13142 ///
13143 /// # Example
13144 /// ```ignore,no_run
13145 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13146 /// use google_cloud_netapp_v1::model::Volume;
13147 /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13148 /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13149 /// ```
13150 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13151 where
13152 T: std::convert::Into<crate::model::Volume>,
13153 {
13154 self.volume = v.map(|x| x.into());
13155 self
13156 }
13157}
13158
13159impl wkt::message::Message for UpdateVolumeRequest {
13160 fn typename() -> &'static str {
13161 "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
13162 }
13163}
13164
13165/// Message for deleting a Volume
13166#[derive(Clone, Default, PartialEq)]
13167#[non_exhaustive]
13168pub struct DeleteVolumeRequest {
13169 /// Required. Name of the volume
13170 pub name: std::string::String,
13171
13172 /// If this field is set as true, CCFE will not block the volume resource
13173 /// deletion even if it has any snapshots resource. (Otherwise, the request
13174 /// will only work if the volume has no snapshots.)
13175 pub force: bool,
13176
13177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13178}
13179
13180impl DeleteVolumeRequest {
13181 pub fn new() -> Self {
13182 std::default::Default::default()
13183 }
13184
13185 /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
13186 ///
13187 /// # Example
13188 /// ```ignore,no_run
13189 /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13190 /// let x = DeleteVolumeRequest::new().set_name("example");
13191 /// ```
13192 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13193 self.name = v.into();
13194 self
13195 }
13196
13197 /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
13198 ///
13199 /// # Example
13200 /// ```ignore,no_run
13201 /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13202 /// let x = DeleteVolumeRequest::new().set_force(true);
13203 /// ```
13204 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13205 self.force = v.into();
13206 self
13207 }
13208}
13209
13210impl wkt::message::Message for DeleteVolumeRequest {
13211 fn typename() -> &'static str {
13212 "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
13213 }
13214}
13215
13216/// RevertVolumeRequest reverts the given volume to the specified snapshot.
13217#[derive(Clone, Default, PartialEq)]
13218#[non_exhaustive]
13219pub struct RevertVolumeRequest {
13220 /// Required. The resource name of the volume, in the format of
13221 /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
13222 pub name: std::string::String,
13223
13224 /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
13225 /// specified ID is the {snapshot_id} of the fully qualified name like
13226 /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
13227 pub snapshot_id: std::string::String,
13228
13229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13230}
13231
13232impl RevertVolumeRequest {
13233 pub fn new() -> Self {
13234 std::default::Default::default()
13235 }
13236
13237 /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
13238 ///
13239 /// # Example
13240 /// ```ignore,no_run
13241 /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13242 /// let x = RevertVolumeRequest::new().set_name("example");
13243 /// ```
13244 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13245 self.name = v.into();
13246 self
13247 }
13248
13249 /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
13250 ///
13251 /// # Example
13252 /// ```ignore,no_run
13253 /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13254 /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
13255 /// ```
13256 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13257 self.snapshot_id = v.into();
13258 self
13259 }
13260}
13261
13262impl wkt::message::Message for RevertVolumeRequest {
13263 fn typename() -> &'static str {
13264 "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
13265 }
13266}
13267
13268/// Volume provides a filesystem that you can mount.
13269#[derive(Clone, Default, PartialEq)]
13270#[non_exhaustive]
13271pub struct Volume {
13272 /// Identifier. Name of the volume
13273 pub name: std::string::String,
13274
13275 /// Output only. State of the volume
13276 pub state: crate::model::volume::State,
13277
13278 /// Output only. State details of the volume
13279 pub state_details: std::string::String,
13280
13281 /// Output only. Create time of the volume
13282 pub create_time: std::option::Option<wkt::Timestamp>,
13283
13284 /// Required. Share name of the volume
13285 pub share_name: std::string::String,
13286
13287 /// Output only. This field is not implemented. The values provided in this
13288 /// field are ignored.
13289 pub psa_range: std::string::String,
13290
13291 /// Required. StoragePool name of the volume
13292 pub storage_pool: std::string::String,
13293
13294 /// Output only. VPC Network name.
13295 /// Format: projects/{project}/global/networks/{network}
13296 pub network: std::string::String,
13297
13298 /// Output only. Service level of the volume
13299 pub service_level: crate::model::ServiceLevel,
13300
13301 /// Required. Capacity in GIB of the volume
13302 pub capacity_gib: i64,
13303
13304 /// Optional. Export policy of the volume
13305 pub export_policy: std::option::Option<crate::model::ExportPolicy>,
13306
13307 /// Required. Protocols required for the volume
13308 pub protocols: std::vec::Vec<crate::model::Protocols>,
13309
13310 /// Optional. SMB share settings for the volume.
13311 pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
13312
13313 /// Output only. Mount options of this volume
13314 pub mount_options: std::vec::Vec<crate::model::MountOption>,
13315
13316 /// Optional. Default unix style permission (e.g. 777) the mount point will be
13317 /// created with. Applicable for NFS protocol types only.
13318 pub unix_permissions: std::string::String,
13319
13320 /// Optional. Labels as key value pairs
13321 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13322
13323 /// Optional. Description of the volume
13324 pub description: std::string::String,
13325
13326 /// Optional. SnapshotPolicy for a volume.
13327 pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
13328
13329 /// Optional. Snap_reserve specifies percentage of volume storage reserved for
13330 /// snapshot storage. Default is 0 percent.
13331 pub snap_reserve: f64,
13332
13333 /// Optional. Snapshot_directory if enabled (true) the volume will contain a
13334 /// read-only .snapshot directory which provides access to each of the volume's
13335 /// snapshots.
13336 pub snapshot_directory: bool,
13337
13338 /// Output only. Used capacity in GIB of the volume. This is computed
13339 /// periodically and it does not represent the realtime usage.
13340 pub used_gib: i64,
13341
13342 /// Optional. Security Style of the Volume
13343 pub security_style: crate::model::SecurityStyle,
13344
13345 /// Optional. Flag indicating if the volume is a kerberos volume or not, export
13346 /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
13347 pub kerberos_enabled: bool,
13348
13349 /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
13350 pub ldap_enabled: bool,
13351
13352 /// Output only. Specifies the ActiveDirectory name of a SMB volume.
13353 pub active_directory: std::string::String,
13354
13355 /// Optional. Specifies the source of the volume to be created from.
13356 pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
13357
13358 /// Output only. Specifies the KMS config to be used for volume encryption.
13359 pub kms_config: std::string::String,
13360
13361 /// Output only. Specified the current volume encryption key source.
13362 pub encryption_type: crate::model::EncryptionType,
13363
13364 /// Output only. Indicates whether the volume is part of a replication
13365 /// relationship.
13366 pub has_replication: bool,
13367
13368 /// BackupConfig of the volume.
13369 pub backup_config: std::option::Option<crate::model::BackupConfig>,
13370
13371 /// Optional. List of actions that are restricted on this volume.
13372 pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
13373
13374 /// Optional. Flag indicating if the volume will be a large capacity volume or
13375 /// a regular volume.
13376 pub large_capacity: bool,
13377
13378 /// Optional. Flag indicating if the volume will have an IP address per node
13379 /// for volumes supporting multiple IP endpoints. Only the volume with
13380 /// large_capacity will be allowed to have multiple endpoints.
13381 pub multiple_endpoints: bool,
13382
13383 /// Tiering policy for the volume.
13384 pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
13385
13386 /// Output only. Specifies the replica zone for regional volume.
13387 pub replica_zone: std::string::String,
13388
13389 /// Output only. Specifies the active zone for regional volume.
13390 pub zone: std::string::String,
13391
13392 /// Output only. Size of the volume cold tier data rounded down to the nearest
13393 /// GiB.
13394 pub cold_tier_size_gib: i64,
13395
13396 /// Optional. The Hybrid Replication parameters for the volume.
13397 pub hybrid_replication_parameters:
13398 std::option::Option<crate::model::HybridReplicationParameters>,
13399
13400 /// Optional. Throughput of the volume (in MiB/s)
13401 pub throughput_mibps: f64,
13402
13403 /// Optional. Cache parameters for the volume.
13404 pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
13405
13406 /// Output only. Total hot tier data rounded down to the nearest GiB used by
13407 /// the Volume. This field is only used for flex Service Level
13408 pub hot_tier_size_used_gib: i64,
13409
13410 /// Optional. Block devices for the volume.
13411 /// Currently, only one block device is permitted per Volume.
13412 pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
13413
13414 /// Output only. If this volume is a clone, this field contains details about
13415 /// the clone.
13416 pub clone_details: std::option::Option<crate::model::volume::CloneDetails>,
13417
13418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13419}
13420
13421impl Volume {
13422 pub fn new() -> Self {
13423 std::default::Default::default()
13424 }
13425
13426 /// Sets the value of [name][crate::model::Volume::name].
13427 ///
13428 /// # Example
13429 /// ```ignore,no_run
13430 /// # use google_cloud_netapp_v1::model::Volume;
13431 /// let x = Volume::new().set_name("example");
13432 /// ```
13433 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13434 self.name = v.into();
13435 self
13436 }
13437
13438 /// Sets the value of [state][crate::model::Volume::state].
13439 ///
13440 /// # Example
13441 /// ```ignore,no_run
13442 /// # use google_cloud_netapp_v1::model::Volume;
13443 /// use google_cloud_netapp_v1::model::volume::State;
13444 /// let x0 = Volume::new().set_state(State::Ready);
13445 /// let x1 = Volume::new().set_state(State::Creating);
13446 /// let x2 = Volume::new().set_state(State::Deleting);
13447 /// ```
13448 pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
13449 self.state = v.into();
13450 self
13451 }
13452
13453 /// Sets the value of [state_details][crate::model::Volume::state_details].
13454 ///
13455 /// # Example
13456 /// ```ignore,no_run
13457 /// # use google_cloud_netapp_v1::model::Volume;
13458 /// let x = Volume::new().set_state_details("example");
13459 /// ```
13460 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13461 self.state_details = v.into();
13462 self
13463 }
13464
13465 /// Sets the value of [create_time][crate::model::Volume::create_time].
13466 ///
13467 /// # Example
13468 /// ```ignore,no_run
13469 /// # use google_cloud_netapp_v1::model::Volume;
13470 /// use wkt::Timestamp;
13471 /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
13472 /// ```
13473 pub fn set_create_time<T>(mut self, v: T) -> Self
13474 where
13475 T: std::convert::Into<wkt::Timestamp>,
13476 {
13477 self.create_time = std::option::Option::Some(v.into());
13478 self
13479 }
13480
13481 /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
13482 ///
13483 /// # Example
13484 /// ```ignore,no_run
13485 /// # use google_cloud_netapp_v1::model::Volume;
13486 /// use wkt::Timestamp;
13487 /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13488 /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
13489 /// ```
13490 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13491 where
13492 T: std::convert::Into<wkt::Timestamp>,
13493 {
13494 self.create_time = v.map(|x| x.into());
13495 self
13496 }
13497
13498 /// Sets the value of [share_name][crate::model::Volume::share_name].
13499 ///
13500 /// # Example
13501 /// ```ignore,no_run
13502 /// # use google_cloud_netapp_v1::model::Volume;
13503 /// let x = Volume::new().set_share_name("example");
13504 /// ```
13505 pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13506 self.share_name = v.into();
13507 self
13508 }
13509
13510 /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13511 ///
13512 /// # Example
13513 /// ```ignore,no_run
13514 /// # use google_cloud_netapp_v1::model::Volume;
13515 /// let x = Volume::new().set_psa_range("example");
13516 /// ```
13517 pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13518 self.psa_range = v.into();
13519 self
13520 }
13521
13522 /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13523 ///
13524 /// # Example
13525 /// ```ignore,no_run
13526 /// # use google_cloud_netapp_v1::model::Volume;
13527 /// let x = Volume::new().set_storage_pool("example");
13528 /// ```
13529 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13530 self.storage_pool = v.into();
13531 self
13532 }
13533
13534 /// Sets the value of [network][crate::model::Volume::network].
13535 ///
13536 /// # Example
13537 /// ```ignore,no_run
13538 /// # use google_cloud_netapp_v1::model::Volume;
13539 /// let x = Volume::new().set_network("example");
13540 /// ```
13541 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13542 self.network = v.into();
13543 self
13544 }
13545
13546 /// Sets the value of [service_level][crate::model::Volume::service_level].
13547 ///
13548 /// # Example
13549 /// ```ignore,no_run
13550 /// # use google_cloud_netapp_v1::model::Volume;
13551 /// use google_cloud_netapp_v1::model::ServiceLevel;
13552 /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13553 /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13554 /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13555 /// ```
13556 pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13557 mut self,
13558 v: T,
13559 ) -> Self {
13560 self.service_level = v.into();
13561 self
13562 }
13563
13564 /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13565 ///
13566 /// # Example
13567 /// ```ignore,no_run
13568 /// # use google_cloud_netapp_v1::model::Volume;
13569 /// let x = Volume::new().set_capacity_gib(42);
13570 /// ```
13571 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13572 self.capacity_gib = v.into();
13573 self
13574 }
13575
13576 /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13577 ///
13578 /// # Example
13579 /// ```ignore,no_run
13580 /// # use google_cloud_netapp_v1::model::Volume;
13581 /// use google_cloud_netapp_v1::model::ExportPolicy;
13582 /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13583 /// ```
13584 pub fn set_export_policy<T>(mut self, v: T) -> Self
13585 where
13586 T: std::convert::Into<crate::model::ExportPolicy>,
13587 {
13588 self.export_policy = std::option::Option::Some(v.into());
13589 self
13590 }
13591
13592 /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13593 ///
13594 /// # Example
13595 /// ```ignore,no_run
13596 /// # use google_cloud_netapp_v1::model::Volume;
13597 /// use google_cloud_netapp_v1::model::ExportPolicy;
13598 /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13599 /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13600 /// ```
13601 pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13602 where
13603 T: std::convert::Into<crate::model::ExportPolicy>,
13604 {
13605 self.export_policy = v.map(|x| x.into());
13606 self
13607 }
13608
13609 /// Sets the value of [protocols][crate::model::Volume::protocols].
13610 ///
13611 /// # Example
13612 /// ```ignore,no_run
13613 /// # use google_cloud_netapp_v1::model::Volume;
13614 /// use google_cloud_netapp_v1::model::Protocols;
13615 /// let x = Volume::new().set_protocols([
13616 /// Protocols::Nfsv3,
13617 /// Protocols::Nfsv4,
13618 /// Protocols::Smb,
13619 /// ]);
13620 /// ```
13621 pub fn set_protocols<T, V>(mut self, v: T) -> Self
13622 where
13623 T: std::iter::IntoIterator<Item = V>,
13624 V: std::convert::Into<crate::model::Protocols>,
13625 {
13626 use std::iter::Iterator;
13627 self.protocols = v.into_iter().map(|i| i.into()).collect();
13628 self
13629 }
13630
13631 /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13632 ///
13633 /// # Example
13634 /// ```ignore,no_run
13635 /// # use google_cloud_netapp_v1::model::Volume;
13636 /// use google_cloud_netapp_v1::model::SMBSettings;
13637 /// let x = Volume::new().set_smb_settings([
13638 /// SMBSettings::EncryptData,
13639 /// SMBSettings::Browsable,
13640 /// SMBSettings::ChangeNotify,
13641 /// ]);
13642 /// ```
13643 pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
13644 where
13645 T: std::iter::IntoIterator<Item = V>,
13646 V: std::convert::Into<crate::model::SMBSettings>,
13647 {
13648 use std::iter::Iterator;
13649 self.smb_settings = v.into_iter().map(|i| i.into()).collect();
13650 self
13651 }
13652
13653 /// Sets the value of [mount_options][crate::model::Volume::mount_options].
13654 ///
13655 /// # Example
13656 /// ```ignore,no_run
13657 /// # use google_cloud_netapp_v1::model::Volume;
13658 /// use google_cloud_netapp_v1::model::MountOption;
13659 /// let x = Volume::new()
13660 /// .set_mount_options([
13661 /// MountOption::default()/* use setters */,
13662 /// MountOption::default()/* use (different) setters */,
13663 /// ]);
13664 /// ```
13665 pub fn set_mount_options<T, V>(mut self, v: T) -> Self
13666 where
13667 T: std::iter::IntoIterator<Item = V>,
13668 V: std::convert::Into<crate::model::MountOption>,
13669 {
13670 use std::iter::Iterator;
13671 self.mount_options = v.into_iter().map(|i| i.into()).collect();
13672 self
13673 }
13674
13675 /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
13676 ///
13677 /// # Example
13678 /// ```ignore,no_run
13679 /// # use google_cloud_netapp_v1::model::Volume;
13680 /// let x = Volume::new().set_unix_permissions("example");
13681 /// ```
13682 pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
13683 mut self,
13684 v: T,
13685 ) -> Self {
13686 self.unix_permissions = v.into();
13687 self
13688 }
13689
13690 /// Sets the value of [labels][crate::model::Volume::labels].
13691 ///
13692 /// # Example
13693 /// ```ignore,no_run
13694 /// # use google_cloud_netapp_v1::model::Volume;
13695 /// let x = Volume::new().set_labels([
13696 /// ("key0", "abc"),
13697 /// ("key1", "xyz"),
13698 /// ]);
13699 /// ```
13700 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13701 where
13702 T: std::iter::IntoIterator<Item = (K, V)>,
13703 K: std::convert::Into<std::string::String>,
13704 V: std::convert::Into<std::string::String>,
13705 {
13706 use std::iter::Iterator;
13707 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13708 self
13709 }
13710
13711 /// Sets the value of [description][crate::model::Volume::description].
13712 ///
13713 /// # Example
13714 /// ```ignore,no_run
13715 /// # use google_cloud_netapp_v1::model::Volume;
13716 /// let x = Volume::new().set_description("example");
13717 /// ```
13718 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13719 self.description = v.into();
13720 self
13721 }
13722
13723 /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13724 ///
13725 /// # Example
13726 /// ```ignore,no_run
13727 /// # use google_cloud_netapp_v1::model::Volume;
13728 /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13729 /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
13730 /// ```
13731 pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
13732 where
13733 T: std::convert::Into<crate::model::SnapshotPolicy>,
13734 {
13735 self.snapshot_policy = std::option::Option::Some(v.into());
13736 self
13737 }
13738
13739 /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13740 ///
13741 /// # Example
13742 /// ```ignore,no_run
13743 /// # use google_cloud_netapp_v1::model::Volume;
13744 /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13745 /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
13746 /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
13747 /// ```
13748 pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
13749 where
13750 T: std::convert::Into<crate::model::SnapshotPolicy>,
13751 {
13752 self.snapshot_policy = v.map(|x| x.into());
13753 self
13754 }
13755
13756 /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
13757 ///
13758 /// # Example
13759 /// ```ignore,no_run
13760 /// # use google_cloud_netapp_v1::model::Volume;
13761 /// let x = Volume::new().set_snap_reserve(42.0);
13762 /// ```
13763 pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13764 self.snap_reserve = v.into();
13765 self
13766 }
13767
13768 /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
13769 ///
13770 /// # Example
13771 /// ```ignore,no_run
13772 /// # use google_cloud_netapp_v1::model::Volume;
13773 /// let x = Volume::new().set_snapshot_directory(true);
13774 /// ```
13775 pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13776 self.snapshot_directory = v.into();
13777 self
13778 }
13779
13780 /// Sets the value of [used_gib][crate::model::Volume::used_gib].
13781 ///
13782 /// # Example
13783 /// ```ignore,no_run
13784 /// # use google_cloud_netapp_v1::model::Volume;
13785 /// let x = Volume::new().set_used_gib(42);
13786 /// ```
13787 pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13788 self.used_gib = v.into();
13789 self
13790 }
13791
13792 /// Sets the value of [security_style][crate::model::Volume::security_style].
13793 ///
13794 /// # Example
13795 /// ```ignore,no_run
13796 /// # use google_cloud_netapp_v1::model::Volume;
13797 /// use google_cloud_netapp_v1::model::SecurityStyle;
13798 /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
13799 /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
13800 /// ```
13801 pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
13802 mut self,
13803 v: T,
13804 ) -> Self {
13805 self.security_style = v.into();
13806 self
13807 }
13808
13809 /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
13810 ///
13811 /// # Example
13812 /// ```ignore,no_run
13813 /// # use google_cloud_netapp_v1::model::Volume;
13814 /// let x = Volume::new().set_kerberos_enabled(true);
13815 /// ```
13816 pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13817 self.kerberos_enabled = v.into();
13818 self
13819 }
13820
13821 /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
13822 ///
13823 /// # Example
13824 /// ```ignore,no_run
13825 /// # use google_cloud_netapp_v1::model::Volume;
13826 /// let x = Volume::new().set_ldap_enabled(true);
13827 /// ```
13828 pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13829 self.ldap_enabled = v.into();
13830 self
13831 }
13832
13833 /// Sets the value of [active_directory][crate::model::Volume::active_directory].
13834 ///
13835 /// # Example
13836 /// ```ignore,no_run
13837 /// # use google_cloud_netapp_v1::model::Volume;
13838 /// let x = Volume::new().set_active_directory("example");
13839 /// ```
13840 pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
13841 mut self,
13842 v: T,
13843 ) -> Self {
13844 self.active_directory = v.into();
13845 self
13846 }
13847
13848 /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
13849 ///
13850 /// # Example
13851 /// ```ignore,no_run
13852 /// # use google_cloud_netapp_v1::model::Volume;
13853 /// use google_cloud_netapp_v1::model::RestoreParameters;
13854 /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
13855 /// ```
13856 pub fn set_restore_parameters<T>(mut self, v: T) -> Self
13857 where
13858 T: std::convert::Into<crate::model::RestoreParameters>,
13859 {
13860 self.restore_parameters = std::option::Option::Some(v.into());
13861 self
13862 }
13863
13864 /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
13865 ///
13866 /// # Example
13867 /// ```ignore,no_run
13868 /// # use google_cloud_netapp_v1::model::Volume;
13869 /// use google_cloud_netapp_v1::model::RestoreParameters;
13870 /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
13871 /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
13872 /// ```
13873 pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13874 where
13875 T: std::convert::Into<crate::model::RestoreParameters>,
13876 {
13877 self.restore_parameters = v.map(|x| x.into());
13878 self
13879 }
13880
13881 /// Sets the value of [kms_config][crate::model::Volume::kms_config].
13882 ///
13883 /// # Example
13884 /// ```ignore,no_run
13885 /// # use google_cloud_netapp_v1::model::Volume;
13886 /// let x = Volume::new().set_kms_config("example");
13887 /// ```
13888 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13889 self.kms_config = v.into();
13890 self
13891 }
13892
13893 /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
13894 ///
13895 /// # Example
13896 /// ```ignore,no_run
13897 /// # use google_cloud_netapp_v1::model::Volume;
13898 /// use google_cloud_netapp_v1::model::EncryptionType;
13899 /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
13900 /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
13901 /// ```
13902 pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
13903 mut self,
13904 v: T,
13905 ) -> Self {
13906 self.encryption_type = v.into();
13907 self
13908 }
13909
13910 /// Sets the value of [has_replication][crate::model::Volume::has_replication].
13911 ///
13912 /// # Example
13913 /// ```ignore,no_run
13914 /// # use google_cloud_netapp_v1::model::Volume;
13915 /// let x = Volume::new().set_has_replication(true);
13916 /// ```
13917 pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13918 self.has_replication = v.into();
13919 self
13920 }
13921
13922 /// Sets the value of [backup_config][crate::model::Volume::backup_config].
13923 ///
13924 /// # Example
13925 /// ```ignore,no_run
13926 /// # use google_cloud_netapp_v1::model::Volume;
13927 /// use google_cloud_netapp_v1::model::BackupConfig;
13928 /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
13929 /// ```
13930 pub fn set_backup_config<T>(mut self, v: T) -> Self
13931 where
13932 T: std::convert::Into<crate::model::BackupConfig>,
13933 {
13934 self.backup_config = std::option::Option::Some(v.into());
13935 self
13936 }
13937
13938 /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
13939 ///
13940 /// # Example
13941 /// ```ignore,no_run
13942 /// # use google_cloud_netapp_v1::model::Volume;
13943 /// use google_cloud_netapp_v1::model::BackupConfig;
13944 /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
13945 /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
13946 /// ```
13947 pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
13948 where
13949 T: std::convert::Into<crate::model::BackupConfig>,
13950 {
13951 self.backup_config = v.map(|x| x.into());
13952 self
13953 }
13954
13955 /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
13956 ///
13957 /// # Example
13958 /// ```ignore,no_run
13959 /// # use google_cloud_netapp_v1::model::Volume;
13960 /// use google_cloud_netapp_v1::model::RestrictedAction;
13961 /// let x = Volume::new().set_restricted_actions([
13962 /// RestrictedAction::Delete,
13963 /// ]);
13964 /// ```
13965 pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
13966 where
13967 T: std::iter::IntoIterator<Item = V>,
13968 V: std::convert::Into<crate::model::RestrictedAction>,
13969 {
13970 use std::iter::Iterator;
13971 self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
13972 self
13973 }
13974
13975 /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
13976 ///
13977 /// # Example
13978 /// ```ignore,no_run
13979 /// # use google_cloud_netapp_v1::model::Volume;
13980 /// let x = Volume::new().set_large_capacity(true);
13981 /// ```
13982 pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13983 self.large_capacity = v.into();
13984 self
13985 }
13986
13987 /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
13988 ///
13989 /// # Example
13990 /// ```ignore,no_run
13991 /// # use google_cloud_netapp_v1::model::Volume;
13992 /// let x = Volume::new().set_multiple_endpoints(true);
13993 /// ```
13994 pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13995 self.multiple_endpoints = v.into();
13996 self
13997 }
13998
13999 /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
14000 ///
14001 /// # Example
14002 /// ```ignore,no_run
14003 /// # use google_cloud_netapp_v1::model::Volume;
14004 /// use google_cloud_netapp_v1::model::TieringPolicy;
14005 /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
14006 /// ```
14007 pub fn set_tiering_policy<T>(mut self, v: T) -> Self
14008 where
14009 T: std::convert::Into<crate::model::TieringPolicy>,
14010 {
14011 self.tiering_policy = std::option::Option::Some(v.into());
14012 self
14013 }
14014
14015 /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
14016 ///
14017 /// # Example
14018 /// ```ignore,no_run
14019 /// # use google_cloud_netapp_v1::model::Volume;
14020 /// use google_cloud_netapp_v1::model::TieringPolicy;
14021 /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
14022 /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
14023 /// ```
14024 pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
14025 where
14026 T: std::convert::Into<crate::model::TieringPolicy>,
14027 {
14028 self.tiering_policy = v.map(|x| x.into());
14029 self
14030 }
14031
14032 /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
14033 ///
14034 /// # Example
14035 /// ```ignore,no_run
14036 /// # use google_cloud_netapp_v1::model::Volume;
14037 /// let x = Volume::new().set_replica_zone("example");
14038 /// ```
14039 pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14040 self.replica_zone = v.into();
14041 self
14042 }
14043
14044 /// Sets the value of [zone][crate::model::Volume::zone].
14045 ///
14046 /// # Example
14047 /// ```ignore,no_run
14048 /// # use google_cloud_netapp_v1::model::Volume;
14049 /// let x = Volume::new().set_zone("example");
14050 /// ```
14051 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14052 self.zone = v.into();
14053 self
14054 }
14055
14056 /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
14057 ///
14058 /// # Example
14059 /// ```ignore,no_run
14060 /// # use google_cloud_netapp_v1::model::Volume;
14061 /// let x = Volume::new().set_cold_tier_size_gib(42);
14062 /// ```
14063 pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14064 self.cold_tier_size_gib = v.into();
14065 self
14066 }
14067
14068 /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14069 ///
14070 /// # Example
14071 /// ```ignore,no_run
14072 /// # use google_cloud_netapp_v1::model::Volume;
14073 /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14074 /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
14075 /// ```
14076 pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
14077 where
14078 T: std::convert::Into<crate::model::HybridReplicationParameters>,
14079 {
14080 self.hybrid_replication_parameters = std::option::Option::Some(v.into());
14081 self
14082 }
14083
14084 /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14085 ///
14086 /// # Example
14087 /// ```ignore,no_run
14088 /// # use google_cloud_netapp_v1::model::Volume;
14089 /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14090 /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
14091 /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
14092 /// ```
14093 pub fn set_or_clear_hybrid_replication_parameters<T>(
14094 mut self,
14095 v: std::option::Option<T>,
14096 ) -> Self
14097 where
14098 T: std::convert::Into<crate::model::HybridReplicationParameters>,
14099 {
14100 self.hybrid_replication_parameters = v.map(|x| x.into());
14101 self
14102 }
14103
14104 /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
14105 ///
14106 /// # Example
14107 /// ```ignore,no_run
14108 /// # use google_cloud_netapp_v1::model::Volume;
14109 /// let x = Volume::new().set_throughput_mibps(42.0);
14110 /// ```
14111 pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14112 self.throughput_mibps = v.into();
14113 self
14114 }
14115
14116 /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
14117 ///
14118 /// # Example
14119 /// ```ignore,no_run
14120 /// # use google_cloud_netapp_v1::model::Volume;
14121 /// use google_cloud_netapp_v1::model::CacheParameters;
14122 /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
14123 /// ```
14124 pub fn set_cache_parameters<T>(mut self, v: T) -> Self
14125 where
14126 T: std::convert::Into<crate::model::CacheParameters>,
14127 {
14128 self.cache_parameters = std::option::Option::Some(v.into());
14129 self
14130 }
14131
14132 /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
14133 ///
14134 /// # Example
14135 /// ```ignore,no_run
14136 /// # use google_cloud_netapp_v1::model::Volume;
14137 /// use google_cloud_netapp_v1::model::CacheParameters;
14138 /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
14139 /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
14140 /// ```
14141 pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14142 where
14143 T: std::convert::Into<crate::model::CacheParameters>,
14144 {
14145 self.cache_parameters = v.map(|x| x.into());
14146 self
14147 }
14148
14149 /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
14150 ///
14151 /// # Example
14152 /// ```ignore,no_run
14153 /// # use google_cloud_netapp_v1::model::Volume;
14154 /// let x = Volume::new().set_hot_tier_size_used_gib(42);
14155 /// ```
14156 pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14157 self.hot_tier_size_used_gib = v.into();
14158 self
14159 }
14160
14161 /// Sets the value of [block_devices][crate::model::Volume::block_devices].
14162 ///
14163 /// # Example
14164 /// ```ignore,no_run
14165 /// # use google_cloud_netapp_v1::model::Volume;
14166 /// use google_cloud_netapp_v1::model::BlockDevice;
14167 /// let x = Volume::new()
14168 /// .set_block_devices([
14169 /// BlockDevice::default()/* use setters */,
14170 /// BlockDevice::default()/* use (different) setters */,
14171 /// ]);
14172 /// ```
14173 pub fn set_block_devices<T, V>(mut self, v: T) -> Self
14174 where
14175 T: std::iter::IntoIterator<Item = V>,
14176 V: std::convert::Into<crate::model::BlockDevice>,
14177 {
14178 use std::iter::Iterator;
14179 self.block_devices = v.into_iter().map(|i| i.into()).collect();
14180 self
14181 }
14182
14183 /// Sets the value of [clone_details][crate::model::Volume::clone_details].
14184 ///
14185 /// # Example
14186 /// ```ignore,no_run
14187 /// # use google_cloud_netapp_v1::model::Volume;
14188 /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14189 /// let x = Volume::new().set_clone_details(CloneDetails::default()/* use setters */);
14190 /// ```
14191 pub fn set_clone_details<T>(mut self, v: T) -> Self
14192 where
14193 T: std::convert::Into<crate::model::volume::CloneDetails>,
14194 {
14195 self.clone_details = std::option::Option::Some(v.into());
14196 self
14197 }
14198
14199 /// Sets or clears the value of [clone_details][crate::model::Volume::clone_details].
14200 ///
14201 /// # Example
14202 /// ```ignore,no_run
14203 /// # use google_cloud_netapp_v1::model::Volume;
14204 /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14205 /// let x = Volume::new().set_or_clear_clone_details(Some(CloneDetails::default()/* use setters */));
14206 /// let x = Volume::new().set_or_clear_clone_details(None::<CloneDetails>);
14207 /// ```
14208 pub fn set_or_clear_clone_details<T>(mut self, v: std::option::Option<T>) -> Self
14209 where
14210 T: std::convert::Into<crate::model::volume::CloneDetails>,
14211 {
14212 self.clone_details = v.map(|x| x.into());
14213 self
14214 }
14215}
14216
14217impl wkt::message::Message for Volume {
14218 fn typename() -> &'static str {
14219 "type.googleapis.com/google.cloud.netapp.v1.Volume"
14220 }
14221}
14222
14223/// Defines additional types related to [Volume].
14224pub mod volume {
14225 #[allow(unused_imports)]
14226 use super::*;
14227
14228 /// Details about a clone volume.
14229 #[derive(Clone, Default, PartialEq)]
14230 #[non_exhaustive]
14231 pub struct CloneDetails {
14232 /// Output only. Specifies the full resource name of the source snapshot from
14233 /// which this volume was cloned. Format:
14234 /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
14235 pub source_snapshot: std::string::String,
14236
14237 /// Output only. Full name of the source volume resource.
14238 /// Format:
14239 /// projects/{project}/locations/{location}/volumes/{volume}
14240 pub source_volume: std::string::String,
14241
14242 /// Output only. Shared space in GiB. Determined at volume creation time
14243 /// based on size of source snapshot.
14244 pub shared_space_gib: i64,
14245
14246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14247 }
14248
14249 impl CloneDetails {
14250 pub fn new() -> Self {
14251 std::default::Default::default()
14252 }
14253
14254 /// Sets the value of [source_snapshot][crate::model::volume::CloneDetails::source_snapshot].
14255 ///
14256 /// # Example
14257 /// ```ignore,no_run
14258 /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14259 /// let x = CloneDetails::new().set_source_snapshot("example");
14260 /// ```
14261 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(
14262 mut self,
14263 v: T,
14264 ) -> Self {
14265 self.source_snapshot = v.into();
14266 self
14267 }
14268
14269 /// Sets the value of [source_volume][crate::model::volume::CloneDetails::source_volume].
14270 ///
14271 /// # Example
14272 /// ```ignore,no_run
14273 /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14274 /// let x = CloneDetails::new().set_source_volume("example");
14275 /// ```
14276 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(
14277 mut self,
14278 v: T,
14279 ) -> Self {
14280 self.source_volume = v.into();
14281 self
14282 }
14283
14284 /// Sets the value of [shared_space_gib][crate::model::volume::CloneDetails::shared_space_gib].
14285 ///
14286 /// # Example
14287 /// ```ignore,no_run
14288 /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14289 /// let x = CloneDetails::new().set_shared_space_gib(42);
14290 /// ```
14291 pub fn set_shared_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14292 self.shared_space_gib = v.into();
14293 self
14294 }
14295 }
14296
14297 impl wkt::message::Message for CloneDetails {
14298 fn typename() -> &'static str {
14299 "type.googleapis.com/google.cloud.netapp.v1.Volume.CloneDetails"
14300 }
14301 }
14302
14303 /// The volume states
14304 ///
14305 /// # Working with unknown values
14306 ///
14307 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14308 /// additional enum variants at any time. Adding new variants is not considered
14309 /// a breaking change. Applications should write their code in anticipation of:
14310 ///
14311 /// - New values appearing in future releases of the client library, **and**
14312 /// - New values received dynamically, without application changes.
14313 ///
14314 /// Please consult the [Working with enums] section in the user guide for some
14315 /// guidelines.
14316 ///
14317 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14318 #[derive(Clone, Debug, PartialEq)]
14319 #[non_exhaustive]
14320 pub enum State {
14321 /// Unspecified Volume State
14322 Unspecified,
14323 /// Volume State is Ready
14324 Ready,
14325 /// Volume State is Creating
14326 Creating,
14327 /// Volume State is Deleting
14328 Deleting,
14329 /// Volume State is Updating
14330 Updating,
14331 /// Volume State is Restoring
14332 Restoring,
14333 /// Volume State is Disabled
14334 Disabled,
14335 /// Volume State is Error
14336 Error,
14337 /// Volume State is Preparing. Note that this is different from CREATING
14338 /// where CREATING means the volume is being created, while PREPARING means
14339 /// the volume is created and now being prepared for the replication.
14340 Preparing,
14341 /// Volume State is Read Only
14342 ReadOnly,
14343 /// If set, the enum was initialized with an unknown value.
14344 ///
14345 /// Applications can examine the value using [State::value] or
14346 /// [State::name].
14347 UnknownValue(state::UnknownValue),
14348 }
14349
14350 #[doc(hidden)]
14351 pub mod state {
14352 #[allow(unused_imports)]
14353 use super::*;
14354 #[derive(Clone, Debug, PartialEq)]
14355 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14356 }
14357
14358 impl State {
14359 /// Gets the enum value.
14360 ///
14361 /// Returns `None` if the enum contains an unknown value deserialized from
14362 /// the string representation of enums.
14363 pub fn value(&self) -> std::option::Option<i32> {
14364 match self {
14365 Self::Unspecified => std::option::Option::Some(0),
14366 Self::Ready => std::option::Option::Some(1),
14367 Self::Creating => std::option::Option::Some(2),
14368 Self::Deleting => std::option::Option::Some(3),
14369 Self::Updating => std::option::Option::Some(4),
14370 Self::Restoring => std::option::Option::Some(5),
14371 Self::Disabled => std::option::Option::Some(6),
14372 Self::Error => std::option::Option::Some(7),
14373 Self::Preparing => std::option::Option::Some(8),
14374 Self::ReadOnly => std::option::Option::Some(9),
14375 Self::UnknownValue(u) => u.0.value(),
14376 }
14377 }
14378
14379 /// Gets the enum value as a string.
14380 ///
14381 /// Returns `None` if the enum contains an unknown value deserialized from
14382 /// the integer representation of enums.
14383 pub fn name(&self) -> std::option::Option<&str> {
14384 match self {
14385 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14386 Self::Ready => std::option::Option::Some("READY"),
14387 Self::Creating => std::option::Option::Some("CREATING"),
14388 Self::Deleting => std::option::Option::Some("DELETING"),
14389 Self::Updating => std::option::Option::Some("UPDATING"),
14390 Self::Restoring => std::option::Option::Some("RESTORING"),
14391 Self::Disabled => std::option::Option::Some("DISABLED"),
14392 Self::Error => std::option::Option::Some("ERROR"),
14393 Self::Preparing => std::option::Option::Some("PREPARING"),
14394 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
14395 Self::UnknownValue(u) => u.0.name(),
14396 }
14397 }
14398 }
14399
14400 impl std::default::Default for State {
14401 fn default() -> Self {
14402 use std::convert::From;
14403 Self::from(0)
14404 }
14405 }
14406
14407 impl std::fmt::Display for State {
14408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14409 wkt::internal::display_enum(f, self.name(), self.value())
14410 }
14411 }
14412
14413 impl std::convert::From<i32> for State {
14414 fn from(value: i32) -> Self {
14415 match value {
14416 0 => Self::Unspecified,
14417 1 => Self::Ready,
14418 2 => Self::Creating,
14419 3 => Self::Deleting,
14420 4 => Self::Updating,
14421 5 => Self::Restoring,
14422 6 => Self::Disabled,
14423 7 => Self::Error,
14424 8 => Self::Preparing,
14425 9 => Self::ReadOnly,
14426 _ => Self::UnknownValue(state::UnknownValue(
14427 wkt::internal::UnknownEnumValue::Integer(value),
14428 )),
14429 }
14430 }
14431 }
14432
14433 impl std::convert::From<&str> for State {
14434 fn from(value: &str) -> Self {
14435 use std::string::ToString;
14436 match value {
14437 "STATE_UNSPECIFIED" => Self::Unspecified,
14438 "READY" => Self::Ready,
14439 "CREATING" => Self::Creating,
14440 "DELETING" => Self::Deleting,
14441 "UPDATING" => Self::Updating,
14442 "RESTORING" => Self::Restoring,
14443 "DISABLED" => Self::Disabled,
14444 "ERROR" => Self::Error,
14445 "PREPARING" => Self::Preparing,
14446 "READ_ONLY" => Self::ReadOnly,
14447 _ => Self::UnknownValue(state::UnknownValue(
14448 wkt::internal::UnknownEnumValue::String(value.to_string()),
14449 )),
14450 }
14451 }
14452 }
14453
14454 impl serde::ser::Serialize for State {
14455 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14456 where
14457 S: serde::Serializer,
14458 {
14459 match self {
14460 Self::Unspecified => serializer.serialize_i32(0),
14461 Self::Ready => serializer.serialize_i32(1),
14462 Self::Creating => serializer.serialize_i32(2),
14463 Self::Deleting => serializer.serialize_i32(3),
14464 Self::Updating => serializer.serialize_i32(4),
14465 Self::Restoring => serializer.serialize_i32(5),
14466 Self::Disabled => serializer.serialize_i32(6),
14467 Self::Error => serializer.serialize_i32(7),
14468 Self::Preparing => serializer.serialize_i32(8),
14469 Self::ReadOnly => serializer.serialize_i32(9),
14470 Self::UnknownValue(u) => u.0.serialize(serializer),
14471 }
14472 }
14473 }
14474
14475 impl<'de> serde::de::Deserialize<'de> for State {
14476 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14477 where
14478 D: serde::Deserializer<'de>,
14479 {
14480 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14481 ".google.cloud.netapp.v1.Volume.State",
14482 ))
14483 }
14484 }
14485}
14486
14487/// Defines the export policy for the volume.
14488#[derive(Clone, Default, PartialEq)]
14489#[non_exhaustive]
14490pub struct ExportPolicy {
14491 /// Required. List of export policy rules
14492 pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
14493
14494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14495}
14496
14497impl ExportPolicy {
14498 pub fn new() -> Self {
14499 std::default::Default::default()
14500 }
14501
14502 /// Sets the value of [rules][crate::model::ExportPolicy::rules].
14503 ///
14504 /// # Example
14505 /// ```ignore,no_run
14506 /// # use google_cloud_netapp_v1::model::ExportPolicy;
14507 /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14508 /// let x = ExportPolicy::new()
14509 /// .set_rules([
14510 /// SimpleExportPolicyRule::default()/* use setters */,
14511 /// SimpleExportPolicyRule::default()/* use (different) setters */,
14512 /// ]);
14513 /// ```
14514 pub fn set_rules<T, V>(mut self, v: T) -> Self
14515 where
14516 T: std::iter::IntoIterator<Item = V>,
14517 V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
14518 {
14519 use std::iter::Iterator;
14520 self.rules = v.into_iter().map(|i| i.into()).collect();
14521 self
14522 }
14523}
14524
14525impl wkt::message::Message for ExportPolicy {
14526 fn typename() -> &'static str {
14527 "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
14528 }
14529}
14530
14531/// An export policy rule describing various export options.
14532#[derive(Clone, Default, PartialEq)]
14533#[non_exhaustive]
14534pub struct SimpleExportPolicyRule {
14535 /// Comma separated list of allowed clients IP addresses
14536 pub allowed_clients: std::option::Option<std::string::String>,
14537
14538 /// Whether Unix root access will be granted.
14539 pub has_root_access: std::option::Option<std::string::String>,
14540
14541 /// Access type (ReadWrite, ReadOnly, None)
14542 pub access_type: std::option::Option<crate::model::AccessType>,
14543
14544 /// NFS V3 protocol.
14545 pub nfsv3: std::option::Option<bool>,
14546
14547 /// NFS V4 protocol.
14548 pub nfsv4: std::option::Option<bool>,
14549
14550 /// If enabled (true) the rule defines a read only access for clients matching
14551 /// the 'allowedClients' specification. It enables nfs clients to mount using
14552 /// 'authentication' kerberos security mode.
14553 pub kerberos_5_read_only: std::option::Option<bool>,
14554
14555 /// If enabled (true) the rule defines read and write access for clients
14556 /// matching the 'allowedClients' specification. It enables nfs clients to
14557 /// mount using 'authentication' kerberos security mode. The
14558 /// 'kerberos5ReadOnly' value be ignored if this is enabled.
14559 pub kerberos_5_read_write: std::option::Option<bool>,
14560
14561 /// If enabled (true) the rule defines a read only access for clients matching
14562 /// the 'allowedClients' specification. It enables nfs clients to mount using
14563 /// 'integrity' kerberos security mode.
14564 pub kerberos_5i_read_only: std::option::Option<bool>,
14565
14566 /// If enabled (true) the rule defines read and write access for clients
14567 /// matching the 'allowedClients' specification. It enables nfs clients to
14568 /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
14569 /// value be ignored if this is enabled.
14570 pub kerberos_5i_read_write: std::option::Option<bool>,
14571
14572 /// If enabled (true) the rule defines a read only access for clients matching
14573 /// the 'allowedClients' specification. It enables nfs clients to mount using
14574 /// 'privacy' kerberos security mode.
14575 pub kerberos_5p_read_only: std::option::Option<bool>,
14576
14577 /// If enabled (true) the rule defines read and write access for clients
14578 /// matching the 'allowedClients' specification. It enables nfs clients to
14579 /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
14580 /// value be ignored if this is enabled.
14581 pub kerberos_5p_read_write: std::option::Option<bool>,
14582
14583 /// Optional. Defines how user identity squashing is applied for this export
14584 /// rule. This field is the preferred way to configure squashing behavior and
14585 /// takes precedence over `has_root_access` if both are provided.
14586 pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
14587
14588 /// Optional. An integer representing the anonymous user ID. Range is 0 to
14589 /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
14590 pub anon_uid: std::option::Option<i64>,
14591
14592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14593}
14594
14595impl SimpleExportPolicyRule {
14596 pub fn new() -> Self {
14597 std::default::Default::default()
14598 }
14599
14600 /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14601 ///
14602 /// # Example
14603 /// ```ignore,no_run
14604 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14605 /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
14606 /// ```
14607 pub fn set_allowed_clients<T>(mut self, v: T) -> Self
14608 where
14609 T: std::convert::Into<std::string::String>,
14610 {
14611 self.allowed_clients = std::option::Option::Some(v.into());
14612 self
14613 }
14614
14615 /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14616 ///
14617 /// # Example
14618 /// ```ignore,no_run
14619 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14620 /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
14621 /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
14622 /// ```
14623 pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
14624 where
14625 T: std::convert::Into<std::string::String>,
14626 {
14627 self.allowed_clients = v.map(|x| x.into());
14628 self
14629 }
14630
14631 /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14632 ///
14633 /// # Example
14634 /// ```ignore,no_run
14635 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14636 /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
14637 /// ```
14638 pub fn set_has_root_access<T>(mut self, v: T) -> Self
14639 where
14640 T: std::convert::Into<std::string::String>,
14641 {
14642 self.has_root_access = std::option::Option::Some(v.into());
14643 self
14644 }
14645
14646 /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14647 ///
14648 /// # Example
14649 /// ```ignore,no_run
14650 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14651 /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
14652 /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
14653 /// ```
14654 pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
14655 where
14656 T: std::convert::Into<std::string::String>,
14657 {
14658 self.has_root_access = v.map(|x| x.into());
14659 self
14660 }
14661
14662 /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14663 ///
14664 /// # Example
14665 /// ```ignore,no_run
14666 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14667 /// use google_cloud_netapp_v1::model::AccessType;
14668 /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
14669 /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
14670 /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
14671 /// ```
14672 pub fn set_access_type<T>(mut self, v: T) -> Self
14673 where
14674 T: std::convert::Into<crate::model::AccessType>,
14675 {
14676 self.access_type = std::option::Option::Some(v.into());
14677 self
14678 }
14679
14680 /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14681 ///
14682 /// # Example
14683 /// ```ignore,no_run
14684 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14685 /// use google_cloud_netapp_v1::model::AccessType;
14686 /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
14687 /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
14688 /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
14689 /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
14690 /// ```
14691 pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
14692 where
14693 T: std::convert::Into<crate::model::AccessType>,
14694 {
14695 self.access_type = v.map(|x| x.into());
14696 self
14697 }
14698
14699 /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14700 ///
14701 /// # Example
14702 /// ```ignore,no_run
14703 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14704 /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
14705 /// ```
14706 pub fn set_nfsv3<T>(mut self, v: T) -> Self
14707 where
14708 T: std::convert::Into<bool>,
14709 {
14710 self.nfsv3 = std::option::Option::Some(v.into());
14711 self
14712 }
14713
14714 /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14715 ///
14716 /// # Example
14717 /// ```ignore,no_run
14718 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14719 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
14720 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
14721 /// ```
14722 pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
14723 where
14724 T: std::convert::Into<bool>,
14725 {
14726 self.nfsv3 = v.map(|x| x.into());
14727 self
14728 }
14729
14730 /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14731 ///
14732 /// # Example
14733 /// ```ignore,no_run
14734 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14735 /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
14736 /// ```
14737 pub fn set_nfsv4<T>(mut self, v: T) -> Self
14738 where
14739 T: std::convert::Into<bool>,
14740 {
14741 self.nfsv4 = std::option::Option::Some(v.into());
14742 self
14743 }
14744
14745 /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14746 ///
14747 /// # Example
14748 /// ```ignore,no_run
14749 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14750 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
14751 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
14752 /// ```
14753 pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
14754 where
14755 T: std::convert::Into<bool>,
14756 {
14757 self.nfsv4 = v.map(|x| x.into());
14758 self
14759 }
14760
14761 /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14762 ///
14763 /// # Example
14764 /// ```ignore,no_run
14765 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14766 /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
14767 /// ```
14768 pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
14769 where
14770 T: std::convert::Into<bool>,
14771 {
14772 self.kerberos_5_read_only = std::option::Option::Some(v.into());
14773 self
14774 }
14775
14776 /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14777 ///
14778 /// # Example
14779 /// ```ignore,no_run
14780 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14781 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
14782 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
14783 /// ```
14784 pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14785 where
14786 T: std::convert::Into<bool>,
14787 {
14788 self.kerberos_5_read_only = v.map(|x| x.into());
14789 self
14790 }
14791
14792 /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14793 ///
14794 /// # Example
14795 /// ```ignore,no_run
14796 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14797 /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
14798 /// ```
14799 pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
14800 where
14801 T: std::convert::Into<bool>,
14802 {
14803 self.kerberos_5_read_write = std::option::Option::Some(v.into());
14804 self
14805 }
14806
14807 /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14808 ///
14809 /// # Example
14810 /// ```ignore,no_run
14811 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14812 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
14813 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
14814 /// ```
14815 pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14816 where
14817 T: std::convert::Into<bool>,
14818 {
14819 self.kerberos_5_read_write = v.map(|x| x.into());
14820 self
14821 }
14822
14823 /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14824 ///
14825 /// # Example
14826 /// ```ignore,no_run
14827 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14828 /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
14829 /// ```
14830 pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
14831 where
14832 T: std::convert::Into<bool>,
14833 {
14834 self.kerberos_5i_read_only = std::option::Option::Some(v.into());
14835 self
14836 }
14837
14838 /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14839 ///
14840 /// # Example
14841 /// ```ignore,no_run
14842 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14843 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
14844 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
14845 /// ```
14846 pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14847 where
14848 T: std::convert::Into<bool>,
14849 {
14850 self.kerberos_5i_read_only = v.map(|x| x.into());
14851 self
14852 }
14853
14854 /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14855 ///
14856 /// # Example
14857 /// ```ignore,no_run
14858 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14859 /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
14860 /// ```
14861 pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
14862 where
14863 T: std::convert::Into<bool>,
14864 {
14865 self.kerberos_5i_read_write = std::option::Option::Some(v.into());
14866 self
14867 }
14868
14869 /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14870 ///
14871 /// # Example
14872 /// ```ignore,no_run
14873 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14874 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
14875 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
14876 /// ```
14877 pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14878 where
14879 T: std::convert::Into<bool>,
14880 {
14881 self.kerberos_5i_read_write = v.map(|x| x.into());
14882 self
14883 }
14884
14885 /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14886 ///
14887 /// # Example
14888 /// ```ignore,no_run
14889 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14890 /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
14891 /// ```
14892 pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
14893 where
14894 T: std::convert::Into<bool>,
14895 {
14896 self.kerberos_5p_read_only = std::option::Option::Some(v.into());
14897 self
14898 }
14899
14900 /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14901 ///
14902 /// # Example
14903 /// ```ignore,no_run
14904 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14905 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
14906 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
14907 /// ```
14908 pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14909 where
14910 T: std::convert::Into<bool>,
14911 {
14912 self.kerberos_5p_read_only = v.map(|x| x.into());
14913 self
14914 }
14915
14916 /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14917 ///
14918 /// # Example
14919 /// ```ignore,no_run
14920 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14921 /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
14922 /// ```
14923 pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
14924 where
14925 T: std::convert::Into<bool>,
14926 {
14927 self.kerberos_5p_read_write = std::option::Option::Some(v.into());
14928 self
14929 }
14930
14931 /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14932 ///
14933 /// # Example
14934 /// ```ignore,no_run
14935 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14936 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
14937 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
14938 /// ```
14939 pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14940 where
14941 T: std::convert::Into<bool>,
14942 {
14943 self.kerberos_5p_read_write = v.map(|x| x.into());
14944 self
14945 }
14946
14947 /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14948 ///
14949 /// # Example
14950 /// ```ignore,no_run
14951 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14952 /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14953 /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
14954 /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
14955 /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
14956 /// ```
14957 pub fn set_squash_mode<T>(mut self, v: T) -> Self
14958 where
14959 T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14960 {
14961 self.squash_mode = std::option::Option::Some(v.into());
14962 self
14963 }
14964
14965 /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14966 ///
14967 /// # Example
14968 /// ```ignore,no_run
14969 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14970 /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14971 /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
14972 /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
14973 /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
14974 /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
14975 /// ```
14976 pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
14977 where
14978 T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14979 {
14980 self.squash_mode = v.map(|x| x.into());
14981 self
14982 }
14983
14984 /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14985 ///
14986 /// # Example
14987 /// ```ignore,no_run
14988 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14989 /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
14990 /// ```
14991 pub fn set_anon_uid<T>(mut self, v: T) -> Self
14992 where
14993 T: std::convert::Into<i64>,
14994 {
14995 self.anon_uid = std::option::Option::Some(v.into());
14996 self
14997 }
14998
14999 /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15000 ///
15001 /// # Example
15002 /// ```ignore,no_run
15003 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15004 /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
15005 /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
15006 /// ```
15007 pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
15008 where
15009 T: std::convert::Into<i64>,
15010 {
15011 self.anon_uid = v.map(|x| x.into());
15012 self
15013 }
15014}
15015
15016impl wkt::message::Message for SimpleExportPolicyRule {
15017 fn typename() -> &'static str {
15018 "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
15019 }
15020}
15021
15022/// Defines additional types related to [SimpleExportPolicyRule].
15023pub mod simple_export_policy_rule {
15024 #[allow(unused_imports)]
15025 use super::*;
15026
15027 /// `SquashMode` defines how remote user privileges are restricted when
15028 /// accessing an NFS export. It controls how user identities (like root) are
15029 /// mapped to anonymous users to limit access and enforce security.
15030 ///
15031 /// # Working with unknown values
15032 ///
15033 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15034 /// additional enum variants at any time. Adding new variants is not considered
15035 /// a breaking change. Applications should write their code in anticipation of:
15036 ///
15037 /// - New values appearing in future releases of the client library, **and**
15038 /// - New values received dynamically, without application changes.
15039 ///
15040 /// Please consult the [Working with enums] section in the user guide for some
15041 /// guidelines.
15042 ///
15043 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15044 #[derive(Clone, Debug, PartialEq)]
15045 #[non_exhaustive]
15046 pub enum SquashMode {
15047 /// Defaults to `NO_ROOT_SQUASH`.
15048 Unspecified,
15049 /// The root user (UID 0) retains full access. Other users are
15050 /// unaffected.
15051 NoRootSquash,
15052 /// The root user (UID 0) is squashed to anonymous user ID. Other users are
15053 /// unaffected.
15054 RootSquash,
15055 /// All users are squashed to anonymous user ID.
15056 AllSquash,
15057 /// If set, the enum was initialized with an unknown value.
15058 ///
15059 /// Applications can examine the value using [SquashMode::value] or
15060 /// [SquashMode::name].
15061 UnknownValue(squash_mode::UnknownValue),
15062 }
15063
15064 #[doc(hidden)]
15065 pub mod squash_mode {
15066 #[allow(unused_imports)]
15067 use super::*;
15068 #[derive(Clone, Debug, PartialEq)]
15069 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15070 }
15071
15072 impl SquashMode {
15073 /// Gets the enum value.
15074 ///
15075 /// Returns `None` if the enum contains an unknown value deserialized from
15076 /// the string representation of enums.
15077 pub fn value(&self) -> std::option::Option<i32> {
15078 match self {
15079 Self::Unspecified => std::option::Option::Some(0),
15080 Self::NoRootSquash => std::option::Option::Some(1),
15081 Self::RootSquash => std::option::Option::Some(2),
15082 Self::AllSquash => std::option::Option::Some(3),
15083 Self::UnknownValue(u) => u.0.value(),
15084 }
15085 }
15086
15087 /// Gets the enum value as a string.
15088 ///
15089 /// Returns `None` if the enum contains an unknown value deserialized from
15090 /// the integer representation of enums.
15091 pub fn name(&self) -> std::option::Option<&str> {
15092 match self {
15093 Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
15094 Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
15095 Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
15096 Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
15097 Self::UnknownValue(u) => u.0.name(),
15098 }
15099 }
15100 }
15101
15102 impl std::default::Default for SquashMode {
15103 fn default() -> Self {
15104 use std::convert::From;
15105 Self::from(0)
15106 }
15107 }
15108
15109 impl std::fmt::Display for SquashMode {
15110 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15111 wkt::internal::display_enum(f, self.name(), self.value())
15112 }
15113 }
15114
15115 impl std::convert::From<i32> for SquashMode {
15116 fn from(value: i32) -> Self {
15117 match value {
15118 0 => Self::Unspecified,
15119 1 => Self::NoRootSquash,
15120 2 => Self::RootSquash,
15121 3 => Self::AllSquash,
15122 _ => Self::UnknownValue(squash_mode::UnknownValue(
15123 wkt::internal::UnknownEnumValue::Integer(value),
15124 )),
15125 }
15126 }
15127 }
15128
15129 impl std::convert::From<&str> for SquashMode {
15130 fn from(value: &str) -> Self {
15131 use std::string::ToString;
15132 match value {
15133 "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
15134 "NO_ROOT_SQUASH" => Self::NoRootSquash,
15135 "ROOT_SQUASH" => Self::RootSquash,
15136 "ALL_SQUASH" => Self::AllSquash,
15137 _ => Self::UnknownValue(squash_mode::UnknownValue(
15138 wkt::internal::UnknownEnumValue::String(value.to_string()),
15139 )),
15140 }
15141 }
15142 }
15143
15144 impl serde::ser::Serialize for SquashMode {
15145 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15146 where
15147 S: serde::Serializer,
15148 {
15149 match self {
15150 Self::Unspecified => serializer.serialize_i32(0),
15151 Self::NoRootSquash => serializer.serialize_i32(1),
15152 Self::RootSquash => serializer.serialize_i32(2),
15153 Self::AllSquash => serializer.serialize_i32(3),
15154 Self::UnknownValue(u) => u.0.serialize(serializer),
15155 }
15156 }
15157 }
15158
15159 impl<'de> serde::de::Deserialize<'de> for SquashMode {
15160 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15161 where
15162 D: serde::Deserializer<'de>,
15163 {
15164 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
15165 ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
15166 ))
15167 }
15168 }
15169}
15170
15171/// Snapshot Policy for a volume.
15172#[derive(Clone, Default, PartialEq)]
15173#[non_exhaustive]
15174pub struct SnapshotPolicy {
15175 /// If enabled, make snapshots automatically according to the schedules.
15176 /// Default is false.
15177 pub enabled: std::option::Option<bool>,
15178
15179 /// Hourly schedule policy.
15180 pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
15181
15182 /// Daily schedule policy.
15183 pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
15184
15185 /// Weekly schedule policy.
15186 pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
15187
15188 /// Monthly schedule policy.
15189 pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
15190
15191 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15192}
15193
15194impl SnapshotPolicy {
15195 pub fn new() -> Self {
15196 std::default::Default::default()
15197 }
15198
15199 /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
15200 ///
15201 /// # Example
15202 /// ```ignore,no_run
15203 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15204 /// let x = SnapshotPolicy::new().set_enabled(true);
15205 /// ```
15206 pub fn set_enabled<T>(mut self, v: T) -> Self
15207 where
15208 T: std::convert::Into<bool>,
15209 {
15210 self.enabled = std::option::Option::Some(v.into());
15211 self
15212 }
15213
15214 /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
15215 ///
15216 /// # Example
15217 /// ```ignore,no_run
15218 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15219 /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
15220 /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
15221 /// ```
15222 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15223 where
15224 T: std::convert::Into<bool>,
15225 {
15226 self.enabled = v.map(|x| x.into());
15227 self
15228 }
15229
15230 /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15231 ///
15232 /// # Example
15233 /// ```ignore,no_run
15234 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15235 /// use google_cloud_netapp_v1::model::HourlySchedule;
15236 /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
15237 /// ```
15238 pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
15239 where
15240 T: std::convert::Into<crate::model::HourlySchedule>,
15241 {
15242 self.hourly_schedule = std::option::Option::Some(v.into());
15243 self
15244 }
15245
15246 /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15247 ///
15248 /// # Example
15249 /// ```ignore,no_run
15250 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15251 /// use google_cloud_netapp_v1::model::HourlySchedule;
15252 /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
15253 /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
15254 /// ```
15255 pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15256 where
15257 T: std::convert::Into<crate::model::HourlySchedule>,
15258 {
15259 self.hourly_schedule = v.map(|x| x.into());
15260 self
15261 }
15262
15263 /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15264 ///
15265 /// # Example
15266 /// ```ignore,no_run
15267 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15268 /// use google_cloud_netapp_v1::model::DailySchedule;
15269 /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
15270 /// ```
15271 pub fn set_daily_schedule<T>(mut self, v: T) -> Self
15272 where
15273 T: std::convert::Into<crate::model::DailySchedule>,
15274 {
15275 self.daily_schedule = std::option::Option::Some(v.into());
15276 self
15277 }
15278
15279 /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15280 ///
15281 /// # Example
15282 /// ```ignore,no_run
15283 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15284 /// use google_cloud_netapp_v1::model::DailySchedule;
15285 /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
15286 /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
15287 /// ```
15288 pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15289 where
15290 T: std::convert::Into<crate::model::DailySchedule>,
15291 {
15292 self.daily_schedule = v.map(|x| x.into());
15293 self
15294 }
15295
15296 /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15297 ///
15298 /// # Example
15299 /// ```ignore,no_run
15300 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15301 /// use google_cloud_netapp_v1::model::WeeklySchedule;
15302 /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
15303 /// ```
15304 pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
15305 where
15306 T: std::convert::Into<crate::model::WeeklySchedule>,
15307 {
15308 self.weekly_schedule = std::option::Option::Some(v.into());
15309 self
15310 }
15311
15312 /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15313 ///
15314 /// # Example
15315 /// ```ignore,no_run
15316 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15317 /// use google_cloud_netapp_v1::model::WeeklySchedule;
15318 /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
15319 /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
15320 /// ```
15321 pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15322 where
15323 T: std::convert::Into<crate::model::WeeklySchedule>,
15324 {
15325 self.weekly_schedule = v.map(|x| x.into());
15326 self
15327 }
15328
15329 /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15330 ///
15331 /// # Example
15332 /// ```ignore,no_run
15333 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15334 /// use google_cloud_netapp_v1::model::MonthlySchedule;
15335 /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
15336 /// ```
15337 pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
15338 where
15339 T: std::convert::Into<crate::model::MonthlySchedule>,
15340 {
15341 self.monthly_schedule = std::option::Option::Some(v.into());
15342 self
15343 }
15344
15345 /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15346 ///
15347 /// # Example
15348 /// ```ignore,no_run
15349 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15350 /// use google_cloud_netapp_v1::model::MonthlySchedule;
15351 /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
15352 /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
15353 /// ```
15354 pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15355 where
15356 T: std::convert::Into<crate::model::MonthlySchedule>,
15357 {
15358 self.monthly_schedule = v.map(|x| x.into());
15359 self
15360 }
15361}
15362
15363impl wkt::message::Message for SnapshotPolicy {
15364 fn typename() -> &'static str {
15365 "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
15366 }
15367}
15368
15369/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
15370#[derive(Clone, Default, PartialEq)]
15371#[non_exhaustive]
15372pub struct HourlySchedule {
15373 /// The maximum number of Snapshots to keep for the hourly schedule
15374 pub snapshots_to_keep: std::option::Option<f64>,
15375
15376 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15377 /// top of the hour (0).
15378 pub minute: std::option::Option<f64>,
15379
15380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15381}
15382
15383impl HourlySchedule {
15384 pub fn new() -> Self {
15385 std::default::Default::default()
15386 }
15387
15388 /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15389 ///
15390 /// # Example
15391 /// ```ignore,no_run
15392 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15393 /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
15394 /// ```
15395 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15396 where
15397 T: std::convert::Into<f64>,
15398 {
15399 self.snapshots_to_keep = std::option::Option::Some(v.into());
15400 self
15401 }
15402
15403 /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15404 ///
15405 /// # Example
15406 /// ```ignore,no_run
15407 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15408 /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15409 /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15410 /// ```
15411 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15412 where
15413 T: std::convert::Into<f64>,
15414 {
15415 self.snapshots_to_keep = v.map(|x| x.into());
15416 self
15417 }
15418
15419 /// Sets the value of [minute][crate::model::HourlySchedule::minute].
15420 ///
15421 /// # Example
15422 /// ```ignore,no_run
15423 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15424 /// let x = HourlySchedule::new().set_minute(42.0);
15425 /// ```
15426 pub fn set_minute<T>(mut self, v: T) -> Self
15427 where
15428 T: std::convert::Into<f64>,
15429 {
15430 self.minute = std::option::Option::Some(v.into());
15431 self
15432 }
15433
15434 /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
15435 ///
15436 /// # Example
15437 /// ```ignore,no_run
15438 /// # use google_cloud_netapp_v1::model::HourlySchedule;
15439 /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
15440 /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
15441 /// ```
15442 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15443 where
15444 T: std::convert::Into<f64>,
15445 {
15446 self.minute = v.map(|x| x.into());
15447 self
15448 }
15449}
15450
15451impl wkt::message::Message for HourlySchedule {
15452 fn typename() -> &'static str {
15453 "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
15454 }
15455}
15456
15457/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
15458#[derive(Clone, Default, PartialEq)]
15459#[non_exhaustive]
15460pub struct DailySchedule {
15461 /// The maximum number of Snapshots to keep for the hourly schedule
15462 pub snapshots_to_keep: std::option::Option<f64>,
15463
15464 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15465 /// top of the hour (0).
15466 pub minute: std::option::Option<f64>,
15467
15468 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15469 pub hour: std::option::Option<f64>,
15470
15471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15472}
15473
15474impl DailySchedule {
15475 pub fn new() -> Self {
15476 std::default::Default::default()
15477 }
15478
15479 /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15480 ///
15481 /// # Example
15482 /// ```ignore,no_run
15483 /// # use google_cloud_netapp_v1::model::DailySchedule;
15484 /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
15485 /// ```
15486 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15487 where
15488 T: std::convert::Into<f64>,
15489 {
15490 self.snapshots_to_keep = std::option::Option::Some(v.into());
15491 self
15492 }
15493
15494 /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15495 ///
15496 /// # Example
15497 /// ```ignore,no_run
15498 /// # use google_cloud_netapp_v1::model::DailySchedule;
15499 /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15500 /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15501 /// ```
15502 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15503 where
15504 T: std::convert::Into<f64>,
15505 {
15506 self.snapshots_to_keep = v.map(|x| x.into());
15507 self
15508 }
15509
15510 /// Sets the value of [minute][crate::model::DailySchedule::minute].
15511 ///
15512 /// # Example
15513 /// ```ignore,no_run
15514 /// # use google_cloud_netapp_v1::model::DailySchedule;
15515 /// let x = DailySchedule::new().set_minute(42.0);
15516 /// ```
15517 pub fn set_minute<T>(mut self, v: T) -> Self
15518 where
15519 T: std::convert::Into<f64>,
15520 {
15521 self.minute = std::option::Option::Some(v.into());
15522 self
15523 }
15524
15525 /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
15526 ///
15527 /// # Example
15528 /// ```ignore,no_run
15529 /// # use google_cloud_netapp_v1::model::DailySchedule;
15530 /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
15531 /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
15532 /// ```
15533 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15534 where
15535 T: std::convert::Into<f64>,
15536 {
15537 self.minute = v.map(|x| x.into());
15538 self
15539 }
15540
15541 /// Sets the value of [hour][crate::model::DailySchedule::hour].
15542 ///
15543 /// # Example
15544 /// ```ignore,no_run
15545 /// # use google_cloud_netapp_v1::model::DailySchedule;
15546 /// let x = DailySchedule::new().set_hour(42.0);
15547 /// ```
15548 pub fn set_hour<T>(mut self, v: T) -> Self
15549 where
15550 T: std::convert::Into<f64>,
15551 {
15552 self.hour = std::option::Option::Some(v.into());
15553 self
15554 }
15555
15556 /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
15557 ///
15558 /// # Example
15559 /// ```ignore,no_run
15560 /// # use google_cloud_netapp_v1::model::DailySchedule;
15561 /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
15562 /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
15563 /// ```
15564 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15565 where
15566 T: std::convert::Into<f64>,
15567 {
15568 self.hour = v.map(|x| x.into());
15569 self
15570 }
15571}
15572
15573impl wkt::message::Message for DailySchedule {
15574 fn typename() -> &'static str {
15575 "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
15576 }
15577}
15578
15579/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
15580/// 23:50
15581#[derive(Clone, Default, PartialEq)]
15582#[non_exhaustive]
15583pub struct WeeklySchedule {
15584 /// The maximum number of Snapshots to keep for the hourly schedule
15585 pub snapshots_to_keep: std::option::Option<f64>,
15586
15587 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15588 /// top of the hour (0).
15589 pub minute: std::option::Option<f64>,
15590
15591 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15592 pub hour: std::option::Option<f64>,
15593
15594 /// Set the day or days of the week to make a snapshot. Accepts a comma
15595 /// separated days of the week. Defaults to 'Sunday'.
15596 pub day: std::option::Option<std::string::String>,
15597
15598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15599}
15600
15601impl WeeklySchedule {
15602 pub fn new() -> Self {
15603 std::default::Default::default()
15604 }
15605
15606 /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15607 ///
15608 /// # Example
15609 /// ```ignore,no_run
15610 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15611 /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
15612 /// ```
15613 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15614 where
15615 T: std::convert::Into<f64>,
15616 {
15617 self.snapshots_to_keep = std::option::Option::Some(v.into());
15618 self
15619 }
15620
15621 /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15622 ///
15623 /// # Example
15624 /// ```ignore,no_run
15625 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15626 /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15627 /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15628 /// ```
15629 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15630 where
15631 T: std::convert::Into<f64>,
15632 {
15633 self.snapshots_to_keep = v.map(|x| x.into());
15634 self
15635 }
15636
15637 /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
15638 ///
15639 /// # Example
15640 /// ```ignore,no_run
15641 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15642 /// let x = WeeklySchedule::new().set_minute(42.0);
15643 /// ```
15644 pub fn set_minute<T>(mut self, v: T) -> Self
15645 where
15646 T: std::convert::Into<f64>,
15647 {
15648 self.minute = std::option::Option::Some(v.into());
15649 self
15650 }
15651
15652 /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
15653 ///
15654 /// # Example
15655 /// ```ignore,no_run
15656 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15657 /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
15658 /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
15659 /// ```
15660 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15661 where
15662 T: std::convert::Into<f64>,
15663 {
15664 self.minute = v.map(|x| x.into());
15665 self
15666 }
15667
15668 /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
15669 ///
15670 /// # Example
15671 /// ```ignore,no_run
15672 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15673 /// let x = WeeklySchedule::new().set_hour(42.0);
15674 /// ```
15675 pub fn set_hour<T>(mut self, v: T) -> Self
15676 where
15677 T: std::convert::Into<f64>,
15678 {
15679 self.hour = std::option::Option::Some(v.into());
15680 self
15681 }
15682
15683 /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
15684 ///
15685 /// # Example
15686 /// ```ignore,no_run
15687 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15688 /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
15689 /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
15690 /// ```
15691 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15692 where
15693 T: std::convert::Into<f64>,
15694 {
15695 self.hour = v.map(|x| x.into());
15696 self
15697 }
15698
15699 /// Sets the value of [day][crate::model::WeeklySchedule::day].
15700 ///
15701 /// # Example
15702 /// ```ignore,no_run
15703 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15704 /// let x = WeeklySchedule::new().set_day("example");
15705 /// ```
15706 pub fn set_day<T>(mut self, v: T) -> Self
15707 where
15708 T: std::convert::Into<std::string::String>,
15709 {
15710 self.day = std::option::Option::Some(v.into());
15711 self
15712 }
15713
15714 /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
15715 ///
15716 /// # Example
15717 /// ```ignore,no_run
15718 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15719 /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
15720 /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
15721 /// ```
15722 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
15723 where
15724 T: std::convert::Into<std::string::String>,
15725 {
15726 self.day = v.map(|x| x.into());
15727 self
15728 }
15729}
15730
15731impl wkt::message::Message for WeeklySchedule {
15732 fn typename() -> &'static str {
15733 "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
15734 }
15735}
15736
15737/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
15738#[derive(Clone, Default, PartialEq)]
15739#[non_exhaustive]
15740pub struct MonthlySchedule {
15741 /// The maximum number of Snapshots to keep for the hourly schedule
15742 pub snapshots_to_keep: std::option::Option<f64>,
15743
15744 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15745 /// top of the hour (0).
15746 pub minute: std::option::Option<f64>,
15747
15748 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15749 pub hour: std::option::Option<f64>,
15750
15751 /// Set the day or days of the month to make a snapshot (1-31). Accepts a
15752 /// comma separated number of days. Defaults to '1'.
15753 pub days_of_month: std::option::Option<std::string::String>,
15754
15755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15756}
15757
15758impl MonthlySchedule {
15759 pub fn new() -> Self {
15760 std::default::Default::default()
15761 }
15762
15763 /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15764 ///
15765 /// # Example
15766 /// ```ignore,no_run
15767 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15768 /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
15769 /// ```
15770 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15771 where
15772 T: std::convert::Into<f64>,
15773 {
15774 self.snapshots_to_keep = std::option::Option::Some(v.into());
15775 self
15776 }
15777
15778 /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15779 ///
15780 /// # Example
15781 /// ```ignore,no_run
15782 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15783 /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15784 /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15785 /// ```
15786 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15787 where
15788 T: std::convert::Into<f64>,
15789 {
15790 self.snapshots_to_keep = v.map(|x| x.into());
15791 self
15792 }
15793
15794 /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
15795 ///
15796 /// # Example
15797 /// ```ignore,no_run
15798 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15799 /// let x = MonthlySchedule::new().set_minute(42.0);
15800 /// ```
15801 pub fn set_minute<T>(mut self, v: T) -> Self
15802 where
15803 T: std::convert::Into<f64>,
15804 {
15805 self.minute = std::option::Option::Some(v.into());
15806 self
15807 }
15808
15809 /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
15810 ///
15811 /// # Example
15812 /// ```ignore,no_run
15813 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15814 /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
15815 /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
15816 /// ```
15817 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15818 where
15819 T: std::convert::Into<f64>,
15820 {
15821 self.minute = v.map(|x| x.into());
15822 self
15823 }
15824
15825 /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
15826 ///
15827 /// # Example
15828 /// ```ignore,no_run
15829 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15830 /// let x = MonthlySchedule::new().set_hour(42.0);
15831 /// ```
15832 pub fn set_hour<T>(mut self, v: T) -> Self
15833 where
15834 T: std::convert::Into<f64>,
15835 {
15836 self.hour = std::option::Option::Some(v.into());
15837 self
15838 }
15839
15840 /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
15841 ///
15842 /// # Example
15843 /// ```ignore,no_run
15844 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15845 /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
15846 /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
15847 /// ```
15848 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15849 where
15850 T: std::convert::Into<f64>,
15851 {
15852 self.hour = v.map(|x| x.into());
15853 self
15854 }
15855
15856 /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15857 ///
15858 /// # Example
15859 /// ```ignore,no_run
15860 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15861 /// let x = MonthlySchedule::new().set_days_of_month("example");
15862 /// ```
15863 pub fn set_days_of_month<T>(mut self, v: T) -> Self
15864 where
15865 T: std::convert::Into<std::string::String>,
15866 {
15867 self.days_of_month = std::option::Option::Some(v.into());
15868 self
15869 }
15870
15871 /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15872 ///
15873 /// # Example
15874 /// ```ignore,no_run
15875 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15876 /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
15877 /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
15878 /// ```
15879 pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
15880 where
15881 T: std::convert::Into<std::string::String>,
15882 {
15883 self.days_of_month = v.map(|x| x.into());
15884 self
15885 }
15886}
15887
15888impl wkt::message::Message for MonthlySchedule {
15889 fn typename() -> &'static str {
15890 "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
15891 }
15892}
15893
15894/// View only mount options for a volume.
15895#[derive(Clone, Default, PartialEq)]
15896#[non_exhaustive]
15897pub struct MountOption {
15898 /// Export string
15899 pub export: std::string::String,
15900
15901 /// Full export string
15902 pub export_full: std::string::String,
15903
15904 /// Protocol to mount with.
15905 pub protocol: crate::model::Protocols,
15906
15907 /// Instructions for mounting
15908 pub instructions: std::string::String,
15909
15910 /// Output only. IP Address.
15911 pub ip_address: std::string::String,
15912
15913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15914}
15915
15916impl MountOption {
15917 pub fn new() -> Self {
15918 std::default::Default::default()
15919 }
15920
15921 /// Sets the value of [export][crate::model::MountOption::export].
15922 ///
15923 /// # Example
15924 /// ```ignore,no_run
15925 /// # use google_cloud_netapp_v1::model::MountOption;
15926 /// let x = MountOption::new().set_export("example");
15927 /// ```
15928 pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15929 self.export = v.into();
15930 self
15931 }
15932
15933 /// Sets the value of [export_full][crate::model::MountOption::export_full].
15934 ///
15935 /// # Example
15936 /// ```ignore,no_run
15937 /// # use google_cloud_netapp_v1::model::MountOption;
15938 /// let x = MountOption::new().set_export_full("example");
15939 /// ```
15940 pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15941 self.export_full = v.into();
15942 self
15943 }
15944
15945 /// Sets the value of [protocol][crate::model::MountOption::protocol].
15946 ///
15947 /// # Example
15948 /// ```ignore,no_run
15949 /// # use google_cloud_netapp_v1::model::MountOption;
15950 /// use google_cloud_netapp_v1::model::Protocols;
15951 /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
15952 /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
15953 /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
15954 /// ```
15955 pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
15956 self.protocol = v.into();
15957 self
15958 }
15959
15960 /// Sets the value of [instructions][crate::model::MountOption::instructions].
15961 ///
15962 /// # Example
15963 /// ```ignore,no_run
15964 /// # use google_cloud_netapp_v1::model::MountOption;
15965 /// let x = MountOption::new().set_instructions("example");
15966 /// ```
15967 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15968 self.instructions = v.into();
15969 self
15970 }
15971
15972 /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
15973 ///
15974 /// # Example
15975 /// ```ignore,no_run
15976 /// # use google_cloud_netapp_v1::model::MountOption;
15977 /// let x = MountOption::new().set_ip_address("example");
15978 /// ```
15979 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15980 self.ip_address = v.into();
15981 self
15982 }
15983}
15984
15985impl wkt::message::Message for MountOption {
15986 fn typename() -> &'static str {
15987 "type.googleapis.com/google.cloud.netapp.v1.MountOption"
15988 }
15989}
15990
15991/// The RestoreParameters if volume is created from a snapshot or backup.
15992#[derive(Clone, Default, PartialEq)]
15993#[non_exhaustive]
15994pub struct RestoreParameters {
15995 /// The source that the volume is created from.
15996 pub source: std::option::Option<crate::model::restore_parameters::Source>,
15997
15998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15999}
16000
16001impl RestoreParameters {
16002 pub fn new() -> Self {
16003 std::default::Default::default()
16004 }
16005
16006 /// Sets the value of [source][crate::model::RestoreParameters::source].
16007 ///
16008 /// Note that all the setters affecting `source` are mutually
16009 /// exclusive.
16010 ///
16011 /// # Example
16012 /// ```ignore,no_run
16013 /// # use google_cloud_netapp_v1::model::RestoreParameters;
16014 /// use google_cloud_netapp_v1::model::restore_parameters::Source;
16015 /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
16016 /// ```
16017 pub fn set_source<
16018 T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
16019 >(
16020 mut self,
16021 v: T,
16022 ) -> Self {
16023 self.source = v.into();
16024 self
16025 }
16026
16027 /// The value of [source][crate::model::RestoreParameters::source]
16028 /// if it holds a `SourceSnapshot`, `None` if the field is not set or
16029 /// holds a different branch.
16030 pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
16031 #[allow(unreachable_patterns)]
16032 self.source.as_ref().and_then(|v| match v {
16033 crate::model::restore_parameters::Source::SourceSnapshot(v) => {
16034 std::option::Option::Some(v)
16035 }
16036 _ => std::option::Option::None,
16037 })
16038 }
16039
16040 /// Sets the value of [source][crate::model::RestoreParameters::source]
16041 /// to hold a `SourceSnapshot`.
16042 ///
16043 /// Note that all the setters affecting `source` are
16044 /// mutually exclusive.
16045 ///
16046 /// # Example
16047 /// ```ignore,no_run
16048 /// # use google_cloud_netapp_v1::model::RestoreParameters;
16049 /// let x = RestoreParameters::new().set_source_snapshot("example");
16050 /// assert!(x.source_snapshot().is_some());
16051 /// assert!(x.source_backup().is_none());
16052 /// ```
16053 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16054 self.source = std::option::Option::Some(
16055 crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
16056 );
16057 self
16058 }
16059
16060 /// The value of [source][crate::model::RestoreParameters::source]
16061 /// if it holds a `SourceBackup`, `None` if the field is not set or
16062 /// holds a different branch.
16063 pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
16064 #[allow(unreachable_patterns)]
16065 self.source.as_ref().and_then(|v| match v {
16066 crate::model::restore_parameters::Source::SourceBackup(v) => {
16067 std::option::Option::Some(v)
16068 }
16069 _ => std::option::Option::None,
16070 })
16071 }
16072
16073 /// Sets the value of [source][crate::model::RestoreParameters::source]
16074 /// to hold a `SourceBackup`.
16075 ///
16076 /// Note that all the setters affecting `source` are
16077 /// mutually exclusive.
16078 ///
16079 /// # Example
16080 /// ```ignore,no_run
16081 /// # use google_cloud_netapp_v1::model::RestoreParameters;
16082 /// let x = RestoreParameters::new().set_source_backup("example");
16083 /// assert!(x.source_backup().is_some());
16084 /// assert!(x.source_snapshot().is_none());
16085 /// ```
16086 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16087 self.source = std::option::Option::Some(
16088 crate::model::restore_parameters::Source::SourceBackup(v.into()),
16089 );
16090 self
16091 }
16092}
16093
16094impl wkt::message::Message for RestoreParameters {
16095 fn typename() -> &'static str {
16096 "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
16097 }
16098}
16099
16100/// Defines additional types related to [RestoreParameters].
16101pub mod restore_parameters {
16102 #[allow(unused_imports)]
16103 use super::*;
16104
16105 /// The source that the volume is created from.
16106 #[derive(Clone, Debug, PartialEq)]
16107 #[non_exhaustive]
16108 pub enum Source {
16109 /// Full name of the snapshot resource.
16110 /// Format:
16111 /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
16112 SourceSnapshot(std::string::String),
16113 /// Full name of the backup resource.
16114 /// Format for standard backup:
16115 /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
16116 /// Format for BackupDR backup:
16117 /// projects/{project}/locations/{location}/backupVaults/{backup_vault}/dataSources/{data_source}/backups/{backup}
16118 SourceBackup(std::string::String),
16119 }
16120}
16121
16122/// BackupConfig contains backup related config on a volume.
16123#[derive(Clone, Default, PartialEq)]
16124#[non_exhaustive]
16125pub struct BackupConfig {
16126 /// Optional. When specified, schedule backups will be created based on the
16127 /// policy configuration.
16128 pub backup_policies: std::vec::Vec<std::string::String>,
16129
16130 /// Optional. Name of backup vault.
16131 /// Format:
16132 /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
16133 pub backup_vault: std::string::String,
16134
16135 /// Optional. When set to true, scheduled backup is enabled on the volume.
16136 /// This field should be nil when there's no backup policy attached.
16137 pub scheduled_backup_enabled: std::option::Option<bool>,
16138
16139 /// Output only. Total size of all backups in a chain in bytes = baseline
16140 /// backup size + sum(incremental backup size).
16141 pub backup_chain_bytes: std::option::Option<i64>,
16142
16143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16144}
16145
16146impl BackupConfig {
16147 pub fn new() -> Self {
16148 std::default::Default::default()
16149 }
16150
16151 /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
16152 ///
16153 /// # Example
16154 /// ```ignore,no_run
16155 /// # use google_cloud_netapp_v1::model::BackupConfig;
16156 /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
16157 /// ```
16158 pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
16159 where
16160 T: std::iter::IntoIterator<Item = V>,
16161 V: std::convert::Into<std::string::String>,
16162 {
16163 use std::iter::Iterator;
16164 self.backup_policies = v.into_iter().map(|i| i.into()).collect();
16165 self
16166 }
16167
16168 /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
16169 ///
16170 /// # Example
16171 /// ```ignore,no_run
16172 /// # use google_cloud_netapp_v1::model::BackupConfig;
16173 /// let x = BackupConfig::new().set_backup_vault("example");
16174 /// ```
16175 pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16176 self.backup_vault = v.into();
16177 self
16178 }
16179
16180 /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16181 ///
16182 /// # Example
16183 /// ```ignore,no_run
16184 /// # use google_cloud_netapp_v1::model::BackupConfig;
16185 /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
16186 /// ```
16187 pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
16188 where
16189 T: std::convert::Into<bool>,
16190 {
16191 self.scheduled_backup_enabled = std::option::Option::Some(v.into());
16192 self
16193 }
16194
16195 /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16196 ///
16197 /// # Example
16198 /// ```ignore,no_run
16199 /// # use google_cloud_netapp_v1::model::BackupConfig;
16200 /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
16201 /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
16202 /// ```
16203 pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16204 where
16205 T: std::convert::Into<bool>,
16206 {
16207 self.scheduled_backup_enabled = v.map(|x| x.into());
16208 self
16209 }
16210
16211 /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16212 ///
16213 /// # Example
16214 /// ```ignore,no_run
16215 /// # use google_cloud_netapp_v1::model::BackupConfig;
16216 /// let x = BackupConfig::new().set_backup_chain_bytes(42);
16217 /// ```
16218 pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
16219 where
16220 T: std::convert::Into<i64>,
16221 {
16222 self.backup_chain_bytes = std::option::Option::Some(v.into());
16223 self
16224 }
16225
16226 /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16227 ///
16228 /// # Example
16229 /// ```ignore,no_run
16230 /// # use google_cloud_netapp_v1::model::BackupConfig;
16231 /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
16232 /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
16233 /// ```
16234 pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
16235 where
16236 T: std::convert::Into<i64>,
16237 {
16238 self.backup_chain_bytes = v.map(|x| x.into());
16239 self
16240 }
16241}
16242
16243impl wkt::message::Message for BackupConfig {
16244 fn typename() -> &'static str {
16245 "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
16246 }
16247}
16248
16249/// Defines tiering policy for the volume.
16250#[derive(Clone, Default, PartialEq)]
16251#[non_exhaustive]
16252pub struct TieringPolicy {
16253 /// Optional. Flag indicating if the volume has tiering policy enable/pause.
16254 /// Default is PAUSED.
16255 pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
16256
16257 /// Optional. Time in days to mark the volume's data block as cold and make it
16258 /// eligible for tiering, can be range from 2-183. Default is 31.
16259 pub cooling_threshold_days: std::option::Option<i32>,
16260
16261 /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
16262 /// is false. This is only applicable to Flex service level.
16263 pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
16264
16265 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16266}
16267
16268impl TieringPolicy {
16269 pub fn new() -> Self {
16270 std::default::Default::default()
16271 }
16272
16273 /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
16274 ///
16275 /// # Example
16276 /// ```ignore,no_run
16277 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16278 /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16279 /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
16280 /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
16281 /// ```
16282 pub fn set_tier_action<T>(mut self, v: T) -> Self
16283 where
16284 T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16285 {
16286 self.tier_action = std::option::Option::Some(v.into());
16287 self
16288 }
16289
16290 /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
16291 ///
16292 /// # Example
16293 /// ```ignore,no_run
16294 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16295 /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16296 /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
16297 /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
16298 /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
16299 /// ```
16300 pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
16301 where
16302 T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16303 {
16304 self.tier_action = v.map(|x| x.into());
16305 self
16306 }
16307
16308 /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16309 ///
16310 /// # Example
16311 /// ```ignore,no_run
16312 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16313 /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
16314 /// ```
16315 pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
16316 where
16317 T: std::convert::Into<i32>,
16318 {
16319 self.cooling_threshold_days = std::option::Option::Some(v.into());
16320 self
16321 }
16322
16323 /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16324 ///
16325 /// # Example
16326 /// ```ignore,no_run
16327 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16328 /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
16329 /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
16330 /// ```
16331 pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
16332 where
16333 T: std::convert::Into<i32>,
16334 {
16335 self.cooling_threshold_days = v.map(|x| x.into());
16336 self
16337 }
16338
16339 /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16340 ///
16341 /// # Example
16342 /// ```ignore,no_run
16343 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16344 /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
16345 /// ```
16346 pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
16347 where
16348 T: std::convert::Into<bool>,
16349 {
16350 self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
16351 self
16352 }
16353
16354 /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16355 ///
16356 /// # Example
16357 /// ```ignore,no_run
16358 /// # use google_cloud_netapp_v1::model::TieringPolicy;
16359 /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
16360 /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
16361 /// ```
16362 pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16363 where
16364 T: std::convert::Into<bool>,
16365 {
16366 self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
16367 self
16368 }
16369}
16370
16371impl wkt::message::Message for TieringPolicy {
16372 fn typename() -> &'static str {
16373 "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
16374 }
16375}
16376
16377/// Defines additional types related to [TieringPolicy].
16378pub mod tiering_policy {
16379 #[allow(unused_imports)]
16380 use super::*;
16381
16382 /// Tier action for the volume.
16383 ///
16384 /// # Working with unknown values
16385 ///
16386 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16387 /// additional enum variants at any time. Adding new variants is not considered
16388 /// a breaking change. Applications should write their code in anticipation of:
16389 ///
16390 /// - New values appearing in future releases of the client library, **and**
16391 /// - New values received dynamically, without application changes.
16392 ///
16393 /// Please consult the [Working with enums] section in the user guide for some
16394 /// guidelines.
16395 ///
16396 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16397 #[derive(Clone, Debug, PartialEq)]
16398 #[non_exhaustive]
16399 pub enum TierAction {
16400 /// Unspecified.
16401 Unspecified,
16402 /// When tiering is enabled, new cold data will be tiered.
16403 Enabled,
16404 /// When paused, tiering won't be performed on new data. Existing data stays
16405 /// tiered until accessed.
16406 Paused,
16407 /// If set, the enum was initialized with an unknown value.
16408 ///
16409 /// Applications can examine the value using [TierAction::value] or
16410 /// [TierAction::name].
16411 UnknownValue(tier_action::UnknownValue),
16412 }
16413
16414 #[doc(hidden)]
16415 pub mod tier_action {
16416 #[allow(unused_imports)]
16417 use super::*;
16418 #[derive(Clone, Debug, PartialEq)]
16419 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16420 }
16421
16422 impl TierAction {
16423 /// Gets the enum value.
16424 ///
16425 /// Returns `None` if the enum contains an unknown value deserialized from
16426 /// the string representation of enums.
16427 pub fn value(&self) -> std::option::Option<i32> {
16428 match self {
16429 Self::Unspecified => std::option::Option::Some(0),
16430 Self::Enabled => std::option::Option::Some(1),
16431 Self::Paused => std::option::Option::Some(2),
16432 Self::UnknownValue(u) => u.0.value(),
16433 }
16434 }
16435
16436 /// Gets the enum value as a string.
16437 ///
16438 /// Returns `None` if the enum contains an unknown value deserialized from
16439 /// the integer representation of enums.
16440 pub fn name(&self) -> std::option::Option<&str> {
16441 match self {
16442 Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
16443 Self::Enabled => std::option::Option::Some("ENABLED"),
16444 Self::Paused => std::option::Option::Some("PAUSED"),
16445 Self::UnknownValue(u) => u.0.name(),
16446 }
16447 }
16448 }
16449
16450 impl std::default::Default for TierAction {
16451 fn default() -> Self {
16452 use std::convert::From;
16453 Self::from(0)
16454 }
16455 }
16456
16457 impl std::fmt::Display for TierAction {
16458 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16459 wkt::internal::display_enum(f, self.name(), self.value())
16460 }
16461 }
16462
16463 impl std::convert::From<i32> for TierAction {
16464 fn from(value: i32) -> Self {
16465 match value {
16466 0 => Self::Unspecified,
16467 1 => Self::Enabled,
16468 2 => Self::Paused,
16469 _ => Self::UnknownValue(tier_action::UnknownValue(
16470 wkt::internal::UnknownEnumValue::Integer(value),
16471 )),
16472 }
16473 }
16474 }
16475
16476 impl std::convert::From<&str> for TierAction {
16477 fn from(value: &str) -> Self {
16478 use std::string::ToString;
16479 match value {
16480 "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
16481 "ENABLED" => Self::Enabled,
16482 "PAUSED" => Self::Paused,
16483 _ => Self::UnknownValue(tier_action::UnknownValue(
16484 wkt::internal::UnknownEnumValue::String(value.to_string()),
16485 )),
16486 }
16487 }
16488 }
16489
16490 impl serde::ser::Serialize for TierAction {
16491 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16492 where
16493 S: serde::Serializer,
16494 {
16495 match self {
16496 Self::Unspecified => serializer.serialize_i32(0),
16497 Self::Enabled => serializer.serialize_i32(1),
16498 Self::Paused => serializer.serialize_i32(2),
16499 Self::UnknownValue(u) => u.0.serialize(serializer),
16500 }
16501 }
16502 }
16503
16504 impl<'de> serde::de::Deserialize<'de> for TierAction {
16505 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16506 where
16507 D: serde::Deserializer<'de>,
16508 {
16509 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
16510 ".google.cloud.netapp.v1.TieringPolicy.TierAction",
16511 ))
16512 }
16513 }
16514}
16515
16516/// The Hybrid Replication parameters for the volume.
16517#[derive(Clone, Default, PartialEq)]
16518#[non_exhaustive]
16519pub struct HybridReplicationParameters {
16520 /// Required. Desired name for the replication of this volume.
16521 pub replication: std::string::String,
16522
16523 /// Required. Name of the user's local source volume to be peered with the
16524 /// destination volume.
16525 pub peer_volume_name: std::string::String,
16526
16527 /// Required. Name of the user's local source cluster to be peered with the
16528 /// destination cluster.
16529 pub peer_cluster_name: std::string::String,
16530
16531 /// Required. Name of the user's local source vserver svm to be peered with the
16532 /// destination vserver svm.
16533 pub peer_svm_name: std::string::String,
16534
16535 /// Required. List of node ip addresses to be peered with.
16536 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
16537
16538 /// Optional. Name of source cluster location associated with the Hybrid
16539 /// replication. This is a free-form field for the display purpose only.
16540 pub cluster_location: std::string::String,
16541
16542 /// Optional. Description of the replication.
16543 pub description: std::string::String,
16544
16545 /// Optional. Labels to be added to the replication as the key value pairs.
16546 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16547
16548 /// Optional. Replication Schedule for the replication created.
16549 pub replication_schedule: crate::model::HybridReplicationSchedule,
16550
16551 /// Optional. Type of the hybrid replication.
16552 pub hybrid_replication_type:
16553 crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16554
16555 /// Optional. Constituent volume count for large volume.
16556 pub large_volume_constituent_count: i32,
16557
16558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16559}
16560
16561impl HybridReplicationParameters {
16562 pub fn new() -> Self {
16563 std::default::Default::default()
16564 }
16565
16566 /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
16567 ///
16568 /// # Example
16569 /// ```ignore,no_run
16570 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16571 /// let x = HybridReplicationParameters::new().set_replication("example");
16572 /// ```
16573 pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16574 self.replication = v.into();
16575 self
16576 }
16577
16578 /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
16579 ///
16580 /// # Example
16581 /// ```ignore,no_run
16582 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16583 /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
16584 /// ```
16585 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
16586 mut self,
16587 v: T,
16588 ) -> Self {
16589 self.peer_volume_name = v.into();
16590 self
16591 }
16592
16593 /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
16594 ///
16595 /// # Example
16596 /// ```ignore,no_run
16597 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16598 /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
16599 /// ```
16600 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
16601 mut self,
16602 v: T,
16603 ) -> Self {
16604 self.peer_cluster_name = v.into();
16605 self
16606 }
16607
16608 /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
16609 ///
16610 /// # Example
16611 /// ```ignore,no_run
16612 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16613 /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
16614 /// ```
16615 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16616 self.peer_svm_name = v.into();
16617 self
16618 }
16619
16620 /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
16621 ///
16622 /// # Example
16623 /// ```ignore,no_run
16624 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16625 /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16626 /// ```
16627 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16628 where
16629 T: std::iter::IntoIterator<Item = V>,
16630 V: std::convert::Into<std::string::String>,
16631 {
16632 use std::iter::Iterator;
16633 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16634 self
16635 }
16636
16637 /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
16638 ///
16639 /// # Example
16640 /// ```ignore,no_run
16641 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16642 /// let x = HybridReplicationParameters::new().set_cluster_location("example");
16643 /// ```
16644 pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
16645 mut self,
16646 v: T,
16647 ) -> Self {
16648 self.cluster_location = v.into();
16649 self
16650 }
16651
16652 /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
16653 ///
16654 /// # Example
16655 /// ```ignore,no_run
16656 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16657 /// let x = HybridReplicationParameters::new().set_description("example");
16658 /// ```
16659 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16660 self.description = v.into();
16661 self
16662 }
16663
16664 /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
16665 ///
16666 /// # Example
16667 /// ```ignore,no_run
16668 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16669 /// let x = HybridReplicationParameters::new().set_labels([
16670 /// ("key0", "abc"),
16671 /// ("key1", "xyz"),
16672 /// ]);
16673 /// ```
16674 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16675 where
16676 T: std::iter::IntoIterator<Item = (K, V)>,
16677 K: std::convert::Into<std::string::String>,
16678 V: std::convert::Into<std::string::String>,
16679 {
16680 use std::iter::Iterator;
16681 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16682 self
16683 }
16684
16685 /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
16686 ///
16687 /// # Example
16688 /// ```ignore,no_run
16689 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16690 /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
16691 /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
16692 /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
16693 /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
16694 /// ```
16695 pub fn set_replication_schedule<
16696 T: std::convert::Into<crate::model::HybridReplicationSchedule>,
16697 >(
16698 mut self,
16699 v: T,
16700 ) -> Self {
16701 self.replication_schedule = v.into();
16702 self
16703 }
16704
16705 /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
16706 ///
16707 /// # Example
16708 /// ```ignore,no_run
16709 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16710 /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
16711 /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
16712 /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
16713 /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
16714 /// ```
16715 pub fn set_hybrid_replication_type<
16716 T: std::convert::Into<
16717 crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16718 >,
16719 >(
16720 mut self,
16721 v: T,
16722 ) -> Self {
16723 self.hybrid_replication_type = v.into();
16724 self
16725 }
16726
16727 /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
16728 ///
16729 /// # Example
16730 /// ```ignore,no_run
16731 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16732 /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
16733 /// ```
16734 pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16735 self.large_volume_constituent_count = v.into();
16736 self
16737 }
16738}
16739
16740impl wkt::message::Message for HybridReplicationParameters {
16741 fn typename() -> &'static str {
16742 "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
16743 }
16744}
16745
16746/// Defines additional types related to [HybridReplicationParameters].
16747pub mod hybrid_replication_parameters {
16748 #[allow(unused_imports)]
16749 use super::*;
16750
16751 /// Type of the volume's hybrid replication.
16752 ///
16753 /// # Working with unknown values
16754 ///
16755 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16756 /// additional enum variants at any time. Adding new variants is not considered
16757 /// a breaking change. Applications should write their code in anticipation of:
16758 ///
16759 /// - New values appearing in future releases of the client library, **and**
16760 /// - New values received dynamically, without application changes.
16761 ///
16762 /// Please consult the [Working with enums] section in the user guide for some
16763 /// guidelines.
16764 ///
16765 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16766 #[derive(Clone, Debug, PartialEq)]
16767 #[non_exhaustive]
16768 pub enum VolumeHybridReplicationType {
16769 /// Unspecified hybrid replication type.
16770 Unspecified,
16771 /// Hybrid replication type for migration.
16772 Migration,
16773 /// Hybrid replication type for continuous replication.
16774 ContinuousReplication,
16775 /// New field for reversible OnPrem replication, to be used for data
16776 /// protection.
16777 OnpremReplication,
16778 /// New field for reversible OnPrem replication, to be used for data
16779 /// protection.
16780 ReverseOnpremReplication,
16781 /// If set, the enum was initialized with an unknown value.
16782 ///
16783 /// Applications can examine the value using [VolumeHybridReplicationType::value] or
16784 /// [VolumeHybridReplicationType::name].
16785 UnknownValue(volume_hybrid_replication_type::UnknownValue),
16786 }
16787
16788 #[doc(hidden)]
16789 pub mod volume_hybrid_replication_type {
16790 #[allow(unused_imports)]
16791 use super::*;
16792 #[derive(Clone, Debug, PartialEq)]
16793 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16794 }
16795
16796 impl VolumeHybridReplicationType {
16797 /// Gets the enum value.
16798 ///
16799 /// Returns `None` if the enum contains an unknown value deserialized from
16800 /// the string representation of enums.
16801 pub fn value(&self) -> std::option::Option<i32> {
16802 match self {
16803 Self::Unspecified => std::option::Option::Some(0),
16804 Self::Migration => std::option::Option::Some(1),
16805 Self::ContinuousReplication => std::option::Option::Some(2),
16806 Self::OnpremReplication => std::option::Option::Some(3),
16807 Self::ReverseOnpremReplication => std::option::Option::Some(4),
16808 Self::UnknownValue(u) => u.0.value(),
16809 }
16810 }
16811
16812 /// Gets the enum value as a string.
16813 ///
16814 /// Returns `None` if the enum contains an unknown value deserialized from
16815 /// the integer representation of enums.
16816 pub fn name(&self) -> std::option::Option<&str> {
16817 match self {
16818 Self::Unspecified => {
16819 std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
16820 }
16821 Self::Migration => std::option::Option::Some("MIGRATION"),
16822 Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
16823 Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
16824 Self::ReverseOnpremReplication => {
16825 std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
16826 }
16827 Self::UnknownValue(u) => u.0.name(),
16828 }
16829 }
16830 }
16831
16832 impl std::default::Default for VolumeHybridReplicationType {
16833 fn default() -> Self {
16834 use std::convert::From;
16835 Self::from(0)
16836 }
16837 }
16838
16839 impl std::fmt::Display for VolumeHybridReplicationType {
16840 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16841 wkt::internal::display_enum(f, self.name(), self.value())
16842 }
16843 }
16844
16845 impl std::convert::From<i32> for VolumeHybridReplicationType {
16846 fn from(value: i32) -> Self {
16847 match value {
16848 0 => Self::Unspecified,
16849 1 => Self::Migration,
16850 2 => Self::ContinuousReplication,
16851 3 => Self::OnpremReplication,
16852 4 => Self::ReverseOnpremReplication,
16853 _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16854 wkt::internal::UnknownEnumValue::Integer(value),
16855 )),
16856 }
16857 }
16858 }
16859
16860 impl std::convert::From<&str> for VolumeHybridReplicationType {
16861 fn from(value: &str) -> Self {
16862 use std::string::ToString;
16863 match value {
16864 "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
16865 "MIGRATION" => Self::Migration,
16866 "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
16867 "ONPREM_REPLICATION" => Self::OnpremReplication,
16868 "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
16869 _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16870 wkt::internal::UnknownEnumValue::String(value.to_string()),
16871 )),
16872 }
16873 }
16874 }
16875
16876 impl serde::ser::Serialize for VolumeHybridReplicationType {
16877 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16878 where
16879 S: serde::Serializer,
16880 {
16881 match self {
16882 Self::Unspecified => serializer.serialize_i32(0),
16883 Self::Migration => serializer.serialize_i32(1),
16884 Self::ContinuousReplication => serializer.serialize_i32(2),
16885 Self::OnpremReplication => serializer.serialize_i32(3),
16886 Self::ReverseOnpremReplication => serializer.serialize_i32(4),
16887 Self::UnknownValue(u) => u.0.serialize(serializer),
16888 }
16889 }
16890 }
16891
16892 impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
16893 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16894 where
16895 D: serde::Deserializer<'de>,
16896 {
16897 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
16898 ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
16899 }
16900 }
16901}
16902
16903/// Cache Parameters for the volume.
16904#[derive(Clone, Default, PartialEq)]
16905#[non_exhaustive]
16906pub struct CacheParameters {
16907 /// Required. Name of the origin volume for the cache volume.
16908 pub peer_volume_name: std::string::String,
16909
16910 /// Required. Name of the origin volume's ONTAP cluster.
16911 pub peer_cluster_name: std::string::String,
16912
16913 /// Required. Name of the origin volume's SVM.
16914 pub peer_svm_name: std::string::String,
16915
16916 /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
16917 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
16918
16919 /// Optional. Indicates whether the cache volume has global file lock enabled.
16920 pub enable_global_file_lock: std::option::Option<bool>,
16921
16922 /// Optional. Configuration of the cache volume.
16923 pub cache_config: std::option::Option<crate::model::CacheConfig>,
16924
16925 /// Output only. State of the cache volume indicating the peering status.
16926 pub cache_state: crate::model::cache_parameters::CacheState,
16927
16928 /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
16929 /// peering requests.
16930 pub command: std::string::String,
16931
16932 /// Optional. Expiration time for the peering command to be executed on user's
16933 /// ONTAP.
16934 pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
16935
16936 /// Output only. Temporary passphrase generated to accept cluster peering
16937 /// command.
16938 pub passphrase: std::string::String,
16939
16940 /// Output only. Detailed description of the current cache state.
16941 pub state_details: std::string::String,
16942
16943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16944}
16945
16946impl CacheParameters {
16947 pub fn new() -> Self {
16948 std::default::Default::default()
16949 }
16950
16951 /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
16952 ///
16953 /// # Example
16954 /// ```ignore,no_run
16955 /// # use google_cloud_netapp_v1::model::CacheParameters;
16956 /// let x = CacheParameters::new().set_peer_volume_name("example");
16957 /// ```
16958 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
16959 mut self,
16960 v: T,
16961 ) -> Self {
16962 self.peer_volume_name = v.into();
16963 self
16964 }
16965
16966 /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
16967 ///
16968 /// # Example
16969 /// ```ignore,no_run
16970 /// # use google_cloud_netapp_v1::model::CacheParameters;
16971 /// let x = CacheParameters::new().set_peer_cluster_name("example");
16972 /// ```
16973 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
16974 mut self,
16975 v: T,
16976 ) -> Self {
16977 self.peer_cluster_name = v.into();
16978 self
16979 }
16980
16981 /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
16982 ///
16983 /// # Example
16984 /// ```ignore,no_run
16985 /// # use google_cloud_netapp_v1::model::CacheParameters;
16986 /// let x = CacheParameters::new().set_peer_svm_name("example");
16987 /// ```
16988 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16989 self.peer_svm_name = v.into();
16990 self
16991 }
16992
16993 /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
16994 ///
16995 /// # Example
16996 /// ```ignore,no_run
16997 /// # use google_cloud_netapp_v1::model::CacheParameters;
16998 /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16999 /// ```
17000 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
17001 where
17002 T: std::iter::IntoIterator<Item = V>,
17003 V: std::convert::Into<std::string::String>,
17004 {
17005 use std::iter::Iterator;
17006 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
17007 self
17008 }
17009
17010 /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17011 ///
17012 /// # Example
17013 /// ```ignore,no_run
17014 /// # use google_cloud_netapp_v1::model::CacheParameters;
17015 /// let x = CacheParameters::new().set_enable_global_file_lock(true);
17016 /// ```
17017 pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
17018 where
17019 T: std::convert::Into<bool>,
17020 {
17021 self.enable_global_file_lock = std::option::Option::Some(v.into());
17022 self
17023 }
17024
17025 /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17026 ///
17027 /// # Example
17028 /// ```ignore,no_run
17029 /// # use google_cloud_netapp_v1::model::CacheParameters;
17030 /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
17031 /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
17032 /// ```
17033 pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
17034 where
17035 T: std::convert::Into<bool>,
17036 {
17037 self.enable_global_file_lock = v.map(|x| x.into());
17038 self
17039 }
17040
17041 /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
17042 ///
17043 /// # Example
17044 /// ```ignore,no_run
17045 /// # use google_cloud_netapp_v1::model::CacheParameters;
17046 /// use google_cloud_netapp_v1::model::CacheConfig;
17047 /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
17048 /// ```
17049 pub fn set_cache_config<T>(mut self, v: T) -> Self
17050 where
17051 T: std::convert::Into<crate::model::CacheConfig>,
17052 {
17053 self.cache_config = std::option::Option::Some(v.into());
17054 self
17055 }
17056
17057 /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
17058 ///
17059 /// # Example
17060 /// ```ignore,no_run
17061 /// # use google_cloud_netapp_v1::model::CacheParameters;
17062 /// use google_cloud_netapp_v1::model::CacheConfig;
17063 /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
17064 /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
17065 /// ```
17066 pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
17067 where
17068 T: std::convert::Into<crate::model::CacheConfig>,
17069 {
17070 self.cache_config = v.map(|x| x.into());
17071 self
17072 }
17073
17074 /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
17075 ///
17076 /// # Example
17077 /// ```ignore,no_run
17078 /// # use google_cloud_netapp_v1::model::CacheParameters;
17079 /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
17080 /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
17081 /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
17082 /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
17083 /// ```
17084 pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
17085 mut self,
17086 v: T,
17087 ) -> Self {
17088 self.cache_state = v.into();
17089 self
17090 }
17091
17092 /// Sets the value of [command][crate::model::CacheParameters::command].
17093 ///
17094 /// # Example
17095 /// ```ignore,no_run
17096 /// # use google_cloud_netapp_v1::model::CacheParameters;
17097 /// let x = CacheParameters::new().set_command("example");
17098 /// ```
17099 pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17100 self.command = v.into();
17101 self
17102 }
17103
17104 /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17105 ///
17106 /// # Example
17107 /// ```ignore,no_run
17108 /// # use google_cloud_netapp_v1::model::CacheParameters;
17109 /// use wkt::Timestamp;
17110 /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
17111 /// ```
17112 pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
17113 where
17114 T: std::convert::Into<wkt::Timestamp>,
17115 {
17116 self.peering_command_expiry_time = std::option::Option::Some(v.into());
17117 self
17118 }
17119
17120 /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17121 ///
17122 /// # Example
17123 /// ```ignore,no_run
17124 /// # use google_cloud_netapp_v1::model::CacheParameters;
17125 /// use wkt::Timestamp;
17126 /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
17127 /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
17128 /// ```
17129 pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
17130 where
17131 T: std::convert::Into<wkt::Timestamp>,
17132 {
17133 self.peering_command_expiry_time = v.map(|x| x.into());
17134 self
17135 }
17136
17137 /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
17138 ///
17139 /// # Example
17140 /// ```ignore,no_run
17141 /// # use google_cloud_netapp_v1::model::CacheParameters;
17142 /// let x = CacheParameters::new().set_passphrase("example");
17143 /// ```
17144 pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17145 self.passphrase = v.into();
17146 self
17147 }
17148
17149 /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
17150 ///
17151 /// # Example
17152 /// ```ignore,no_run
17153 /// # use google_cloud_netapp_v1::model::CacheParameters;
17154 /// let x = CacheParameters::new().set_state_details("example");
17155 /// ```
17156 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17157 self.state_details = v.into();
17158 self
17159 }
17160}
17161
17162impl wkt::message::Message for CacheParameters {
17163 fn typename() -> &'static str {
17164 "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
17165 }
17166}
17167
17168/// Defines additional types related to [CacheParameters].
17169pub mod cache_parameters {
17170 #[allow(unused_imports)]
17171 use super::*;
17172
17173 /// State of the cache volume indicating the peering status.
17174 ///
17175 /// # Working with unknown values
17176 ///
17177 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17178 /// additional enum variants at any time. Adding new variants is not considered
17179 /// a breaking change. Applications should write their code in anticipation of:
17180 ///
17181 /// - New values appearing in future releases of the client library, **and**
17182 /// - New values received dynamically, without application changes.
17183 ///
17184 /// Please consult the [Working with enums] section in the user guide for some
17185 /// guidelines.
17186 ///
17187 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17188 #[derive(Clone, Debug, PartialEq)]
17189 #[non_exhaustive]
17190 pub enum CacheState {
17191 /// Default unspecified state.
17192 Unspecified,
17193 /// State indicating waiting for cluster peering to be established.
17194 PendingClusterPeering,
17195 /// State indicating waiting for SVM peering to be established.
17196 PendingSvmPeering,
17197 /// State indicating successful establishment of peering with origin
17198 /// volumes's ONTAP cluster.
17199 Peered,
17200 /// Terminal state wherein peering with origin volume's ONTAP cluster
17201 /// has failed.
17202 Error,
17203 /// If set, the enum was initialized with an unknown value.
17204 ///
17205 /// Applications can examine the value using [CacheState::value] or
17206 /// [CacheState::name].
17207 UnknownValue(cache_state::UnknownValue),
17208 }
17209
17210 #[doc(hidden)]
17211 pub mod cache_state {
17212 #[allow(unused_imports)]
17213 use super::*;
17214 #[derive(Clone, Debug, PartialEq)]
17215 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17216 }
17217
17218 impl CacheState {
17219 /// Gets the enum value.
17220 ///
17221 /// Returns `None` if the enum contains an unknown value deserialized from
17222 /// the string representation of enums.
17223 pub fn value(&self) -> std::option::Option<i32> {
17224 match self {
17225 Self::Unspecified => std::option::Option::Some(0),
17226 Self::PendingClusterPeering => std::option::Option::Some(1),
17227 Self::PendingSvmPeering => std::option::Option::Some(2),
17228 Self::Peered => std::option::Option::Some(3),
17229 Self::Error => std::option::Option::Some(4),
17230 Self::UnknownValue(u) => u.0.value(),
17231 }
17232 }
17233
17234 /// Gets the enum value as a string.
17235 ///
17236 /// Returns `None` if the enum contains an unknown value deserialized from
17237 /// the integer representation of enums.
17238 pub fn name(&self) -> std::option::Option<&str> {
17239 match self {
17240 Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
17241 Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
17242 Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
17243 Self::Peered => std::option::Option::Some("PEERED"),
17244 Self::Error => std::option::Option::Some("ERROR"),
17245 Self::UnknownValue(u) => u.0.name(),
17246 }
17247 }
17248 }
17249
17250 impl std::default::Default for CacheState {
17251 fn default() -> Self {
17252 use std::convert::From;
17253 Self::from(0)
17254 }
17255 }
17256
17257 impl std::fmt::Display for CacheState {
17258 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17259 wkt::internal::display_enum(f, self.name(), self.value())
17260 }
17261 }
17262
17263 impl std::convert::From<i32> for CacheState {
17264 fn from(value: i32) -> Self {
17265 match value {
17266 0 => Self::Unspecified,
17267 1 => Self::PendingClusterPeering,
17268 2 => Self::PendingSvmPeering,
17269 3 => Self::Peered,
17270 4 => Self::Error,
17271 _ => Self::UnknownValue(cache_state::UnknownValue(
17272 wkt::internal::UnknownEnumValue::Integer(value),
17273 )),
17274 }
17275 }
17276 }
17277
17278 impl std::convert::From<&str> for CacheState {
17279 fn from(value: &str) -> Self {
17280 use std::string::ToString;
17281 match value {
17282 "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
17283 "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
17284 "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
17285 "PEERED" => Self::Peered,
17286 "ERROR" => Self::Error,
17287 _ => Self::UnknownValue(cache_state::UnknownValue(
17288 wkt::internal::UnknownEnumValue::String(value.to_string()),
17289 )),
17290 }
17291 }
17292 }
17293
17294 impl serde::ser::Serialize for CacheState {
17295 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17296 where
17297 S: serde::Serializer,
17298 {
17299 match self {
17300 Self::Unspecified => serializer.serialize_i32(0),
17301 Self::PendingClusterPeering => serializer.serialize_i32(1),
17302 Self::PendingSvmPeering => serializer.serialize_i32(2),
17303 Self::Peered => serializer.serialize_i32(3),
17304 Self::Error => serializer.serialize_i32(4),
17305 Self::UnknownValue(u) => u.0.serialize(serializer),
17306 }
17307 }
17308 }
17309
17310 impl<'de> serde::de::Deserialize<'de> for CacheState {
17311 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17312 where
17313 D: serde::Deserializer<'de>,
17314 {
17315 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
17316 ".google.cloud.netapp.v1.CacheParameters.CacheState",
17317 ))
17318 }
17319 }
17320}
17321
17322/// Configuration of the cache volume.
17323#[derive(Clone, Default, PartialEq)]
17324#[non_exhaustive]
17325pub struct CacheConfig {
17326 /// Optional. Pre-populate cache volume with data from the origin volume.
17327 pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
17328
17329 /// Optional. Flag indicating whether writeback is enabled for the FlexCache
17330 /// volume.
17331 pub writeback_enabled: std::option::Option<bool>,
17332
17333 /// Optional. Flag indicating whether a CIFS change notification is enabled for
17334 /// the FlexCache volume.
17335 pub cifs_change_notify_enabled: std::option::Option<bool>,
17336
17337 /// Output only. State of the prepopulation job indicating how the
17338 /// prepopulation is progressing.
17339 pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
17340
17341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17342}
17343
17344impl CacheConfig {
17345 pub fn new() -> Self {
17346 std::default::Default::default()
17347 }
17348
17349 /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17350 ///
17351 /// # Example
17352 /// ```ignore,no_run
17353 /// # use google_cloud_netapp_v1::model::CacheConfig;
17354 /// use google_cloud_netapp_v1::model::CachePrePopulate;
17355 /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
17356 /// ```
17357 pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
17358 where
17359 T: std::convert::Into<crate::model::CachePrePopulate>,
17360 {
17361 self.cache_pre_populate = std::option::Option::Some(v.into());
17362 self
17363 }
17364
17365 /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17366 ///
17367 /// # Example
17368 /// ```ignore,no_run
17369 /// # use google_cloud_netapp_v1::model::CacheConfig;
17370 /// use google_cloud_netapp_v1::model::CachePrePopulate;
17371 /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
17372 /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
17373 /// ```
17374 pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
17375 where
17376 T: std::convert::Into<crate::model::CachePrePopulate>,
17377 {
17378 self.cache_pre_populate = v.map(|x| x.into());
17379 self
17380 }
17381
17382 /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17383 ///
17384 /// # Example
17385 /// ```ignore,no_run
17386 /// # use google_cloud_netapp_v1::model::CacheConfig;
17387 /// let x = CacheConfig::new().set_writeback_enabled(true);
17388 /// ```
17389 pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
17390 where
17391 T: std::convert::Into<bool>,
17392 {
17393 self.writeback_enabled = std::option::Option::Some(v.into());
17394 self
17395 }
17396
17397 /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17398 ///
17399 /// # Example
17400 /// ```ignore,no_run
17401 /// # use google_cloud_netapp_v1::model::CacheConfig;
17402 /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
17403 /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
17404 /// ```
17405 pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17406 where
17407 T: std::convert::Into<bool>,
17408 {
17409 self.writeback_enabled = v.map(|x| x.into());
17410 self
17411 }
17412
17413 /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17414 ///
17415 /// # Example
17416 /// ```ignore,no_run
17417 /// # use google_cloud_netapp_v1::model::CacheConfig;
17418 /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
17419 /// ```
17420 pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
17421 where
17422 T: std::convert::Into<bool>,
17423 {
17424 self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
17425 self
17426 }
17427
17428 /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17429 ///
17430 /// # Example
17431 /// ```ignore,no_run
17432 /// # use google_cloud_netapp_v1::model::CacheConfig;
17433 /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
17434 /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
17435 /// ```
17436 pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17437 where
17438 T: std::convert::Into<bool>,
17439 {
17440 self.cifs_change_notify_enabled = v.map(|x| x.into());
17441 self
17442 }
17443
17444 /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
17445 ///
17446 /// # Example
17447 /// ```ignore,no_run
17448 /// # use google_cloud_netapp_v1::model::CacheConfig;
17449 /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
17450 /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
17451 /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
17452 /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
17453 /// ```
17454 pub fn set_cache_pre_populate_state<
17455 T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
17456 >(
17457 mut self,
17458 v: T,
17459 ) -> Self {
17460 self.cache_pre_populate_state = v.into();
17461 self
17462 }
17463}
17464
17465impl wkt::message::Message for CacheConfig {
17466 fn typename() -> &'static str {
17467 "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
17468 }
17469}
17470
17471/// Defines additional types related to [CacheConfig].
17472pub mod cache_config {
17473 #[allow(unused_imports)]
17474 use super::*;
17475
17476 /// State of the prepopulation job indicating how the prepopulation is
17477 /// progressing.
17478 ///
17479 /// # Working with unknown values
17480 ///
17481 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17482 /// additional enum variants at any time. Adding new variants is not considered
17483 /// a breaking change. Applications should write their code in anticipation of:
17484 ///
17485 /// - New values appearing in future releases of the client library, **and**
17486 /// - New values received dynamically, without application changes.
17487 ///
17488 /// Please consult the [Working with enums] section in the user guide for some
17489 /// guidelines.
17490 ///
17491 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17492 #[derive(Clone, Debug, PartialEq)]
17493 #[non_exhaustive]
17494 pub enum CachePrePopulateState {
17495 /// Default unspecified state.
17496 Unspecified,
17497 /// State representing when the most recent create or update request did not
17498 /// require a prepopulation job.
17499 NotNeeded,
17500 /// State representing when the most recent update request requested a
17501 /// prepopulation job but it has not yet completed.
17502 InProgress,
17503 /// State representing when the most recent update request requested a
17504 /// prepopulation job and it has completed successfully.
17505 Complete,
17506 /// State representing when the most recent update request requested a
17507 /// prepopulation job but the prepopulate job failed.
17508 Error,
17509 /// If set, the enum was initialized with an unknown value.
17510 ///
17511 /// Applications can examine the value using [CachePrePopulateState::value] or
17512 /// [CachePrePopulateState::name].
17513 UnknownValue(cache_pre_populate_state::UnknownValue),
17514 }
17515
17516 #[doc(hidden)]
17517 pub mod cache_pre_populate_state {
17518 #[allow(unused_imports)]
17519 use super::*;
17520 #[derive(Clone, Debug, PartialEq)]
17521 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17522 }
17523
17524 impl CachePrePopulateState {
17525 /// Gets the enum value.
17526 ///
17527 /// Returns `None` if the enum contains an unknown value deserialized from
17528 /// the string representation of enums.
17529 pub fn value(&self) -> std::option::Option<i32> {
17530 match self {
17531 Self::Unspecified => std::option::Option::Some(0),
17532 Self::NotNeeded => std::option::Option::Some(1),
17533 Self::InProgress => std::option::Option::Some(2),
17534 Self::Complete => std::option::Option::Some(3),
17535 Self::Error => std::option::Option::Some(4),
17536 Self::UnknownValue(u) => u.0.value(),
17537 }
17538 }
17539
17540 /// Gets the enum value as a string.
17541 ///
17542 /// Returns `None` if the enum contains an unknown value deserialized from
17543 /// the integer representation of enums.
17544 pub fn name(&self) -> std::option::Option<&str> {
17545 match self {
17546 Self::Unspecified => {
17547 std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
17548 }
17549 Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
17550 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
17551 Self::Complete => std::option::Option::Some("COMPLETE"),
17552 Self::Error => std::option::Option::Some("ERROR"),
17553 Self::UnknownValue(u) => u.0.name(),
17554 }
17555 }
17556 }
17557
17558 impl std::default::Default for CachePrePopulateState {
17559 fn default() -> Self {
17560 use std::convert::From;
17561 Self::from(0)
17562 }
17563 }
17564
17565 impl std::fmt::Display for CachePrePopulateState {
17566 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17567 wkt::internal::display_enum(f, self.name(), self.value())
17568 }
17569 }
17570
17571 impl std::convert::From<i32> for CachePrePopulateState {
17572 fn from(value: i32) -> Self {
17573 match value {
17574 0 => Self::Unspecified,
17575 1 => Self::NotNeeded,
17576 2 => Self::InProgress,
17577 3 => Self::Complete,
17578 4 => Self::Error,
17579 _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
17580 wkt::internal::UnknownEnumValue::Integer(value),
17581 )),
17582 }
17583 }
17584 }
17585
17586 impl std::convert::From<&str> for CachePrePopulateState {
17587 fn from(value: &str) -> Self {
17588 use std::string::ToString;
17589 match value {
17590 "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
17591 "NOT_NEEDED" => Self::NotNeeded,
17592 "IN_PROGRESS" => Self::InProgress,
17593 "COMPLETE" => Self::Complete,
17594 "ERROR" => Self::Error,
17595 _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
17596 wkt::internal::UnknownEnumValue::String(value.to_string()),
17597 )),
17598 }
17599 }
17600 }
17601
17602 impl serde::ser::Serialize for CachePrePopulateState {
17603 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17604 where
17605 S: serde::Serializer,
17606 {
17607 match self {
17608 Self::Unspecified => serializer.serialize_i32(0),
17609 Self::NotNeeded => serializer.serialize_i32(1),
17610 Self::InProgress => serializer.serialize_i32(2),
17611 Self::Complete => serializer.serialize_i32(3),
17612 Self::Error => serializer.serialize_i32(4),
17613 Self::UnknownValue(u) => u.0.serialize(serializer),
17614 }
17615 }
17616 }
17617
17618 impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
17619 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17620 where
17621 D: serde::Deserializer<'de>,
17622 {
17623 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
17624 ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
17625 ))
17626 }
17627 }
17628}
17629
17630/// Pre-populate cache volume with data from the origin volume.
17631#[derive(Clone, Default, PartialEq)]
17632#[non_exhaustive]
17633pub struct CachePrePopulate {
17634 /// Optional. List of directory-paths to be pre-populated for the FlexCache
17635 /// volume.
17636 pub path_list: std::vec::Vec<std::string::String>,
17637
17638 /// Optional. List of directory-paths to be excluded for pre-population for the
17639 /// FlexCache volume.
17640 pub exclude_path_list: std::vec::Vec<std::string::String>,
17641
17642 /// Optional. Flag indicating whether the directories listed with the
17643 /// `path_list` need to be recursively pre-populated.
17644 pub recursion: std::option::Option<bool>,
17645
17646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17647}
17648
17649impl CachePrePopulate {
17650 pub fn new() -> Self {
17651 std::default::Default::default()
17652 }
17653
17654 /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
17655 ///
17656 /// # Example
17657 /// ```ignore,no_run
17658 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17659 /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
17660 /// ```
17661 pub fn set_path_list<T, V>(mut self, v: T) -> Self
17662 where
17663 T: std::iter::IntoIterator<Item = V>,
17664 V: std::convert::Into<std::string::String>,
17665 {
17666 use std::iter::Iterator;
17667 self.path_list = v.into_iter().map(|i| i.into()).collect();
17668 self
17669 }
17670
17671 /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
17672 ///
17673 /// # Example
17674 /// ```ignore,no_run
17675 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17676 /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
17677 /// ```
17678 pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
17679 where
17680 T: std::iter::IntoIterator<Item = V>,
17681 V: std::convert::Into<std::string::String>,
17682 {
17683 use std::iter::Iterator;
17684 self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
17685 self
17686 }
17687
17688 /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
17689 ///
17690 /// # Example
17691 /// ```ignore,no_run
17692 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17693 /// let x = CachePrePopulate::new().set_recursion(true);
17694 /// ```
17695 pub fn set_recursion<T>(mut self, v: T) -> Self
17696 where
17697 T: std::convert::Into<bool>,
17698 {
17699 self.recursion = std::option::Option::Some(v.into());
17700 self
17701 }
17702
17703 /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
17704 ///
17705 /// # Example
17706 /// ```ignore,no_run
17707 /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17708 /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
17709 /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
17710 /// ```
17711 pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
17712 where
17713 T: std::convert::Into<bool>,
17714 {
17715 self.recursion = v.map(|x| x.into());
17716 self
17717 }
17718}
17719
17720impl wkt::message::Message for CachePrePopulate {
17721 fn typename() -> &'static str {
17722 "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
17723 }
17724}
17725
17726/// Block device represents the device(s) which are stored in the block volume.
17727#[derive(Clone, Default, PartialEq)]
17728#[non_exhaustive]
17729pub struct BlockDevice {
17730 /// Optional. User-defined name for the block device, unique within the volume.
17731 /// In case no user input is provided, name will be auto-generated in the
17732 /// backend. The name must meet the following requirements:
17733 ///
17734 /// * Be between 1 and 255 characters long.
17735 /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
17736 /// and the following special characters: "-", "_", "}", "{", ".".
17737 /// * Spaces are not allowed.
17738 pub name: std::option::Option<std::string::String>,
17739
17740 /// Optional. A list of host groups that identify hosts that can mount the
17741 /// block volume. Format:
17742 /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
17743 /// This field can be updated after the block device is created.
17744 pub host_groups: std::vec::Vec<std::string::String>,
17745
17746 /// Output only. Device identifier of the block volume. This represents
17747 /// `lun_serial_number` for iSCSI volumes.
17748 pub identifier: std::string::String,
17749
17750 /// Optional. The size of the block device in GiB.
17751 /// Any value provided for the `size_gib` field during volume creation is
17752 /// ignored. The block device's size is system-managed and will be set to match
17753 /// the parent Volume's `capacity_gib`.
17754 pub size_gib: std::option::Option<i64>,
17755
17756 /// Required. Immutable. The OS type of the volume.
17757 /// This field can't be changed after the block device is created.
17758 pub os_type: crate::model::OsType,
17759
17760 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17761}
17762
17763impl BlockDevice {
17764 pub fn new() -> Self {
17765 std::default::Default::default()
17766 }
17767
17768 /// Sets the value of [name][crate::model::BlockDevice::name].
17769 ///
17770 /// # Example
17771 /// ```ignore,no_run
17772 /// # use google_cloud_netapp_v1::model::BlockDevice;
17773 /// let x = BlockDevice::new().set_name("example");
17774 /// ```
17775 pub fn set_name<T>(mut self, v: T) -> Self
17776 where
17777 T: std::convert::Into<std::string::String>,
17778 {
17779 self.name = std::option::Option::Some(v.into());
17780 self
17781 }
17782
17783 /// Sets or clears the value of [name][crate::model::BlockDevice::name].
17784 ///
17785 /// # Example
17786 /// ```ignore,no_run
17787 /// # use google_cloud_netapp_v1::model::BlockDevice;
17788 /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
17789 /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
17790 /// ```
17791 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
17792 where
17793 T: std::convert::Into<std::string::String>,
17794 {
17795 self.name = v.map(|x| x.into());
17796 self
17797 }
17798
17799 /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
17800 ///
17801 /// # Example
17802 /// ```ignore,no_run
17803 /// # use google_cloud_netapp_v1::model::BlockDevice;
17804 /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
17805 /// ```
17806 pub fn set_host_groups<T, V>(mut self, v: T) -> Self
17807 where
17808 T: std::iter::IntoIterator<Item = V>,
17809 V: std::convert::Into<std::string::String>,
17810 {
17811 use std::iter::Iterator;
17812 self.host_groups = v.into_iter().map(|i| i.into()).collect();
17813 self
17814 }
17815
17816 /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
17817 ///
17818 /// # Example
17819 /// ```ignore,no_run
17820 /// # use google_cloud_netapp_v1::model::BlockDevice;
17821 /// let x = BlockDevice::new().set_identifier("example");
17822 /// ```
17823 pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17824 self.identifier = v.into();
17825 self
17826 }
17827
17828 /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
17829 ///
17830 /// # Example
17831 /// ```ignore,no_run
17832 /// # use google_cloud_netapp_v1::model::BlockDevice;
17833 /// let x = BlockDevice::new().set_size_gib(42);
17834 /// ```
17835 pub fn set_size_gib<T>(mut self, v: T) -> Self
17836 where
17837 T: std::convert::Into<i64>,
17838 {
17839 self.size_gib = std::option::Option::Some(v.into());
17840 self
17841 }
17842
17843 /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
17844 ///
17845 /// # Example
17846 /// ```ignore,no_run
17847 /// # use google_cloud_netapp_v1::model::BlockDevice;
17848 /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
17849 /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
17850 /// ```
17851 pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
17852 where
17853 T: std::convert::Into<i64>,
17854 {
17855 self.size_gib = v.map(|x| x.into());
17856 self
17857 }
17858
17859 /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
17860 ///
17861 /// # Example
17862 /// ```ignore,no_run
17863 /// # use google_cloud_netapp_v1::model::BlockDevice;
17864 /// use google_cloud_netapp_v1::model::OsType;
17865 /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
17866 /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
17867 /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
17868 /// ```
17869 pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
17870 self.os_type = v.into();
17871 self
17872 }
17873}
17874
17875impl wkt::message::Message for BlockDevice {
17876 fn typename() -> &'static str {
17877 "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
17878 }
17879}
17880
17881/// RestoreBackupFilesRequest restores files from a backup to a volume.
17882#[derive(Clone, Default, PartialEq)]
17883#[non_exhaustive]
17884pub struct RestoreBackupFilesRequest {
17885 /// Required. The volume resource name, in the format
17886 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
17887 pub name: std::string::String,
17888
17889 /// Required. The backup resource name, in the format
17890 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
17891 pub backup: std::string::String,
17892
17893 /// Required. List of files to be restored, specified by their absolute path in
17894 /// the source volume.
17895 pub file_list: std::vec::Vec<std::string::String>,
17896
17897 /// Optional. Absolute directory path in the destination volume. This is
17898 /// required if the `file_list` is provided.
17899 pub restore_destination_path: std::string::String,
17900
17901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17902}
17903
17904impl RestoreBackupFilesRequest {
17905 pub fn new() -> Self {
17906 std::default::Default::default()
17907 }
17908
17909 /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
17910 ///
17911 /// # Example
17912 /// ```ignore,no_run
17913 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17914 /// let x = RestoreBackupFilesRequest::new().set_name("example");
17915 /// ```
17916 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17917 self.name = v.into();
17918 self
17919 }
17920
17921 /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
17922 ///
17923 /// # Example
17924 /// ```ignore,no_run
17925 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17926 /// let x = RestoreBackupFilesRequest::new().set_backup("example");
17927 /// ```
17928 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17929 self.backup = v.into();
17930 self
17931 }
17932
17933 /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
17934 ///
17935 /// # Example
17936 /// ```ignore,no_run
17937 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17938 /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
17939 /// ```
17940 pub fn set_file_list<T, V>(mut self, v: T) -> Self
17941 where
17942 T: std::iter::IntoIterator<Item = V>,
17943 V: std::convert::Into<std::string::String>,
17944 {
17945 use std::iter::Iterator;
17946 self.file_list = v.into_iter().map(|i| i.into()).collect();
17947 self
17948 }
17949
17950 /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
17951 ///
17952 /// # Example
17953 /// ```ignore,no_run
17954 /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17955 /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
17956 /// ```
17957 pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
17958 mut self,
17959 v: T,
17960 ) -> Self {
17961 self.restore_destination_path = v.into();
17962 self
17963 }
17964}
17965
17966impl wkt::message::Message for RestoreBackupFilesRequest {
17967 fn typename() -> &'static str {
17968 "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
17969 }
17970}
17971
17972/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
17973#[derive(Clone, Default, PartialEq)]
17974#[non_exhaustive]
17975pub struct RestoreBackupFilesResponse {
17976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17977}
17978
17979impl RestoreBackupFilesResponse {
17980 pub fn new() -> Self {
17981 std::default::Default::default()
17982 }
17983}
17984
17985impl wkt::message::Message for RestoreBackupFilesResponse {
17986 fn typename() -> &'static str {
17987 "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
17988 }
17989}
17990
17991/// EstablishVolumePeeringRequest establishes cluster and svm peerings between
17992/// the source and destination clusters.
17993#[derive(Clone, Default, PartialEq)]
17994#[non_exhaustive]
17995pub struct EstablishVolumePeeringRequest {
17996 /// Required. The volume resource name, in the format
17997 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
17998 pub name: std::string::String,
17999
18000 /// Required. Name of the user's local source cluster to be peered with the
18001 /// destination cluster.
18002 pub peer_cluster_name: std::string::String,
18003
18004 /// Required. Name of the user's local source vserver svm to be peered with the
18005 /// destination vserver svm.
18006 pub peer_svm_name: std::string::String,
18007
18008 /// Optional. List of IPv4 ip addresses to be used for peering.
18009 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
18010
18011 /// Required. Name of the user's local source volume to be peered with the
18012 /// destination volume.
18013 pub peer_volume_name: std::string::String,
18014
18015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18016}
18017
18018impl EstablishVolumePeeringRequest {
18019 pub fn new() -> Self {
18020 std::default::Default::default()
18021 }
18022
18023 /// Sets the value of [name][crate::model::EstablishVolumePeeringRequest::name].
18024 ///
18025 /// # Example
18026 /// ```ignore,no_run
18027 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18028 /// let x = EstablishVolumePeeringRequest::new().set_name("example");
18029 /// ```
18030 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18031 self.name = v.into();
18032 self
18033 }
18034
18035 /// Sets the value of [peer_cluster_name][crate::model::EstablishVolumePeeringRequest::peer_cluster_name].
18036 ///
18037 /// # Example
18038 /// ```ignore,no_run
18039 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18040 /// let x = EstablishVolumePeeringRequest::new().set_peer_cluster_name("example");
18041 /// ```
18042 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
18043 mut self,
18044 v: T,
18045 ) -> Self {
18046 self.peer_cluster_name = v.into();
18047 self
18048 }
18049
18050 /// Sets the value of [peer_svm_name][crate::model::EstablishVolumePeeringRequest::peer_svm_name].
18051 ///
18052 /// # Example
18053 /// ```ignore,no_run
18054 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18055 /// let x = EstablishVolumePeeringRequest::new().set_peer_svm_name("example");
18056 /// ```
18057 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18058 self.peer_svm_name = v.into();
18059 self
18060 }
18061
18062 /// Sets the value of [peer_ip_addresses][crate::model::EstablishVolumePeeringRequest::peer_ip_addresses].
18063 ///
18064 /// # Example
18065 /// ```ignore,no_run
18066 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18067 /// let x = EstablishVolumePeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
18068 /// ```
18069 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
18070 where
18071 T: std::iter::IntoIterator<Item = V>,
18072 V: std::convert::Into<std::string::String>,
18073 {
18074 use std::iter::Iterator;
18075 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
18076 self
18077 }
18078
18079 /// Sets the value of [peer_volume_name][crate::model::EstablishVolumePeeringRequest::peer_volume_name].
18080 ///
18081 /// # Example
18082 /// ```ignore,no_run
18083 /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18084 /// let x = EstablishVolumePeeringRequest::new().set_peer_volume_name("example");
18085 /// ```
18086 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
18087 mut self,
18088 v: T,
18089 ) -> Self {
18090 self.peer_volume_name = v.into();
18091 self
18092 }
18093}
18094
18095impl wkt::message::Message for EstablishVolumePeeringRequest {
18096 fn typename() -> &'static str {
18097 "type.googleapis.com/google.cloud.netapp.v1.EstablishVolumePeeringRequest"
18098 }
18099}
18100
18101/// The service level of a storage pool and its volumes.
18102///
18103/// # Working with unknown values
18104///
18105/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18106/// additional enum variants at any time. Adding new variants is not considered
18107/// a breaking change. Applications should write their code in anticipation of:
18108///
18109/// - New values appearing in future releases of the client library, **and**
18110/// - New values received dynamically, without application changes.
18111///
18112/// Please consult the [Working with enums] section in the user guide for some
18113/// guidelines.
18114///
18115/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18116#[derive(Clone, Debug, PartialEq)]
18117#[non_exhaustive]
18118pub enum ServiceLevel {
18119 /// Unspecified service level.
18120 Unspecified,
18121 /// Premium service level.
18122 Premium,
18123 /// Extreme service level.
18124 Extreme,
18125 /// Standard service level.
18126 Standard,
18127 /// Flex service level.
18128 Flex,
18129 /// If set, the enum was initialized with an unknown value.
18130 ///
18131 /// Applications can examine the value using [ServiceLevel::value] or
18132 /// [ServiceLevel::name].
18133 UnknownValue(service_level::UnknownValue),
18134}
18135
18136#[doc(hidden)]
18137pub mod service_level {
18138 #[allow(unused_imports)]
18139 use super::*;
18140 #[derive(Clone, Debug, PartialEq)]
18141 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18142}
18143
18144impl ServiceLevel {
18145 /// Gets the enum value.
18146 ///
18147 /// Returns `None` if the enum contains an unknown value deserialized from
18148 /// the string representation of enums.
18149 pub fn value(&self) -> std::option::Option<i32> {
18150 match self {
18151 Self::Unspecified => std::option::Option::Some(0),
18152 Self::Premium => std::option::Option::Some(1),
18153 Self::Extreme => std::option::Option::Some(2),
18154 Self::Standard => std::option::Option::Some(3),
18155 Self::Flex => std::option::Option::Some(4),
18156 Self::UnknownValue(u) => u.0.value(),
18157 }
18158 }
18159
18160 /// Gets the enum value as a string.
18161 ///
18162 /// Returns `None` if the enum contains an unknown value deserialized from
18163 /// the integer representation of enums.
18164 pub fn name(&self) -> std::option::Option<&str> {
18165 match self {
18166 Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
18167 Self::Premium => std::option::Option::Some("PREMIUM"),
18168 Self::Extreme => std::option::Option::Some("EXTREME"),
18169 Self::Standard => std::option::Option::Some("STANDARD"),
18170 Self::Flex => std::option::Option::Some("FLEX"),
18171 Self::UnknownValue(u) => u.0.name(),
18172 }
18173 }
18174}
18175
18176impl std::default::Default for ServiceLevel {
18177 fn default() -> Self {
18178 use std::convert::From;
18179 Self::from(0)
18180 }
18181}
18182
18183impl std::fmt::Display for ServiceLevel {
18184 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18185 wkt::internal::display_enum(f, self.name(), self.value())
18186 }
18187}
18188
18189impl std::convert::From<i32> for ServiceLevel {
18190 fn from(value: i32) -> Self {
18191 match value {
18192 0 => Self::Unspecified,
18193 1 => Self::Premium,
18194 2 => Self::Extreme,
18195 3 => Self::Standard,
18196 4 => Self::Flex,
18197 _ => Self::UnknownValue(service_level::UnknownValue(
18198 wkt::internal::UnknownEnumValue::Integer(value),
18199 )),
18200 }
18201 }
18202}
18203
18204impl std::convert::From<&str> for ServiceLevel {
18205 fn from(value: &str) -> Self {
18206 use std::string::ToString;
18207 match value {
18208 "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
18209 "PREMIUM" => Self::Premium,
18210 "EXTREME" => Self::Extreme,
18211 "STANDARD" => Self::Standard,
18212 "FLEX" => Self::Flex,
18213 _ => Self::UnknownValue(service_level::UnknownValue(
18214 wkt::internal::UnknownEnumValue::String(value.to_string()),
18215 )),
18216 }
18217 }
18218}
18219
18220impl serde::ser::Serialize for ServiceLevel {
18221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18222 where
18223 S: serde::Serializer,
18224 {
18225 match self {
18226 Self::Unspecified => serializer.serialize_i32(0),
18227 Self::Premium => serializer.serialize_i32(1),
18228 Self::Extreme => serializer.serialize_i32(2),
18229 Self::Standard => serializer.serialize_i32(3),
18230 Self::Flex => serializer.serialize_i32(4),
18231 Self::UnknownValue(u) => u.0.serialize(serializer),
18232 }
18233 }
18234}
18235
18236impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
18237 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18238 where
18239 D: serde::Deserializer<'de>,
18240 {
18241 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
18242 ".google.cloud.netapp.v1.ServiceLevel",
18243 ))
18244 }
18245}
18246
18247/// Flex Storage Pool performance.
18248///
18249/// # Working with unknown values
18250///
18251/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18252/// additional enum variants at any time. Adding new variants is not considered
18253/// a breaking change. Applications should write their code in anticipation of:
18254///
18255/// - New values appearing in future releases of the client library, **and**
18256/// - New values received dynamically, without application changes.
18257///
18258/// Please consult the [Working with enums] section in the user guide for some
18259/// guidelines.
18260///
18261/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18262#[derive(Clone, Debug, PartialEq)]
18263#[non_exhaustive]
18264pub enum FlexPerformance {
18265 /// Unspecified flex performance.
18266 Unspecified,
18267 /// Flex Storage Pool with default performance.
18268 Default,
18269 /// Flex Storage Pool with custom performance.
18270 Custom,
18271 /// If set, the enum was initialized with an unknown value.
18272 ///
18273 /// Applications can examine the value using [FlexPerformance::value] or
18274 /// [FlexPerformance::name].
18275 UnknownValue(flex_performance::UnknownValue),
18276}
18277
18278#[doc(hidden)]
18279pub mod flex_performance {
18280 #[allow(unused_imports)]
18281 use super::*;
18282 #[derive(Clone, Debug, PartialEq)]
18283 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18284}
18285
18286impl FlexPerformance {
18287 /// Gets the enum value.
18288 ///
18289 /// Returns `None` if the enum contains an unknown value deserialized from
18290 /// the string representation of enums.
18291 pub fn value(&self) -> std::option::Option<i32> {
18292 match self {
18293 Self::Unspecified => std::option::Option::Some(0),
18294 Self::Default => std::option::Option::Some(1),
18295 Self::Custom => std::option::Option::Some(2),
18296 Self::UnknownValue(u) => u.0.value(),
18297 }
18298 }
18299
18300 /// Gets the enum value as a string.
18301 ///
18302 /// Returns `None` if the enum contains an unknown value deserialized from
18303 /// the integer representation of enums.
18304 pub fn name(&self) -> std::option::Option<&str> {
18305 match self {
18306 Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
18307 Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
18308 Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
18309 Self::UnknownValue(u) => u.0.name(),
18310 }
18311 }
18312}
18313
18314impl std::default::Default for FlexPerformance {
18315 fn default() -> Self {
18316 use std::convert::From;
18317 Self::from(0)
18318 }
18319}
18320
18321impl std::fmt::Display for FlexPerformance {
18322 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18323 wkt::internal::display_enum(f, self.name(), self.value())
18324 }
18325}
18326
18327impl std::convert::From<i32> for FlexPerformance {
18328 fn from(value: i32) -> Self {
18329 match value {
18330 0 => Self::Unspecified,
18331 1 => Self::Default,
18332 2 => Self::Custom,
18333 _ => Self::UnknownValue(flex_performance::UnknownValue(
18334 wkt::internal::UnknownEnumValue::Integer(value),
18335 )),
18336 }
18337 }
18338}
18339
18340impl std::convert::From<&str> for FlexPerformance {
18341 fn from(value: &str) -> Self {
18342 use std::string::ToString;
18343 match value {
18344 "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
18345 "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
18346 "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
18347 _ => Self::UnknownValue(flex_performance::UnknownValue(
18348 wkt::internal::UnknownEnumValue::String(value.to_string()),
18349 )),
18350 }
18351 }
18352}
18353
18354impl serde::ser::Serialize for FlexPerformance {
18355 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18356 where
18357 S: serde::Serializer,
18358 {
18359 match self {
18360 Self::Unspecified => serializer.serialize_i32(0),
18361 Self::Default => serializer.serialize_i32(1),
18362 Self::Custom => serializer.serialize_i32(2),
18363 Self::UnknownValue(u) => u.0.serialize(serializer),
18364 }
18365 }
18366}
18367
18368impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
18369 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18370 where
18371 D: serde::Deserializer<'de>,
18372 {
18373 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
18374 ".google.cloud.netapp.v1.FlexPerformance",
18375 ))
18376 }
18377}
18378
18379/// The volume encryption key source.
18380///
18381/// # Working with unknown values
18382///
18383/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18384/// additional enum variants at any time. Adding new variants is not considered
18385/// a breaking change. Applications should write their code in anticipation of:
18386///
18387/// - New values appearing in future releases of the client library, **and**
18388/// - New values received dynamically, without application changes.
18389///
18390/// Please consult the [Working with enums] section in the user guide for some
18391/// guidelines.
18392///
18393/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18394#[derive(Clone, Debug, PartialEq)]
18395#[non_exhaustive]
18396pub enum EncryptionType {
18397 /// The source of the encryption key is not specified.
18398 Unspecified,
18399 /// Google managed encryption key.
18400 ServiceManaged,
18401 /// Customer managed encryption key, which is stored in KMS.
18402 CloudKms,
18403 /// If set, the enum was initialized with an unknown value.
18404 ///
18405 /// Applications can examine the value using [EncryptionType::value] or
18406 /// [EncryptionType::name].
18407 UnknownValue(encryption_type::UnknownValue),
18408}
18409
18410#[doc(hidden)]
18411pub mod encryption_type {
18412 #[allow(unused_imports)]
18413 use super::*;
18414 #[derive(Clone, Debug, PartialEq)]
18415 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18416}
18417
18418impl EncryptionType {
18419 /// Gets the enum value.
18420 ///
18421 /// Returns `None` if the enum contains an unknown value deserialized from
18422 /// the string representation of enums.
18423 pub fn value(&self) -> std::option::Option<i32> {
18424 match self {
18425 Self::Unspecified => std::option::Option::Some(0),
18426 Self::ServiceManaged => std::option::Option::Some(1),
18427 Self::CloudKms => std::option::Option::Some(2),
18428 Self::UnknownValue(u) => u.0.value(),
18429 }
18430 }
18431
18432 /// Gets the enum value as a string.
18433 ///
18434 /// Returns `None` if the enum contains an unknown value deserialized from
18435 /// the integer representation of enums.
18436 pub fn name(&self) -> std::option::Option<&str> {
18437 match self {
18438 Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
18439 Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
18440 Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
18441 Self::UnknownValue(u) => u.0.name(),
18442 }
18443 }
18444}
18445
18446impl std::default::Default for EncryptionType {
18447 fn default() -> Self {
18448 use std::convert::From;
18449 Self::from(0)
18450 }
18451}
18452
18453impl std::fmt::Display for EncryptionType {
18454 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18455 wkt::internal::display_enum(f, self.name(), self.value())
18456 }
18457}
18458
18459impl std::convert::From<i32> for EncryptionType {
18460 fn from(value: i32) -> Self {
18461 match value {
18462 0 => Self::Unspecified,
18463 1 => Self::ServiceManaged,
18464 2 => Self::CloudKms,
18465 _ => Self::UnknownValue(encryption_type::UnknownValue(
18466 wkt::internal::UnknownEnumValue::Integer(value),
18467 )),
18468 }
18469 }
18470}
18471
18472impl std::convert::From<&str> for EncryptionType {
18473 fn from(value: &str) -> Self {
18474 use std::string::ToString;
18475 match value {
18476 "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
18477 "SERVICE_MANAGED" => Self::ServiceManaged,
18478 "CLOUD_KMS" => Self::CloudKms,
18479 _ => Self::UnknownValue(encryption_type::UnknownValue(
18480 wkt::internal::UnknownEnumValue::String(value.to_string()),
18481 )),
18482 }
18483 }
18484}
18485
18486impl serde::ser::Serialize for EncryptionType {
18487 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18488 where
18489 S: serde::Serializer,
18490 {
18491 match self {
18492 Self::Unspecified => serializer.serialize_i32(0),
18493 Self::ServiceManaged => serializer.serialize_i32(1),
18494 Self::CloudKms => serializer.serialize_i32(2),
18495 Self::UnknownValue(u) => u.0.serialize(serializer),
18496 }
18497 }
18498}
18499
18500impl<'de> serde::de::Deserialize<'de> for EncryptionType {
18501 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18502 where
18503 D: serde::Deserializer<'de>,
18504 {
18505 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
18506 ".google.cloud.netapp.v1.EncryptionType",
18507 ))
18508 }
18509}
18510
18511/// Type of directory service
18512///
18513/// # Working with unknown values
18514///
18515/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18516/// additional enum variants at any time. Adding new variants is not considered
18517/// a breaking change. Applications should write their code in anticipation of:
18518///
18519/// - New values appearing in future releases of the client library, **and**
18520/// - New values received dynamically, without application changes.
18521///
18522/// Please consult the [Working with enums] section in the user guide for some
18523/// guidelines.
18524///
18525/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18526#[derive(Clone, Debug, PartialEq)]
18527#[non_exhaustive]
18528pub enum DirectoryServiceType {
18529 /// Directory service type is not specified.
18530 Unspecified,
18531 /// Active directory policy attached to the storage pool.
18532 ActiveDirectory,
18533 /// If set, the enum was initialized with an unknown value.
18534 ///
18535 /// Applications can examine the value using [DirectoryServiceType::value] or
18536 /// [DirectoryServiceType::name].
18537 UnknownValue(directory_service_type::UnknownValue),
18538}
18539
18540#[doc(hidden)]
18541pub mod directory_service_type {
18542 #[allow(unused_imports)]
18543 use super::*;
18544 #[derive(Clone, Debug, PartialEq)]
18545 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18546}
18547
18548impl DirectoryServiceType {
18549 /// Gets the enum value.
18550 ///
18551 /// Returns `None` if the enum contains an unknown value deserialized from
18552 /// the string representation of enums.
18553 pub fn value(&self) -> std::option::Option<i32> {
18554 match self {
18555 Self::Unspecified => std::option::Option::Some(0),
18556 Self::ActiveDirectory => std::option::Option::Some(1),
18557 Self::UnknownValue(u) => u.0.value(),
18558 }
18559 }
18560
18561 /// Gets the enum value as a string.
18562 ///
18563 /// Returns `None` if the enum contains an unknown value deserialized from
18564 /// the integer representation of enums.
18565 pub fn name(&self) -> std::option::Option<&str> {
18566 match self {
18567 Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
18568 Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
18569 Self::UnknownValue(u) => u.0.name(),
18570 }
18571 }
18572}
18573
18574impl std::default::Default for DirectoryServiceType {
18575 fn default() -> Self {
18576 use std::convert::From;
18577 Self::from(0)
18578 }
18579}
18580
18581impl std::fmt::Display for DirectoryServiceType {
18582 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18583 wkt::internal::display_enum(f, self.name(), self.value())
18584 }
18585}
18586
18587impl std::convert::From<i32> for DirectoryServiceType {
18588 fn from(value: i32) -> Self {
18589 match value {
18590 0 => Self::Unspecified,
18591 1 => Self::ActiveDirectory,
18592 _ => Self::UnknownValue(directory_service_type::UnknownValue(
18593 wkt::internal::UnknownEnumValue::Integer(value),
18594 )),
18595 }
18596 }
18597}
18598
18599impl std::convert::From<&str> for DirectoryServiceType {
18600 fn from(value: &str) -> Self {
18601 use std::string::ToString;
18602 match value {
18603 "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
18604 "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
18605 _ => Self::UnknownValue(directory_service_type::UnknownValue(
18606 wkt::internal::UnknownEnumValue::String(value.to_string()),
18607 )),
18608 }
18609 }
18610}
18611
18612impl serde::ser::Serialize for DirectoryServiceType {
18613 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18614 where
18615 S: serde::Serializer,
18616 {
18617 match self {
18618 Self::Unspecified => serializer.serialize_i32(0),
18619 Self::ActiveDirectory => serializer.serialize_i32(1),
18620 Self::UnknownValue(u) => u.0.serialize(serializer),
18621 }
18622 }
18623}
18624
18625impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
18626 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18627 where
18628 D: serde::Deserializer<'de>,
18629 {
18630 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
18631 ".google.cloud.netapp.v1.DirectoryServiceType",
18632 ))
18633 }
18634}
18635
18636/// Type of storage pool
18637///
18638/// # Working with unknown values
18639///
18640/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18641/// additional enum variants at any time. Adding new variants is not considered
18642/// a breaking change. Applications should write their code in anticipation of:
18643///
18644/// - New values appearing in future releases of the client library, **and**
18645/// - New values received dynamically, without application changes.
18646///
18647/// Please consult the [Working with enums] section in the user guide for some
18648/// guidelines.
18649///
18650/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18651#[derive(Clone, Debug, PartialEq)]
18652#[non_exhaustive]
18653pub enum StoragePoolType {
18654 /// Storage pool type is not specified.
18655 Unspecified,
18656 /// Storage pool type is file.
18657 File,
18658 /// Storage pool type is unified.
18659 Unified,
18660 /// If set, the enum was initialized with an unknown value.
18661 ///
18662 /// Applications can examine the value using [StoragePoolType::value] or
18663 /// [StoragePoolType::name].
18664 UnknownValue(storage_pool_type::UnknownValue),
18665}
18666
18667#[doc(hidden)]
18668pub mod storage_pool_type {
18669 #[allow(unused_imports)]
18670 use super::*;
18671 #[derive(Clone, Debug, PartialEq)]
18672 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18673}
18674
18675impl StoragePoolType {
18676 /// Gets the enum value.
18677 ///
18678 /// Returns `None` if the enum contains an unknown value deserialized from
18679 /// the string representation of enums.
18680 pub fn value(&self) -> std::option::Option<i32> {
18681 match self {
18682 Self::Unspecified => std::option::Option::Some(0),
18683 Self::File => std::option::Option::Some(1),
18684 Self::Unified => std::option::Option::Some(2),
18685 Self::UnknownValue(u) => u.0.value(),
18686 }
18687 }
18688
18689 /// Gets the enum value as a string.
18690 ///
18691 /// Returns `None` if the enum contains an unknown value deserialized from
18692 /// the integer representation of enums.
18693 pub fn name(&self) -> std::option::Option<&str> {
18694 match self {
18695 Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
18696 Self::File => std::option::Option::Some("FILE"),
18697 Self::Unified => std::option::Option::Some("UNIFIED"),
18698 Self::UnknownValue(u) => u.0.name(),
18699 }
18700 }
18701}
18702
18703impl std::default::Default for StoragePoolType {
18704 fn default() -> Self {
18705 use std::convert::From;
18706 Self::from(0)
18707 }
18708}
18709
18710impl std::fmt::Display for StoragePoolType {
18711 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18712 wkt::internal::display_enum(f, self.name(), self.value())
18713 }
18714}
18715
18716impl std::convert::From<i32> for StoragePoolType {
18717 fn from(value: i32) -> Self {
18718 match value {
18719 0 => Self::Unspecified,
18720 1 => Self::File,
18721 2 => Self::Unified,
18722 _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18723 wkt::internal::UnknownEnumValue::Integer(value),
18724 )),
18725 }
18726 }
18727}
18728
18729impl std::convert::From<&str> for StoragePoolType {
18730 fn from(value: &str) -> Self {
18731 use std::string::ToString;
18732 match value {
18733 "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
18734 "FILE" => Self::File,
18735 "UNIFIED" => Self::Unified,
18736 _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18737 wkt::internal::UnknownEnumValue::String(value.to_string()),
18738 )),
18739 }
18740 }
18741}
18742
18743impl serde::ser::Serialize for StoragePoolType {
18744 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18745 where
18746 S: serde::Serializer,
18747 {
18748 match self {
18749 Self::Unspecified => serializer.serialize_i32(0),
18750 Self::File => serializer.serialize_i32(1),
18751 Self::Unified => serializer.serialize_i32(2),
18752 Self::UnknownValue(u) => u.0.serialize(serializer),
18753 }
18754 }
18755}
18756
18757impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
18758 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18759 where
18760 D: serde::Deserializer<'de>,
18761 {
18762 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
18763 ".google.cloud.netapp.v1.StoragePoolType",
18764 ))
18765 }
18766}
18767
18768/// Schedule for Hybrid Replication.
18769/// New enum values may be added in future to support different frequency of
18770/// replication.
18771///
18772/// # Working with unknown values
18773///
18774/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18775/// additional enum variants at any time. Adding new variants is not considered
18776/// a breaking change. Applications should write their code in anticipation of:
18777///
18778/// - New values appearing in future releases of the client library, **and**
18779/// - New values received dynamically, without application changes.
18780///
18781/// Please consult the [Working with enums] section in the user guide for some
18782/// guidelines.
18783///
18784/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18785#[derive(Clone, Debug, PartialEq)]
18786#[non_exhaustive]
18787pub enum HybridReplicationSchedule {
18788 /// Unspecified HybridReplicationSchedule
18789 Unspecified,
18790 /// Replication happens once every 10 minutes.
18791 Every10Minutes,
18792 /// Replication happens once every hour.
18793 Hourly,
18794 /// Replication happens once every day.
18795 Daily,
18796 /// If set, the enum was initialized with an unknown value.
18797 ///
18798 /// Applications can examine the value using [HybridReplicationSchedule::value] or
18799 /// [HybridReplicationSchedule::name].
18800 UnknownValue(hybrid_replication_schedule::UnknownValue),
18801}
18802
18803#[doc(hidden)]
18804pub mod hybrid_replication_schedule {
18805 #[allow(unused_imports)]
18806 use super::*;
18807 #[derive(Clone, Debug, PartialEq)]
18808 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18809}
18810
18811impl HybridReplicationSchedule {
18812 /// Gets the enum value.
18813 ///
18814 /// Returns `None` if the enum contains an unknown value deserialized from
18815 /// the string representation of enums.
18816 pub fn value(&self) -> std::option::Option<i32> {
18817 match self {
18818 Self::Unspecified => std::option::Option::Some(0),
18819 Self::Every10Minutes => std::option::Option::Some(1),
18820 Self::Hourly => std::option::Option::Some(2),
18821 Self::Daily => std::option::Option::Some(3),
18822 Self::UnknownValue(u) => u.0.value(),
18823 }
18824 }
18825
18826 /// Gets the enum value as a string.
18827 ///
18828 /// Returns `None` if the enum contains an unknown value deserialized from
18829 /// the integer representation of enums.
18830 pub fn name(&self) -> std::option::Option<&str> {
18831 match self {
18832 Self::Unspecified => {
18833 std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
18834 }
18835 Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
18836 Self::Hourly => std::option::Option::Some("HOURLY"),
18837 Self::Daily => std::option::Option::Some("DAILY"),
18838 Self::UnknownValue(u) => u.0.name(),
18839 }
18840 }
18841}
18842
18843impl std::default::Default for HybridReplicationSchedule {
18844 fn default() -> Self {
18845 use std::convert::From;
18846 Self::from(0)
18847 }
18848}
18849
18850impl std::fmt::Display for HybridReplicationSchedule {
18851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18852 wkt::internal::display_enum(f, self.name(), self.value())
18853 }
18854}
18855
18856impl std::convert::From<i32> for HybridReplicationSchedule {
18857 fn from(value: i32) -> Self {
18858 match value {
18859 0 => Self::Unspecified,
18860 1 => Self::Every10Minutes,
18861 2 => Self::Hourly,
18862 3 => Self::Daily,
18863 _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18864 wkt::internal::UnknownEnumValue::Integer(value),
18865 )),
18866 }
18867 }
18868}
18869
18870impl std::convert::From<&str> for HybridReplicationSchedule {
18871 fn from(value: &str) -> Self {
18872 use std::string::ToString;
18873 match value {
18874 "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
18875 "EVERY_10_MINUTES" => Self::Every10Minutes,
18876 "HOURLY" => Self::Hourly,
18877 "DAILY" => Self::Daily,
18878 _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18879 wkt::internal::UnknownEnumValue::String(value.to_string()),
18880 )),
18881 }
18882 }
18883}
18884
18885impl serde::ser::Serialize for HybridReplicationSchedule {
18886 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18887 where
18888 S: serde::Serializer,
18889 {
18890 match self {
18891 Self::Unspecified => serializer.serialize_i32(0),
18892 Self::Every10Minutes => serializer.serialize_i32(1),
18893 Self::Hourly => serializer.serialize_i32(2),
18894 Self::Daily => serializer.serialize_i32(3),
18895 Self::UnknownValue(u) => u.0.serialize(serializer),
18896 }
18897 }
18898}
18899
18900impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
18901 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18902 where
18903 D: serde::Deserializer<'de>,
18904 {
18905 deserializer.deserialize_any(
18906 wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
18907 ".google.cloud.netapp.v1.HybridReplicationSchedule",
18908 ),
18909 )
18910 }
18911}
18912
18913/// QoS (Quality of Service) Types of the storage pool
18914///
18915/// # Working with unknown values
18916///
18917/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18918/// additional enum variants at any time. Adding new variants is not considered
18919/// a breaking change. Applications should write their code in anticipation of:
18920///
18921/// - New values appearing in future releases of the client library, **and**
18922/// - New values received dynamically, without application changes.
18923///
18924/// Please consult the [Working with enums] section in the user guide for some
18925/// guidelines.
18926///
18927/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18928#[derive(Clone, Debug, PartialEq)]
18929#[non_exhaustive]
18930pub enum QosType {
18931 /// Unspecified QoS Type
18932 Unspecified,
18933 /// QoS Type is Auto
18934 Auto,
18935 /// QoS Type is Manual
18936 Manual,
18937 /// If set, the enum was initialized with an unknown value.
18938 ///
18939 /// Applications can examine the value using [QosType::value] or
18940 /// [QosType::name].
18941 UnknownValue(qos_type::UnknownValue),
18942}
18943
18944#[doc(hidden)]
18945pub mod qos_type {
18946 #[allow(unused_imports)]
18947 use super::*;
18948 #[derive(Clone, Debug, PartialEq)]
18949 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18950}
18951
18952impl QosType {
18953 /// Gets the enum value.
18954 ///
18955 /// Returns `None` if the enum contains an unknown value deserialized from
18956 /// the string representation of enums.
18957 pub fn value(&self) -> std::option::Option<i32> {
18958 match self {
18959 Self::Unspecified => std::option::Option::Some(0),
18960 Self::Auto => std::option::Option::Some(1),
18961 Self::Manual => std::option::Option::Some(2),
18962 Self::UnknownValue(u) => u.0.value(),
18963 }
18964 }
18965
18966 /// Gets the enum value as a string.
18967 ///
18968 /// Returns `None` if the enum contains an unknown value deserialized from
18969 /// the integer representation of enums.
18970 pub fn name(&self) -> std::option::Option<&str> {
18971 match self {
18972 Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
18973 Self::Auto => std::option::Option::Some("AUTO"),
18974 Self::Manual => std::option::Option::Some("MANUAL"),
18975 Self::UnknownValue(u) => u.0.name(),
18976 }
18977 }
18978}
18979
18980impl std::default::Default for QosType {
18981 fn default() -> Self {
18982 use std::convert::From;
18983 Self::from(0)
18984 }
18985}
18986
18987impl std::fmt::Display for QosType {
18988 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18989 wkt::internal::display_enum(f, self.name(), self.value())
18990 }
18991}
18992
18993impl std::convert::From<i32> for QosType {
18994 fn from(value: i32) -> Self {
18995 match value {
18996 0 => Self::Unspecified,
18997 1 => Self::Auto,
18998 2 => Self::Manual,
18999 _ => Self::UnknownValue(qos_type::UnknownValue(
19000 wkt::internal::UnknownEnumValue::Integer(value),
19001 )),
19002 }
19003 }
19004}
19005
19006impl std::convert::From<&str> for QosType {
19007 fn from(value: &str) -> Self {
19008 use std::string::ToString;
19009 match value {
19010 "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
19011 "AUTO" => Self::Auto,
19012 "MANUAL" => Self::Manual,
19013 _ => Self::UnknownValue(qos_type::UnknownValue(
19014 wkt::internal::UnknownEnumValue::String(value.to_string()),
19015 )),
19016 }
19017 }
19018}
19019
19020impl serde::ser::Serialize for QosType {
19021 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19022 where
19023 S: serde::Serializer,
19024 {
19025 match self {
19026 Self::Unspecified => serializer.serialize_i32(0),
19027 Self::Auto => serializer.serialize_i32(1),
19028 Self::Manual => serializer.serialize_i32(2),
19029 Self::UnknownValue(u) => u.0.serialize(serializer),
19030 }
19031 }
19032}
19033
19034impl<'de> serde::de::Deserialize<'de> for QosType {
19035 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19036 where
19037 D: serde::Deserializer<'de>,
19038 {
19039 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
19040 ".google.cloud.netapp.v1.QosType",
19041 ))
19042 }
19043}
19044
19045/// OS types for the host group
19046///
19047/// # Working with unknown values
19048///
19049/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19050/// additional enum variants at any time. Adding new variants is not considered
19051/// a breaking change. Applications should write their code in anticipation of:
19052///
19053/// - New values appearing in future releases of the client library, **and**
19054/// - New values received dynamically, without application changes.
19055///
19056/// Please consult the [Working with enums] section in the user guide for some
19057/// guidelines.
19058///
19059/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19060#[derive(Clone, Debug, PartialEq)]
19061#[non_exhaustive]
19062pub enum OsType {
19063 /// Unspecified OS Type
19064 Unspecified,
19065 /// OS Type is Linux
19066 Linux,
19067 /// OS Type is Windows
19068 Windows,
19069 /// OS Type is VMware ESXi
19070 Esxi,
19071 /// If set, the enum was initialized with an unknown value.
19072 ///
19073 /// Applications can examine the value using [OsType::value] or
19074 /// [OsType::name].
19075 UnknownValue(os_type::UnknownValue),
19076}
19077
19078#[doc(hidden)]
19079pub mod os_type {
19080 #[allow(unused_imports)]
19081 use super::*;
19082 #[derive(Clone, Debug, PartialEq)]
19083 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19084}
19085
19086impl OsType {
19087 /// Gets the enum value.
19088 ///
19089 /// Returns `None` if the enum contains an unknown value deserialized from
19090 /// the string representation of enums.
19091 pub fn value(&self) -> std::option::Option<i32> {
19092 match self {
19093 Self::Unspecified => std::option::Option::Some(0),
19094 Self::Linux => std::option::Option::Some(1),
19095 Self::Windows => std::option::Option::Some(2),
19096 Self::Esxi => std::option::Option::Some(3),
19097 Self::UnknownValue(u) => u.0.value(),
19098 }
19099 }
19100
19101 /// Gets the enum value as a string.
19102 ///
19103 /// Returns `None` if the enum contains an unknown value deserialized from
19104 /// the integer representation of enums.
19105 pub fn name(&self) -> std::option::Option<&str> {
19106 match self {
19107 Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
19108 Self::Linux => std::option::Option::Some("LINUX"),
19109 Self::Windows => std::option::Option::Some("WINDOWS"),
19110 Self::Esxi => std::option::Option::Some("ESXI"),
19111 Self::UnknownValue(u) => u.0.name(),
19112 }
19113 }
19114}
19115
19116impl std::default::Default for OsType {
19117 fn default() -> Self {
19118 use std::convert::From;
19119 Self::from(0)
19120 }
19121}
19122
19123impl std::fmt::Display for OsType {
19124 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19125 wkt::internal::display_enum(f, self.name(), self.value())
19126 }
19127}
19128
19129impl std::convert::From<i32> for OsType {
19130 fn from(value: i32) -> Self {
19131 match value {
19132 0 => Self::Unspecified,
19133 1 => Self::Linux,
19134 2 => Self::Windows,
19135 3 => Self::Esxi,
19136 _ => Self::UnknownValue(os_type::UnknownValue(
19137 wkt::internal::UnknownEnumValue::Integer(value),
19138 )),
19139 }
19140 }
19141}
19142
19143impl std::convert::From<&str> for OsType {
19144 fn from(value: &str) -> Self {
19145 use std::string::ToString;
19146 match value {
19147 "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
19148 "LINUX" => Self::Linux,
19149 "WINDOWS" => Self::Windows,
19150 "ESXI" => Self::Esxi,
19151 _ => Self::UnknownValue(os_type::UnknownValue(
19152 wkt::internal::UnknownEnumValue::String(value.to_string()),
19153 )),
19154 }
19155 }
19156}
19157
19158impl serde::ser::Serialize for OsType {
19159 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19160 where
19161 S: serde::Serializer,
19162 {
19163 match self {
19164 Self::Unspecified => serializer.serialize_i32(0),
19165 Self::Linux => serializer.serialize_i32(1),
19166 Self::Windows => serializer.serialize_i32(2),
19167 Self::Esxi => serializer.serialize_i32(3),
19168 Self::UnknownValue(u) => u.0.serialize(serializer),
19169 }
19170 }
19171}
19172
19173impl<'de> serde::de::Deserialize<'de> for OsType {
19174 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19175 where
19176 D: serde::Deserializer<'de>,
19177 {
19178 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
19179 ".google.cloud.netapp.v1.OsType",
19180 ))
19181 }
19182}
19183
19184/// `Mode` of the storage pool or volume. This field is used to control whether
19185/// the resource is managed by the GCNV APIs or the GCNV ONTAP Mode APIs.
19186///
19187/// # Working with unknown values
19188///
19189/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19190/// additional enum variants at any time. Adding new variants is not considered
19191/// a breaking change. Applications should write their code in anticipation of:
19192///
19193/// - New values appearing in future releases of the client library, **and**
19194/// - New values received dynamically, without application changes.
19195///
19196/// Please consult the [Working with enums] section in the user guide for some
19197/// guidelines.
19198///
19199/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19200#[derive(Clone, Debug, PartialEq)]
19201#[non_exhaustive]
19202pub enum Mode {
19203 /// The `Mode` is not specified.
19204 Unspecified,
19205 /// The resource is managed by the GCNV APIs.
19206 Default,
19207 /// The resource is managed by the GCNV ONTAP Mode APIs.
19208 Ontap,
19209 /// If set, the enum was initialized with an unknown value.
19210 ///
19211 /// Applications can examine the value using [Mode::value] or
19212 /// [Mode::name].
19213 UnknownValue(mode::UnknownValue),
19214}
19215
19216#[doc(hidden)]
19217pub mod mode {
19218 #[allow(unused_imports)]
19219 use super::*;
19220 #[derive(Clone, Debug, PartialEq)]
19221 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19222}
19223
19224impl Mode {
19225 /// Gets the enum value.
19226 ///
19227 /// Returns `None` if the enum contains an unknown value deserialized from
19228 /// the string representation of enums.
19229 pub fn value(&self) -> std::option::Option<i32> {
19230 match self {
19231 Self::Unspecified => std::option::Option::Some(0),
19232 Self::Default => std::option::Option::Some(1),
19233 Self::Ontap => std::option::Option::Some(2),
19234 Self::UnknownValue(u) => u.0.value(),
19235 }
19236 }
19237
19238 /// Gets the enum value as a string.
19239 ///
19240 /// Returns `None` if the enum contains an unknown value deserialized from
19241 /// the integer representation of enums.
19242 pub fn name(&self) -> std::option::Option<&str> {
19243 match self {
19244 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
19245 Self::Default => std::option::Option::Some("DEFAULT"),
19246 Self::Ontap => std::option::Option::Some("ONTAP"),
19247 Self::UnknownValue(u) => u.0.name(),
19248 }
19249 }
19250}
19251
19252impl std::default::Default for Mode {
19253 fn default() -> Self {
19254 use std::convert::From;
19255 Self::from(0)
19256 }
19257}
19258
19259impl std::fmt::Display for Mode {
19260 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19261 wkt::internal::display_enum(f, self.name(), self.value())
19262 }
19263}
19264
19265impl std::convert::From<i32> for Mode {
19266 fn from(value: i32) -> Self {
19267 match value {
19268 0 => Self::Unspecified,
19269 1 => Self::Default,
19270 2 => Self::Ontap,
19271 _ => Self::UnknownValue(mode::UnknownValue(
19272 wkt::internal::UnknownEnumValue::Integer(value),
19273 )),
19274 }
19275 }
19276}
19277
19278impl std::convert::From<&str> for Mode {
19279 fn from(value: &str) -> Self {
19280 use std::string::ToString;
19281 match value {
19282 "MODE_UNSPECIFIED" => Self::Unspecified,
19283 "DEFAULT" => Self::Default,
19284 "ONTAP" => Self::Ontap,
19285 _ => Self::UnknownValue(mode::UnknownValue(wkt::internal::UnknownEnumValue::String(
19286 value.to_string(),
19287 ))),
19288 }
19289 }
19290}
19291
19292impl serde::ser::Serialize for Mode {
19293 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19294 where
19295 S: serde::Serializer,
19296 {
19297 match self {
19298 Self::Unspecified => serializer.serialize_i32(0),
19299 Self::Default => serializer.serialize_i32(1),
19300 Self::Ontap => serializer.serialize_i32(2),
19301 Self::UnknownValue(u) => u.0.serialize(serializer),
19302 }
19303 }
19304}
19305
19306impl<'de> serde::de::Deserialize<'de> for Mode {
19307 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19308 where
19309 D: serde::Deserializer<'de>,
19310 {
19311 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
19312 ".google.cloud.netapp.v1.Mode",
19313 ))
19314 }
19315}
19316
19317/// Protocols is an enum of all the supported network protocols for a volume.
19318///
19319/// # Working with unknown values
19320///
19321/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19322/// additional enum variants at any time. Adding new variants is not considered
19323/// a breaking change. Applications should write their code in anticipation of:
19324///
19325/// - New values appearing in future releases of the client library, **and**
19326/// - New values received dynamically, without application changes.
19327///
19328/// Please consult the [Working with enums] section in the user guide for some
19329/// guidelines.
19330///
19331/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19332#[derive(Clone, Debug, PartialEq)]
19333#[non_exhaustive]
19334pub enum Protocols {
19335 /// Unspecified protocol
19336 Unspecified,
19337 /// NFS V3 protocol
19338 Nfsv3,
19339 /// NFS V4 protocol
19340 Nfsv4,
19341 /// SMB protocol
19342 Smb,
19343 /// ISCSI protocol
19344 Iscsi,
19345 /// If set, the enum was initialized with an unknown value.
19346 ///
19347 /// Applications can examine the value using [Protocols::value] or
19348 /// [Protocols::name].
19349 UnknownValue(protocols::UnknownValue),
19350}
19351
19352#[doc(hidden)]
19353pub mod protocols {
19354 #[allow(unused_imports)]
19355 use super::*;
19356 #[derive(Clone, Debug, PartialEq)]
19357 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19358}
19359
19360impl Protocols {
19361 /// Gets the enum value.
19362 ///
19363 /// Returns `None` if the enum contains an unknown value deserialized from
19364 /// the string representation of enums.
19365 pub fn value(&self) -> std::option::Option<i32> {
19366 match self {
19367 Self::Unspecified => std::option::Option::Some(0),
19368 Self::Nfsv3 => std::option::Option::Some(1),
19369 Self::Nfsv4 => std::option::Option::Some(2),
19370 Self::Smb => std::option::Option::Some(3),
19371 Self::Iscsi => std::option::Option::Some(4),
19372 Self::UnknownValue(u) => u.0.value(),
19373 }
19374 }
19375
19376 /// Gets the enum value as a string.
19377 ///
19378 /// Returns `None` if the enum contains an unknown value deserialized from
19379 /// the integer representation of enums.
19380 pub fn name(&self) -> std::option::Option<&str> {
19381 match self {
19382 Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
19383 Self::Nfsv3 => std::option::Option::Some("NFSV3"),
19384 Self::Nfsv4 => std::option::Option::Some("NFSV4"),
19385 Self::Smb => std::option::Option::Some("SMB"),
19386 Self::Iscsi => std::option::Option::Some("ISCSI"),
19387 Self::UnknownValue(u) => u.0.name(),
19388 }
19389 }
19390}
19391
19392impl std::default::Default for Protocols {
19393 fn default() -> Self {
19394 use std::convert::From;
19395 Self::from(0)
19396 }
19397}
19398
19399impl std::fmt::Display for Protocols {
19400 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19401 wkt::internal::display_enum(f, self.name(), self.value())
19402 }
19403}
19404
19405impl std::convert::From<i32> for Protocols {
19406 fn from(value: i32) -> Self {
19407 match value {
19408 0 => Self::Unspecified,
19409 1 => Self::Nfsv3,
19410 2 => Self::Nfsv4,
19411 3 => Self::Smb,
19412 4 => Self::Iscsi,
19413 _ => Self::UnknownValue(protocols::UnknownValue(
19414 wkt::internal::UnknownEnumValue::Integer(value),
19415 )),
19416 }
19417 }
19418}
19419
19420impl std::convert::From<&str> for Protocols {
19421 fn from(value: &str) -> Self {
19422 use std::string::ToString;
19423 match value {
19424 "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
19425 "NFSV3" => Self::Nfsv3,
19426 "NFSV4" => Self::Nfsv4,
19427 "SMB" => Self::Smb,
19428 "ISCSI" => Self::Iscsi,
19429 _ => Self::UnknownValue(protocols::UnknownValue(
19430 wkt::internal::UnknownEnumValue::String(value.to_string()),
19431 )),
19432 }
19433 }
19434}
19435
19436impl serde::ser::Serialize for Protocols {
19437 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19438 where
19439 S: serde::Serializer,
19440 {
19441 match self {
19442 Self::Unspecified => serializer.serialize_i32(0),
19443 Self::Nfsv3 => serializer.serialize_i32(1),
19444 Self::Nfsv4 => serializer.serialize_i32(2),
19445 Self::Smb => serializer.serialize_i32(3),
19446 Self::Iscsi => serializer.serialize_i32(4),
19447 Self::UnknownValue(u) => u.0.serialize(serializer),
19448 }
19449 }
19450}
19451
19452impl<'de> serde::de::Deserialize<'de> for Protocols {
19453 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19454 where
19455 D: serde::Deserializer<'de>,
19456 {
19457 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
19458 ".google.cloud.netapp.v1.Protocols",
19459 ))
19460 }
19461}
19462
19463/// AccessType is an enum of all the supported access types for a volume.
19464///
19465/// # Working with unknown values
19466///
19467/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19468/// additional enum variants at any time. Adding new variants is not considered
19469/// a breaking change. Applications should write their code in anticipation of:
19470///
19471/// - New values appearing in future releases of the client library, **and**
19472/// - New values received dynamically, without application changes.
19473///
19474/// Please consult the [Working with enums] section in the user guide for some
19475/// guidelines.
19476///
19477/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19478#[derive(Clone, Debug, PartialEq)]
19479#[non_exhaustive]
19480pub enum AccessType {
19481 /// Unspecified Access Type
19482 Unspecified,
19483 /// Read Only
19484 ReadOnly,
19485 /// Read Write
19486 ReadWrite,
19487 /// None
19488 ReadNone,
19489 /// If set, the enum was initialized with an unknown value.
19490 ///
19491 /// Applications can examine the value using [AccessType::value] or
19492 /// [AccessType::name].
19493 UnknownValue(access_type::UnknownValue),
19494}
19495
19496#[doc(hidden)]
19497pub mod access_type {
19498 #[allow(unused_imports)]
19499 use super::*;
19500 #[derive(Clone, Debug, PartialEq)]
19501 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19502}
19503
19504impl AccessType {
19505 /// Gets the enum value.
19506 ///
19507 /// Returns `None` if the enum contains an unknown value deserialized from
19508 /// the string representation of enums.
19509 pub fn value(&self) -> std::option::Option<i32> {
19510 match self {
19511 Self::Unspecified => std::option::Option::Some(0),
19512 Self::ReadOnly => std::option::Option::Some(1),
19513 Self::ReadWrite => std::option::Option::Some(2),
19514 Self::ReadNone => std::option::Option::Some(3),
19515 Self::UnknownValue(u) => u.0.value(),
19516 }
19517 }
19518
19519 /// Gets the enum value as a string.
19520 ///
19521 /// Returns `None` if the enum contains an unknown value deserialized from
19522 /// the integer representation of enums.
19523 pub fn name(&self) -> std::option::Option<&str> {
19524 match self {
19525 Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
19526 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
19527 Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
19528 Self::ReadNone => std::option::Option::Some("READ_NONE"),
19529 Self::UnknownValue(u) => u.0.name(),
19530 }
19531 }
19532}
19533
19534impl std::default::Default for AccessType {
19535 fn default() -> Self {
19536 use std::convert::From;
19537 Self::from(0)
19538 }
19539}
19540
19541impl std::fmt::Display for AccessType {
19542 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19543 wkt::internal::display_enum(f, self.name(), self.value())
19544 }
19545}
19546
19547impl std::convert::From<i32> for AccessType {
19548 fn from(value: i32) -> Self {
19549 match value {
19550 0 => Self::Unspecified,
19551 1 => Self::ReadOnly,
19552 2 => Self::ReadWrite,
19553 3 => Self::ReadNone,
19554 _ => Self::UnknownValue(access_type::UnknownValue(
19555 wkt::internal::UnknownEnumValue::Integer(value),
19556 )),
19557 }
19558 }
19559}
19560
19561impl std::convert::From<&str> for AccessType {
19562 fn from(value: &str) -> Self {
19563 use std::string::ToString;
19564 match value {
19565 "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
19566 "READ_ONLY" => Self::ReadOnly,
19567 "READ_WRITE" => Self::ReadWrite,
19568 "READ_NONE" => Self::ReadNone,
19569 _ => Self::UnknownValue(access_type::UnknownValue(
19570 wkt::internal::UnknownEnumValue::String(value.to_string()),
19571 )),
19572 }
19573 }
19574}
19575
19576impl serde::ser::Serialize for AccessType {
19577 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19578 where
19579 S: serde::Serializer,
19580 {
19581 match self {
19582 Self::Unspecified => serializer.serialize_i32(0),
19583 Self::ReadOnly => serializer.serialize_i32(1),
19584 Self::ReadWrite => serializer.serialize_i32(2),
19585 Self::ReadNone => serializer.serialize_i32(3),
19586 Self::UnknownValue(u) => u.0.serialize(serializer),
19587 }
19588 }
19589}
19590
19591impl<'de> serde::de::Deserialize<'de> for AccessType {
19592 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19593 where
19594 D: serde::Deserializer<'de>,
19595 {
19596 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
19597 ".google.cloud.netapp.v1.AccessType",
19598 ))
19599 }
19600}
19601
19602/// SMBSettings
19603/// Modifies the behaviour of a SMB volume.
19604///
19605/// # Working with unknown values
19606///
19607/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19608/// additional enum variants at any time. Adding new variants is not considered
19609/// a breaking change. Applications should write their code in anticipation of:
19610///
19611/// - New values appearing in future releases of the client library, **and**
19612/// - New values received dynamically, without application changes.
19613///
19614/// Please consult the [Working with enums] section in the user guide for some
19615/// guidelines.
19616///
19617/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19618#[derive(Clone, Debug, PartialEq)]
19619#[non_exhaustive]
19620pub enum SMBSettings {
19621 /// Unspecified default option
19622 Unspecified,
19623 /// SMB setting encrypt data
19624 EncryptData,
19625 /// SMB setting browsable
19626 Browsable,
19627 /// SMB setting notify change
19628 ChangeNotify,
19629 /// SMB setting not to notify change
19630 NonBrowsable,
19631 /// SMB setting oplocks
19632 Oplocks,
19633 /// SMB setting to show snapshots
19634 ShowSnapshot,
19635 /// SMB setting to show previous versions
19636 ShowPreviousVersions,
19637 /// SMB setting to access volume based on enumerartion
19638 AccessBasedEnumeration,
19639 /// Continuously available enumeration
19640 ContinuouslyAvailable,
19641 /// If set, the enum was initialized with an unknown value.
19642 ///
19643 /// Applications can examine the value using [SMBSettings::value] or
19644 /// [SMBSettings::name].
19645 UnknownValue(smb_settings::UnknownValue),
19646}
19647
19648#[doc(hidden)]
19649pub mod smb_settings {
19650 #[allow(unused_imports)]
19651 use super::*;
19652 #[derive(Clone, Debug, PartialEq)]
19653 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19654}
19655
19656impl SMBSettings {
19657 /// Gets the enum value.
19658 ///
19659 /// Returns `None` if the enum contains an unknown value deserialized from
19660 /// the string representation of enums.
19661 pub fn value(&self) -> std::option::Option<i32> {
19662 match self {
19663 Self::Unspecified => std::option::Option::Some(0),
19664 Self::EncryptData => std::option::Option::Some(1),
19665 Self::Browsable => std::option::Option::Some(2),
19666 Self::ChangeNotify => std::option::Option::Some(3),
19667 Self::NonBrowsable => std::option::Option::Some(4),
19668 Self::Oplocks => std::option::Option::Some(5),
19669 Self::ShowSnapshot => std::option::Option::Some(6),
19670 Self::ShowPreviousVersions => std::option::Option::Some(7),
19671 Self::AccessBasedEnumeration => std::option::Option::Some(8),
19672 Self::ContinuouslyAvailable => std::option::Option::Some(9),
19673 Self::UnknownValue(u) => u.0.value(),
19674 }
19675 }
19676
19677 /// Gets the enum value as a string.
19678 ///
19679 /// Returns `None` if the enum contains an unknown value deserialized from
19680 /// the integer representation of enums.
19681 pub fn name(&self) -> std::option::Option<&str> {
19682 match self {
19683 Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
19684 Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
19685 Self::Browsable => std::option::Option::Some("BROWSABLE"),
19686 Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
19687 Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
19688 Self::Oplocks => std::option::Option::Some("OPLOCKS"),
19689 Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
19690 Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
19691 Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
19692 Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
19693 Self::UnknownValue(u) => u.0.name(),
19694 }
19695 }
19696}
19697
19698impl std::default::Default for SMBSettings {
19699 fn default() -> Self {
19700 use std::convert::From;
19701 Self::from(0)
19702 }
19703}
19704
19705impl std::fmt::Display for SMBSettings {
19706 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19707 wkt::internal::display_enum(f, self.name(), self.value())
19708 }
19709}
19710
19711impl std::convert::From<i32> for SMBSettings {
19712 fn from(value: i32) -> Self {
19713 match value {
19714 0 => Self::Unspecified,
19715 1 => Self::EncryptData,
19716 2 => Self::Browsable,
19717 3 => Self::ChangeNotify,
19718 4 => Self::NonBrowsable,
19719 5 => Self::Oplocks,
19720 6 => Self::ShowSnapshot,
19721 7 => Self::ShowPreviousVersions,
19722 8 => Self::AccessBasedEnumeration,
19723 9 => Self::ContinuouslyAvailable,
19724 _ => Self::UnknownValue(smb_settings::UnknownValue(
19725 wkt::internal::UnknownEnumValue::Integer(value),
19726 )),
19727 }
19728 }
19729}
19730
19731impl std::convert::From<&str> for SMBSettings {
19732 fn from(value: &str) -> Self {
19733 use std::string::ToString;
19734 match value {
19735 "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
19736 "ENCRYPT_DATA" => Self::EncryptData,
19737 "BROWSABLE" => Self::Browsable,
19738 "CHANGE_NOTIFY" => Self::ChangeNotify,
19739 "NON_BROWSABLE" => Self::NonBrowsable,
19740 "OPLOCKS" => Self::Oplocks,
19741 "SHOW_SNAPSHOT" => Self::ShowSnapshot,
19742 "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
19743 "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
19744 "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
19745 _ => Self::UnknownValue(smb_settings::UnknownValue(
19746 wkt::internal::UnknownEnumValue::String(value.to_string()),
19747 )),
19748 }
19749 }
19750}
19751
19752impl serde::ser::Serialize for SMBSettings {
19753 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19754 where
19755 S: serde::Serializer,
19756 {
19757 match self {
19758 Self::Unspecified => serializer.serialize_i32(0),
19759 Self::EncryptData => serializer.serialize_i32(1),
19760 Self::Browsable => serializer.serialize_i32(2),
19761 Self::ChangeNotify => serializer.serialize_i32(3),
19762 Self::NonBrowsable => serializer.serialize_i32(4),
19763 Self::Oplocks => serializer.serialize_i32(5),
19764 Self::ShowSnapshot => serializer.serialize_i32(6),
19765 Self::ShowPreviousVersions => serializer.serialize_i32(7),
19766 Self::AccessBasedEnumeration => serializer.serialize_i32(8),
19767 Self::ContinuouslyAvailable => serializer.serialize_i32(9),
19768 Self::UnknownValue(u) => u.0.serialize(serializer),
19769 }
19770 }
19771}
19772
19773impl<'de> serde::de::Deserialize<'de> for SMBSettings {
19774 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19775 where
19776 D: serde::Deserializer<'de>,
19777 {
19778 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
19779 ".google.cloud.netapp.v1.SMBSettings",
19780 ))
19781 }
19782}
19783
19784/// The security style of the volume, can be either UNIX or NTFS.
19785///
19786/// # Working with unknown values
19787///
19788/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19789/// additional enum variants at any time. Adding new variants is not considered
19790/// a breaking change. Applications should write their code in anticipation of:
19791///
19792/// - New values appearing in future releases of the client library, **and**
19793/// - New values received dynamically, without application changes.
19794///
19795/// Please consult the [Working with enums] section in the user guide for some
19796/// guidelines.
19797///
19798/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19799#[derive(Clone, Debug, PartialEq)]
19800#[non_exhaustive]
19801pub enum SecurityStyle {
19802 /// SecurityStyle is unspecified
19803 Unspecified,
19804 /// SecurityStyle uses NTFS
19805 Ntfs,
19806 /// SecurityStyle uses UNIX
19807 Unix,
19808 /// If set, the enum was initialized with an unknown value.
19809 ///
19810 /// Applications can examine the value using [SecurityStyle::value] or
19811 /// [SecurityStyle::name].
19812 UnknownValue(security_style::UnknownValue),
19813}
19814
19815#[doc(hidden)]
19816pub mod security_style {
19817 #[allow(unused_imports)]
19818 use super::*;
19819 #[derive(Clone, Debug, PartialEq)]
19820 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19821}
19822
19823impl SecurityStyle {
19824 /// Gets the enum value.
19825 ///
19826 /// Returns `None` if the enum contains an unknown value deserialized from
19827 /// the string representation of enums.
19828 pub fn value(&self) -> std::option::Option<i32> {
19829 match self {
19830 Self::Unspecified => std::option::Option::Some(0),
19831 Self::Ntfs => std::option::Option::Some(1),
19832 Self::Unix => std::option::Option::Some(2),
19833 Self::UnknownValue(u) => u.0.value(),
19834 }
19835 }
19836
19837 /// Gets the enum value as a string.
19838 ///
19839 /// Returns `None` if the enum contains an unknown value deserialized from
19840 /// the integer representation of enums.
19841 pub fn name(&self) -> std::option::Option<&str> {
19842 match self {
19843 Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
19844 Self::Ntfs => std::option::Option::Some("NTFS"),
19845 Self::Unix => std::option::Option::Some("UNIX"),
19846 Self::UnknownValue(u) => u.0.name(),
19847 }
19848 }
19849}
19850
19851impl std::default::Default for SecurityStyle {
19852 fn default() -> Self {
19853 use std::convert::From;
19854 Self::from(0)
19855 }
19856}
19857
19858impl std::fmt::Display for SecurityStyle {
19859 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19860 wkt::internal::display_enum(f, self.name(), self.value())
19861 }
19862}
19863
19864impl std::convert::From<i32> for SecurityStyle {
19865 fn from(value: i32) -> Self {
19866 match value {
19867 0 => Self::Unspecified,
19868 1 => Self::Ntfs,
19869 2 => Self::Unix,
19870 _ => Self::UnknownValue(security_style::UnknownValue(
19871 wkt::internal::UnknownEnumValue::Integer(value),
19872 )),
19873 }
19874 }
19875}
19876
19877impl std::convert::From<&str> for SecurityStyle {
19878 fn from(value: &str) -> Self {
19879 use std::string::ToString;
19880 match value {
19881 "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
19882 "NTFS" => Self::Ntfs,
19883 "UNIX" => Self::Unix,
19884 _ => Self::UnknownValue(security_style::UnknownValue(
19885 wkt::internal::UnknownEnumValue::String(value.to_string()),
19886 )),
19887 }
19888 }
19889}
19890
19891impl serde::ser::Serialize for SecurityStyle {
19892 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19893 where
19894 S: serde::Serializer,
19895 {
19896 match self {
19897 Self::Unspecified => serializer.serialize_i32(0),
19898 Self::Ntfs => serializer.serialize_i32(1),
19899 Self::Unix => serializer.serialize_i32(2),
19900 Self::UnknownValue(u) => u.0.serialize(serializer),
19901 }
19902 }
19903}
19904
19905impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
19906 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19907 where
19908 D: serde::Deserializer<'de>,
19909 {
19910 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
19911 ".google.cloud.netapp.v1.SecurityStyle",
19912 ))
19913 }
19914}
19915
19916/// Actions to be restricted for a volume.
19917///
19918/// # Working with unknown values
19919///
19920/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19921/// additional enum variants at any time. Adding new variants is not considered
19922/// a breaking change. Applications should write their code in anticipation of:
19923///
19924/// - New values appearing in future releases of the client library, **and**
19925/// - New values received dynamically, without application changes.
19926///
19927/// Please consult the [Working with enums] section in the user guide for some
19928/// guidelines.
19929///
19930/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19931#[derive(Clone, Debug, PartialEq)]
19932#[non_exhaustive]
19933pub enum RestrictedAction {
19934 /// Unspecified restricted action
19935 Unspecified,
19936 /// Prevent volume from being deleted when mounted.
19937 Delete,
19938 /// If set, the enum was initialized with an unknown value.
19939 ///
19940 /// Applications can examine the value using [RestrictedAction::value] or
19941 /// [RestrictedAction::name].
19942 UnknownValue(restricted_action::UnknownValue),
19943}
19944
19945#[doc(hidden)]
19946pub mod restricted_action {
19947 #[allow(unused_imports)]
19948 use super::*;
19949 #[derive(Clone, Debug, PartialEq)]
19950 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19951}
19952
19953impl RestrictedAction {
19954 /// Gets the enum value.
19955 ///
19956 /// Returns `None` if the enum contains an unknown value deserialized from
19957 /// the string representation of enums.
19958 pub fn value(&self) -> std::option::Option<i32> {
19959 match self {
19960 Self::Unspecified => std::option::Option::Some(0),
19961 Self::Delete => std::option::Option::Some(1),
19962 Self::UnknownValue(u) => u.0.value(),
19963 }
19964 }
19965
19966 /// Gets the enum value as a string.
19967 ///
19968 /// Returns `None` if the enum contains an unknown value deserialized from
19969 /// the integer representation of enums.
19970 pub fn name(&self) -> std::option::Option<&str> {
19971 match self {
19972 Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
19973 Self::Delete => std::option::Option::Some("DELETE"),
19974 Self::UnknownValue(u) => u.0.name(),
19975 }
19976 }
19977}
19978
19979impl std::default::Default for RestrictedAction {
19980 fn default() -> Self {
19981 use std::convert::From;
19982 Self::from(0)
19983 }
19984}
19985
19986impl std::fmt::Display for RestrictedAction {
19987 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19988 wkt::internal::display_enum(f, self.name(), self.value())
19989 }
19990}
19991
19992impl std::convert::From<i32> for RestrictedAction {
19993 fn from(value: i32) -> Self {
19994 match value {
19995 0 => Self::Unspecified,
19996 1 => Self::Delete,
19997 _ => Self::UnknownValue(restricted_action::UnknownValue(
19998 wkt::internal::UnknownEnumValue::Integer(value),
19999 )),
20000 }
20001 }
20002}
20003
20004impl std::convert::From<&str> for RestrictedAction {
20005 fn from(value: &str) -> Self {
20006 use std::string::ToString;
20007 match value {
20008 "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
20009 "DELETE" => Self::Delete,
20010 _ => Self::UnknownValue(restricted_action::UnknownValue(
20011 wkt::internal::UnknownEnumValue::String(value.to_string()),
20012 )),
20013 }
20014 }
20015}
20016
20017impl serde::ser::Serialize for RestrictedAction {
20018 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20019 where
20020 S: serde::Serializer,
20021 {
20022 match self {
20023 Self::Unspecified => serializer.serialize_i32(0),
20024 Self::Delete => serializer.serialize_i32(1),
20025 Self::UnknownValue(u) => u.0.serialize(serializer),
20026 }
20027 }
20028}
20029
20030impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
20031 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20032 where
20033 D: serde::Deserializer<'de>,
20034 {
20035 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
20036 ".google.cloud.netapp.v1.RestrictedAction",
20037 ))
20038 }
20039}