1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct OperationMetadata {
44 pub create_time: std::option::Option<wkt::Timestamp>,
46
47 pub end_time: std::option::Option<wkt::Timestamp>,
49
50 pub target: std::string::String,
52
53 pub verb: std::string::String,
55
56 pub status_message: std::string::String,
58
59 pub requested_cancellation: bool,
67
68 pub api_version: std::string::String,
70
71 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
72}
73
74impl OperationMetadata {
75 pub fn new() -> Self {
76 std::default::Default::default()
77 }
78
79 pub fn set_create_time<T>(mut self, v: T) -> Self
81 where
82 T: std::convert::Into<wkt::Timestamp>,
83 {
84 self.create_time = std::option::Option::Some(v.into());
85 self
86 }
87
88 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
90 where
91 T: std::convert::Into<wkt::Timestamp>,
92 {
93 self.create_time = v.map(|x| x.into());
94 self
95 }
96
97 pub fn set_end_time<T>(mut self, v: T) -> Self
99 where
100 T: std::convert::Into<wkt::Timestamp>,
101 {
102 self.end_time = std::option::Option::Some(v.into());
103 self
104 }
105
106 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
108 where
109 T: std::convert::Into<wkt::Timestamp>,
110 {
111 self.end_time = v.map(|x| x.into());
112 self
113 }
114
115 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
117 self.target = v.into();
118 self
119 }
120
121 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123 self.verb = v.into();
124 self
125 }
126
127 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129 self.status_message = v.into();
130 self
131 }
132
133 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
135 self.requested_cancellation = v.into();
136 self
137 }
138
139 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
141 self.api_version = v.into();
142 self
143 }
144}
145
146impl wkt::message::Message for OperationMetadata {
147 fn typename() -> &'static str {
148 "type.googleapis.com/google.cloud.baremetalsolution.v2.OperationMetadata"
149 }
150}
151
152#[derive(Clone, Default, PartialEq)]
154#[non_exhaustive]
155pub struct ResetInstanceResponse {
156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
157}
158
159impl ResetInstanceResponse {
160 pub fn new() -> Self {
161 std::default::Default::default()
162 }
163}
164
165impl wkt::message::Message for ResetInstanceResponse {
166 fn typename() -> &'static str {
167 "type.googleapis.com/google.cloud.baremetalsolution.v2.ResetInstanceResponse"
168 }
169}
170
171#[derive(Clone, Default, PartialEq)]
173#[non_exhaustive]
174pub struct Instance {
175 pub name: std::string::String,
181
182 pub id: std::string::String,
184
185 pub create_time: std::option::Option<wkt::Timestamp>,
187
188 pub update_time: std::option::Option<wkt::Timestamp>,
190
191 pub machine_type: std::string::String,
195
196 pub state: crate::model::instance::State,
198
199 pub hyperthreading_enabled: bool,
202
203 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
205
206 pub luns: std::vec::Vec<crate::model::Lun>,
208
209 pub volumes: std::vec::Vec<crate::model::Volume>,
212
213 pub networks: std::vec::Vec<crate::model::Network>,
215
216 pub interactive_serial_console_enabled: bool,
219
220 pub os_image: std::string::String,
222
223 pub pod: std::string::String,
228
229 pub network_template: std::string::String,
233
234 pub logical_interfaces: std::vec::Vec<crate::model::LogicalInterface>,
242
243 pub login_info: std::string::String,
245
246 pub workload_profile: crate::model::WorkloadProfile,
248
249 pub firmware_version: std::string::String,
251
252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
253}
254
255impl Instance {
256 pub fn new() -> Self {
257 std::default::Default::default()
258 }
259
260 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
262 self.name = v.into();
263 self
264 }
265
266 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
268 self.id = v.into();
269 self
270 }
271
272 pub fn set_create_time<T>(mut self, v: T) -> Self
274 where
275 T: std::convert::Into<wkt::Timestamp>,
276 {
277 self.create_time = std::option::Option::Some(v.into());
278 self
279 }
280
281 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
283 where
284 T: std::convert::Into<wkt::Timestamp>,
285 {
286 self.create_time = v.map(|x| x.into());
287 self
288 }
289
290 pub fn set_update_time<T>(mut self, v: T) -> Self
292 where
293 T: std::convert::Into<wkt::Timestamp>,
294 {
295 self.update_time = std::option::Option::Some(v.into());
296 self
297 }
298
299 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
301 where
302 T: std::convert::Into<wkt::Timestamp>,
303 {
304 self.update_time = v.map(|x| x.into());
305 self
306 }
307
308 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
310 self.machine_type = v.into();
311 self
312 }
313
314 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
316 self.state = v.into();
317 self
318 }
319
320 pub fn set_hyperthreading_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
322 self.hyperthreading_enabled = v.into();
323 self
324 }
325
326 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
328 where
329 T: std::iter::IntoIterator<Item = (K, V)>,
330 K: std::convert::Into<std::string::String>,
331 V: std::convert::Into<std::string::String>,
332 {
333 use std::iter::Iterator;
334 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
335 self
336 }
337
338 pub fn set_luns<T, V>(mut self, v: T) -> Self
340 where
341 T: std::iter::IntoIterator<Item = V>,
342 V: std::convert::Into<crate::model::Lun>,
343 {
344 use std::iter::Iterator;
345 self.luns = v.into_iter().map(|i| i.into()).collect();
346 self
347 }
348
349 pub fn set_volumes<T, V>(mut self, v: T) -> Self
351 where
352 T: std::iter::IntoIterator<Item = V>,
353 V: std::convert::Into<crate::model::Volume>,
354 {
355 use std::iter::Iterator;
356 self.volumes = v.into_iter().map(|i| i.into()).collect();
357 self
358 }
359
360 pub fn set_networks<T, V>(mut self, v: T) -> Self
362 where
363 T: std::iter::IntoIterator<Item = V>,
364 V: std::convert::Into<crate::model::Network>,
365 {
366 use std::iter::Iterator;
367 self.networks = v.into_iter().map(|i| i.into()).collect();
368 self
369 }
370
371 pub fn set_interactive_serial_console_enabled<T: std::convert::Into<bool>>(
373 mut self,
374 v: T,
375 ) -> Self {
376 self.interactive_serial_console_enabled = v.into();
377 self
378 }
379
380 pub fn set_os_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
382 self.os_image = v.into();
383 self
384 }
385
386 pub fn set_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
388 self.pod = v.into();
389 self
390 }
391
392 pub fn set_network_template<T: std::convert::Into<std::string::String>>(
394 mut self,
395 v: T,
396 ) -> Self {
397 self.network_template = v.into();
398 self
399 }
400
401 pub fn set_logical_interfaces<T, V>(mut self, v: T) -> Self
403 where
404 T: std::iter::IntoIterator<Item = V>,
405 V: std::convert::Into<crate::model::LogicalInterface>,
406 {
407 use std::iter::Iterator;
408 self.logical_interfaces = v.into_iter().map(|i| i.into()).collect();
409 self
410 }
411
412 pub fn set_login_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
414 self.login_info = v.into();
415 self
416 }
417
418 pub fn set_workload_profile<T: std::convert::Into<crate::model::WorkloadProfile>>(
420 mut self,
421 v: T,
422 ) -> Self {
423 self.workload_profile = v.into();
424 self
425 }
426
427 pub fn set_firmware_version<T: std::convert::Into<std::string::String>>(
429 mut self,
430 v: T,
431 ) -> Self {
432 self.firmware_version = v.into();
433 self
434 }
435}
436
437impl wkt::message::Message for Instance {
438 fn typename() -> &'static str {
439 "type.googleapis.com/google.cloud.baremetalsolution.v2.Instance"
440 }
441}
442
443pub mod instance {
445 #[allow(unused_imports)]
446 use super::*;
447
448 #[derive(Clone, Debug, PartialEq)]
464 #[non_exhaustive]
465 pub enum State {
466 Unspecified,
468 Provisioning,
470 Running,
472 Deleted,
474 Updating,
476 Starting,
478 Stopping,
480 Shutdown,
482 UnknownValue(state::UnknownValue),
487 }
488
489 #[doc(hidden)]
490 pub mod state {
491 #[allow(unused_imports)]
492 use super::*;
493 #[derive(Clone, Debug, PartialEq)]
494 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
495 }
496
497 impl State {
498 pub fn value(&self) -> std::option::Option<i32> {
503 match self {
504 Self::Unspecified => std::option::Option::Some(0),
505 Self::Provisioning => std::option::Option::Some(1),
506 Self::Running => std::option::Option::Some(2),
507 Self::Deleted => std::option::Option::Some(3),
508 Self::Updating => std::option::Option::Some(4),
509 Self::Starting => std::option::Option::Some(5),
510 Self::Stopping => std::option::Option::Some(6),
511 Self::Shutdown => std::option::Option::Some(7),
512 Self::UnknownValue(u) => u.0.value(),
513 }
514 }
515
516 pub fn name(&self) -> std::option::Option<&str> {
521 match self {
522 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
523 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
524 Self::Running => std::option::Option::Some("RUNNING"),
525 Self::Deleted => std::option::Option::Some("DELETED"),
526 Self::Updating => std::option::Option::Some("UPDATING"),
527 Self::Starting => std::option::Option::Some("STARTING"),
528 Self::Stopping => std::option::Option::Some("STOPPING"),
529 Self::Shutdown => std::option::Option::Some("SHUTDOWN"),
530 Self::UnknownValue(u) => u.0.name(),
531 }
532 }
533 }
534
535 impl std::default::Default for State {
536 fn default() -> Self {
537 use std::convert::From;
538 Self::from(0)
539 }
540 }
541
542 impl std::fmt::Display for State {
543 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
544 wkt::internal::display_enum(f, self.name(), self.value())
545 }
546 }
547
548 impl std::convert::From<i32> for State {
549 fn from(value: i32) -> Self {
550 match value {
551 0 => Self::Unspecified,
552 1 => Self::Provisioning,
553 2 => Self::Running,
554 3 => Self::Deleted,
555 4 => Self::Updating,
556 5 => Self::Starting,
557 6 => Self::Stopping,
558 7 => Self::Shutdown,
559 _ => Self::UnknownValue(state::UnknownValue(
560 wkt::internal::UnknownEnumValue::Integer(value),
561 )),
562 }
563 }
564 }
565
566 impl std::convert::From<&str> for State {
567 fn from(value: &str) -> Self {
568 use std::string::ToString;
569 match value {
570 "STATE_UNSPECIFIED" => Self::Unspecified,
571 "PROVISIONING" => Self::Provisioning,
572 "RUNNING" => Self::Running,
573 "DELETED" => Self::Deleted,
574 "UPDATING" => Self::Updating,
575 "STARTING" => Self::Starting,
576 "STOPPING" => Self::Stopping,
577 "SHUTDOWN" => Self::Shutdown,
578 _ => Self::UnknownValue(state::UnknownValue(
579 wkt::internal::UnknownEnumValue::String(value.to_string()),
580 )),
581 }
582 }
583 }
584
585 impl serde::ser::Serialize for State {
586 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
587 where
588 S: serde::Serializer,
589 {
590 match self {
591 Self::Unspecified => serializer.serialize_i32(0),
592 Self::Provisioning => serializer.serialize_i32(1),
593 Self::Running => serializer.serialize_i32(2),
594 Self::Deleted => serializer.serialize_i32(3),
595 Self::Updating => serializer.serialize_i32(4),
596 Self::Starting => serializer.serialize_i32(5),
597 Self::Stopping => serializer.serialize_i32(6),
598 Self::Shutdown => serializer.serialize_i32(7),
599 Self::UnknownValue(u) => u.0.serialize(serializer),
600 }
601 }
602 }
603
604 impl<'de> serde::de::Deserialize<'de> for State {
605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
606 where
607 D: serde::Deserializer<'de>,
608 {
609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
610 ".google.cloud.baremetalsolution.v2.Instance.State",
611 ))
612 }
613 }
614}
615
616#[derive(Clone, Default, PartialEq)]
618#[non_exhaustive]
619pub struct GetInstanceRequest {
620 pub name: std::string::String,
622
623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
624}
625
626impl GetInstanceRequest {
627 pub fn new() -> Self {
628 std::default::Default::default()
629 }
630
631 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
633 self.name = v.into();
634 self
635 }
636}
637
638impl wkt::message::Message for GetInstanceRequest {
639 fn typename() -> &'static str {
640 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetInstanceRequest"
641 }
642}
643
644#[derive(Clone, Default, PartialEq)]
646#[non_exhaustive]
647pub struct ListInstancesRequest {
648 pub parent: std::string::String,
650
651 pub page_size: i32,
654
655 pub page_token: std::string::String,
657
658 pub filter: std::string::String,
660
661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
662}
663
664impl ListInstancesRequest {
665 pub fn new() -> Self {
666 std::default::Default::default()
667 }
668
669 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
671 self.parent = v.into();
672 self
673 }
674
675 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
677 self.page_size = v.into();
678 self
679 }
680
681 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
683 self.page_token = v.into();
684 self
685 }
686
687 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
689 self.filter = v.into();
690 self
691 }
692}
693
694impl wkt::message::Message for ListInstancesRequest {
695 fn typename() -> &'static str {
696 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListInstancesRequest"
697 }
698}
699
700#[derive(Clone, Default, PartialEq)]
702#[non_exhaustive]
703pub struct ListInstancesResponse {
704 pub instances: std::vec::Vec<crate::model::Instance>,
706
707 pub next_page_token: std::string::String,
709
710 pub unreachable: std::vec::Vec<std::string::String>,
712
713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
714}
715
716impl ListInstancesResponse {
717 pub fn new() -> Self {
718 std::default::Default::default()
719 }
720
721 pub fn set_instances<T, V>(mut self, v: T) -> Self
723 where
724 T: std::iter::IntoIterator<Item = V>,
725 V: std::convert::Into<crate::model::Instance>,
726 {
727 use std::iter::Iterator;
728 self.instances = v.into_iter().map(|i| i.into()).collect();
729 self
730 }
731
732 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
734 self.next_page_token = v.into();
735 self
736 }
737
738 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
740 where
741 T: std::iter::IntoIterator<Item = V>,
742 V: std::convert::Into<std::string::String>,
743 {
744 use std::iter::Iterator;
745 self.unreachable = v.into_iter().map(|i| i.into()).collect();
746 self
747 }
748}
749
750impl wkt::message::Message for ListInstancesResponse {
751 fn typename() -> &'static str {
752 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListInstancesResponse"
753 }
754}
755
756#[doc(hidden)]
757impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
758 type PageItem = crate::model::Instance;
759
760 fn items(self) -> std::vec::Vec<Self::PageItem> {
761 self.instances
762 }
763
764 fn next_page_token(&self) -> std::string::String {
765 use std::clone::Clone;
766 self.next_page_token.clone()
767 }
768}
769
770#[derive(Clone, Default, PartialEq)]
772#[non_exhaustive]
773pub struct UpdateInstanceRequest {
774 pub instance: std::option::Option<crate::model::Instance>,
779
780 pub update_mask: std::option::Option<wkt::FieldMask>,
786
787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
788}
789
790impl UpdateInstanceRequest {
791 pub fn new() -> Self {
792 std::default::Default::default()
793 }
794
795 pub fn set_instance<T>(mut self, v: T) -> Self
797 where
798 T: std::convert::Into<crate::model::Instance>,
799 {
800 self.instance = std::option::Option::Some(v.into());
801 self
802 }
803
804 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
806 where
807 T: std::convert::Into<crate::model::Instance>,
808 {
809 self.instance = v.map(|x| x.into());
810 self
811 }
812
813 pub fn set_update_mask<T>(mut self, v: T) -> Self
815 where
816 T: std::convert::Into<wkt::FieldMask>,
817 {
818 self.update_mask = std::option::Option::Some(v.into());
819 self
820 }
821
822 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
824 where
825 T: std::convert::Into<wkt::FieldMask>,
826 {
827 self.update_mask = v.map(|x| x.into());
828 self
829 }
830}
831
832impl wkt::message::Message for UpdateInstanceRequest {
833 fn typename() -> &'static str {
834 "type.googleapis.com/google.cloud.baremetalsolution.v2.UpdateInstanceRequest"
835 }
836}
837
838#[derive(Clone, Default, PartialEq)]
840#[non_exhaustive]
841pub struct RenameInstanceRequest {
842 pub name: std::string::String,
845
846 pub new_instance_id: std::string::String,
848
849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
850}
851
852impl RenameInstanceRequest {
853 pub fn new() -> Self {
854 std::default::Default::default()
855 }
856
857 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
859 self.name = v.into();
860 self
861 }
862
863 pub fn set_new_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
865 self.new_instance_id = v.into();
866 self
867 }
868}
869
870impl wkt::message::Message for RenameInstanceRequest {
871 fn typename() -> &'static str {
872 "type.googleapis.com/google.cloud.baremetalsolution.v2.RenameInstanceRequest"
873 }
874}
875
876#[derive(Clone, Default, PartialEq)]
878#[non_exhaustive]
879pub struct ResetInstanceRequest {
880 pub name: std::string::String,
882
883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
884}
885
886impl ResetInstanceRequest {
887 pub fn new() -> Self {
888 std::default::Default::default()
889 }
890
891 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
893 self.name = v.into();
894 self
895 }
896}
897
898impl wkt::message::Message for ResetInstanceRequest {
899 fn typename() -> &'static str {
900 "type.googleapis.com/google.cloud.baremetalsolution.v2.ResetInstanceRequest"
901 }
902}
903
904#[derive(Clone, Default, PartialEq)]
906#[non_exhaustive]
907pub struct StartInstanceRequest {
908 pub name: std::string::String,
910
911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
912}
913
914impl StartInstanceRequest {
915 pub fn new() -> Self {
916 std::default::Default::default()
917 }
918
919 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
921 self.name = v.into();
922 self
923 }
924}
925
926impl wkt::message::Message for StartInstanceRequest {
927 fn typename() -> &'static str {
928 "type.googleapis.com/google.cloud.baremetalsolution.v2.StartInstanceRequest"
929 }
930}
931
932#[derive(Clone, Default, PartialEq)]
934#[non_exhaustive]
935pub struct StartInstanceResponse {
936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
937}
938
939impl StartInstanceResponse {
940 pub fn new() -> Self {
941 std::default::Default::default()
942 }
943}
944
945impl wkt::message::Message for StartInstanceResponse {
946 fn typename() -> &'static str {
947 "type.googleapis.com/google.cloud.baremetalsolution.v2.StartInstanceResponse"
948 }
949}
950
951#[derive(Clone, Default, PartialEq)]
953#[non_exhaustive]
954pub struct StopInstanceRequest {
955 pub name: std::string::String,
957
958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
959}
960
961impl StopInstanceRequest {
962 pub fn new() -> Self {
963 std::default::Default::default()
964 }
965
966 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
968 self.name = v.into();
969 self
970 }
971}
972
973impl wkt::message::Message for StopInstanceRequest {
974 fn typename() -> &'static str {
975 "type.googleapis.com/google.cloud.baremetalsolution.v2.StopInstanceRequest"
976 }
977}
978
979#[derive(Clone, Default, PartialEq)]
981#[non_exhaustive]
982pub struct StopInstanceResponse {
983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984}
985
986impl StopInstanceResponse {
987 pub fn new() -> Self {
988 std::default::Default::default()
989 }
990}
991
992impl wkt::message::Message for StopInstanceResponse {
993 fn typename() -> &'static str {
994 "type.googleapis.com/google.cloud.baremetalsolution.v2.StopInstanceResponse"
995 }
996}
997
998#[derive(Clone, Default, PartialEq)]
1000#[non_exhaustive]
1001pub struct EnableInteractiveSerialConsoleRequest {
1002 pub name: std::string::String,
1004
1005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1006}
1007
1008impl EnableInteractiveSerialConsoleRequest {
1009 pub fn new() -> Self {
1010 std::default::Default::default()
1011 }
1012
1013 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1015 self.name = v.into();
1016 self
1017 }
1018}
1019
1020impl wkt::message::Message for EnableInteractiveSerialConsoleRequest {
1021 fn typename() -> &'static str {
1022 "type.googleapis.com/google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleRequest"
1023 }
1024}
1025
1026#[derive(Clone, Default, PartialEq)]
1028#[non_exhaustive]
1029pub struct EnableInteractiveSerialConsoleResponse {
1030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1031}
1032
1033impl EnableInteractiveSerialConsoleResponse {
1034 pub fn new() -> Self {
1035 std::default::Default::default()
1036 }
1037}
1038
1039impl wkt::message::Message for EnableInteractiveSerialConsoleResponse {
1040 fn typename() -> &'static str {
1041 "type.googleapis.com/google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleResponse"
1042 }
1043}
1044
1045#[derive(Clone, Default, PartialEq)]
1047#[non_exhaustive]
1048pub struct DisableInteractiveSerialConsoleRequest {
1049 pub name: std::string::String,
1051
1052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1053}
1054
1055impl DisableInteractiveSerialConsoleRequest {
1056 pub fn new() -> Self {
1057 std::default::Default::default()
1058 }
1059
1060 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1062 self.name = v.into();
1063 self
1064 }
1065}
1066
1067impl wkt::message::Message for DisableInteractiveSerialConsoleRequest {
1068 fn typename() -> &'static str {
1069 "type.googleapis.com/google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleRequest"
1070 }
1071}
1072
1073#[derive(Clone, Default, PartialEq)]
1075#[non_exhaustive]
1076pub struct DisableInteractiveSerialConsoleResponse {
1077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1078}
1079
1080impl DisableInteractiveSerialConsoleResponse {
1081 pub fn new() -> Self {
1082 std::default::Default::default()
1083 }
1084}
1085
1086impl wkt::message::Message for DisableInteractiveSerialConsoleResponse {
1087 fn typename() -> &'static str {
1088 "type.googleapis.com/google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleResponse"
1089 }
1090}
1091
1092#[derive(Clone, Default, PartialEq)]
1094#[non_exhaustive]
1095pub struct DetachLunRequest {
1096 pub instance: std::string::String,
1098
1099 pub lun: std::string::String,
1101
1102 pub skip_reboot: bool,
1104
1105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1106}
1107
1108impl DetachLunRequest {
1109 pub fn new() -> Self {
1110 std::default::Default::default()
1111 }
1112
1113 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1115 self.instance = v.into();
1116 self
1117 }
1118
1119 pub fn set_lun<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1121 self.lun = v.into();
1122 self
1123 }
1124
1125 pub fn set_skip_reboot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1127 self.skip_reboot = v.into();
1128 self
1129 }
1130}
1131
1132impl wkt::message::Message for DetachLunRequest {
1133 fn typename() -> &'static str {
1134 "type.googleapis.com/google.cloud.baremetalsolution.v2.DetachLunRequest"
1135 }
1136}
1137
1138#[derive(Clone, Default, PartialEq)]
1140#[non_exhaustive]
1141pub struct ServerNetworkTemplate {
1142 pub name: std::string::String,
1148
1149 pub applicable_instance_types: std::vec::Vec<std::string::String>,
1151
1152 pub logical_interfaces: std::vec::Vec<crate::model::server_network_template::LogicalInterface>,
1154
1155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1156}
1157
1158impl ServerNetworkTemplate {
1159 pub fn new() -> Self {
1160 std::default::Default::default()
1161 }
1162
1163 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1165 self.name = v.into();
1166 self
1167 }
1168
1169 pub fn set_applicable_instance_types<T, V>(mut self, v: T) -> Self
1171 where
1172 T: std::iter::IntoIterator<Item = V>,
1173 V: std::convert::Into<std::string::String>,
1174 {
1175 use std::iter::Iterator;
1176 self.applicable_instance_types = v.into_iter().map(|i| i.into()).collect();
1177 self
1178 }
1179
1180 pub fn set_logical_interfaces<T, V>(mut self, v: T) -> Self
1182 where
1183 T: std::iter::IntoIterator<Item = V>,
1184 V: std::convert::Into<crate::model::server_network_template::LogicalInterface>,
1185 {
1186 use std::iter::Iterator;
1187 self.logical_interfaces = v.into_iter().map(|i| i.into()).collect();
1188 self
1189 }
1190}
1191
1192impl wkt::message::Message for ServerNetworkTemplate {
1193 fn typename() -> &'static str {
1194 "type.googleapis.com/google.cloud.baremetalsolution.v2.ServerNetworkTemplate"
1195 }
1196}
1197
1198pub mod server_network_template {
1200 #[allow(unused_imports)]
1201 use super::*;
1202
1203 #[derive(Clone, Default, PartialEq)]
1205 #[non_exhaustive]
1206 pub struct LogicalInterface {
1207 pub name: std::string::String,
1213
1214 pub r#type: crate::model::server_network_template::logical_interface::InterfaceType,
1216
1217 pub required: bool,
1219
1220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1221 }
1222
1223 impl LogicalInterface {
1224 pub fn new() -> Self {
1225 std::default::Default::default()
1226 }
1227
1228 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1230 self.name = v.into();
1231 self
1232 }
1233
1234 pub fn set_type<
1236 T: std::convert::Into<
1237 crate::model::server_network_template::logical_interface::InterfaceType,
1238 >,
1239 >(
1240 mut self,
1241 v: T,
1242 ) -> Self {
1243 self.r#type = v.into();
1244 self
1245 }
1246
1247 pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1249 self.required = v.into();
1250 self
1251 }
1252 }
1253
1254 impl wkt::message::Message for LogicalInterface {
1255 fn typename() -> &'static str {
1256 "type.googleapis.com/google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface"
1257 }
1258 }
1259
1260 pub mod logical_interface {
1262 #[allow(unused_imports)]
1263 use super::*;
1264
1265 #[derive(Clone, Debug, PartialEq)]
1281 #[non_exhaustive]
1282 pub enum InterfaceType {
1283 Unspecified,
1285 Bond,
1287 Nic,
1289 UnknownValue(interface_type::UnknownValue),
1294 }
1295
1296 #[doc(hidden)]
1297 pub mod interface_type {
1298 #[allow(unused_imports)]
1299 use super::*;
1300 #[derive(Clone, Debug, PartialEq)]
1301 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1302 }
1303
1304 impl InterfaceType {
1305 pub fn value(&self) -> std::option::Option<i32> {
1310 match self {
1311 Self::Unspecified => std::option::Option::Some(0),
1312 Self::Bond => std::option::Option::Some(1),
1313 Self::Nic => std::option::Option::Some(2),
1314 Self::UnknownValue(u) => u.0.value(),
1315 }
1316 }
1317
1318 pub fn name(&self) -> std::option::Option<&str> {
1323 match self {
1324 Self::Unspecified => std::option::Option::Some("INTERFACE_TYPE_UNSPECIFIED"),
1325 Self::Bond => std::option::Option::Some("BOND"),
1326 Self::Nic => std::option::Option::Some("NIC"),
1327 Self::UnknownValue(u) => u.0.name(),
1328 }
1329 }
1330 }
1331
1332 impl std::default::Default for InterfaceType {
1333 fn default() -> Self {
1334 use std::convert::From;
1335 Self::from(0)
1336 }
1337 }
1338
1339 impl std::fmt::Display for InterfaceType {
1340 fn fmt(
1341 &self,
1342 f: &mut std::fmt::Formatter<'_>,
1343 ) -> std::result::Result<(), std::fmt::Error> {
1344 wkt::internal::display_enum(f, self.name(), self.value())
1345 }
1346 }
1347
1348 impl std::convert::From<i32> for InterfaceType {
1349 fn from(value: i32) -> Self {
1350 match value {
1351 0 => Self::Unspecified,
1352 1 => Self::Bond,
1353 2 => Self::Nic,
1354 _ => Self::UnknownValue(interface_type::UnknownValue(
1355 wkt::internal::UnknownEnumValue::Integer(value),
1356 )),
1357 }
1358 }
1359 }
1360
1361 impl std::convert::From<&str> for InterfaceType {
1362 fn from(value: &str) -> Self {
1363 use std::string::ToString;
1364 match value {
1365 "INTERFACE_TYPE_UNSPECIFIED" => Self::Unspecified,
1366 "BOND" => Self::Bond,
1367 "NIC" => Self::Nic,
1368 _ => Self::UnknownValue(interface_type::UnknownValue(
1369 wkt::internal::UnknownEnumValue::String(value.to_string()),
1370 )),
1371 }
1372 }
1373 }
1374
1375 impl serde::ser::Serialize for InterfaceType {
1376 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1377 where
1378 S: serde::Serializer,
1379 {
1380 match self {
1381 Self::Unspecified => serializer.serialize_i32(0),
1382 Self::Bond => serializer.serialize_i32(1),
1383 Self::Nic => serializer.serialize_i32(2),
1384 Self::UnknownValue(u) => u.0.serialize(serializer),
1385 }
1386 }
1387 }
1388
1389 impl<'de> serde::de::Deserialize<'de> for InterfaceType {
1390 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1391 where
1392 D: serde::Deserializer<'de>,
1393 {
1394 deserializer.deserialize_any(wkt::internal::EnumVisitor::<InterfaceType>::new(
1395 ".google.cloud.baremetalsolution.v2.ServerNetworkTemplate.LogicalInterface.InterfaceType"))
1396 }
1397 }
1398 }
1399}
1400
1401#[derive(Clone, Default, PartialEq)]
1403#[non_exhaustive]
1404pub struct Lun {
1405 pub name: std::string::String,
1407
1408 pub id: std::string::String,
1410
1411 pub state: crate::model::lun::State,
1413
1414 pub size_gb: i64,
1416
1417 pub multiprotocol_type: crate::model::lun::MultiprotocolType,
1420
1421 pub storage_volume: std::string::String,
1423
1424 pub shareable: bool,
1426
1427 pub boot_lun: bool,
1429
1430 pub storage_type: crate::model::lun::StorageType,
1432
1433 pub wwid: std::string::String,
1435
1436 pub expire_time: std::option::Option<wkt::Timestamp>,
1439
1440 pub instances: std::vec::Vec<std::string::String>,
1442
1443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1444}
1445
1446impl Lun {
1447 pub fn new() -> Self {
1448 std::default::Default::default()
1449 }
1450
1451 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1453 self.name = v.into();
1454 self
1455 }
1456
1457 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1459 self.id = v.into();
1460 self
1461 }
1462
1463 pub fn set_state<T: std::convert::Into<crate::model::lun::State>>(mut self, v: T) -> Self {
1465 self.state = v.into();
1466 self
1467 }
1468
1469 pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1471 self.size_gb = v.into();
1472 self
1473 }
1474
1475 pub fn set_multiprotocol_type<T: std::convert::Into<crate::model::lun::MultiprotocolType>>(
1477 mut self,
1478 v: T,
1479 ) -> Self {
1480 self.multiprotocol_type = v.into();
1481 self
1482 }
1483
1484 pub fn set_storage_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1486 self.storage_volume = v.into();
1487 self
1488 }
1489
1490 pub fn set_shareable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1492 self.shareable = v.into();
1493 self
1494 }
1495
1496 pub fn set_boot_lun<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1498 self.boot_lun = v.into();
1499 self
1500 }
1501
1502 pub fn set_storage_type<T: std::convert::Into<crate::model::lun::StorageType>>(
1504 mut self,
1505 v: T,
1506 ) -> Self {
1507 self.storage_type = v.into();
1508 self
1509 }
1510
1511 pub fn set_wwid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.wwid = v.into();
1514 self
1515 }
1516
1517 pub fn set_expire_time<T>(mut self, v: T) -> Self
1519 where
1520 T: std::convert::Into<wkt::Timestamp>,
1521 {
1522 self.expire_time = std::option::Option::Some(v.into());
1523 self
1524 }
1525
1526 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
1528 where
1529 T: std::convert::Into<wkt::Timestamp>,
1530 {
1531 self.expire_time = v.map(|x| x.into());
1532 self
1533 }
1534
1535 pub fn set_instances<T, V>(mut self, v: T) -> Self
1537 where
1538 T: std::iter::IntoIterator<Item = V>,
1539 V: std::convert::Into<std::string::String>,
1540 {
1541 use std::iter::Iterator;
1542 self.instances = v.into_iter().map(|i| i.into()).collect();
1543 self
1544 }
1545}
1546
1547impl wkt::message::Message for Lun {
1548 fn typename() -> &'static str {
1549 "type.googleapis.com/google.cloud.baremetalsolution.v2.Lun"
1550 }
1551}
1552
1553pub mod lun {
1555 #[allow(unused_imports)]
1556 use super::*;
1557
1558 #[derive(Clone, Debug, PartialEq)]
1574 #[non_exhaustive]
1575 pub enum State {
1576 Unspecified,
1578 Creating,
1580 Updating,
1582 Ready,
1584 Deleting,
1586 CoolOff,
1588 UnknownValue(state::UnknownValue),
1593 }
1594
1595 #[doc(hidden)]
1596 pub mod state {
1597 #[allow(unused_imports)]
1598 use super::*;
1599 #[derive(Clone, Debug, PartialEq)]
1600 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1601 }
1602
1603 impl State {
1604 pub fn value(&self) -> std::option::Option<i32> {
1609 match self {
1610 Self::Unspecified => std::option::Option::Some(0),
1611 Self::Creating => std::option::Option::Some(1),
1612 Self::Updating => std::option::Option::Some(2),
1613 Self::Ready => std::option::Option::Some(3),
1614 Self::Deleting => std::option::Option::Some(4),
1615 Self::CoolOff => std::option::Option::Some(5),
1616 Self::UnknownValue(u) => u.0.value(),
1617 }
1618 }
1619
1620 pub fn name(&self) -> std::option::Option<&str> {
1625 match self {
1626 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1627 Self::Creating => std::option::Option::Some("CREATING"),
1628 Self::Updating => std::option::Option::Some("UPDATING"),
1629 Self::Ready => std::option::Option::Some("READY"),
1630 Self::Deleting => std::option::Option::Some("DELETING"),
1631 Self::CoolOff => std::option::Option::Some("COOL_OFF"),
1632 Self::UnknownValue(u) => u.0.name(),
1633 }
1634 }
1635 }
1636
1637 impl std::default::Default for State {
1638 fn default() -> Self {
1639 use std::convert::From;
1640 Self::from(0)
1641 }
1642 }
1643
1644 impl std::fmt::Display for State {
1645 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1646 wkt::internal::display_enum(f, self.name(), self.value())
1647 }
1648 }
1649
1650 impl std::convert::From<i32> for State {
1651 fn from(value: i32) -> Self {
1652 match value {
1653 0 => Self::Unspecified,
1654 1 => Self::Creating,
1655 2 => Self::Updating,
1656 3 => Self::Ready,
1657 4 => Self::Deleting,
1658 5 => Self::CoolOff,
1659 _ => Self::UnknownValue(state::UnknownValue(
1660 wkt::internal::UnknownEnumValue::Integer(value),
1661 )),
1662 }
1663 }
1664 }
1665
1666 impl std::convert::From<&str> for State {
1667 fn from(value: &str) -> Self {
1668 use std::string::ToString;
1669 match value {
1670 "STATE_UNSPECIFIED" => Self::Unspecified,
1671 "CREATING" => Self::Creating,
1672 "UPDATING" => Self::Updating,
1673 "READY" => Self::Ready,
1674 "DELETING" => Self::Deleting,
1675 "COOL_OFF" => Self::CoolOff,
1676 _ => Self::UnknownValue(state::UnknownValue(
1677 wkt::internal::UnknownEnumValue::String(value.to_string()),
1678 )),
1679 }
1680 }
1681 }
1682
1683 impl serde::ser::Serialize for State {
1684 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1685 where
1686 S: serde::Serializer,
1687 {
1688 match self {
1689 Self::Unspecified => serializer.serialize_i32(0),
1690 Self::Creating => serializer.serialize_i32(1),
1691 Self::Updating => serializer.serialize_i32(2),
1692 Self::Ready => serializer.serialize_i32(3),
1693 Self::Deleting => serializer.serialize_i32(4),
1694 Self::CoolOff => serializer.serialize_i32(5),
1695 Self::UnknownValue(u) => u.0.serialize(serializer),
1696 }
1697 }
1698 }
1699
1700 impl<'de> serde::de::Deserialize<'de> for State {
1701 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1702 where
1703 D: serde::Deserializer<'de>,
1704 {
1705 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1706 ".google.cloud.baremetalsolution.v2.Lun.State",
1707 ))
1708 }
1709 }
1710
1711 #[derive(Clone, Debug, PartialEq)]
1727 #[non_exhaustive]
1728 pub enum MultiprotocolType {
1729 Unspecified,
1731 Linux,
1733 UnknownValue(multiprotocol_type::UnknownValue),
1738 }
1739
1740 #[doc(hidden)]
1741 pub mod multiprotocol_type {
1742 #[allow(unused_imports)]
1743 use super::*;
1744 #[derive(Clone, Debug, PartialEq)]
1745 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1746 }
1747
1748 impl MultiprotocolType {
1749 pub fn value(&self) -> std::option::Option<i32> {
1754 match self {
1755 Self::Unspecified => std::option::Option::Some(0),
1756 Self::Linux => std::option::Option::Some(1),
1757 Self::UnknownValue(u) => u.0.value(),
1758 }
1759 }
1760
1761 pub fn name(&self) -> std::option::Option<&str> {
1766 match self {
1767 Self::Unspecified => std::option::Option::Some("MULTIPROTOCOL_TYPE_UNSPECIFIED"),
1768 Self::Linux => std::option::Option::Some("LINUX"),
1769 Self::UnknownValue(u) => u.0.name(),
1770 }
1771 }
1772 }
1773
1774 impl std::default::Default for MultiprotocolType {
1775 fn default() -> Self {
1776 use std::convert::From;
1777 Self::from(0)
1778 }
1779 }
1780
1781 impl std::fmt::Display for MultiprotocolType {
1782 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1783 wkt::internal::display_enum(f, self.name(), self.value())
1784 }
1785 }
1786
1787 impl std::convert::From<i32> for MultiprotocolType {
1788 fn from(value: i32) -> Self {
1789 match value {
1790 0 => Self::Unspecified,
1791 1 => Self::Linux,
1792 _ => Self::UnknownValue(multiprotocol_type::UnknownValue(
1793 wkt::internal::UnknownEnumValue::Integer(value),
1794 )),
1795 }
1796 }
1797 }
1798
1799 impl std::convert::From<&str> for MultiprotocolType {
1800 fn from(value: &str) -> Self {
1801 use std::string::ToString;
1802 match value {
1803 "MULTIPROTOCOL_TYPE_UNSPECIFIED" => Self::Unspecified,
1804 "LINUX" => Self::Linux,
1805 _ => Self::UnknownValue(multiprotocol_type::UnknownValue(
1806 wkt::internal::UnknownEnumValue::String(value.to_string()),
1807 )),
1808 }
1809 }
1810 }
1811
1812 impl serde::ser::Serialize for MultiprotocolType {
1813 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1814 where
1815 S: serde::Serializer,
1816 {
1817 match self {
1818 Self::Unspecified => serializer.serialize_i32(0),
1819 Self::Linux => serializer.serialize_i32(1),
1820 Self::UnknownValue(u) => u.0.serialize(serializer),
1821 }
1822 }
1823 }
1824
1825 impl<'de> serde::de::Deserialize<'de> for MultiprotocolType {
1826 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1827 where
1828 D: serde::Deserializer<'de>,
1829 {
1830 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MultiprotocolType>::new(
1831 ".google.cloud.baremetalsolution.v2.Lun.MultiprotocolType",
1832 ))
1833 }
1834 }
1835
1836 #[derive(Clone, Debug, PartialEq)]
1852 #[non_exhaustive]
1853 pub enum StorageType {
1854 Unspecified,
1856 Ssd,
1858 Hdd,
1860 UnknownValue(storage_type::UnknownValue),
1865 }
1866
1867 #[doc(hidden)]
1868 pub mod storage_type {
1869 #[allow(unused_imports)]
1870 use super::*;
1871 #[derive(Clone, Debug, PartialEq)]
1872 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1873 }
1874
1875 impl StorageType {
1876 pub fn value(&self) -> std::option::Option<i32> {
1881 match self {
1882 Self::Unspecified => std::option::Option::Some(0),
1883 Self::Ssd => std::option::Option::Some(1),
1884 Self::Hdd => std::option::Option::Some(2),
1885 Self::UnknownValue(u) => u.0.value(),
1886 }
1887 }
1888
1889 pub fn name(&self) -> std::option::Option<&str> {
1894 match self {
1895 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
1896 Self::Ssd => std::option::Option::Some("SSD"),
1897 Self::Hdd => std::option::Option::Some("HDD"),
1898 Self::UnknownValue(u) => u.0.name(),
1899 }
1900 }
1901 }
1902
1903 impl std::default::Default for StorageType {
1904 fn default() -> Self {
1905 use std::convert::From;
1906 Self::from(0)
1907 }
1908 }
1909
1910 impl std::fmt::Display for StorageType {
1911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1912 wkt::internal::display_enum(f, self.name(), self.value())
1913 }
1914 }
1915
1916 impl std::convert::From<i32> for StorageType {
1917 fn from(value: i32) -> Self {
1918 match value {
1919 0 => Self::Unspecified,
1920 1 => Self::Ssd,
1921 2 => Self::Hdd,
1922 _ => Self::UnknownValue(storage_type::UnknownValue(
1923 wkt::internal::UnknownEnumValue::Integer(value),
1924 )),
1925 }
1926 }
1927 }
1928
1929 impl std::convert::From<&str> for StorageType {
1930 fn from(value: &str) -> Self {
1931 use std::string::ToString;
1932 match value {
1933 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
1934 "SSD" => Self::Ssd,
1935 "HDD" => Self::Hdd,
1936 _ => Self::UnknownValue(storage_type::UnknownValue(
1937 wkt::internal::UnknownEnumValue::String(value.to_string()),
1938 )),
1939 }
1940 }
1941 }
1942
1943 impl serde::ser::Serialize for StorageType {
1944 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1945 where
1946 S: serde::Serializer,
1947 {
1948 match self {
1949 Self::Unspecified => serializer.serialize_i32(0),
1950 Self::Ssd => serializer.serialize_i32(1),
1951 Self::Hdd => serializer.serialize_i32(2),
1952 Self::UnknownValue(u) => u.0.serialize(serializer),
1953 }
1954 }
1955 }
1956
1957 impl<'de> serde::de::Deserialize<'de> for StorageType {
1958 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1959 where
1960 D: serde::Deserializer<'de>,
1961 {
1962 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
1963 ".google.cloud.baremetalsolution.v2.Lun.StorageType",
1964 ))
1965 }
1966 }
1967}
1968
1969#[derive(Clone, Default, PartialEq)]
1971#[non_exhaustive]
1972pub struct GetLunRequest {
1973 pub name: std::string::String,
1975
1976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1977}
1978
1979impl GetLunRequest {
1980 pub fn new() -> Self {
1981 std::default::Default::default()
1982 }
1983
1984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1986 self.name = v.into();
1987 self
1988 }
1989}
1990
1991impl wkt::message::Message for GetLunRequest {
1992 fn typename() -> &'static str {
1993 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetLunRequest"
1994 }
1995}
1996
1997#[derive(Clone, Default, PartialEq)]
1999#[non_exhaustive]
2000pub struct ListLunsRequest {
2001 pub parent: std::string::String,
2003
2004 pub page_size: i32,
2007
2008 pub page_token: std::string::String,
2010
2011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2012}
2013
2014impl ListLunsRequest {
2015 pub fn new() -> Self {
2016 std::default::Default::default()
2017 }
2018
2019 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.parent = v.into();
2022 self
2023 }
2024
2025 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2027 self.page_size = v.into();
2028 self
2029 }
2030
2031 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.page_token = v.into();
2034 self
2035 }
2036}
2037
2038impl wkt::message::Message for ListLunsRequest {
2039 fn typename() -> &'static str {
2040 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListLunsRequest"
2041 }
2042}
2043
2044#[derive(Clone, Default, PartialEq)]
2046#[non_exhaustive]
2047pub struct ListLunsResponse {
2048 pub luns: std::vec::Vec<crate::model::Lun>,
2050
2051 pub next_page_token: std::string::String,
2053
2054 pub unreachable: std::vec::Vec<std::string::String>,
2056
2057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2058}
2059
2060impl ListLunsResponse {
2061 pub fn new() -> Self {
2062 std::default::Default::default()
2063 }
2064
2065 pub fn set_luns<T, V>(mut self, v: T) -> Self
2067 where
2068 T: std::iter::IntoIterator<Item = V>,
2069 V: std::convert::Into<crate::model::Lun>,
2070 {
2071 use std::iter::Iterator;
2072 self.luns = v.into_iter().map(|i| i.into()).collect();
2073 self
2074 }
2075
2076 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2078 self.next_page_token = v.into();
2079 self
2080 }
2081
2082 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2084 where
2085 T: std::iter::IntoIterator<Item = V>,
2086 V: std::convert::Into<std::string::String>,
2087 {
2088 use std::iter::Iterator;
2089 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2090 self
2091 }
2092}
2093
2094impl wkt::message::Message for ListLunsResponse {
2095 fn typename() -> &'static str {
2096 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListLunsResponse"
2097 }
2098}
2099
2100#[doc(hidden)]
2101impl gax::paginator::internal::PageableResponse for ListLunsResponse {
2102 type PageItem = crate::model::Lun;
2103
2104 fn items(self) -> std::vec::Vec<Self::PageItem> {
2105 self.luns
2106 }
2107
2108 fn next_page_token(&self) -> std::string::String {
2109 use std::clone::Clone;
2110 self.next_page_token.clone()
2111 }
2112}
2113
2114#[derive(Clone, Default, PartialEq)]
2116#[non_exhaustive]
2117pub struct EvictLunRequest {
2118 pub name: std::string::String,
2120
2121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2122}
2123
2124impl EvictLunRequest {
2125 pub fn new() -> Self {
2126 std::default::Default::default()
2127 }
2128
2129 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2131 self.name = v.into();
2132 self
2133 }
2134}
2135
2136impl wkt::message::Message for EvictLunRequest {
2137 fn typename() -> &'static str {
2138 "type.googleapis.com/google.cloud.baremetalsolution.v2.EvictLunRequest"
2139 }
2140}
2141
2142#[derive(Clone, Default, PartialEq)]
2144#[non_exhaustive]
2145pub struct Network {
2146 pub name: std::string::String,
2152
2153 pub id: std::string::String,
2155
2156 pub r#type: crate::model::network::Type,
2158
2159 pub ip_address: std::string::String,
2161
2162 pub mac_address: std::vec::Vec<std::string::String>,
2164
2165 pub state: crate::model::network::State,
2167
2168 pub vlan_id: std::string::String,
2170
2171 pub cidr: std::string::String,
2173
2174 pub vrf: std::option::Option<crate::model::Vrf>,
2176
2177 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2179
2180 pub services_cidr: std::string::String,
2182
2183 pub reservations: std::vec::Vec<crate::model::NetworkAddressReservation>,
2187
2188 pub pod: std::string::String,
2190
2191 pub mount_points: std::vec::Vec<crate::model::NetworkMountPoint>,
2193
2194 pub jumbo_frames_enabled: bool,
2196
2197 pub gateway_ip: std::string::String,
2199
2200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2201}
2202
2203impl Network {
2204 pub fn new() -> Self {
2205 std::default::Default::default()
2206 }
2207
2208 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2210 self.name = v.into();
2211 self
2212 }
2213
2214 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2216 self.id = v.into();
2217 self
2218 }
2219
2220 pub fn set_type<T: std::convert::Into<crate::model::network::Type>>(mut self, v: T) -> Self {
2222 self.r#type = v.into();
2223 self
2224 }
2225
2226 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2228 self.ip_address = v.into();
2229 self
2230 }
2231
2232 pub fn set_mac_address<T, V>(mut self, v: T) -> Self
2234 where
2235 T: std::iter::IntoIterator<Item = V>,
2236 V: std::convert::Into<std::string::String>,
2237 {
2238 use std::iter::Iterator;
2239 self.mac_address = v.into_iter().map(|i| i.into()).collect();
2240 self
2241 }
2242
2243 pub fn set_state<T: std::convert::Into<crate::model::network::State>>(mut self, v: T) -> Self {
2245 self.state = v.into();
2246 self
2247 }
2248
2249 pub fn set_vlan_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2251 self.vlan_id = v.into();
2252 self
2253 }
2254
2255 pub fn set_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2257 self.cidr = v.into();
2258 self
2259 }
2260
2261 pub fn set_vrf<T>(mut self, v: T) -> Self
2263 where
2264 T: std::convert::Into<crate::model::Vrf>,
2265 {
2266 self.vrf = std::option::Option::Some(v.into());
2267 self
2268 }
2269
2270 pub fn set_or_clear_vrf<T>(mut self, v: std::option::Option<T>) -> Self
2272 where
2273 T: std::convert::Into<crate::model::Vrf>,
2274 {
2275 self.vrf = v.map(|x| x.into());
2276 self
2277 }
2278
2279 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2281 where
2282 T: std::iter::IntoIterator<Item = (K, V)>,
2283 K: std::convert::Into<std::string::String>,
2284 V: std::convert::Into<std::string::String>,
2285 {
2286 use std::iter::Iterator;
2287 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2288 self
2289 }
2290
2291 pub fn set_services_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2293 self.services_cidr = v.into();
2294 self
2295 }
2296
2297 pub fn set_reservations<T, V>(mut self, v: T) -> Self
2299 where
2300 T: std::iter::IntoIterator<Item = V>,
2301 V: std::convert::Into<crate::model::NetworkAddressReservation>,
2302 {
2303 use std::iter::Iterator;
2304 self.reservations = v.into_iter().map(|i| i.into()).collect();
2305 self
2306 }
2307
2308 pub fn set_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.pod = v.into();
2311 self
2312 }
2313
2314 pub fn set_mount_points<T, V>(mut self, v: T) -> Self
2316 where
2317 T: std::iter::IntoIterator<Item = V>,
2318 V: std::convert::Into<crate::model::NetworkMountPoint>,
2319 {
2320 use std::iter::Iterator;
2321 self.mount_points = v.into_iter().map(|i| i.into()).collect();
2322 self
2323 }
2324
2325 pub fn set_jumbo_frames_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2327 self.jumbo_frames_enabled = v.into();
2328 self
2329 }
2330
2331 pub fn set_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2333 self.gateway_ip = v.into();
2334 self
2335 }
2336}
2337
2338impl wkt::message::Message for Network {
2339 fn typename() -> &'static str {
2340 "type.googleapis.com/google.cloud.baremetalsolution.v2.Network"
2341 }
2342}
2343
2344pub mod network {
2346 #[allow(unused_imports)]
2347 use super::*;
2348
2349 #[derive(Clone, Debug, PartialEq)]
2365 #[non_exhaustive]
2366 pub enum Type {
2367 Unspecified,
2369 Client,
2371 Private,
2373 UnknownValue(r#type::UnknownValue),
2378 }
2379
2380 #[doc(hidden)]
2381 pub mod r#type {
2382 #[allow(unused_imports)]
2383 use super::*;
2384 #[derive(Clone, Debug, PartialEq)]
2385 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2386 }
2387
2388 impl Type {
2389 pub fn value(&self) -> std::option::Option<i32> {
2394 match self {
2395 Self::Unspecified => std::option::Option::Some(0),
2396 Self::Client => std::option::Option::Some(1),
2397 Self::Private => std::option::Option::Some(2),
2398 Self::UnknownValue(u) => u.0.value(),
2399 }
2400 }
2401
2402 pub fn name(&self) -> std::option::Option<&str> {
2407 match self {
2408 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
2409 Self::Client => std::option::Option::Some("CLIENT"),
2410 Self::Private => std::option::Option::Some("PRIVATE"),
2411 Self::UnknownValue(u) => u.0.name(),
2412 }
2413 }
2414 }
2415
2416 impl std::default::Default for Type {
2417 fn default() -> Self {
2418 use std::convert::From;
2419 Self::from(0)
2420 }
2421 }
2422
2423 impl std::fmt::Display for Type {
2424 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2425 wkt::internal::display_enum(f, self.name(), self.value())
2426 }
2427 }
2428
2429 impl std::convert::From<i32> for Type {
2430 fn from(value: i32) -> Self {
2431 match value {
2432 0 => Self::Unspecified,
2433 1 => Self::Client,
2434 2 => Self::Private,
2435 _ => Self::UnknownValue(r#type::UnknownValue(
2436 wkt::internal::UnknownEnumValue::Integer(value),
2437 )),
2438 }
2439 }
2440 }
2441
2442 impl std::convert::From<&str> for Type {
2443 fn from(value: &str) -> Self {
2444 use std::string::ToString;
2445 match value {
2446 "TYPE_UNSPECIFIED" => Self::Unspecified,
2447 "CLIENT" => Self::Client,
2448 "PRIVATE" => Self::Private,
2449 _ => Self::UnknownValue(r#type::UnknownValue(
2450 wkt::internal::UnknownEnumValue::String(value.to_string()),
2451 )),
2452 }
2453 }
2454 }
2455
2456 impl serde::ser::Serialize for Type {
2457 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2458 where
2459 S: serde::Serializer,
2460 {
2461 match self {
2462 Self::Unspecified => serializer.serialize_i32(0),
2463 Self::Client => serializer.serialize_i32(1),
2464 Self::Private => serializer.serialize_i32(2),
2465 Self::UnknownValue(u) => u.0.serialize(serializer),
2466 }
2467 }
2468 }
2469
2470 impl<'de> serde::de::Deserialize<'de> for Type {
2471 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2472 where
2473 D: serde::Deserializer<'de>,
2474 {
2475 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
2476 ".google.cloud.baremetalsolution.v2.Network.Type",
2477 ))
2478 }
2479 }
2480
2481 #[derive(Clone, Debug, PartialEq)]
2497 #[non_exhaustive]
2498 pub enum State {
2499 Unspecified,
2501 Provisioning,
2503 Provisioned,
2505 Deprovisioning,
2507 Updating,
2509 UnknownValue(state::UnknownValue),
2514 }
2515
2516 #[doc(hidden)]
2517 pub mod state {
2518 #[allow(unused_imports)]
2519 use super::*;
2520 #[derive(Clone, Debug, PartialEq)]
2521 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2522 }
2523
2524 impl State {
2525 pub fn value(&self) -> std::option::Option<i32> {
2530 match self {
2531 Self::Unspecified => std::option::Option::Some(0),
2532 Self::Provisioning => std::option::Option::Some(1),
2533 Self::Provisioned => std::option::Option::Some(2),
2534 Self::Deprovisioning => std::option::Option::Some(3),
2535 Self::Updating => std::option::Option::Some(4),
2536 Self::UnknownValue(u) => u.0.value(),
2537 }
2538 }
2539
2540 pub fn name(&self) -> std::option::Option<&str> {
2545 match self {
2546 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2547 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
2548 Self::Provisioned => std::option::Option::Some("PROVISIONED"),
2549 Self::Deprovisioning => std::option::Option::Some("DEPROVISIONING"),
2550 Self::Updating => std::option::Option::Some("UPDATING"),
2551 Self::UnknownValue(u) => u.0.name(),
2552 }
2553 }
2554 }
2555
2556 impl std::default::Default for State {
2557 fn default() -> Self {
2558 use std::convert::From;
2559 Self::from(0)
2560 }
2561 }
2562
2563 impl std::fmt::Display for State {
2564 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2565 wkt::internal::display_enum(f, self.name(), self.value())
2566 }
2567 }
2568
2569 impl std::convert::From<i32> for State {
2570 fn from(value: i32) -> Self {
2571 match value {
2572 0 => Self::Unspecified,
2573 1 => Self::Provisioning,
2574 2 => Self::Provisioned,
2575 3 => Self::Deprovisioning,
2576 4 => Self::Updating,
2577 _ => Self::UnknownValue(state::UnknownValue(
2578 wkt::internal::UnknownEnumValue::Integer(value),
2579 )),
2580 }
2581 }
2582 }
2583
2584 impl std::convert::From<&str> for State {
2585 fn from(value: &str) -> Self {
2586 use std::string::ToString;
2587 match value {
2588 "STATE_UNSPECIFIED" => Self::Unspecified,
2589 "PROVISIONING" => Self::Provisioning,
2590 "PROVISIONED" => Self::Provisioned,
2591 "DEPROVISIONING" => Self::Deprovisioning,
2592 "UPDATING" => Self::Updating,
2593 _ => Self::UnknownValue(state::UnknownValue(
2594 wkt::internal::UnknownEnumValue::String(value.to_string()),
2595 )),
2596 }
2597 }
2598 }
2599
2600 impl serde::ser::Serialize for State {
2601 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2602 where
2603 S: serde::Serializer,
2604 {
2605 match self {
2606 Self::Unspecified => serializer.serialize_i32(0),
2607 Self::Provisioning => serializer.serialize_i32(1),
2608 Self::Provisioned => serializer.serialize_i32(2),
2609 Self::Deprovisioning => serializer.serialize_i32(3),
2610 Self::Updating => serializer.serialize_i32(4),
2611 Self::UnknownValue(u) => u.0.serialize(serializer),
2612 }
2613 }
2614 }
2615
2616 impl<'de> serde::de::Deserialize<'de> for State {
2617 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2618 where
2619 D: serde::Deserializer<'de>,
2620 {
2621 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2622 ".google.cloud.baremetalsolution.v2.Network.State",
2623 ))
2624 }
2625 }
2626}
2627
2628#[derive(Clone, Default, PartialEq)]
2630#[non_exhaustive]
2631pub struct NetworkAddressReservation {
2632 pub start_address: std::string::String,
2635
2636 pub end_address: std::string::String,
2641
2642 pub note: std::string::String,
2644
2645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2646}
2647
2648impl NetworkAddressReservation {
2649 pub fn new() -> Self {
2650 std::default::Default::default()
2651 }
2652
2653 pub fn set_start_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2655 self.start_address = v.into();
2656 self
2657 }
2658
2659 pub fn set_end_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2661 self.end_address = v.into();
2662 self
2663 }
2664
2665 pub fn set_note<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2667 self.note = v.into();
2668 self
2669 }
2670}
2671
2672impl wkt::message::Message for NetworkAddressReservation {
2673 fn typename() -> &'static str {
2674 "type.googleapis.com/google.cloud.baremetalsolution.v2.NetworkAddressReservation"
2675 }
2676}
2677
2678#[derive(Clone, Default, PartialEq)]
2680#[non_exhaustive]
2681pub struct Vrf {
2682 pub name: std::string::String,
2684
2685 pub state: crate::model::vrf::State,
2687
2688 pub qos_policy: std::option::Option<crate::model::vrf::QosPolicy>,
2693
2694 pub vlan_attachments: std::vec::Vec<crate::model::vrf::VlanAttachment>,
2696
2697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2698}
2699
2700impl Vrf {
2701 pub fn new() -> Self {
2702 std::default::Default::default()
2703 }
2704
2705 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2707 self.name = v.into();
2708 self
2709 }
2710
2711 pub fn set_state<T: std::convert::Into<crate::model::vrf::State>>(mut self, v: T) -> Self {
2713 self.state = v.into();
2714 self
2715 }
2716
2717 pub fn set_qos_policy<T>(mut self, v: T) -> Self
2719 where
2720 T: std::convert::Into<crate::model::vrf::QosPolicy>,
2721 {
2722 self.qos_policy = std::option::Option::Some(v.into());
2723 self
2724 }
2725
2726 pub fn set_or_clear_qos_policy<T>(mut self, v: std::option::Option<T>) -> Self
2728 where
2729 T: std::convert::Into<crate::model::vrf::QosPolicy>,
2730 {
2731 self.qos_policy = v.map(|x| x.into());
2732 self
2733 }
2734
2735 pub fn set_vlan_attachments<T, V>(mut self, v: T) -> Self
2737 where
2738 T: std::iter::IntoIterator<Item = V>,
2739 V: std::convert::Into<crate::model::vrf::VlanAttachment>,
2740 {
2741 use std::iter::Iterator;
2742 self.vlan_attachments = v.into_iter().map(|i| i.into()).collect();
2743 self
2744 }
2745}
2746
2747impl wkt::message::Message for Vrf {
2748 fn typename() -> &'static str {
2749 "type.googleapis.com/google.cloud.baremetalsolution.v2.VRF"
2750 }
2751}
2752
2753pub mod vrf {
2755 #[allow(unused_imports)]
2756 use super::*;
2757
2758 #[derive(Clone, Default, PartialEq)]
2760 #[non_exhaustive]
2761 pub struct QosPolicy {
2762 pub bandwidth_gbps: f64,
2764
2765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2766 }
2767
2768 impl QosPolicy {
2769 pub fn new() -> Self {
2770 std::default::Default::default()
2771 }
2772
2773 pub fn set_bandwidth_gbps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2775 self.bandwidth_gbps = v.into();
2776 self
2777 }
2778 }
2779
2780 impl wkt::message::Message for QosPolicy {
2781 fn typename() -> &'static str {
2782 "type.googleapis.com/google.cloud.baremetalsolution.v2.VRF.QosPolicy"
2783 }
2784 }
2785
2786 #[derive(Clone, Default, PartialEq)]
2788 #[non_exhaustive]
2789 pub struct VlanAttachment {
2790 pub peer_vlan_id: i64,
2792
2793 pub peer_ip: std::string::String,
2795
2796 pub router_ip: std::string::String,
2798
2799 pub pairing_key: std::string::String,
2801
2802 pub qos_policy: std::option::Option<crate::model::vrf::QosPolicy>,
2805
2806 pub id: std::string::String,
2808
2809 pub interconnect_attachment: std::string::String,
2812
2813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2814 }
2815
2816 impl VlanAttachment {
2817 pub fn new() -> Self {
2818 std::default::Default::default()
2819 }
2820
2821 pub fn set_peer_vlan_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2823 self.peer_vlan_id = v.into();
2824 self
2825 }
2826
2827 pub fn set_peer_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2829 self.peer_ip = v.into();
2830 self
2831 }
2832
2833 pub fn set_router_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2835 self.router_ip = v.into();
2836 self
2837 }
2838
2839 pub fn set_pairing_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2841 self.pairing_key = v.into();
2842 self
2843 }
2844
2845 pub fn set_qos_policy<T>(mut self, v: T) -> Self
2847 where
2848 T: std::convert::Into<crate::model::vrf::QosPolicy>,
2849 {
2850 self.qos_policy = std::option::Option::Some(v.into());
2851 self
2852 }
2853
2854 pub fn set_or_clear_qos_policy<T>(mut self, v: std::option::Option<T>) -> Self
2856 where
2857 T: std::convert::Into<crate::model::vrf::QosPolicy>,
2858 {
2859 self.qos_policy = v.map(|x| x.into());
2860 self
2861 }
2862
2863 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2865 self.id = v.into();
2866 self
2867 }
2868
2869 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
2871 mut self,
2872 v: T,
2873 ) -> Self {
2874 self.interconnect_attachment = v.into();
2875 self
2876 }
2877 }
2878
2879 impl wkt::message::Message for VlanAttachment {
2880 fn typename() -> &'static str {
2881 "type.googleapis.com/google.cloud.baremetalsolution.v2.VRF.VlanAttachment"
2882 }
2883 }
2884
2885 #[derive(Clone, Debug, PartialEq)]
2901 #[non_exhaustive]
2902 pub enum State {
2903 Unspecified,
2905 Provisioning,
2907 Provisioned,
2909 UnknownValue(state::UnknownValue),
2914 }
2915
2916 #[doc(hidden)]
2917 pub mod state {
2918 #[allow(unused_imports)]
2919 use super::*;
2920 #[derive(Clone, Debug, PartialEq)]
2921 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2922 }
2923
2924 impl State {
2925 pub fn value(&self) -> std::option::Option<i32> {
2930 match self {
2931 Self::Unspecified => std::option::Option::Some(0),
2932 Self::Provisioning => std::option::Option::Some(1),
2933 Self::Provisioned => std::option::Option::Some(2),
2934 Self::UnknownValue(u) => u.0.value(),
2935 }
2936 }
2937
2938 pub fn name(&self) -> std::option::Option<&str> {
2943 match self {
2944 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2945 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
2946 Self::Provisioned => std::option::Option::Some("PROVISIONED"),
2947 Self::UnknownValue(u) => u.0.name(),
2948 }
2949 }
2950 }
2951
2952 impl std::default::Default for State {
2953 fn default() -> Self {
2954 use std::convert::From;
2955 Self::from(0)
2956 }
2957 }
2958
2959 impl std::fmt::Display for State {
2960 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2961 wkt::internal::display_enum(f, self.name(), self.value())
2962 }
2963 }
2964
2965 impl std::convert::From<i32> for State {
2966 fn from(value: i32) -> Self {
2967 match value {
2968 0 => Self::Unspecified,
2969 1 => Self::Provisioning,
2970 2 => Self::Provisioned,
2971 _ => Self::UnknownValue(state::UnknownValue(
2972 wkt::internal::UnknownEnumValue::Integer(value),
2973 )),
2974 }
2975 }
2976 }
2977
2978 impl std::convert::From<&str> for State {
2979 fn from(value: &str) -> Self {
2980 use std::string::ToString;
2981 match value {
2982 "STATE_UNSPECIFIED" => Self::Unspecified,
2983 "PROVISIONING" => Self::Provisioning,
2984 "PROVISIONED" => Self::Provisioned,
2985 _ => Self::UnknownValue(state::UnknownValue(
2986 wkt::internal::UnknownEnumValue::String(value.to_string()),
2987 )),
2988 }
2989 }
2990 }
2991
2992 impl serde::ser::Serialize for State {
2993 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2994 where
2995 S: serde::Serializer,
2996 {
2997 match self {
2998 Self::Unspecified => serializer.serialize_i32(0),
2999 Self::Provisioning => serializer.serialize_i32(1),
3000 Self::Provisioned => serializer.serialize_i32(2),
3001 Self::UnknownValue(u) => u.0.serialize(serializer),
3002 }
3003 }
3004 }
3005
3006 impl<'de> serde::de::Deserialize<'de> for State {
3007 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3008 where
3009 D: serde::Deserializer<'de>,
3010 {
3011 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3012 ".google.cloud.baremetalsolution.v2.VRF.State",
3013 ))
3014 }
3015 }
3016}
3017
3018#[derive(Clone, Default, PartialEq)]
3023#[non_exhaustive]
3024pub struct LogicalInterface {
3025 pub logical_network_interfaces:
3027 std::vec::Vec<crate::model::logical_interface::LogicalNetworkInterface>,
3028
3029 pub name: std::string::String,
3032
3033 #[deprecated]
3036 pub interface_index: i32,
3037
3038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3039}
3040
3041impl LogicalInterface {
3042 pub fn new() -> Self {
3043 std::default::Default::default()
3044 }
3045
3046 pub fn set_logical_network_interfaces<T, V>(mut self, v: T) -> Self
3048 where
3049 T: std::iter::IntoIterator<Item = V>,
3050 V: std::convert::Into<crate::model::logical_interface::LogicalNetworkInterface>,
3051 {
3052 use std::iter::Iterator;
3053 self.logical_network_interfaces = v.into_iter().map(|i| i.into()).collect();
3054 self
3055 }
3056
3057 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3059 self.name = v.into();
3060 self
3061 }
3062
3063 #[deprecated]
3065 pub fn set_interface_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3066 self.interface_index = v.into();
3067 self
3068 }
3069}
3070
3071impl wkt::message::Message for LogicalInterface {
3072 fn typename() -> &'static str {
3073 "type.googleapis.com/google.cloud.baremetalsolution.v2.LogicalInterface"
3074 }
3075}
3076
3077pub mod logical_interface {
3079 #[allow(unused_imports)]
3080 use super::*;
3081
3082 #[derive(Clone, Default, PartialEq)]
3084 #[non_exhaustive]
3085 pub struct LogicalNetworkInterface {
3086 pub network: std::string::String,
3088
3089 pub ip_address: std::string::String,
3091
3092 pub default_gateway: bool,
3095
3096 pub network_type: crate::model::network::Type,
3098
3099 pub id: std::string::String,
3101
3102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3103 }
3104
3105 impl LogicalNetworkInterface {
3106 pub fn new() -> Self {
3107 std::default::Default::default()
3108 }
3109
3110 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3112 self.network = v.into();
3113 self
3114 }
3115
3116 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3118 self.ip_address = v.into();
3119 self
3120 }
3121
3122 pub fn set_default_gateway<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3124 self.default_gateway = v.into();
3125 self
3126 }
3127
3128 pub fn set_network_type<T: std::convert::Into<crate::model::network::Type>>(
3130 mut self,
3131 v: T,
3132 ) -> Self {
3133 self.network_type = v.into();
3134 self
3135 }
3136
3137 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3139 self.id = v.into();
3140 self
3141 }
3142 }
3143
3144 impl wkt::message::Message for LogicalNetworkInterface {
3145 fn typename() -> &'static str {
3146 "type.googleapis.com/google.cloud.baremetalsolution.v2.LogicalInterface.LogicalNetworkInterface"
3147 }
3148 }
3149}
3150
3151#[derive(Clone, Default, PartialEq)]
3153#[non_exhaustive]
3154pub struct GetNetworkRequest {
3155 pub name: std::string::String,
3157
3158 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3159}
3160
3161impl GetNetworkRequest {
3162 pub fn new() -> Self {
3163 std::default::Default::default()
3164 }
3165
3166 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3168 self.name = v.into();
3169 self
3170 }
3171}
3172
3173impl wkt::message::Message for GetNetworkRequest {
3174 fn typename() -> &'static str {
3175 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetNetworkRequest"
3176 }
3177}
3178
3179#[derive(Clone, Default, PartialEq)]
3181#[non_exhaustive]
3182pub struct ListNetworksRequest {
3183 pub parent: std::string::String,
3185
3186 pub page_size: i32,
3189
3190 pub page_token: std::string::String,
3192
3193 pub filter: std::string::String,
3195
3196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3197}
3198
3199impl ListNetworksRequest {
3200 pub fn new() -> Self {
3201 std::default::Default::default()
3202 }
3203
3204 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3206 self.parent = v.into();
3207 self
3208 }
3209
3210 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3212 self.page_size = v.into();
3213 self
3214 }
3215
3216 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3218 self.page_token = v.into();
3219 self
3220 }
3221
3222 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3224 self.filter = v.into();
3225 self
3226 }
3227}
3228
3229impl wkt::message::Message for ListNetworksRequest {
3230 fn typename() -> &'static str {
3231 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListNetworksRequest"
3232 }
3233}
3234
3235#[derive(Clone, Default, PartialEq)]
3237#[non_exhaustive]
3238pub struct ListNetworksResponse {
3239 pub networks: std::vec::Vec<crate::model::Network>,
3241
3242 pub next_page_token: std::string::String,
3244
3245 pub unreachable: std::vec::Vec<std::string::String>,
3247
3248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3249}
3250
3251impl ListNetworksResponse {
3252 pub fn new() -> Self {
3253 std::default::Default::default()
3254 }
3255
3256 pub fn set_networks<T, V>(mut self, v: T) -> Self
3258 where
3259 T: std::iter::IntoIterator<Item = V>,
3260 V: std::convert::Into<crate::model::Network>,
3261 {
3262 use std::iter::Iterator;
3263 self.networks = v.into_iter().map(|i| i.into()).collect();
3264 self
3265 }
3266
3267 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269 self.next_page_token = v.into();
3270 self
3271 }
3272
3273 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3275 where
3276 T: std::iter::IntoIterator<Item = V>,
3277 V: std::convert::Into<std::string::String>,
3278 {
3279 use std::iter::Iterator;
3280 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3281 self
3282 }
3283}
3284
3285impl wkt::message::Message for ListNetworksResponse {
3286 fn typename() -> &'static str {
3287 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListNetworksResponse"
3288 }
3289}
3290
3291#[doc(hidden)]
3292impl gax::paginator::internal::PageableResponse for ListNetworksResponse {
3293 type PageItem = crate::model::Network;
3294
3295 fn items(self) -> std::vec::Vec<Self::PageItem> {
3296 self.networks
3297 }
3298
3299 fn next_page_token(&self) -> std::string::String {
3300 use std::clone::Clone;
3301 self.next_page_token.clone()
3302 }
3303}
3304
3305#[derive(Clone, Default, PartialEq)]
3307#[non_exhaustive]
3308pub struct UpdateNetworkRequest {
3309 pub network: std::option::Option<crate::model::Network>,
3314
3315 pub update_mask: std::option::Option<wkt::FieldMask>,
3319
3320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3321}
3322
3323impl UpdateNetworkRequest {
3324 pub fn new() -> Self {
3325 std::default::Default::default()
3326 }
3327
3328 pub fn set_network<T>(mut self, v: T) -> Self
3330 where
3331 T: std::convert::Into<crate::model::Network>,
3332 {
3333 self.network = std::option::Option::Some(v.into());
3334 self
3335 }
3336
3337 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
3339 where
3340 T: std::convert::Into<crate::model::Network>,
3341 {
3342 self.network = v.map(|x| x.into());
3343 self
3344 }
3345
3346 pub fn set_update_mask<T>(mut self, v: T) -> Self
3348 where
3349 T: std::convert::Into<wkt::FieldMask>,
3350 {
3351 self.update_mask = std::option::Option::Some(v.into());
3352 self
3353 }
3354
3355 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3357 where
3358 T: std::convert::Into<wkt::FieldMask>,
3359 {
3360 self.update_mask = v.map(|x| x.into());
3361 self
3362 }
3363}
3364
3365impl wkt::message::Message for UpdateNetworkRequest {
3366 fn typename() -> &'static str {
3367 "type.googleapis.com/google.cloud.baremetalsolution.v2.UpdateNetworkRequest"
3368 }
3369}
3370
3371#[derive(Clone, Default, PartialEq)]
3373#[non_exhaustive]
3374pub struct NetworkUsage {
3375 pub network: std::option::Option<crate::model::Network>,
3377
3378 pub used_ips: std::vec::Vec<std::string::String>,
3380
3381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3382}
3383
3384impl NetworkUsage {
3385 pub fn new() -> Self {
3386 std::default::Default::default()
3387 }
3388
3389 pub fn set_network<T>(mut self, v: T) -> Self
3391 where
3392 T: std::convert::Into<crate::model::Network>,
3393 {
3394 self.network = std::option::Option::Some(v.into());
3395 self
3396 }
3397
3398 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
3400 where
3401 T: std::convert::Into<crate::model::Network>,
3402 {
3403 self.network = v.map(|x| x.into());
3404 self
3405 }
3406
3407 pub fn set_used_ips<T, V>(mut self, v: T) -> Self
3409 where
3410 T: std::iter::IntoIterator<Item = V>,
3411 V: std::convert::Into<std::string::String>,
3412 {
3413 use std::iter::Iterator;
3414 self.used_ips = v.into_iter().map(|i| i.into()).collect();
3415 self
3416 }
3417}
3418
3419impl wkt::message::Message for NetworkUsage {
3420 fn typename() -> &'static str {
3421 "type.googleapis.com/google.cloud.baremetalsolution.v2.NetworkUsage"
3422 }
3423}
3424
3425#[derive(Clone, Default, PartialEq)]
3427#[non_exhaustive]
3428pub struct ListNetworkUsageRequest {
3429 pub location: std::string::String,
3431
3432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3433}
3434
3435impl ListNetworkUsageRequest {
3436 pub fn new() -> Self {
3437 std::default::Default::default()
3438 }
3439
3440 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3442 self.location = v.into();
3443 self
3444 }
3445}
3446
3447impl wkt::message::Message for ListNetworkUsageRequest {
3448 fn typename() -> &'static str {
3449 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListNetworkUsageRequest"
3450 }
3451}
3452
3453#[derive(Clone, Default, PartialEq)]
3455#[non_exhaustive]
3456pub struct ListNetworkUsageResponse {
3457 pub networks: std::vec::Vec<crate::model::NetworkUsage>,
3459
3460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3461}
3462
3463impl ListNetworkUsageResponse {
3464 pub fn new() -> Self {
3465 std::default::Default::default()
3466 }
3467
3468 pub fn set_networks<T, V>(mut self, v: T) -> Self
3470 where
3471 T: std::iter::IntoIterator<Item = V>,
3472 V: std::convert::Into<crate::model::NetworkUsage>,
3473 {
3474 use std::iter::Iterator;
3475 self.networks = v.into_iter().map(|i| i.into()).collect();
3476 self
3477 }
3478}
3479
3480impl wkt::message::Message for ListNetworkUsageResponse {
3481 fn typename() -> &'static str {
3482 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListNetworkUsageResponse"
3483 }
3484}
3485
3486#[derive(Clone, Default, PartialEq)]
3488#[non_exhaustive]
3489pub struct NetworkMountPoint {
3490 pub instance: std::string::String,
3492
3493 pub logical_interface: std::string::String,
3495
3496 pub default_gateway: bool,
3498
3499 pub ip_address: std::string::String,
3501
3502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3503}
3504
3505impl NetworkMountPoint {
3506 pub fn new() -> Self {
3507 std::default::Default::default()
3508 }
3509
3510 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3512 self.instance = v.into();
3513 self
3514 }
3515
3516 pub fn set_logical_interface<T: std::convert::Into<std::string::String>>(
3518 mut self,
3519 v: T,
3520 ) -> Self {
3521 self.logical_interface = v.into();
3522 self
3523 }
3524
3525 pub fn set_default_gateway<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3527 self.default_gateway = v.into();
3528 self
3529 }
3530
3531 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3533 self.ip_address = v.into();
3534 self
3535 }
3536}
3537
3538impl wkt::message::Message for NetworkMountPoint {
3539 fn typename() -> &'static str {
3540 "type.googleapis.com/google.cloud.baremetalsolution.v2.NetworkMountPoint"
3541 }
3542}
3543
3544#[derive(Clone, Default, PartialEq)]
3546#[non_exhaustive]
3547pub struct RenameNetworkRequest {
3548 pub name: std::string::String,
3551
3552 pub new_network_id: std::string::String,
3554
3555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3556}
3557
3558impl RenameNetworkRequest {
3559 pub fn new() -> Self {
3560 std::default::Default::default()
3561 }
3562
3563 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3565 self.name = v.into();
3566 self
3567 }
3568
3569 pub fn set_new_network_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3571 self.new_network_id = v.into();
3572 self
3573 }
3574}
3575
3576impl wkt::message::Message for RenameNetworkRequest {
3577 fn typename() -> &'static str {
3578 "type.googleapis.com/google.cloud.baremetalsolution.v2.RenameNetworkRequest"
3579 }
3580}
3581
3582#[derive(Clone, Default, PartialEq)]
3584#[non_exhaustive]
3585pub struct NfsShare {
3586 pub name: std::string::String,
3588
3589 pub nfs_share_id: std::string::String,
3592
3593 pub id: std::string::String,
3596
3597 pub state: crate::model::nfs_share::State,
3599
3600 pub volume: std::string::String,
3603
3604 pub allowed_clients: std::vec::Vec<crate::model::nfs_share::AllowedClient>,
3606
3607 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3609
3610 pub requested_size_gib: i64,
3612
3613 pub storage_type: crate::model::nfs_share::StorageType,
3615
3616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3617}
3618
3619impl NfsShare {
3620 pub fn new() -> Self {
3621 std::default::Default::default()
3622 }
3623
3624 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3626 self.name = v.into();
3627 self
3628 }
3629
3630 pub fn set_nfs_share_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3632 self.nfs_share_id = v.into();
3633 self
3634 }
3635
3636 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3638 self.id = v.into();
3639 self
3640 }
3641
3642 pub fn set_state<T: std::convert::Into<crate::model::nfs_share::State>>(
3644 mut self,
3645 v: T,
3646 ) -> Self {
3647 self.state = v.into();
3648 self
3649 }
3650
3651 pub fn set_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3653 self.volume = v.into();
3654 self
3655 }
3656
3657 pub fn set_allowed_clients<T, V>(mut self, v: T) -> Self
3659 where
3660 T: std::iter::IntoIterator<Item = V>,
3661 V: std::convert::Into<crate::model::nfs_share::AllowedClient>,
3662 {
3663 use std::iter::Iterator;
3664 self.allowed_clients = v.into_iter().map(|i| i.into()).collect();
3665 self
3666 }
3667
3668 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3670 where
3671 T: std::iter::IntoIterator<Item = (K, V)>,
3672 K: std::convert::Into<std::string::String>,
3673 V: std::convert::Into<std::string::String>,
3674 {
3675 use std::iter::Iterator;
3676 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3677 self
3678 }
3679
3680 pub fn set_requested_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3682 self.requested_size_gib = v.into();
3683 self
3684 }
3685
3686 pub fn set_storage_type<T: std::convert::Into<crate::model::nfs_share::StorageType>>(
3688 mut self,
3689 v: T,
3690 ) -> Self {
3691 self.storage_type = v.into();
3692 self
3693 }
3694}
3695
3696impl wkt::message::Message for NfsShare {
3697 fn typename() -> &'static str {
3698 "type.googleapis.com/google.cloud.baremetalsolution.v2.NfsShare"
3699 }
3700}
3701
3702pub mod nfs_share {
3704 #[allow(unused_imports)]
3705 use super::*;
3706
3707 #[derive(Clone, Default, PartialEq)]
3709 #[non_exhaustive]
3710 pub struct AllowedClient {
3711 pub network: std::string::String,
3713
3714 pub share_ip: std::string::String,
3717
3718 pub allowed_clients_cidr: std::string::String,
3720
3721 pub mount_permissions: crate::model::nfs_share::MountPermissions,
3723
3724 pub allow_dev: bool,
3726
3727 pub allow_suid: bool,
3729
3730 pub no_root_squash: bool,
3734
3735 pub nfs_path: std::string::String,
3739
3740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3741 }
3742
3743 impl AllowedClient {
3744 pub fn new() -> Self {
3745 std::default::Default::default()
3746 }
3747
3748 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3750 self.network = v.into();
3751 self
3752 }
3753
3754 pub fn set_share_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3756 self.share_ip = v.into();
3757 self
3758 }
3759
3760 pub fn set_allowed_clients_cidr<T: std::convert::Into<std::string::String>>(
3762 mut self,
3763 v: T,
3764 ) -> Self {
3765 self.allowed_clients_cidr = v.into();
3766 self
3767 }
3768
3769 pub fn set_mount_permissions<
3771 T: std::convert::Into<crate::model::nfs_share::MountPermissions>,
3772 >(
3773 mut self,
3774 v: T,
3775 ) -> Self {
3776 self.mount_permissions = v.into();
3777 self
3778 }
3779
3780 pub fn set_allow_dev<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3782 self.allow_dev = v.into();
3783 self
3784 }
3785
3786 pub fn set_allow_suid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3788 self.allow_suid = v.into();
3789 self
3790 }
3791
3792 pub fn set_no_root_squash<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3794 self.no_root_squash = v.into();
3795 self
3796 }
3797
3798 pub fn set_nfs_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3800 self.nfs_path = v.into();
3801 self
3802 }
3803 }
3804
3805 impl wkt::message::Message for AllowedClient {
3806 fn typename() -> &'static str {
3807 "type.googleapis.com/google.cloud.baremetalsolution.v2.NfsShare.AllowedClient"
3808 }
3809 }
3810
3811 #[derive(Clone, Debug, PartialEq)]
3827 #[non_exhaustive]
3828 pub enum State {
3829 Unspecified,
3831 Provisioned,
3833 Creating,
3835 Updating,
3837 Deleting,
3839 UnknownValue(state::UnknownValue),
3844 }
3845
3846 #[doc(hidden)]
3847 pub mod 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 State {
3855 pub fn value(&self) -> std::option::Option<i32> {
3860 match self {
3861 Self::Unspecified => std::option::Option::Some(0),
3862 Self::Provisioned => std::option::Option::Some(1),
3863 Self::Creating => std::option::Option::Some(2),
3864 Self::Updating => std::option::Option::Some(3),
3865 Self::Deleting => std::option::Option::Some(4),
3866 Self::UnknownValue(u) => u.0.value(),
3867 }
3868 }
3869
3870 pub fn name(&self) -> std::option::Option<&str> {
3875 match self {
3876 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3877 Self::Provisioned => std::option::Option::Some("PROVISIONED"),
3878 Self::Creating => std::option::Option::Some("CREATING"),
3879 Self::Updating => std::option::Option::Some("UPDATING"),
3880 Self::Deleting => std::option::Option::Some("DELETING"),
3881 Self::UnknownValue(u) => u.0.name(),
3882 }
3883 }
3884 }
3885
3886 impl std::default::Default for State {
3887 fn default() -> Self {
3888 use std::convert::From;
3889 Self::from(0)
3890 }
3891 }
3892
3893 impl std::fmt::Display for State {
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 State {
3900 fn from(value: i32) -> Self {
3901 match value {
3902 0 => Self::Unspecified,
3903 1 => Self::Provisioned,
3904 2 => Self::Creating,
3905 3 => Self::Updating,
3906 4 => Self::Deleting,
3907 _ => Self::UnknownValue(state::UnknownValue(
3908 wkt::internal::UnknownEnumValue::Integer(value),
3909 )),
3910 }
3911 }
3912 }
3913
3914 impl std::convert::From<&str> for State {
3915 fn from(value: &str) -> Self {
3916 use std::string::ToString;
3917 match value {
3918 "STATE_UNSPECIFIED" => Self::Unspecified,
3919 "PROVISIONED" => Self::Provisioned,
3920 "CREATING" => Self::Creating,
3921 "UPDATING" => Self::Updating,
3922 "DELETING" => Self::Deleting,
3923 _ => Self::UnknownValue(state::UnknownValue(
3924 wkt::internal::UnknownEnumValue::String(value.to_string()),
3925 )),
3926 }
3927 }
3928 }
3929
3930 impl serde::ser::Serialize for State {
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::Provisioned => serializer.serialize_i32(1),
3938 Self::Creating => serializer.serialize_i32(2),
3939 Self::Updating => serializer.serialize_i32(3),
3940 Self::Deleting => serializer.serialize_i32(4),
3941 Self::UnknownValue(u) => u.0.serialize(serializer),
3942 }
3943 }
3944 }
3945
3946 impl<'de> serde::de::Deserialize<'de> for State {
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::<State>::new(
3952 ".google.cloud.baremetalsolution.v2.NfsShare.State",
3953 ))
3954 }
3955 }
3956
3957 #[derive(Clone, Debug, PartialEq)]
3973 #[non_exhaustive]
3974 pub enum MountPermissions {
3975 Unspecified,
3977 Read,
3979 ReadWrite,
3981 UnknownValue(mount_permissions::UnknownValue),
3986 }
3987
3988 #[doc(hidden)]
3989 pub mod mount_permissions {
3990 #[allow(unused_imports)]
3991 use super::*;
3992 #[derive(Clone, Debug, PartialEq)]
3993 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3994 }
3995
3996 impl MountPermissions {
3997 pub fn value(&self) -> std::option::Option<i32> {
4002 match self {
4003 Self::Unspecified => std::option::Option::Some(0),
4004 Self::Read => std::option::Option::Some(1),
4005 Self::ReadWrite => std::option::Option::Some(2),
4006 Self::UnknownValue(u) => u.0.value(),
4007 }
4008 }
4009
4010 pub fn name(&self) -> std::option::Option<&str> {
4015 match self {
4016 Self::Unspecified => std::option::Option::Some("MOUNT_PERMISSIONS_UNSPECIFIED"),
4017 Self::Read => std::option::Option::Some("READ"),
4018 Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
4019 Self::UnknownValue(u) => u.0.name(),
4020 }
4021 }
4022 }
4023
4024 impl std::default::Default for MountPermissions {
4025 fn default() -> Self {
4026 use std::convert::From;
4027 Self::from(0)
4028 }
4029 }
4030
4031 impl std::fmt::Display for MountPermissions {
4032 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4033 wkt::internal::display_enum(f, self.name(), self.value())
4034 }
4035 }
4036
4037 impl std::convert::From<i32> for MountPermissions {
4038 fn from(value: i32) -> Self {
4039 match value {
4040 0 => Self::Unspecified,
4041 1 => Self::Read,
4042 2 => Self::ReadWrite,
4043 _ => Self::UnknownValue(mount_permissions::UnknownValue(
4044 wkt::internal::UnknownEnumValue::Integer(value),
4045 )),
4046 }
4047 }
4048 }
4049
4050 impl std::convert::From<&str> for MountPermissions {
4051 fn from(value: &str) -> Self {
4052 use std::string::ToString;
4053 match value {
4054 "MOUNT_PERMISSIONS_UNSPECIFIED" => Self::Unspecified,
4055 "READ" => Self::Read,
4056 "READ_WRITE" => Self::ReadWrite,
4057 _ => Self::UnknownValue(mount_permissions::UnknownValue(
4058 wkt::internal::UnknownEnumValue::String(value.to_string()),
4059 )),
4060 }
4061 }
4062 }
4063
4064 impl serde::ser::Serialize for MountPermissions {
4065 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4066 where
4067 S: serde::Serializer,
4068 {
4069 match self {
4070 Self::Unspecified => serializer.serialize_i32(0),
4071 Self::Read => serializer.serialize_i32(1),
4072 Self::ReadWrite => serializer.serialize_i32(2),
4073 Self::UnknownValue(u) => u.0.serialize(serializer),
4074 }
4075 }
4076 }
4077
4078 impl<'de> serde::de::Deserialize<'de> for MountPermissions {
4079 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4080 where
4081 D: serde::Deserializer<'de>,
4082 {
4083 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MountPermissions>::new(
4084 ".google.cloud.baremetalsolution.v2.NfsShare.MountPermissions",
4085 ))
4086 }
4087 }
4088
4089 #[derive(Clone, Debug, PartialEq)]
4105 #[non_exhaustive]
4106 pub enum StorageType {
4107 Unspecified,
4109 Ssd,
4111 Hdd,
4113 UnknownValue(storage_type::UnknownValue),
4118 }
4119
4120 #[doc(hidden)]
4121 pub mod storage_type {
4122 #[allow(unused_imports)]
4123 use super::*;
4124 #[derive(Clone, Debug, PartialEq)]
4125 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4126 }
4127
4128 impl StorageType {
4129 pub fn value(&self) -> std::option::Option<i32> {
4134 match self {
4135 Self::Unspecified => std::option::Option::Some(0),
4136 Self::Ssd => std::option::Option::Some(1),
4137 Self::Hdd => std::option::Option::Some(2),
4138 Self::UnknownValue(u) => u.0.value(),
4139 }
4140 }
4141
4142 pub fn name(&self) -> std::option::Option<&str> {
4147 match self {
4148 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
4149 Self::Ssd => std::option::Option::Some("SSD"),
4150 Self::Hdd => std::option::Option::Some("HDD"),
4151 Self::UnknownValue(u) => u.0.name(),
4152 }
4153 }
4154 }
4155
4156 impl std::default::Default for StorageType {
4157 fn default() -> Self {
4158 use std::convert::From;
4159 Self::from(0)
4160 }
4161 }
4162
4163 impl std::fmt::Display for StorageType {
4164 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4165 wkt::internal::display_enum(f, self.name(), self.value())
4166 }
4167 }
4168
4169 impl std::convert::From<i32> for StorageType {
4170 fn from(value: i32) -> Self {
4171 match value {
4172 0 => Self::Unspecified,
4173 1 => Self::Ssd,
4174 2 => Self::Hdd,
4175 _ => Self::UnknownValue(storage_type::UnknownValue(
4176 wkt::internal::UnknownEnumValue::Integer(value),
4177 )),
4178 }
4179 }
4180 }
4181
4182 impl std::convert::From<&str> for StorageType {
4183 fn from(value: &str) -> Self {
4184 use std::string::ToString;
4185 match value {
4186 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
4187 "SSD" => Self::Ssd,
4188 "HDD" => Self::Hdd,
4189 _ => Self::UnknownValue(storage_type::UnknownValue(
4190 wkt::internal::UnknownEnumValue::String(value.to_string()),
4191 )),
4192 }
4193 }
4194 }
4195
4196 impl serde::ser::Serialize for StorageType {
4197 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4198 where
4199 S: serde::Serializer,
4200 {
4201 match self {
4202 Self::Unspecified => serializer.serialize_i32(0),
4203 Self::Ssd => serializer.serialize_i32(1),
4204 Self::Hdd => serializer.serialize_i32(2),
4205 Self::UnknownValue(u) => u.0.serialize(serializer),
4206 }
4207 }
4208 }
4209
4210 impl<'de> serde::de::Deserialize<'de> for StorageType {
4211 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4212 where
4213 D: serde::Deserializer<'de>,
4214 {
4215 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
4216 ".google.cloud.baremetalsolution.v2.NfsShare.StorageType",
4217 ))
4218 }
4219 }
4220}
4221
4222#[derive(Clone, Default, PartialEq)]
4224#[non_exhaustive]
4225pub struct GetNfsShareRequest {
4226 pub name: std::string::String,
4228
4229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4230}
4231
4232impl GetNfsShareRequest {
4233 pub fn new() -> Self {
4234 std::default::Default::default()
4235 }
4236
4237 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4239 self.name = v.into();
4240 self
4241 }
4242}
4243
4244impl wkt::message::Message for GetNfsShareRequest {
4245 fn typename() -> &'static str {
4246 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetNfsShareRequest"
4247 }
4248}
4249
4250#[derive(Clone, Default, PartialEq)]
4252#[non_exhaustive]
4253pub struct ListNfsSharesRequest {
4254 pub parent: std::string::String,
4256
4257 pub page_size: i32,
4260
4261 pub page_token: std::string::String,
4263
4264 pub filter: std::string::String,
4266
4267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4268}
4269
4270impl ListNfsSharesRequest {
4271 pub fn new() -> Self {
4272 std::default::Default::default()
4273 }
4274
4275 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.parent = v.into();
4278 self
4279 }
4280
4281 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4283 self.page_size = v.into();
4284 self
4285 }
4286
4287 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4289 self.page_token = v.into();
4290 self
4291 }
4292
4293 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4295 self.filter = v.into();
4296 self
4297 }
4298}
4299
4300impl wkt::message::Message for ListNfsSharesRequest {
4301 fn typename() -> &'static str {
4302 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListNfsSharesRequest"
4303 }
4304}
4305
4306#[derive(Clone, Default, PartialEq)]
4308#[non_exhaustive]
4309pub struct ListNfsSharesResponse {
4310 pub nfs_shares: std::vec::Vec<crate::model::NfsShare>,
4312
4313 pub next_page_token: std::string::String,
4315
4316 pub unreachable: std::vec::Vec<std::string::String>,
4318
4319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4320}
4321
4322impl ListNfsSharesResponse {
4323 pub fn new() -> Self {
4324 std::default::Default::default()
4325 }
4326
4327 pub fn set_nfs_shares<T, V>(mut self, v: T) -> Self
4329 where
4330 T: std::iter::IntoIterator<Item = V>,
4331 V: std::convert::Into<crate::model::NfsShare>,
4332 {
4333 use std::iter::Iterator;
4334 self.nfs_shares = v.into_iter().map(|i| i.into()).collect();
4335 self
4336 }
4337
4338 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.next_page_token = v.into();
4341 self
4342 }
4343
4344 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4346 where
4347 T: std::iter::IntoIterator<Item = V>,
4348 V: std::convert::Into<std::string::String>,
4349 {
4350 use std::iter::Iterator;
4351 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4352 self
4353 }
4354}
4355
4356impl wkt::message::Message for ListNfsSharesResponse {
4357 fn typename() -> &'static str {
4358 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListNfsSharesResponse"
4359 }
4360}
4361
4362#[doc(hidden)]
4363impl gax::paginator::internal::PageableResponse for ListNfsSharesResponse {
4364 type PageItem = crate::model::NfsShare;
4365
4366 fn items(self) -> std::vec::Vec<Self::PageItem> {
4367 self.nfs_shares
4368 }
4369
4370 fn next_page_token(&self) -> std::string::String {
4371 use std::clone::Clone;
4372 self.next_page_token.clone()
4373 }
4374}
4375
4376#[derive(Clone, Default, PartialEq)]
4378#[non_exhaustive]
4379pub struct UpdateNfsShareRequest {
4380 pub nfs_share: std::option::Option<crate::model::NfsShare>,
4385
4386 pub update_mask: std::option::Option<wkt::FieldMask>,
4391
4392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4393}
4394
4395impl UpdateNfsShareRequest {
4396 pub fn new() -> Self {
4397 std::default::Default::default()
4398 }
4399
4400 pub fn set_nfs_share<T>(mut self, v: T) -> Self
4402 where
4403 T: std::convert::Into<crate::model::NfsShare>,
4404 {
4405 self.nfs_share = std::option::Option::Some(v.into());
4406 self
4407 }
4408
4409 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
4411 where
4412 T: std::convert::Into<crate::model::NfsShare>,
4413 {
4414 self.nfs_share = v.map(|x| x.into());
4415 self
4416 }
4417
4418 pub fn set_update_mask<T>(mut self, v: T) -> Self
4420 where
4421 T: std::convert::Into<wkt::FieldMask>,
4422 {
4423 self.update_mask = std::option::Option::Some(v.into());
4424 self
4425 }
4426
4427 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4429 where
4430 T: std::convert::Into<wkt::FieldMask>,
4431 {
4432 self.update_mask = v.map(|x| x.into());
4433 self
4434 }
4435}
4436
4437impl wkt::message::Message for UpdateNfsShareRequest {
4438 fn typename() -> &'static str {
4439 "type.googleapis.com/google.cloud.baremetalsolution.v2.UpdateNfsShareRequest"
4440 }
4441}
4442
4443#[derive(Clone, Default, PartialEq)]
4445#[non_exhaustive]
4446pub struct RenameNfsShareRequest {
4447 pub name: std::string::String,
4450
4451 pub new_nfsshare_id: std::string::String,
4453
4454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4455}
4456
4457impl RenameNfsShareRequest {
4458 pub fn new() -> Self {
4459 std::default::Default::default()
4460 }
4461
4462 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4464 self.name = v.into();
4465 self
4466 }
4467
4468 pub fn set_new_nfsshare_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4470 self.new_nfsshare_id = v.into();
4471 self
4472 }
4473}
4474
4475impl wkt::message::Message for RenameNfsShareRequest {
4476 fn typename() -> &'static str {
4477 "type.googleapis.com/google.cloud.baremetalsolution.v2.RenameNfsShareRequest"
4478 }
4479}
4480
4481#[derive(Clone, Default, PartialEq)]
4483#[non_exhaustive]
4484pub struct CreateNfsShareRequest {
4485 pub parent: std::string::String,
4487
4488 pub nfs_share: std::option::Option<crate::model::NfsShare>,
4490
4491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4492}
4493
4494impl CreateNfsShareRequest {
4495 pub fn new() -> Self {
4496 std::default::Default::default()
4497 }
4498
4499 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4501 self.parent = v.into();
4502 self
4503 }
4504
4505 pub fn set_nfs_share<T>(mut self, v: T) -> Self
4507 where
4508 T: std::convert::Into<crate::model::NfsShare>,
4509 {
4510 self.nfs_share = std::option::Option::Some(v.into());
4511 self
4512 }
4513
4514 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
4516 where
4517 T: std::convert::Into<crate::model::NfsShare>,
4518 {
4519 self.nfs_share = v.map(|x| x.into());
4520 self
4521 }
4522}
4523
4524impl wkt::message::Message for CreateNfsShareRequest {
4525 fn typename() -> &'static str {
4526 "type.googleapis.com/google.cloud.baremetalsolution.v2.CreateNfsShareRequest"
4527 }
4528}
4529
4530#[derive(Clone, Default, PartialEq)]
4532#[non_exhaustive]
4533pub struct DeleteNfsShareRequest {
4534 pub name: std::string::String,
4536
4537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4538}
4539
4540impl DeleteNfsShareRequest {
4541 pub fn new() -> Self {
4542 std::default::Default::default()
4543 }
4544
4545 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4547 self.name = v.into();
4548 self
4549 }
4550}
4551
4552impl wkt::message::Message for DeleteNfsShareRequest {
4553 fn typename() -> &'static str {
4554 "type.googleapis.com/google.cloud.baremetalsolution.v2.DeleteNfsShareRequest"
4555 }
4556}
4557
4558#[derive(Clone, Default, PartialEq)]
4560#[non_exhaustive]
4561pub struct OSImage {
4562 pub name: std::string::String,
4564
4565 pub code: std::string::String,
4567
4568 pub description: std::string::String,
4570
4571 pub applicable_instance_types: std::vec::Vec<std::string::String>,
4575
4576 pub supported_network_templates: std::vec::Vec<std::string::String>,
4578
4579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4580}
4581
4582impl OSImage {
4583 pub fn new() -> Self {
4584 std::default::Default::default()
4585 }
4586
4587 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4589 self.name = v.into();
4590 self
4591 }
4592
4593 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4595 self.code = v.into();
4596 self
4597 }
4598
4599 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4601 self.description = v.into();
4602 self
4603 }
4604
4605 pub fn set_applicable_instance_types<T, V>(mut self, v: T) -> Self
4607 where
4608 T: std::iter::IntoIterator<Item = V>,
4609 V: std::convert::Into<std::string::String>,
4610 {
4611 use std::iter::Iterator;
4612 self.applicable_instance_types = v.into_iter().map(|i| i.into()).collect();
4613 self
4614 }
4615
4616 pub fn set_supported_network_templates<T, V>(mut self, v: T) -> Self
4618 where
4619 T: std::iter::IntoIterator<Item = V>,
4620 V: std::convert::Into<std::string::String>,
4621 {
4622 use std::iter::Iterator;
4623 self.supported_network_templates = v.into_iter().map(|i| i.into()).collect();
4624 self
4625 }
4626}
4627
4628impl wkt::message::Message for OSImage {
4629 fn typename() -> &'static str {
4630 "type.googleapis.com/google.cloud.baremetalsolution.v2.OSImage"
4631 }
4632}
4633
4634#[derive(Clone, Default, PartialEq)]
4636#[non_exhaustive]
4637pub struct ListOSImagesRequest {
4638 pub parent: std::string::String,
4640
4641 pub page_size: i32,
4646
4647 pub page_token: std::string::String,
4649
4650 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4651}
4652
4653impl ListOSImagesRequest {
4654 pub fn new() -> Self {
4655 std::default::Default::default()
4656 }
4657
4658 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4660 self.parent = v.into();
4661 self
4662 }
4663
4664 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4666 self.page_size = v.into();
4667 self
4668 }
4669
4670 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4672 self.page_token = v.into();
4673 self
4674 }
4675}
4676
4677impl wkt::message::Message for ListOSImagesRequest {
4678 fn typename() -> &'static str {
4679 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListOSImagesRequest"
4680 }
4681}
4682
4683#[derive(Clone, Default, PartialEq)]
4685#[non_exhaustive]
4686pub struct ListOSImagesResponse {
4687 pub os_images: std::vec::Vec<crate::model::OSImage>,
4689
4690 pub next_page_token: std::string::String,
4693
4694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4695}
4696
4697impl ListOSImagesResponse {
4698 pub fn new() -> Self {
4699 std::default::Default::default()
4700 }
4701
4702 pub fn set_os_images<T, V>(mut self, v: T) -> Self
4704 where
4705 T: std::iter::IntoIterator<Item = V>,
4706 V: std::convert::Into<crate::model::OSImage>,
4707 {
4708 use std::iter::Iterator;
4709 self.os_images = v.into_iter().map(|i| i.into()).collect();
4710 self
4711 }
4712
4713 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4715 self.next_page_token = v.into();
4716 self
4717 }
4718}
4719
4720impl wkt::message::Message for ListOSImagesResponse {
4721 fn typename() -> &'static str {
4722 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListOSImagesResponse"
4723 }
4724}
4725
4726#[doc(hidden)]
4727impl gax::paginator::internal::PageableResponse for ListOSImagesResponse {
4728 type PageItem = crate::model::OSImage;
4729
4730 fn items(self) -> std::vec::Vec<Self::PageItem> {
4731 self.os_images
4732 }
4733
4734 fn next_page_token(&self) -> std::string::String {
4735 use std::clone::Clone;
4736 self.next_page_token.clone()
4737 }
4738}
4739
4740#[derive(Clone, Default, PartialEq)]
4742#[non_exhaustive]
4743pub struct ProvisioningConfig {
4744 pub name: std::string::String,
4747
4748 pub instances: std::vec::Vec<crate::model::InstanceConfig>,
4750
4751 pub networks: std::vec::Vec<crate::model::NetworkConfig>,
4753
4754 pub volumes: std::vec::Vec<crate::model::VolumeConfig>,
4756
4757 pub ticket_id: std::string::String,
4759
4760 pub handover_service_account: std::string::String,
4763
4764 #[deprecated]
4767 pub email: std::string::String,
4768
4769 pub state: crate::model::provisioning_config::State,
4771
4772 pub location: std::string::String,
4775
4776 pub update_time: std::option::Option<wkt::Timestamp>,
4778
4779 pub cloud_console_uri: std::string::String,
4781
4782 pub vpc_sc_enabled: bool,
4784
4785 pub status_message: std::string::String,
4787
4788 pub custom_id: std::string::String,
4790
4791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4792}
4793
4794impl ProvisioningConfig {
4795 pub fn new() -> Self {
4796 std::default::Default::default()
4797 }
4798
4799 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.name = v.into();
4802 self
4803 }
4804
4805 pub fn set_instances<T, V>(mut self, v: T) -> Self
4807 where
4808 T: std::iter::IntoIterator<Item = V>,
4809 V: std::convert::Into<crate::model::InstanceConfig>,
4810 {
4811 use std::iter::Iterator;
4812 self.instances = v.into_iter().map(|i| i.into()).collect();
4813 self
4814 }
4815
4816 pub fn set_networks<T, V>(mut self, v: T) -> Self
4818 where
4819 T: std::iter::IntoIterator<Item = V>,
4820 V: std::convert::Into<crate::model::NetworkConfig>,
4821 {
4822 use std::iter::Iterator;
4823 self.networks = v.into_iter().map(|i| i.into()).collect();
4824 self
4825 }
4826
4827 pub fn set_volumes<T, V>(mut self, v: T) -> Self
4829 where
4830 T: std::iter::IntoIterator<Item = V>,
4831 V: std::convert::Into<crate::model::VolumeConfig>,
4832 {
4833 use std::iter::Iterator;
4834 self.volumes = v.into_iter().map(|i| i.into()).collect();
4835 self
4836 }
4837
4838 pub fn set_ticket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4840 self.ticket_id = v.into();
4841 self
4842 }
4843
4844 pub fn set_handover_service_account<T: std::convert::Into<std::string::String>>(
4846 mut self,
4847 v: T,
4848 ) -> Self {
4849 self.handover_service_account = v.into();
4850 self
4851 }
4852
4853 #[deprecated]
4855 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4856 self.email = v.into();
4857 self
4858 }
4859
4860 pub fn set_state<T: std::convert::Into<crate::model::provisioning_config::State>>(
4862 mut self,
4863 v: T,
4864 ) -> Self {
4865 self.state = v.into();
4866 self
4867 }
4868
4869 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4871 self.location = v.into();
4872 self
4873 }
4874
4875 pub fn set_update_time<T>(mut self, v: T) -> Self
4877 where
4878 T: std::convert::Into<wkt::Timestamp>,
4879 {
4880 self.update_time = std::option::Option::Some(v.into());
4881 self
4882 }
4883
4884 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4886 where
4887 T: std::convert::Into<wkt::Timestamp>,
4888 {
4889 self.update_time = v.map(|x| x.into());
4890 self
4891 }
4892
4893 pub fn set_cloud_console_uri<T: std::convert::Into<std::string::String>>(
4895 mut self,
4896 v: T,
4897 ) -> Self {
4898 self.cloud_console_uri = v.into();
4899 self
4900 }
4901
4902 pub fn set_vpc_sc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4904 self.vpc_sc_enabled = v.into();
4905 self
4906 }
4907
4908 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4910 self.status_message = v.into();
4911 self
4912 }
4913
4914 pub fn set_custom_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4916 self.custom_id = v.into();
4917 self
4918 }
4919}
4920
4921impl wkt::message::Message for ProvisioningConfig {
4922 fn typename() -> &'static str {
4923 "type.googleapis.com/google.cloud.baremetalsolution.v2.ProvisioningConfig"
4924 }
4925}
4926
4927pub mod provisioning_config {
4929 #[allow(unused_imports)]
4930 use super::*;
4931
4932 #[derive(Clone, Debug, PartialEq)]
4948 #[non_exhaustive]
4949 pub enum State {
4950 Unspecified,
4952 Draft,
4954 Submitted,
4956 Provisioning,
4960 Provisioned,
4962 Validated,
4965 Cancelled,
4967 Failed,
4969 UnknownValue(state::UnknownValue),
4974 }
4975
4976 #[doc(hidden)]
4977 pub mod state {
4978 #[allow(unused_imports)]
4979 use super::*;
4980 #[derive(Clone, Debug, PartialEq)]
4981 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4982 }
4983
4984 impl State {
4985 pub fn value(&self) -> std::option::Option<i32> {
4990 match self {
4991 Self::Unspecified => std::option::Option::Some(0),
4992 Self::Draft => std::option::Option::Some(1),
4993 Self::Submitted => std::option::Option::Some(2),
4994 Self::Provisioning => std::option::Option::Some(3),
4995 Self::Provisioned => std::option::Option::Some(4),
4996 Self::Validated => std::option::Option::Some(5),
4997 Self::Cancelled => std::option::Option::Some(6),
4998 Self::Failed => std::option::Option::Some(7),
4999 Self::UnknownValue(u) => u.0.value(),
5000 }
5001 }
5002
5003 pub fn name(&self) -> std::option::Option<&str> {
5008 match self {
5009 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5010 Self::Draft => std::option::Option::Some("DRAFT"),
5011 Self::Submitted => std::option::Option::Some("SUBMITTED"),
5012 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
5013 Self::Provisioned => std::option::Option::Some("PROVISIONED"),
5014 Self::Validated => std::option::Option::Some("VALIDATED"),
5015 Self::Cancelled => std::option::Option::Some("CANCELLED"),
5016 Self::Failed => std::option::Option::Some("FAILED"),
5017 Self::UnknownValue(u) => u.0.name(),
5018 }
5019 }
5020 }
5021
5022 impl std::default::Default for State {
5023 fn default() -> Self {
5024 use std::convert::From;
5025 Self::from(0)
5026 }
5027 }
5028
5029 impl std::fmt::Display for State {
5030 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5031 wkt::internal::display_enum(f, self.name(), self.value())
5032 }
5033 }
5034
5035 impl std::convert::From<i32> for State {
5036 fn from(value: i32) -> Self {
5037 match value {
5038 0 => Self::Unspecified,
5039 1 => Self::Draft,
5040 2 => Self::Submitted,
5041 3 => Self::Provisioning,
5042 4 => Self::Provisioned,
5043 5 => Self::Validated,
5044 6 => Self::Cancelled,
5045 7 => Self::Failed,
5046 _ => Self::UnknownValue(state::UnknownValue(
5047 wkt::internal::UnknownEnumValue::Integer(value),
5048 )),
5049 }
5050 }
5051 }
5052
5053 impl std::convert::From<&str> for State {
5054 fn from(value: &str) -> Self {
5055 use std::string::ToString;
5056 match value {
5057 "STATE_UNSPECIFIED" => Self::Unspecified,
5058 "DRAFT" => Self::Draft,
5059 "SUBMITTED" => Self::Submitted,
5060 "PROVISIONING" => Self::Provisioning,
5061 "PROVISIONED" => Self::Provisioned,
5062 "VALIDATED" => Self::Validated,
5063 "CANCELLED" => Self::Cancelled,
5064 "FAILED" => Self::Failed,
5065 _ => Self::UnknownValue(state::UnknownValue(
5066 wkt::internal::UnknownEnumValue::String(value.to_string()),
5067 )),
5068 }
5069 }
5070 }
5071
5072 impl serde::ser::Serialize for State {
5073 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5074 where
5075 S: serde::Serializer,
5076 {
5077 match self {
5078 Self::Unspecified => serializer.serialize_i32(0),
5079 Self::Draft => serializer.serialize_i32(1),
5080 Self::Submitted => serializer.serialize_i32(2),
5081 Self::Provisioning => serializer.serialize_i32(3),
5082 Self::Provisioned => serializer.serialize_i32(4),
5083 Self::Validated => serializer.serialize_i32(5),
5084 Self::Cancelled => serializer.serialize_i32(6),
5085 Self::Failed => serializer.serialize_i32(7),
5086 Self::UnknownValue(u) => u.0.serialize(serializer),
5087 }
5088 }
5089 }
5090
5091 impl<'de> serde::de::Deserialize<'de> for State {
5092 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5093 where
5094 D: serde::Deserializer<'de>,
5095 {
5096 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5097 ".google.cloud.baremetalsolution.v2.ProvisioningConfig.State",
5098 ))
5099 }
5100 }
5101}
5102
5103#[derive(Clone, Default, PartialEq)]
5105#[non_exhaustive]
5106pub struct SubmitProvisioningConfigRequest {
5107 pub parent: std::string::String,
5110
5111 pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
5113
5114 pub email: std::string::String,
5117
5118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5119}
5120
5121impl SubmitProvisioningConfigRequest {
5122 pub fn new() -> Self {
5123 std::default::Default::default()
5124 }
5125
5126 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5128 self.parent = v.into();
5129 self
5130 }
5131
5132 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
5134 where
5135 T: std::convert::Into<crate::model::ProvisioningConfig>,
5136 {
5137 self.provisioning_config = std::option::Option::Some(v.into());
5138 self
5139 }
5140
5141 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
5143 where
5144 T: std::convert::Into<crate::model::ProvisioningConfig>,
5145 {
5146 self.provisioning_config = v.map(|x| x.into());
5147 self
5148 }
5149
5150 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5152 self.email = v.into();
5153 self
5154 }
5155}
5156
5157impl wkt::message::Message for SubmitProvisioningConfigRequest {
5158 fn typename() -> &'static str {
5159 "type.googleapis.com/google.cloud.baremetalsolution.v2.SubmitProvisioningConfigRequest"
5160 }
5161}
5162
5163#[derive(Clone, Default, PartialEq)]
5165#[non_exhaustive]
5166pub struct SubmitProvisioningConfigResponse {
5167 pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
5169
5170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5171}
5172
5173impl SubmitProvisioningConfigResponse {
5174 pub fn new() -> Self {
5175 std::default::Default::default()
5176 }
5177
5178 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
5180 where
5181 T: std::convert::Into<crate::model::ProvisioningConfig>,
5182 {
5183 self.provisioning_config = std::option::Option::Some(v.into());
5184 self
5185 }
5186
5187 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
5189 where
5190 T: std::convert::Into<crate::model::ProvisioningConfig>,
5191 {
5192 self.provisioning_config = v.map(|x| x.into());
5193 self
5194 }
5195}
5196
5197impl wkt::message::Message for SubmitProvisioningConfigResponse {
5198 fn typename() -> &'static str {
5199 "type.googleapis.com/google.cloud.baremetalsolution.v2.SubmitProvisioningConfigResponse"
5200 }
5201}
5202
5203#[derive(Clone, Default, PartialEq)]
5205#[non_exhaustive]
5206pub struct ProvisioningQuota {
5207 pub name: std::string::String,
5209
5210 pub asset_type: crate::model::provisioning_quota::AssetType,
5212
5213 pub gcp_service: std::string::String,
5215
5216 pub location: std::string::String,
5218
5219 pub available_count: i32,
5221
5222 pub quota: std::option::Option<crate::model::provisioning_quota::Quota>,
5224
5225 pub availability: std::option::Option<crate::model::provisioning_quota::Availability>,
5227
5228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5229}
5230
5231impl ProvisioningQuota {
5232 pub fn new() -> Self {
5233 std::default::Default::default()
5234 }
5235
5236 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5238 self.name = v.into();
5239 self
5240 }
5241
5242 pub fn set_asset_type<T: std::convert::Into<crate::model::provisioning_quota::AssetType>>(
5244 mut self,
5245 v: T,
5246 ) -> Self {
5247 self.asset_type = v.into();
5248 self
5249 }
5250
5251 pub fn set_gcp_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5253 self.gcp_service = v.into();
5254 self
5255 }
5256
5257 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5259 self.location = v.into();
5260 self
5261 }
5262
5263 pub fn set_available_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5265 self.available_count = v.into();
5266 self
5267 }
5268
5269 pub fn set_quota<
5274 T: std::convert::Into<std::option::Option<crate::model::provisioning_quota::Quota>>,
5275 >(
5276 mut self,
5277 v: T,
5278 ) -> Self {
5279 self.quota = v.into();
5280 self
5281 }
5282
5283 pub fn instance_quota(
5287 &self,
5288 ) -> std::option::Option<&std::boxed::Box<crate::model::InstanceQuota>> {
5289 #[allow(unreachable_patterns)]
5290 self.quota.as_ref().and_then(|v| match v {
5291 crate::model::provisioning_quota::Quota::InstanceQuota(v) => {
5292 std::option::Option::Some(v)
5293 }
5294 _ => std::option::Option::None,
5295 })
5296 }
5297
5298 pub fn set_instance_quota<
5304 T: std::convert::Into<std::boxed::Box<crate::model::InstanceQuota>>,
5305 >(
5306 mut self,
5307 v: T,
5308 ) -> Self {
5309 self.quota = std::option::Option::Some(
5310 crate::model::provisioning_quota::Quota::InstanceQuota(v.into()),
5311 );
5312 self
5313 }
5314
5315 pub fn set_availability<
5320 T: std::convert::Into<std::option::Option<crate::model::provisioning_quota::Availability>>,
5321 >(
5322 mut self,
5323 v: T,
5324 ) -> Self {
5325 self.availability = v.into();
5326 self
5327 }
5328
5329 pub fn server_count(&self) -> std::option::Option<&i64> {
5333 #[allow(unreachable_patterns)]
5334 self.availability.as_ref().and_then(|v| match v {
5335 crate::model::provisioning_quota::Availability::ServerCount(v) => {
5336 std::option::Option::Some(v)
5337 }
5338 _ => std::option::Option::None,
5339 })
5340 }
5341
5342 pub fn set_server_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5348 self.availability = std::option::Option::Some(
5349 crate::model::provisioning_quota::Availability::ServerCount(v.into()),
5350 );
5351 self
5352 }
5353
5354 pub fn network_bandwidth(&self) -> std::option::Option<&i64> {
5358 #[allow(unreachable_patterns)]
5359 self.availability.as_ref().and_then(|v| match v {
5360 crate::model::provisioning_quota::Availability::NetworkBandwidth(v) => {
5361 std::option::Option::Some(v)
5362 }
5363 _ => std::option::Option::None,
5364 })
5365 }
5366
5367 pub fn set_network_bandwidth<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5373 self.availability = std::option::Option::Some(
5374 crate::model::provisioning_quota::Availability::NetworkBandwidth(v.into()),
5375 );
5376 self
5377 }
5378
5379 pub fn storage_gib(&self) -> std::option::Option<&i64> {
5383 #[allow(unreachable_patterns)]
5384 self.availability.as_ref().and_then(|v| match v {
5385 crate::model::provisioning_quota::Availability::StorageGib(v) => {
5386 std::option::Option::Some(v)
5387 }
5388 _ => std::option::Option::None,
5389 })
5390 }
5391
5392 pub fn set_storage_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5398 self.availability = std::option::Option::Some(
5399 crate::model::provisioning_quota::Availability::StorageGib(v.into()),
5400 );
5401 self
5402 }
5403}
5404
5405impl wkt::message::Message for ProvisioningQuota {
5406 fn typename() -> &'static str {
5407 "type.googleapis.com/google.cloud.baremetalsolution.v2.ProvisioningQuota"
5408 }
5409}
5410
5411pub mod provisioning_quota {
5413 #[allow(unused_imports)]
5414 use super::*;
5415
5416 #[derive(Clone, Debug, PartialEq)]
5432 #[non_exhaustive]
5433 pub enum AssetType {
5434 Unspecified,
5436 Server,
5438 Storage,
5440 Network,
5442 UnknownValue(asset_type::UnknownValue),
5447 }
5448
5449 #[doc(hidden)]
5450 pub mod asset_type {
5451 #[allow(unused_imports)]
5452 use super::*;
5453 #[derive(Clone, Debug, PartialEq)]
5454 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5455 }
5456
5457 impl AssetType {
5458 pub fn value(&self) -> std::option::Option<i32> {
5463 match self {
5464 Self::Unspecified => std::option::Option::Some(0),
5465 Self::Server => std::option::Option::Some(1),
5466 Self::Storage => std::option::Option::Some(2),
5467 Self::Network => std::option::Option::Some(3),
5468 Self::UnknownValue(u) => u.0.value(),
5469 }
5470 }
5471
5472 pub fn name(&self) -> std::option::Option<&str> {
5477 match self {
5478 Self::Unspecified => std::option::Option::Some("ASSET_TYPE_UNSPECIFIED"),
5479 Self::Server => std::option::Option::Some("ASSET_TYPE_SERVER"),
5480 Self::Storage => std::option::Option::Some("ASSET_TYPE_STORAGE"),
5481 Self::Network => std::option::Option::Some("ASSET_TYPE_NETWORK"),
5482 Self::UnknownValue(u) => u.0.name(),
5483 }
5484 }
5485 }
5486
5487 impl std::default::Default for AssetType {
5488 fn default() -> Self {
5489 use std::convert::From;
5490 Self::from(0)
5491 }
5492 }
5493
5494 impl std::fmt::Display for AssetType {
5495 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5496 wkt::internal::display_enum(f, self.name(), self.value())
5497 }
5498 }
5499
5500 impl std::convert::From<i32> for AssetType {
5501 fn from(value: i32) -> Self {
5502 match value {
5503 0 => Self::Unspecified,
5504 1 => Self::Server,
5505 2 => Self::Storage,
5506 3 => Self::Network,
5507 _ => Self::UnknownValue(asset_type::UnknownValue(
5508 wkt::internal::UnknownEnumValue::Integer(value),
5509 )),
5510 }
5511 }
5512 }
5513
5514 impl std::convert::From<&str> for AssetType {
5515 fn from(value: &str) -> Self {
5516 use std::string::ToString;
5517 match value {
5518 "ASSET_TYPE_UNSPECIFIED" => Self::Unspecified,
5519 "ASSET_TYPE_SERVER" => Self::Server,
5520 "ASSET_TYPE_STORAGE" => Self::Storage,
5521 "ASSET_TYPE_NETWORK" => Self::Network,
5522 _ => Self::UnknownValue(asset_type::UnknownValue(
5523 wkt::internal::UnknownEnumValue::String(value.to_string()),
5524 )),
5525 }
5526 }
5527 }
5528
5529 impl serde::ser::Serialize for AssetType {
5530 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5531 where
5532 S: serde::Serializer,
5533 {
5534 match self {
5535 Self::Unspecified => serializer.serialize_i32(0),
5536 Self::Server => serializer.serialize_i32(1),
5537 Self::Storage => serializer.serialize_i32(2),
5538 Self::Network => serializer.serialize_i32(3),
5539 Self::UnknownValue(u) => u.0.serialize(serializer),
5540 }
5541 }
5542 }
5543
5544 impl<'de> serde::de::Deserialize<'de> for AssetType {
5545 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5546 where
5547 D: serde::Deserializer<'de>,
5548 {
5549 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AssetType>::new(
5550 ".google.cloud.baremetalsolution.v2.ProvisioningQuota.AssetType",
5551 ))
5552 }
5553 }
5554
5555 #[derive(Clone, Debug, PartialEq)]
5557 #[non_exhaustive]
5558 pub enum Quota {
5559 InstanceQuota(std::boxed::Box<crate::model::InstanceQuota>),
5561 }
5562
5563 #[derive(Clone, Debug, PartialEq)]
5565 #[non_exhaustive]
5566 pub enum Availability {
5567 ServerCount(i64),
5569 NetworkBandwidth(i64),
5571 StorageGib(i64),
5573 }
5574}
5575
5576#[derive(Clone, Default, PartialEq)]
5578#[non_exhaustive]
5579pub struct ListProvisioningQuotasRequest {
5580 pub parent: std::string::String,
5582
5583 pub page_size: i32,
5588
5589 pub page_token: std::string::String,
5591
5592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5593}
5594
5595impl ListProvisioningQuotasRequest {
5596 pub fn new() -> Self {
5597 std::default::Default::default()
5598 }
5599
5600 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5602 self.parent = v.into();
5603 self
5604 }
5605
5606 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5608 self.page_size = v.into();
5609 self
5610 }
5611
5612 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5614 self.page_token = v.into();
5615 self
5616 }
5617}
5618
5619impl wkt::message::Message for ListProvisioningQuotasRequest {
5620 fn typename() -> &'static str {
5621 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListProvisioningQuotasRequest"
5622 }
5623}
5624
5625#[derive(Clone, Default, PartialEq)]
5627#[non_exhaustive]
5628pub struct ListProvisioningQuotasResponse {
5629 pub provisioning_quotas: std::vec::Vec<crate::model::ProvisioningQuota>,
5631
5632 pub next_page_token: std::string::String,
5635
5636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5637}
5638
5639impl ListProvisioningQuotasResponse {
5640 pub fn new() -> Self {
5641 std::default::Default::default()
5642 }
5643
5644 pub fn set_provisioning_quotas<T, V>(mut self, v: T) -> Self
5646 where
5647 T: std::iter::IntoIterator<Item = V>,
5648 V: std::convert::Into<crate::model::ProvisioningQuota>,
5649 {
5650 use std::iter::Iterator;
5651 self.provisioning_quotas = v.into_iter().map(|i| i.into()).collect();
5652 self
5653 }
5654
5655 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5657 self.next_page_token = v.into();
5658 self
5659 }
5660}
5661
5662impl wkt::message::Message for ListProvisioningQuotasResponse {
5663 fn typename() -> &'static str {
5664 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListProvisioningQuotasResponse"
5665 }
5666}
5667
5668#[doc(hidden)]
5669impl gax::paginator::internal::PageableResponse for ListProvisioningQuotasResponse {
5670 type PageItem = crate::model::ProvisioningQuota;
5671
5672 fn items(self) -> std::vec::Vec<Self::PageItem> {
5673 self.provisioning_quotas
5674 }
5675
5676 fn next_page_token(&self) -> std::string::String {
5677 use std::clone::Clone;
5678 self.next_page_token.clone()
5679 }
5680}
5681
5682#[derive(Clone, Default, PartialEq)]
5684#[non_exhaustive]
5685pub struct InstanceConfig {
5686 pub name: std::string::String,
5688
5689 pub id: std::string::String,
5692
5693 pub instance_type: std::string::String,
5697
5698 pub hyperthreading: bool,
5700
5701 pub os_image: std::string::String,
5705
5706 #[deprecated]
5708 pub client_network: std::option::Option<crate::model::instance_config::NetworkAddress>,
5709
5710 #[deprecated]
5713 pub private_network: std::option::Option<crate::model::instance_config::NetworkAddress>,
5714
5715 pub user_note: std::string::String,
5718
5719 pub account_networks_enabled: bool,
5721
5722 pub network_config: crate::model::instance_config::NetworkConfig,
5724
5725 pub network_template: std::string::String,
5728
5729 pub logical_interfaces: std::vec::Vec<crate::model::LogicalInterface>,
5733
5734 pub ssh_key_names: std::vec::Vec<std::string::String>,
5736
5737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5738}
5739
5740impl InstanceConfig {
5741 pub fn new() -> Self {
5742 std::default::Default::default()
5743 }
5744
5745 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5747 self.name = v.into();
5748 self
5749 }
5750
5751 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5753 self.id = v.into();
5754 self
5755 }
5756
5757 pub fn set_instance_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.instance_type = v.into();
5760 self
5761 }
5762
5763 pub fn set_hyperthreading<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5765 self.hyperthreading = v.into();
5766 self
5767 }
5768
5769 pub fn set_os_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5771 self.os_image = v.into();
5772 self
5773 }
5774
5775 #[deprecated]
5777 pub fn set_client_network<T>(mut self, v: T) -> Self
5778 where
5779 T: std::convert::Into<crate::model::instance_config::NetworkAddress>,
5780 {
5781 self.client_network = std::option::Option::Some(v.into());
5782 self
5783 }
5784
5785 #[deprecated]
5787 pub fn set_or_clear_client_network<T>(mut self, v: std::option::Option<T>) -> Self
5788 where
5789 T: std::convert::Into<crate::model::instance_config::NetworkAddress>,
5790 {
5791 self.client_network = v.map(|x| x.into());
5792 self
5793 }
5794
5795 #[deprecated]
5797 pub fn set_private_network<T>(mut self, v: T) -> Self
5798 where
5799 T: std::convert::Into<crate::model::instance_config::NetworkAddress>,
5800 {
5801 self.private_network = std::option::Option::Some(v.into());
5802 self
5803 }
5804
5805 #[deprecated]
5807 pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
5808 where
5809 T: std::convert::Into<crate::model::instance_config::NetworkAddress>,
5810 {
5811 self.private_network = v.map(|x| x.into());
5812 self
5813 }
5814
5815 pub fn set_user_note<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5817 self.user_note = v.into();
5818 self
5819 }
5820
5821 pub fn set_account_networks_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5823 self.account_networks_enabled = v.into();
5824 self
5825 }
5826
5827 pub fn set_network_config<
5829 T: std::convert::Into<crate::model::instance_config::NetworkConfig>,
5830 >(
5831 mut self,
5832 v: T,
5833 ) -> Self {
5834 self.network_config = v.into();
5835 self
5836 }
5837
5838 pub fn set_network_template<T: std::convert::Into<std::string::String>>(
5840 mut self,
5841 v: T,
5842 ) -> Self {
5843 self.network_template = v.into();
5844 self
5845 }
5846
5847 pub fn set_logical_interfaces<T, V>(mut self, v: T) -> Self
5849 where
5850 T: std::iter::IntoIterator<Item = V>,
5851 V: std::convert::Into<crate::model::LogicalInterface>,
5852 {
5853 use std::iter::Iterator;
5854 self.logical_interfaces = v.into_iter().map(|i| i.into()).collect();
5855 self
5856 }
5857
5858 pub fn set_ssh_key_names<T, V>(mut self, v: T) -> Self
5860 where
5861 T: std::iter::IntoIterator<Item = V>,
5862 V: std::convert::Into<std::string::String>,
5863 {
5864 use std::iter::Iterator;
5865 self.ssh_key_names = v.into_iter().map(|i| i.into()).collect();
5866 self
5867 }
5868}
5869
5870impl wkt::message::Message for InstanceConfig {
5871 fn typename() -> &'static str {
5872 "type.googleapis.com/google.cloud.baremetalsolution.v2.InstanceConfig"
5873 }
5874}
5875
5876pub mod instance_config {
5878 #[allow(unused_imports)]
5879 use super::*;
5880
5881 #[derive(Clone, Default, PartialEq)]
5883 #[non_exhaustive]
5884 pub struct NetworkAddress {
5885 pub network_id: std::string::String,
5887
5888 pub address: std::string::String,
5890
5891 pub existing_network_id: std::string::String,
5893
5894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5895 }
5896
5897 impl NetworkAddress {
5898 pub fn new() -> Self {
5899 std::default::Default::default()
5900 }
5901
5902 pub fn set_network_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5904 self.network_id = v.into();
5905 self
5906 }
5907
5908 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5910 self.address = v.into();
5911 self
5912 }
5913
5914 pub fn set_existing_network_id<T: std::convert::Into<std::string::String>>(
5916 mut self,
5917 v: T,
5918 ) -> Self {
5919 self.existing_network_id = v.into();
5920 self
5921 }
5922 }
5923
5924 impl wkt::message::Message for NetworkAddress {
5925 fn typename() -> &'static str {
5926 "type.googleapis.com/google.cloud.baremetalsolution.v2.InstanceConfig.NetworkAddress"
5927 }
5928 }
5929
5930 #[derive(Clone, Debug, PartialEq)]
5946 #[non_exhaustive]
5947 pub enum NetworkConfig {
5948 NetworkconfigUnspecified,
5950 SingleVlan,
5952 MultiVlan,
5955 UnknownValue(network_config::UnknownValue),
5960 }
5961
5962 #[doc(hidden)]
5963 pub mod network_config {
5964 #[allow(unused_imports)]
5965 use super::*;
5966 #[derive(Clone, Debug, PartialEq)]
5967 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5968 }
5969
5970 impl NetworkConfig {
5971 pub fn value(&self) -> std::option::Option<i32> {
5976 match self {
5977 Self::NetworkconfigUnspecified => std::option::Option::Some(0),
5978 Self::SingleVlan => std::option::Option::Some(1),
5979 Self::MultiVlan => std::option::Option::Some(2),
5980 Self::UnknownValue(u) => u.0.value(),
5981 }
5982 }
5983
5984 pub fn name(&self) -> std::option::Option<&str> {
5989 match self {
5990 Self::NetworkconfigUnspecified => {
5991 std::option::Option::Some("NETWORKCONFIG_UNSPECIFIED")
5992 }
5993 Self::SingleVlan => std::option::Option::Some("SINGLE_VLAN"),
5994 Self::MultiVlan => std::option::Option::Some("MULTI_VLAN"),
5995 Self::UnknownValue(u) => u.0.name(),
5996 }
5997 }
5998 }
5999
6000 impl std::default::Default for NetworkConfig {
6001 fn default() -> Self {
6002 use std::convert::From;
6003 Self::from(0)
6004 }
6005 }
6006
6007 impl std::fmt::Display for NetworkConfig {
6008 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6009 wkt::internal::display_enum(f, self.name(), self.value())
6010 }
6011 }
6012
6013 impl std::convert::From<i32> for NetworkConfig {
6014 fn from(value: i32) -> Self {
6015 match value {
6016 0 => Self::NetworkconfigUnspecified,
6017 1 => Self::SingleVlan,
6018 2 => Self::MultiVlan,
6019 _ => Self::UnknownValue(network_config::UnknownValue(
6020 wkt::internal::UnknownEnumValue::Integer(value),
6021 )),
6022 }
6023 }
6024 }
6025
6026 impl std::convert::From<&str> for NetworkConfig {
6027 fn from(value: &str) -> Self {
6028 use std::string::ToString;
6029 match value {
6030 "NETWORKCONFIG_UNSPECIFIED" => Self::NetworkconfigUnspecified,
6031 "SINGLE_VLAN" => Self::SingleVlan,
6032 "MULTI_VLAN" => Self::MultiVlan,
6033 _ => Self::UnknownValue(network_config::UnknownValue(
6034 wkt::internal::UnknownEnumValue::String(value.to_string()),
6035 )),
6036 }
6037 }
6038 }
6039
6040 impl serde::ser::Serialize for NetworkConfig {
6041 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6042 where
6043 S: serde::Serializer,
6044 {
6045 match self {
6046 Self::NetworkconfigUnspecified => serializer.serialize_i32(0),
6047 Self::SingleVlan => serializer.serialize_i32(1),
6048 Self::MultiVlan => serializer.serialize_i32(2),
6049 Self::UnknownValue(u) => u.0.serialize(serializer),
6050 }
6051 }
6052 }
6053
6054 impl<'de> serde::de::Deserialize<'de> for NetworkConfig {
6055 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6056 where
6057 D: serde::Deserializer<'de>,
6058 {
6059 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkConfig>::new(
6060 ".google.cloud.baremetalsolution.v2.InstanceConfig.NetworkConfig",
6061 ))
6062 }
6063 }
6064}
6065
6066#[derive(Clone, Default, PartialEq)]
6068#[non_exhaustive]
6069pub struct VolumeConfig {
6070 pub name: std::string::String,
6072
6073 pub id: std::string::String,
6076
6077 pub snapshots_enabled: bool,
6079
6080 pub r#type: crate::model::volume_config::Type,
6082
6083 pub protocol: crate::model::volume_config::Protocol,
6085
6086 pub size_gb: i32,
6088
6089 pub lun_ranges: std::vec::Vec<crate::model::volume_config::LunRange>,
6091
6092 pub machine_ids: std::vec::Vec<std::string::String>,
6095
6096 pub nfs_exports: std::vec::Vec<crate::model::volume_config::NfsExport>,
6098
6099 pub user_note: std::string::String,
6102
6103 pub gcp_service: std::string::String,
6106
6107 pub performance_tier: crate::model::VolumePerformanceTier,
6110
6111 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6112}
6113
6114impl VolumeConfig {
6115 pub fn new() -> Self {
6116 std::default::Default::default()
6117 }
6118
6119 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6121 self.name = v.into();
6122 self
6123 }
6124
6125 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6127 self.id = v.into();
6128 self
6129 }
6130
6131 pub fn set_snapshots_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6133 self.snapshots_enabled = v.into();
6134 self
6135 }
6136
6137 pub fn set_type<T: std::convert::Into<crate::model::volume_config::Type>>(
6139 mut self,
6140 v: T,
6141 ) -> Self {
6142 self.r#type = v.into();
6143 self
6144 }
6145
6146 pub fn set_protocol<T: std::convert::Into<crate::model::volume_config::Protocol>>(
6148 mut self,
6149 v: T,
6150 ) -> Self {
6151 self.protocol = v.into();
6152 self
6153 }
6154
6155 pub fn set_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6157 self.size_gb = v.into();
6158 self
6159 }
6160
6161 pub fn set_lun_ranges<T, V>(mut self, v: T) -> Self
6163 where
6164 T: std::iter::IntoIterator<Item = V>,
6165 V: std::convert::Into<crate::model::volume_config::LunRange>,
6166 {
6167 use std::iter::Iterator;
6168 self.lun_ranges = v.into_iter().map(|i| i.into()).collect();
6169 self
6170 }
6171
6172 pub fn set_machine_ids<T, V>(mut self, v: T) -> Self
6174 where
6175 T: std::iter::IntoIterator<Item = V>,
6176 V: std::convert::Into<std::string::String>,
6177 {
6178 use std::iter::Iterator;
6179 self.machine_ids = v.into_iter().map(|i| i.into()).collect();
6180 self
6181 }
6182
6183 pub fn set_nfs_exports<T, V>(mut self, v: T) -> Self
6185 where
6186 T: std::iter::IntoIterator<Item = V>,
6187 V: std::convert::Into<crate::model::volume_config::NfsExport>,
6188 {
6189 use std::iter::Iterator;
6190 self.nfs_exports = v.into_iter().map(|i| i.into()).collect();
6191 self
6192 }
6193
6194 pub fn set_user_note<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6196 self.user_note = v.into();
6197 self
6198 }
6199
6200 pub fn set_gcp_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6202 self.gcp_service = v.into();
6203 self
6204 }
6205
6206 pub fn set_performance_tier<T: std::convert::Into<crate::model::VolumePerformanceTier>>(
6208 mut self,
6209 v: T,
6210 ) -> Self {
6211 self.performance_tier = v.into();
6212 self
6213 }
6214}
6215
6216impl wkt::message::Message for VolumeConfig {
6217 fn typename() -> &'static str {
6218 "type.googleapis.com/google.cloud.baremetalsolution.v2.VolumeConfig"
6219 }
6220}
6221
6222pub mod volume_config {
6224 #[allow(unused_imports)]
6225 use super::*;
6226
6227 #[derive(Clone, Default, PartialEq)]
6229 #[non_exhaustive]
6230 pub struct LunRange {
6231 pub quantity: i32,
6233
6234 pub size_gb: i32,
6236
6237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6238 }
6239
6240 impl LunRange {
6241 pub fn new() -> Self {
6242 std::default::Default::default()
6243 }
6244
6245 pub fn set_quantity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6247 self.quantity = v.into();
6248 self
6249 }
6250
6251 pub fn set_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6253 self.size_gb = v.into();
6254 self
6255 }
6256 }
6257
6258 impl wkt::message::Message for LunRange {
6259 fn typename() -> &'static str {
6260 "type.googleapis.com/google.cloud.baremetalsolution.v2.VolumeConfig.LunRange"
6261 }
6262 }
6263
6264 #[derive(Clone, Default, PartialEq)]
6266 #[non_exhaustive]
6267 pub struct NfsExport {
6268 pub network_id: std::string::String,
6270
6271 pub permissions: crate::model::volume_config::nfs_export::Permissions,
6273
6274 pub no_root_squash: bool,
6278
6279 pub allow_suid: bool,
6281
6282 pub allow_dev: bool,
6284
6285 pub client: std::option::Option<crate::model::volume_config::nfs_export::Client>,
6287
6288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6289 }
6290
6291 impl NfsExport {
6292 pub fn new() -> Self {
6293 std::default::Default::default()
6294 }
6295
6296 pub fn set_network_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6298 self.network_id = v.into();
6299 self
6300 }
6301
6302 pub fn set_permissions<
6304 T: std::convert::Into<crate::model::volume_config::nfs_export::Permissions>,
6305 >(
6306 mut self,
6307 v: T,
6308 ) -> Self {
6309 self.permissions = v.into();
6310 self
6311 }
6312
6313 pub fn set_no_root_squash<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6315 self.no_root_squash = v.into();
6316 self
6317 }
6318
6319 pub fn set_allow_suid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6321 self.allow_suid = v.into();
6322 self
6323 }
6324
6325 pub fn set_allow_dev<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6327 self.allow_dev = v.into();
6328 self
6329 }
6330
6331 pub fn set_client<
6336 T: std::convert::Into<
6337 std::option::Option<crate::model::volume_config::nfs_export::Client>,
6338 >,
6339 >(
6340 mut self,
6341 v: T,
6342 ) -> Self {
6343 self.client = v.into();
6344 self
6345 }
6346
6347 pub fn machine_id(&self) -> std::option::Option<&std::string::String> {
6351 #[allow(unreachable_patterns)]
6352 self.client.as_ref().and_then(|v| match v {
6353 crate::model::volume_config::nfs_export::Client::MachineId(v) => {
6354 std::option::Option::Some(v)
6355 }
6356 _ => std::option::Option::None,
6357 })
6358 }
6359
6360 pub fn set_machine_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6366 self.client = std::option::Option::Some(
6367 crate::model::volume_config::nfs_export::Client::MachineId(v.into()),
6368 );
6369 self
6370 }
6371
6372 pub fn cidr(&self) -> std::option::Option<&std::string::String> {
6376 #[allow(unreachable_patterns)]
6377 self.client.as_ref().and_then(|v| match v {
6378 crate::model::volume_config::nfs_export::Client::Cidr(v) => {
6379 std::option::Option::Some(v)
6380 }
6381 _ => std::option::Option::None,
6382 })
6383 }
6384
6385 pub fn set_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6391 self.client = std::option::Option::Some(
6392 crate::model::volume_config::nfs_export::Client::Cidr(v.into()),
6393 );
6394 self
6395 }
6396 }
6397
6398 impl wkt::message::Message for NfsExport {
6399 fn typename() -> &'static str {
6400 "type.googleapis.com/google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport"
6401 }
6402 }
6403
6404 pub mod nfs_export {
6406 #[allow(unused_imports)]
6407 use super::*;
6408
6409 #[derive(Clone, Debug, PartialEq)]
6425 #[non_exhaustive]
6426 pub enum Permissions {
6427 Unspecified,
6429 ReadOnly,
6431 ReadWrite,
6433 UnknownValue(permissions::UnknownValue),
6438 }
6439
6440 #[doc(hidden)]
6441 pub mod permissions {
6442 #[allow(unused_imports)]
6443 use super::*;
6444 #[derive(Clone, Debug, PartialEq)]
6445 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6446 }
6447
6448 impl Permissions {
6449 pub fn value(&self) -> std::option::Option<i32> {
6454 match self {
6455 Self::Unspecified => std::option::Option::Some(0),
6456 Self::ReadOnly => std::option::Option::Some(1),
6457 Self::ReadWrite => std::option::Option::Some(2),
6458 Self::UnknownValue(u) => u.0.value(),
6459 }
6460 }
6461
6462 pub fn name(&self) -> std::option::Option<&str> {
6467 match self {
6468 Self::Unspecified => std::option::Option::Some("PERMISSIONS_UNSPECIFIED"),
6469 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
6470 Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
6471 Self::UnknownValue(u) => u.0.name(),
6472 }
6473 }
6474 }
6475
6476 impl std::default::Default for Permissions {
6477 fn default() -> Self {
6478 use std::convert::From;
6479 Self::from(0)
6480 }
6481 }
6482
6483 impl std::fmt::Display for Permissions {
6484 fn fmt(
6485 &self,
6486 f: &mut std::fmt::Formatter<'_>,
6487 ) -> std::result::Result<(), std::fmt::Error> {
6488 wkt::internal::display_enum(f, self.name(), self.value())
6489 }
6490 }
6491
6492 impl std::convert::From<i32> for Permissions {
6493 fn from(value: i32) -> Self {
6494 match value {
6495 0 => Self::Unspecified,
6496 1 => Self::ReadOnly,
6497 2 => Self::ReadWrite,
6498 _ => Self::UnknownValue(permissions::UnknownValue(
6499 wkt::internal::UnknownEnumValue::Integer(value),
6500 )),
6501 }
6502 }
6503 }
6504
6505 impl std::convert::From<&str> for Permissions {
6506 fn from(value: &str) -> Self {
6507 use std::string::ToString;
6508 match value {
6509 "PERMISSIONS_UNSPECIFIED" => Self::Unspecified,
6510 "READ_ONLY" => Self::ReadOnly,
6511 "READ_WRITE" => Self::ReadWrite,
6512 _ => Self::UnknownValue(permissions::UnknownValue(
6513 wkt::internal::UnknownEnumValue::String(value.to_string()),
6514 )),
6515 }
6516 }
6517 }
6518
6519 impl serde::ser::Serialize for Permissions {
6520 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6521 where
6522 S: serde::Serializer,
6523 {
6524 match self {
6525 Self::Unspecified => serializer.serialize_i32(0),
6526 Self::ReadOnly => serializer.serialize_i32(1),
6527 Self::ReadWrite => serializer.serialize_i32(2),
6528 Self::UnknownValue(u) => u.0.serialize(serializer),
6529 }
6530 }
6531 }
6532
6533 impl<'de> serde::de::Deserialize<'de> for Permissions {
6534 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6535 where
6536 D: serde::Deserializer<'de>,
6537 {
6538 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Permissions>::new(
6539 ".google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions",
6540 ))
6541 }
6542 }
6543
6544 #[derive(Clone, Debug, PartialEq)]
6546 #[non_exhaustive]
6547 pub enum Client {
6548 MachineId(std::string::String),
6551 Cidr(std::string::String),
6553 }
6554 }
6555
6556 #[derive(Clone, Debug, PartialEq)]
6572 #[non_exhaustive]
6573 pub enum Type {
6574 Unspecified,
6576 Flash,
6578 Disk,
6580 UnknownValue(r#type::UnknownValue),
6585 }
6586
6587 #[doc(hidden)]
6588 pub mod r#type {
6589 #[allow(unused_imports)]
6590 use super::*;
6591 #[derive(Clone, Debug, PartialEq)]
6592 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6593 }
6594
6595 impl Type {
6596 pub fn value(&self) -> std::option::Option<i32> {
6601 match self {
6602 Self::Unspecified => std::option::Option::Some(0),
6603 Self::Flash => std::option::Option::Some(1),
6604 Self::Disk => std::option::Option::Some(2),
6605 Self::UnknownValue(u) => u.0.value(),
6606 }
6607 }
6608
6609 pub fn name(&self) -> std::option::Option<&str> {
6614 match self {
6615 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
6616 Self::Flash => std::option::Option::Some("FLASH"),
6617 Self::Disk => std::option::Option::Some("DISK"),
6618 Self::UnknownValue(u) => u.0.name(),
6619 }
6620 }
6621 }
6622
6623 impl std::default::Default for Type {
6624 fn default() -> Self {
6625 use std::convert::From;
6626 Self::from(0)
6627 }
6628 }
6629
6630 impl std::fmt::Display for Type {
6631 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6632 wkt::internal::display_enum(f, self.name(), self.value())
6633 }
6634 }
6635
6636 impl std::convert::From<i32> for Type {
6637 fn from(value: i32) -> Self {
6638 match value {
6639 0 => Self::Unspecified,
6640 1 => Self::Flash,
6641 2 => Self::Disk,
6642 _ => Self::UnknownValue(r#type::UnknownValue(
6643 wkt::internal::UnknownEnumValue::Integer(value),
6644 )),
6645 }
6646 }
6647 }
6648
6649 impl std::convert::From<&str> for Type {
6650 fn from(value: &str) -> Self {
6651 use std::string::ToString;
6652 match value {
6653 "TYPE_UNSPECIFIED" => Self::Unspecified,
6654 "FLASH" => Self::Flash,
6655 "DISK" => Self::Disk,
6656 _ => Self::UnknownValue(r#type::UnknownValue(
6657 wkt::internal::UnknownEnumValue::String(value.to_string()),
6658 )),
6659 }
6660 }
6661 }
6662
6663 impl serde::ser::Serialize for Type {
6664 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6665 where
6666 S: serde::Serializer,
6667 {
6668 match self {
6669 Self::Unspecified => serializer.serialize_i32(0),
6670 Self::Flash => serializer.serialize_i32(1),
6671 Self::Disk => serializer.serialize_i32(2),
6672 Self::UnknownValue(u) => u.0.serialize(serializer),
6673 }
6674 }
6675 }
6676
6677 impl<'de> serde::de::Deserialize<'de> for Type {
6678 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6679 where
6680 D: serde::Deserializer<'de>,
6681 {
6682 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
6683 ".google.cloud.baremetalsolution.v2.VolumeConfig.Type",
6684 ))
6685 }
6686 }
6687
6688 #[derive(Clone, Debug, PartialEq)]
6704 #[non_exhaustive]
6705 pub enum Protocol {
6706 Unspecified,
6708 Fc,
6710 Nfs,
6712 UnknownValue(protocol::UnknownValue),
6717 }
6718
6719 #[doc(hidden)]
6720 pub mod protocol {
6721 #[allow(unused_imports)]
6722 use super::*;
6723 #[derive(Clone, Debug, PartialEq)]
6724 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6725 }
6726
6727 impl Protocol {
6728 pub fn value(&self) -> std::option::Option<i32> {
6733 match self {
6734 Self::Unspecified => std::option::Option::Some(0),
6735 Self::Fc => std::option::Option::Some(1),
6736 Self::Nfs => std::option::Option::Some(2),
6737 Self::UnknownValue(u) => u.0.value(),
6738 }
6739 }
6740
6741 pub fn name(&self) -> std::option::Option<&str> {
6746 match self {
6747 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
6748 Self::Fc => std::option::Option::Some("PROTOCOL_FC"),
6749 Self::Nfs => std::option::Option::Some("PROTOCOL_NFS"),
6750 Self::UnknownValue(u) => u.0.name(),
6751 }
6752 }
6753 }
6754
6755 impl std::default::Default for Protocol {
6756 fn default() -> Self {
6757 use std::convert::From;
6758 Self::from(0)
6759 }
6760 }
6761
6762 impl std::fmt::Display for Protocol {
6763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6764 wkt::internal::display_enum(f, self.name(), self.value())
6765 }
6766 }
6767
6768 impl std::convert::From<i32> for Protocol {
6769 fn from(value: i32) -> Self {
6770 match value {
6771 0 => Self::Unspecified,
6772 1 => Self::Fc,
6773 2 => Self::Nfs,
6774 _ => Self::UnknownValue(protocol::UnknownValue(
6775 wkt::internal::UnknownEnumValue::Integer(value),
6776 )),
6777 }
6778 }
6779 }
6780
6781 impl std::convert::From<&str> for Protocol {
6782 fn from(value: &str) -> Self {
6783 use std::string::ToString;
6784 match value {
6785 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
6786 "PROTOCOL_FC" => Self::Fc,
6787 "PROTOCOL_NFS" => Self::Nfs,
6788 _ => Self::UnknownValue(protocol::UnknownValue(
6789 wkt::internal::UnknownEnumValue::String(value.to_string()),
6790 )),
6791 }
6792 }
6793 }
6794
6795 impl serde::ser::Serialize for Protocol {
6796 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6797 where
6798 S: serde::Serializer,
6799 {
6800 match self {
6801 Self::Unspecified => serializer.serialize_i32(0),
6802 Self::Fc => serializer.serialize_i32(1),
6803 Self::Nfs => serializer.serialize_i32(2),
6804 Self::UnknownValue(u) => u.0.serialize(serializer),
6805 }
6806 }
6807 }
6808
6809 impl<'de> serde::de::Deserialize<'de> for Protocol {
6810 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6811 where
6812 D: serde::Deserializer<'de>,
6813 {
6814 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
6815 ".google.cloud.baremetalsolution.v2.VolumeConfig.Protocol",
6816 ))
6817 }
6818 }
6819}
6820
6821#[derive(Clone, Default, PartialEq)]
6823#[non_exhaustive]
6824pub struct NetworkConfig {
6825 pub name: std::string::String,
6827
6828 pub id: std::string::String,
6831
6832 pub r#type: crate::model::network_config::Type,
6834
6835 pub bandwidth: crate::model::network_config::Bandwidth,
6837
6838 pub vlan_attachments: std::vec::Vec<crate::model::network_config::IntakeVlanAttachment>,
6841
6842 pub cidr: std::string::String,
6844
6845 pub service_cidr: crate::model::network_config::ServiceCidr,
6847
6848 pub user_note: std::string::String,
6851
6852 pub gcp_service: std::string::String,
6855
6856 pub vlan_same_project: bool,
6858
6859 pub jumbo_frames_enabled: bool,
6861
6862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6863}
6864
6865impl NetworkConfig {
6866 pub fn new() -> Self {
6867 std::default::Default::default()
6868 }
6869
6870 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6872 self.name = v.into();
6873 self
6874 }
6875
6876 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6878 self.id = v.into();
6879 self
6880 }
6881
6882 pub fn set_type<T: std::convert::Into<crate::model::network_config::Type>>(
6884 mut self,
6885 v: T,
6886 ) -> Self {
6887 self.r#type = v.into();
6888 self
6889 }
6890
6891 pub fn set_bandwidth<T: std::convert::Into<crate::model::network_config::Bandwidth>>(
6893 mut self,
6894 v: T,
6895 ) -> Self {
6896 self.bandwidth = v.into();
6897 self
6898 }
6899
6900 pub fn set_vlan_attachments<T, V>(mut self, v: T) -> Self
6902 where
6903 T: std::iter::IntoIterator<Item = V>,
6904 V: std::convert::Into<crate::model::network_config::IntakeVlanAttachment>,
6905 {
6906 use std::iter::Iterator;
6907 self.vlan_attachments = v.into_iter().map(|i| i.into()).collect();
6908 self
6909 }
6910
6911 pub fn set_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6913 self.cidr = v.into();
6914 self
6915 }
6916
6917 pub fn set_service_cidr<T: std::convert::Into<crate::model::network_config::ServiceCidr>>(
6919 mut self,
6920 v: T,
6921 ) -> Self {
6922 self.service_cidr = v.into();
6923 self
6924 }
6925
6926 pub fn set_user_note<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6928 self.user_note = v.into();
6929 self
6930 }
6931
6932 pub fn set_gcp_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6934 self.gcp_service = v.into();
6935 self
6936 }
6937
6938 pub fn set_vlan_same_project<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6940 self.vlan_same_project = v.into();
6941 self
6942 }
6943
6944 pub fn set_jumbo_frames_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6946 self.jumbo_frames_enabled = v.into();
6947 self
6948 }
6949}
6950
6951impl wkt::message::Message for NetworkConfig {
6952 fn typename() -> &'static str {
6953 "type.googleapis.com/google.cloud.baremetalsolution.v2.NetworkConfig"
6954 }
6955}
6956
6957pub mod network_config {
6959 #[allow(unused_imports)]
6960 use super::*;
6961
6962 #[derive(Clone, Default, PartialEq)]
6964 #[non_exhaustive]
6965 pub struct IntakeVlanAttachment {
6966 pub id: std::string::String,
6968
6969 pub pairing_key: std::string::String,
6971
6972 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6973 }
6974
6975 impl IntakeVlanAttachment {
6976 pub fn new() -> Self {
6977 std::default::Default::default()
6978 }
6979
6980 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6982 self.id = v.into();
6983 self
6984 }
6985
6986 pub fn set_pairing_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6988 self.pairing_key = v.into();
6989 self
6990 }
6991 }
6992
6993 impl wkt::message::Message for IntakeVlanAttachment {
6994 fn typename() -> &'static str {
6995 "type.googleapis.com/google.cloud.baremetalsolution.v2.NetworkConfig.IntakeVlanAttachment"
6996 }
6997 }
6998
6999 #[derive(Clone, Debug, PartialEq)]
7015 #[non_exhaustive]
7016 pub enum Type {
7017 Unspecified,
7019 Client,
7021 Private,
7023 UnknownValue(r#type::UnknownValue),
7028 }
7029
7030 #[doc(hidden)]
7031 pub mod r#type {
7032 #[allow(unused_imports)]
7033 use super::*;
7034 #[derive(Clone, Debug, PartialEq)]
7035 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7036 }
7037
7038 impl Type {
7039 pub fn value(&self) -> std::option::Option<i32> {
7044 match self {
7045 Self::Unspecified => std::option::Option::Some(0),
7046 Self::Client => std::option::Option::Some(1),
7047 Self::Private => std::option::Option::Some(2),
7048 Self::UnknownValue(u) => u.0.value(),
7049 }
7050 }
7051
7052 pub fn name(&self) -> std::option::Option<&str> {
7057 match self {
7058 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7059 Self::Client => std::option::Option::Some("CLIENT"),
7060 Self::Private => std::option::Option::Some("PRIVATE"),
7061 Self::UnknownValue(u) => u.0.name(),
7062 }
7063 }
7064 }
7065
7066 impl std::default::Default for Type {
7067 fn default() -> Self {
7068 use std::convert::From;
7069 Self::from(0)
7070 }
7071 }
7072
7073 impl std::fmt::Display for Type {
7074 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7075 wkt::internal::display_enum(f, self.name(), self.value())
7076 }
7077 }
7078
7079 impl std::convert::From<i32> for Type {
7080 fn from(value: i32) -> Self {
7081 match value {
7082 0 => Self::Unspecified,
7083 1 => Self::Client,
7084 2 => Self::Private,
7085 _ => Self::UnknownValue(r#type::UnknownValue(
7086 wkt::internal::UnknownEnumValue::Integer(value),
7087 )),
7088 }
7089 }
7090 }
7091
7092 impl std::convert::From<&str> for Type {
7093 fn from(value: &str) -> Self {
7094 use std::string::ToString;
7095 match value {
7096 "TYPE_UNSPECIFIED" => Self::Unspecified,
7097 "CLIENT" => Self::Client,
7098 "PRIVATE" => Self::Private,
7099 _ => Self::UnknownValue(r#type::UnknownValue(
7100 wkt::internal::UnknownEnumValue::String(value.to_string()),
7101 )),
7102 }
7103 }
7104 }
7105
7106 impl serde::ser::Serialize for Type {
7107 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7108 where
7109 S: serde::Serializer,
7110 {
7111 match self {
7112 Self::Unspecified => serializer.serialize_i32(0),
7113 Self::Client => serializer.serialize_i32(1),
7114 Self::Private => serializer.serialize_i32(2),
7115 Self::UnknownValue(u) => u.0.serialize(serializer),
7116 }
7117 }
7118 }
7119
7120 impl<'de> serde::de::Deserialize<'de> for Type {
7121 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7122 where
7123 D: serde::Deserializer<'de>,
7124 {
7125 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7126 ".google.cloud.baremetalsolution.v2.NetworkConfig.Type",
7127 ))
7128 }
7129 }
7130
7131 #[derive(Clone, Debug, PartialEq)]
7147 #[non_exhaustive]
7148 pub enum Bandwidth {
7149 Unspecified,
7151 Bw1Gbps,
7153 Bw2Gbps,
7155 Bw5Gbps,
7157 Bw10Gbps,
7159 UnknownValue(bandwidth::UnknownValue),
7164 }
7165
7166 #[doc(hidden)]
7167 pub mod bandwidth {
7168 #[allow(unused_imports)]
7169 use super::*;
7170 #[derive(Clone, Debug, PartialEq)]
7171 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7172 }
7173
7174 impl Bandwidth {
7175 pub fn value(&self) -> std::option::Option<i32> {
7180 match self {
7181 Self::Unspecified => std::option::Option::Some(0),
7182 Self::Bw1Gbps => std::option::Option::Some(1),
7183 Self::Bw2Gbps => std::option::Option::Some(2),
7184 Self::Bw5Gbps => std::option::Option::Some(3),
7185 Self::Bw10Gbps => std::option::Option::Some(4),
7186 Self::UnknownValue(u) => u.0.value(),
7187 }
7188 }
7189
7190 pub fn name(&self) -> std::option::Option<&str> {
7195 match self {
7196 Self::Unspecified => std::option::Option::Some("BANDWIDTH_UNSPECIFIED"),
7197 Self::Bw1Gbps => std::option::Option::Some("BW_1_GBPS"),
7198 Self::Bw2Gbps => std::option::Option::Some("BW_2_GBPS"),
7199 Self::Bw5Gbps => std::option::Option::Some("BW_5_GBPS"),
7200 Self::Bw10Gbps => std::option::Option::Some("BW_10_GBPS"),
7201 Self::UnknownValue(u) => u.0.name(),
7202 }
7203 }
7204 }
7205
7206 impl std::default::Default for Bandwidth {
7207 fn default() -> Self {
7208 use std::convert::From;
7209 Self::from(0)
7210 }
7211 }
7212
7213 impl std::fmt::Display for Bandwidth {
7214 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7215 wkt::internal::display_enum(f, self.name(), self.value())
7216 }
7217 }
7218
7219 impl std::convert::From<i32> for Bandwidth {
7220 fn from(value: i32) -> Self {
7221 match value {
7222 0 => Self::Unspecified,
7223 1 => Self::Bw1Gbps,
7224 2 => Self::Bw2Gbps,
7225 3 => Self::Bw5Gbps,
7226 4 => Self::Bw10Gbps,
7227 _ => Self::UnknownValue(bandwidth::UnknownValue(
7228 wkt::internal::UnknownEnumValue::Integer(value),
7229 )),
7230 }
7231 }
7232 }
7233
7234 impl std::convert::From<&str> for Bandwidth {
7235 fn from(value: &str) -> Self {
7236 use std::string::ToString;
7237 match value {
7238 "BANDWIDTH_UNSPECIFIED" => Self::Unspecified,
7239 "BW_1_GBPS" => Self::Bw1Gbps,
7240 "BW_2_GBPS" => Self::Bw2Gbps,
7241 "BW_5_GBPS" => Self::Bw5Gbps,
7242 "BW_10_GBPS" => Self::Bw10Gbps,
7243 _ => Self::UnknownValue(bandwidth::UnknownValue(
7244 wkt::internal::UnknownEnumValue::String(value.to_string()),
7245 )),
7246 }
7247 }
7248 }
7249
7250 impl serde::ser::Serialize for Bandwidth {
7251 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7252 where
7253 S: serde::Serializer,
7254 {
7255 match self {
7256 Self::Unspecified => serializer.serialize_i32(0),
7257 Self::Bw1Gbps => serializer.serialize_i32(1),
7258 Self::Bw2Gbps => serializer.serialize_i32(2),
7259 Self::Bw5Gbps => serializer.serialize_i32(3),
7260 Self::Bw10Gbps => serializer.serialize_i32(4),
7261 Self::UnknownValue(u) => u.0.serialize(serializer),
7262 }
7263 }
7264 }
7265
7266 impl<'de> serde::de::Deserialize<'de> for Bandwidth {
7267 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7268 where
7269 D: serde::Deserializer<'de>,
7270 {
7271 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Bandwidth>::new(
7272 ".google.cloud.baremetalsolution.v2.NetworkConfig.Bandwidth",
7273 ))
7274 }
7275 }
7276
7277 #[derive(Clone, Debug, PartialEq)]
7293 #[non_exhaustive]
7294 pub enum ServiceCidr {
7295 Unspecified,
7297 Disabled,
7299 High26,
7301 High27,
7303 High28,
7305 UnknownValue(service_cidr::UnknownValue),
7310 }
7311
7312 #[doc(hidden)]
7313 pub mod service_cidr {
7314 #[allow(unused_imports)]
7315 use super::*;
7316 #[derive(Clone, Debug, PartialEq)]
7317 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7318 }
7319
7320 impl ServiceCidr {
7321 pub fn value(&self) -> std::option::Option<i32> {
7326 match self {
7327 Self::Unspecified => std::option::Option::Some(0),
7328 Self::Disabled => std::option::Option::Some(1),
7329 Self::High26 => std::option::Option::Some(2),
7330 Self::High27 => std::option::Option::Some(3),
7331 Self::High28 => std::option::Option::Some(4),
7332 Self::UnknownValue(u) => u.0.value(),
7333 }
7334 }
7335
7336 pub fn name(&self) -> std::option::Option<&str> {
7341 match self {
7342 Self::Unspecified => std::option::Option::Some("SERVICE_CIDR_UNSPECIFIED"),
7343 Self::Disabled => std::option::Option::Some("DISABLED"),
7344 Self::High26 => std::option::Option::Some("HIGH_26"),
7345 Self::High27 => std::option::Option::Some("HIGH_27"),
7346 Self::High28 => std::option::Option::Some("HIGH_28"),
7347 Self::UnknownValue(u) => u.0.name(),
7348 }
7349 }
7350 }
7351
7352 impl std::default::Default for ServiceCidr {
7353 fn default() -> Self {
7354 use std::convert::From;
7355 Self::from(0)
7356 }
7357 }
7358
7359 impl std::fmt::Display for ServiceCidr {
7360 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7361 wkt::internal::display_enum(f, self.name(), self.value())
7362 }
7363 }
7364
7365 impl std::convert::From<i32> for ServiceCidr {
7366 fn from(value: i32) -> Self {
7367 match value {
7368 0 => Self::Unspecified,
7369 1 => Self::Disabled,
7370 2 => Self::High26,
7371 3 => Self::High27,
7372 4 => Self::High28,
7373 _ => Self::UnknownValue(service_cidr::UnknownValue(
7374 wkt::internal::UnknownEnumValue::Integer(value),
7375 )),
7376 }
7377 }
7378 }
7379
7380 impl std::convert::From<&str> for ServiceCidr {
7381 fn from(value: &str) -> Self {
7382 use std::string::ToString;
7383 match value {
7384 "SERVICE_CIDR_UNSPECIFIED" => Self::Unspecified,
7385 "DISABLED" => Self::Disabled,
7386 "HIGH_26" => Self::High26,
7387 "HIGH_27" => Self::High27,
7388 "HIGH_28" => Self::High28,
7389 _ => Self::UnknownValue(service_cidr::UnknownValue(
7390 wkt::internal::UnknownEnumValue::String(value.to_string()),
7391 )),
7392 }
7393 }
7394 }
7395
7396 impl serde::ser::Serialize for ServiceCidr {
7397 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7398 where
7399 S: serde::Serializer,
7400 {
7401 match self {
7402 Self::Unspecified => serializer.serialize_i32(0),
7403 Self::Disabled => serializer.serialize_i32(1),
7404 Self::High26 => serializer.serialize_i32(2),
7405 Self::High27 => serializer.serialize_i32(3),
7406 Self::High28 => serializer.serialize_i32(4),
7407 Self::UnknownValue(u) => u.0.serialize(serializer),
7408 }
7409 }
7410 }
7411
7412 impl<'de> serde::de::Deserialize<'de> for ServiceCidr {
7413 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7414 where
7415 D: serde::Deserializer<'de>,
7416 {
7417 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceCidr>::new(
7418 ".google.cloud.baremetalsolution.v2.NetworkConfig.ServiceCidr",
7419 ))
7420 }
7421 }
7422}
7423
7424#[derive(Clone, Default, PartialEq)]
7426#[non_exhaustive]
7427pub struct InstanceQuota {
7428 pub name: std::string::String,
7430
7431 #[deprecated]
7434 pub instance_type: std::string::String,
7435
7436 pub gcp_service: std::string::String,
7438
7439 pub location: std::string::String,
7441
7442 pub available_machine_count: i32,
7445
7446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7447}
7448
7449impl InstanceQuota {
7450 pub fn new() -> Self {
7451 std::default::Default::default()
7452 }
7453
7454 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7456 self.name = v.into();
7457 self
7458 }
7459
7460 #[deprecated]
7462 pub fn set_instance_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7463 self.instance_type = v.into();
7464 self
7465 }
7466
7467 pub fn set_gcp_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7469 self.gcp_service = v.into();
7470 self
7471 }
7472
7473 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7475 self.location = v.into();
7476 self
7477 }
7478
7479 pub fn set_available_machine_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7481 self.available_machine_count = v.into();
7482 self
7483 }
7484}
7485
7486impl wkt::message::Message for InstanceQuota {
7487 fn typename() -> &'static str {
7488 "type.googleapis.com/google.cloud.baremetalsolution.v2.InstanceQuota"
7489 }
7490}
7491
7492#[derive(Clone, Default, PartialEq)]
7494#[non_exhaustive]
7495pub struct GetProvisioningConfigRequest {
7496 pub name: std::string::String,
7498
7499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7500}
7501
7502impl GetProvisioningConfigRequest {
7503 pub fn new() -> Self {
7504 std::default::Default::default()
7505 }
7506
7507 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7509 self.name = v.into();
7510 self
7511 }
7512}
7513
7514impl wkt::message::Message for GetProvisioningConfigRequest {
7515 fn typename() -> &'static str {
7516 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetProvisioningConfigRequest"
7517 }
7518}
7519
7520#[derive(Clone, Default, PartialEq)]
7522#[non_exhaustive]
7523pub struct CreateProvisioningConfigRequest {
7524 pub parent: std::string::String,
7527
7528 pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
7530
7531 pub email: std::string::String,
7534
7535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7536}
7537
7538impl CreateProvisioningConfigRequest {
7539 pub fn new() -> Self {
7540 std::default::Default::default()
7541 }
7542
7543 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7545 self.parent = v.into();
7546 self
7547 }
7548
7549 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
7551 where
7552 T: std::convert::Into<crate::model::ProvisioningConfig>,
7553 {
7554 self.provisioning_config = std::option::Option::Some(v.into());
7555 self
7556 }
7557
7558 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
7560 where
7561 T: std::convert::Into<crate::model::ProvisioningConfig>,
7562 {
7563 self.provisioning_config = v.map(|x| x.into());
7564 self
7565 }
7566
7567 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7569 self.email = v.into();
7570 self
7571 }
7572}
7573
7574impl wkt::message::Message for CreateProvisioningConfigRequest {
7575 fn typename() -> &'static str {
7576 "type.googleapis.com/google.cloud.baremetalsolution.v2.CreateProvisioningConfigRequest"
7577 }
7578}
7579
7580#[derive(Clone, Default, PartialEq)]
7582#[non_exhaustive]
7583pub struct UpdateProvisioningConfigRequest {
7584 pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
7586
7587 pub update_mask: std::option::Option<wkt::FieldMask>,
7589
7590 pub email: std::string::String,
7593
7594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7595}
7596
7597impl UpdateProvisioningConfigRequest {
7598 pub fn new() -> Self {
7599 std::default::Default::default()
7600 }
7601
7602 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
7604 where
7605 T: std::convert::Into<crate::model::ProvisioningConfig>,
7606 {
7607 self.provisioning_config = std::option::Option::Some(v.into());
7608 self
7609 }
7610
7611 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
7613 where
7614 T: std::convert::Into<crate::model::ProvisioningConfig>,
7615 {
7616 self.provisioning_config = v.map(|x| x.into());
7617 self
7618 }
7619
7620 pub fn set_update_mask<T>(mut self, v: T) -> Self
7622 where
7623 T: std::convert::Into<wkt::FieldMask>,
7624 {
7625 self.update_mask = std::option::Option::Some(v.into());
7626 self
7627 }
7628
7629 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7631 where
7632 T: std::convert::Into<wkt::FieldMask>,
7633 {
7634 self.update_mask = v.map(|x| x.into());
7635 self
7636 }
7637
7638 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7640 self.email = v.into();
7641 self
7642 }
7643}
7644
7645impl wkt::message::Message for UpdateProvisioningConfigRequest {
7646 fn typename() -> &'static str {
7647 "type.googleapis.com/google.cloud.baremetalsolution.v2.UpdateProvisioningConfigRequest"
7648 }
7649}
7650
7651#[derive(Clone, Default, PartialEq)]
7653#[non_exhaustive]
7654pub struct SSHKey {
7655 pub name: std::string::String,
7658
7659 pub public_key: std::string::String,
7661
7662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7663}
7664
7665impl SSHKey {
7666 pub fn new() -> Self {
7667 std::default::Default::default()
7668 }
7669
7670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7672 self.name = v.into();
7673 self
7674 }
7675
7676 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7678 self.public_key = v.into();
7679 self
7680 }
7681}
7682
7683impl wkt::message::Message for SSHKey {
7684 fn typename() -> &'static str {
7685 "type.googleapis.com/google.cloud.baremetalsolution.v2.SSHKey"
7686 }
7687}
7688
7689#[derive(Clone, Default, PartialEq)]
7691#[non_exhaustive]
7692pub struct ListSSHKeysRequest {
7693 pub parent: std::string::String,
7696
7697 pub page_size: i32,
7699
7700 pub page_token: std::string::String,
7702
7703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7704}
7705
7706impl ListSSHKeysRequest {
7707 pub fn new() -> Self {
7708 std::default::Default::default()
7709 }
7710
7711 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7713 self.parent = v.into();
7714 self
7715 }
7716
7717 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7719 self.page_size = v.into();
7720 self
7721 }
7722
7723 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7725 self.page_token = v.into();
7726 self
7727 }
7728}
7729
7730impl wkt::message::Message for ListSSHKeysRequest {
7731 fn typename() -> &'static str {
7732 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListSSHKeysRequest"
7733 }
7734}
7735
7736#[derive(Clone, Default, PartialEq)]
7738#[non_exhaustive]
7739pub struct ListSSHKeysResponse {
7740 pub ssh_keys: std::vec::Vec<crate::model::SSHKey>,
7742
7743 pub next_page_token: std::string::String,
7746
7747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7748}
7749
7750impl ListSSHKeysResponse {
7751 pub fn new() -> Self {
7752 std::default::Default::default()
7753 }
7754
7755 pub fn set_ssh_keys<T, V>(mut self, v: T) -> Self
7757 where
7758 T: std::iter::IntoIterator<Item = V>,
7759 V: std::convert::Into<crate::model::SSHKey>,
7760 {
7761 use std::iter::Iterator;
7762 self.ssh_keys = v.into_iter().map(|i| i.into()).collect();
7763 self
7764 }
7765
7766 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7768 self.next_page_token = v.into();
7769 self
7770 }
7771}
7772
7773impl wkt::message::Message for ListSSHKeysResponse {
7774 fn typename() -> &'static str {
7775 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListSSHKeysResponse"
7776 }
7777}
7778
7779#[doc(hidden)]
7780impl gax::paginator::internal::PageableResponse for ListSSHKeysResponse {
7781 type PageItem = crate::model::SSHKey;
7782
7783 fn items(self) -> std::vec::Vec<Self::PageItem> {
7784 self.ssh_keys
7785 }
7786
7787 fn next_page_token(&self) -> std::string::String {
7788 use std::clone::Clone;
7789 self.next_page_token.clone()
7790 }
7791}
7792
7793#[derive(Clone, Default, PartialEq)]
7795#[non_exhaustive]
7796pub struct CreateSSHKeyRequest {
7797 pub parent: std::string::String,
7799
7800 pub ssh_key: std::option::Option<crate::model::SSHKey>,
7802
7803 pub ssh_key_id: std::string::String,
7809
7810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7811}
7812
7813impl CreateSSHKeyRequest {
7814 pub fn new() -> Self {
7815 std::default::Default::default()
7816 }
7817
7818 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7820 self.parent = v.into();
7821 self
7822 }
7823
7824 pub fn set_ssh_key<T>(mut self, v: T) -> Self
7826 where
7827 T: std::convert::Into<crate::model::SSHKey>,
7828 {
7829 self.ssh_key = std::option::Option::Some(v.into());
7830 self
7831 }
7832
7833 pub fn set_or_clear_ssh_key<T>(mut self, v: std::option::Option<T>) -> Self
7835 where
7836 T: std::convert::Into<crate::model::SSHKey>,
7837 {
7838 self.ssh_key = v.map(|x| x.into());
7839 self
7840 }
7841
7842 pub fn set_ssh_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7844 self.ssh_key_id = v.into();
7845 self
7846 }
7847}
7848
7849impl wkt::message::Message for CreateSSHKeyRequest {
7850 fn typename() -> &'static str {
7851 "type.googleapis.com/google.cloud.baremetalsolution.v2.CreateSSHKeyRequest"
7852 }
7853}
7854
7855#[derive(Clone, Default, PartialEq)]
7857#[non_exhaustive]
7858pub struct DeleteSSHKeyRequest {
7859 pub name: std::string::String,
7862
7863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7864}
7865
7866impl DeleteSSHKeyRequest {
7867 pub fn new() -> Self {
7868 std::default::Default::default()
7869 }
7870
7871 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7873 self.name = v.into();
7874 self
7875 }
7876}
7877
7878impl wkt::message::Message for DeleteSSHKeyRequest {
7879 fn typename() -> &'static str {
7880 "type.googleapis.com/google.cloud.baremetalsolution.v2.DeleteSSHKeyRequest"
7881 }
7882}
7883
7884#[derive(Clone, Default, PartialEq)]
7886#[non_exhaustive]
7887pub struct Volume {
7888 pub name: std::string::String,
7894
7895 pub id: std::string::String,
7897
7898 pub storage_type: crate::model::volume::StorageType,
7900
7901 pub state: crate::model::volume::State,
7903
7904 pub requested_size_gib: i64,
7906
7907 pub originally_requested_size_gib: i64,
7909
7910 pub current_size_gib: i64,
7914
7915 pub emergency_size_gib: i64,
7918
7919 pub max_size_gib: i64,
7921
7922 pub auto_grown_size_gib: i64,
7925
7926 pub remaining_space_gib: i64,
7929
7930 pub snapshot_reservation_detail:
7932 std::option::Option<crate::model::volume::SnapshotReservationDetail>,
7933
7934 pub snapshot_auto_delete_behavior: crate::model::volume::SnapshotAutoDeleteBehavior,
7936
7937 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7939
7940 pub snapshot_enabled: bool,
7942
7943 pub pod: std::string::String,
7945
7946 pub protocol: crate::model::volume::Protocol,
7948
7949 pub boot_volume: bool,
7952
7953 pub performance_tier: crate::model::VolumePerformanceTier,
7956
7957 pub notes: std::string::String,
7960
7961 pub workload_profile: crate::model::volume::WorkloadProfile,
7963
7964 pub expire_time: std::option::Option<wkt::Timestamp>,
7967
7968 pub instances: std::vec::Vec<std::string::String>,
7971
7972 pub attached: bool,
7976
7977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7978}
7979
7980impl Volume {
7981 pub fn new() -> Self {
7982 std::default::Default::default()
7983 }
7984
7985 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7987 self.name = v.into();
7988 self
7989 }
7990
7991 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7993 self.id = v.into();
7994 self
7995 }
7996
7997 pub fn set_storage_type<T: std::convert::Into<crate::model::volume::StorageType>>(
7999 mut self,
8000 v: T,
8001 ) -> Self {
8002 self.storage_type = v.into();
8003 self
8004 }
8005
8006 pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
8008 self.state = v.into();
8009 self
8010 }
8011
8012 pub fn set_requested_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8014 self.requested_size_gib = v.into();
8015 self
8016 }
8017
8018 pub fn set_originally_requested_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8020 self.originally_requested_size_gib = v.into();
8021 self
8022 }
8023
8024 pub fn set_current_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8026 self.current_size_gib = v.into();
8027 self
8028 }
8029
8030 pub fn set_emergency_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8032 self.emergency_size_gib = v.into();
8033 self
8034 }
8035
8036 pub fn set_max_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8038 self.max_size_gib = v.into();
8039 self
8040 }
8041
8042 pub fn set_auto_grown_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8044 self.auto_grown_size_gib = v.into();
8045 self
8046 }
8047
8048 pub fn set_remaining_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8050 self.remaining_space_gib = v.into();
8051 self
8052 }
8053
8054 pub fn set_snapshot_reservation_detail<T>(mut self, v: T) -> Self
8056 where
8057 T: std::convert::Into<crate::model::volume::SnapshotReservationDetail>,
8058 {
8059 self.snapshot_reservation_detail = std::option::Option::Some(v.into());
8060 self
8061 }
8062
8063 pub fn set_or_clear_snapshot_reservation_detail<T>(mut self, v: std::option::Option<T>) -> Self
8065 where
8066 T: std::convert::Into<crate::model::volume::SnapshotReservationDetail>,
8067 {
8068 self.snapshot_reservation_detail = v.map(|x| x.into());
8069 self
8070 }
8071
8072 pub fn set_snapshot_auto_delete_behavior<
8074 T: std::convert::Into<crate::model::volume::SnapshotAutoDeleteBehavior>,
8075 >(
8076 mut self,
8077 v: T,
8078 ) -> Self {
8079 self.snapshot_auto_delete_behavior = v.into();
8080 self
8081 }
8082
8083 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8085 where
8086 T: std::iter::IntoIterator<Item = (K, V)>,
8087 K: std::convert::Into<std::string::String>,
8088 V: std::convert::Into<std::string::String>,
8089 {
8090 use std::iter::Iterator;
8091 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8092 self
8093 }
8094
8095 pub fn set_snapshot_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8097 self.snapshot_enabled = v.into();
8098 self
8099 }
8100
8101 pub fn set_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8103 self.pod = v.into();
8104 self
8105 }
8106
8107 pub fn set_protocol<T: std::convert::Into<crate::model::volume::Protocol>>(
8109 mut self,
8110 v: T,
8111 ) -> Self {
8112 self.protocol = v.into();
8113 self
8114 }
8115
8116 pub fn set_boot_volume<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8118 self.boot_volume = v.into();
8119 self
8120 }
8121
8122 pub fn set_performance_tier<T: std::convert::Into<crate::model::VolumePerformanceTier>>(
8124 mut self,
8125 v: T,
8126 ) -> Self {
8127 self.performance_tier = v.into();
8128 self
8129 }
8130
8131 pub fn set_notes<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8133 self.notes = v.into();
8134 self
8135 }
8136
8137 pub fn set_workload_profile<T: std::convert::Into<crate::model::volume::WorkloadProfile>>(
8139 mut self,
8140 v: T,
8141 ) -> Self {
8142 self.workload_profile = v.into();
8143 self
8144 }
8145
8146 pub fn set_expire_time<T>(mut self, v: T) -> Self
8148 where
8149 T: std::convert::Into<wkt::Timestamp>,
8150 {
8151 self.expire_time = std::option::Option::Some(v.into());
8152 self
8153 }
8154
8155 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
8157 where
8158 T: std::convert::Into<wkt::Timestamp>,
8159 {
8160 self.expire_time = v.map(|x| x.into());
8161 self
8162 }
8163
8164 pub fn set_instances<T, V>(mut self, v: T) -> Self
8166 where
8167 T: std::iter::IntoIterator<Item = V>,
8168 V: std::convert::Into<std::string::String>,
8169 {
8170 use std::iter::Iterator;
8171 self.instances = v.into_iter().map(|i| i.into()).collect();
8172 self
8173 }
8174
8175 pub fn set_attached<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8177 self.attached = v.into();
8178 self
8179 }
8180}
8181
8182impl wkt::message::Message for Volume {
8183 fn typename() -> &'static str {
8184 "type.googleapis.com/google.cloud.baremetalsolution.v2.Volume"
8185 }
8186}
8187
8188pub mod volume {
8190 #[allow(unused_imports)]
8191 use super::*;
8192
8193 #[derive(Clone, Default, PartialEq)]
8195 #[non_exhaustive]
8196 pub struct SnapshotReservationDetail {
8197 pub reserved_space_gib: i64,
8199
8200 pub reserved_space_used_percent: i32,
8205
8206 pub reserved_space_remaining_gib: i64,
8209
8210 pub reserved_space_percent: i32,
8216
8217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8218 }
8219
8220 impl SnapshotReservationDetail {
8221 pub fn new() -> Self {
8222 std::default::Default::default()
8223 }
8224
8225 pub fn set_reserved_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8227 self.reserved_space_gib = v.into();
8228 self
8229 }
8230
8231 pub fn set_reserved_space_used_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8233 self.reserved_space_used_percent = v.into();
8234 self
8235 }
8236
8237 pub fn set_reserved_space_remaining_gib<T: std::convert::Into<i64>>(
8239 mut self,
8240 v: T,
8241 ) -> Self {
8242 self.reserved_space_remaining_gib = v.into();
8243 self
8244 }
8245
8246 pub fn set_reserved_space_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8248 self.reserved_space_percent = v.into();
8249 self
8250 }
8251 }
8252
8253 impl wkt::message::Message for SnapshotReservationDetail {
8254 fn typename() -> &'static str {
8255 "type.googleapis.com/google.cloud.baremetalsolution.v2.Volume.SnapshotReservationDetail"
8256 }
8257 }
8258
8259 #[derive(Clone, Debug, PartialEq)]
8275 #[non_exhaustive]
8276 pub enum StorageType {
8277 Unspecified,
8279 Ssd,
8281 Hdd,
8283 UnknownValue(storage_type::UnknownValue),
8288 }
8289
8290 #[doc(hidden)]
8291 pub mod storage_type {
8292 #[allow(unused_imports)]
8293 use super::*;
8294 #[derive(Clone, Debug, PartialEq)]
8295 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8296 }
8297
8298 impl StorageType {
8299 pub fn value(&self) -> std::option::Option<i32> {
8304 match self {
8305 Self::Unspecified => std::option::Option::Some(0),
8306 Self::Ssd => std::option::Option::Some(1),
8307 Self::Hdd => std::option::Option::Some(2),
8308 Self::UnknownValue(u) => u.0.value(),
8309 }
8310 }
8311
8312 pub fn name(&self) -> std::option::Option<&str> {
8317 match self {
8318 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
8319 Self::Ssd => std::option::Option::Some("SSD"),
8320 Self::Hdd => std::option::Option::Some("HDD"),
8321 Self::UnknownValue(u) => u.0.name(),
8322 }
8323 }
8324 }
8325
8326 impl std::default::Default for StorageType {
8327 fn default() -> Self {
8328 use std::convert::From;
8329 Self::from(0)
8330 }
8331 }
8332
8333 impl std::fmt::Display for StorageType {
8334 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8335 wkt::internal::display_enum(f, self.name(), self.value())
8336 }
8337 }
8338
8339 impl std::convert::From<i32> for StorageType {
8340 fn from(value: i32) -> Self {
8341 match value {
8342 0 => Self::Unspecified,
8343 1 => Self::Ssd,
8344 2 => Self::Hdd,
8345 _ => Self::UnknownValue(storage_type::UnknownValue(
8346 wkt::internal::UnknownEnumValue::Integer(value),
8347 )),
8348 }
8349 }
8350 }
8351
8352 impl std::convert::From<&str> for StorageType {
8353 fn from(value: &str) -> Self {
8354 use std::string::ToString;
8355 match value {
8356 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
8357 "SSD" => Self::Ssd,
8358 "HDD" => Self::Hdd,
8359 _ => Self::UnknownValue(storage_type::UnknownValue(
8360 wkt::internal::UnknownEnumValue::String(value.to_string()),
8361 )),
8362 }
8363 }
8364 }
8365
8366 impl serde::ser::Serialize for StorageType {
8367 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8368 where
8369 S: serde::Serializer,
8370 {
8371 match self {
8372 Self::Unspecified => serializer.serialize_i32(0),
8373 Self::Ssd => serializer.serialize_i32(1),
8374 Self::Hdd => serializer.serialize_i32(2),
8375 Self::UnknownValue(u) => u.0.serialize(serializer),
8376 }
8377 }
8378 }
8379
8380 impl<'de> serde::de::Deserialize<'de> for StorageType {
8381 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8382 where
8383 D: serde::Deserializer<'de>,
8384 {
8385 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
8386 ".google.cloud.baremetalsolution.v2.Volume.StorageType",
8387 ))
8388 }
8389 }
8390
8391 #[derive(Clone, Debug, PartialEq)]
8407 #[non_exhaustive]
8408 pub enum State {
8409 Unspecified,
8411 Creating,
8413 Ready,
8415 Deleting,
8417 Updating,
8419 CoolOff,
8422 UnknownValue(state::UnknownValue),
8427 }
8428
8429 #[doc(hidden)]
8430 pub mod state {
8431 #[allow(unused_imports)]
8432 use super::*;
8433 #[derive(Clone, Debug, PartialEq)]
8434 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8435 }
8436
8437 impl State {
8438 pub fn value(&self) -> std::option::Option<i32> {
8443 match self {
8444 Self::Unspecified => std::option::Option::Some(0),
8445 Self::Creating => std::option::Option::Some(1),
8446 Self::Ready => std::option::Option::Some(2),
8447 Self::Deleting => std::option::Option::Some(3),
8448 Self::Updating => std::option::Option::Some(4),
8449 Self::CoolOff => std::option::Option::Some(5),
8450 Self::UnknownValue(u) => u.0.value(),
8451 }
8452 }
8453
8454 pub fn name(&self) -> std::option::Option<&str> {
8459 match self {
8460 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8461 Self::Creating => std::option::Option::Some("CREATING"),
8462 Self::Ready => std::option::Option::Some("READY"),
8463 Self::Deleting => std::option::Option::Some("DELETING"),
8464 Self::Updating => std::option::Option::Some("UPDATING"),
8465 Self::CoolOff => std::option::Option::Some("COOL_OFF"),
8466 Self::UnknownValue(u) => u.0.name(),
8467 }
8468 }
8469 }
8470
8471 impl std::default::Default for State {
8472 fn default() -> Self {
8473 use std::convert::From;
8474 Self::from(0)
8475 }
8476 }
8477
8478 impl std::fmt::Display for State {
8479 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8480 wkt::internal::display_enum(f, self.name(), self.value())
8481 }
8482 }
8483
8484 impl std::convert::From<i32> for State {
8485 fn from(value: i32) -> Self {
8486 match value {
8487 0 => Self::Unspecified,
8488 1 => Self::Creating,
8489 2 => Self::Ready,
8490 3 => Self::Deleting,
8491 4 => Self::Updating,
8492 5 => Self::CoolOff,
8493 _ => Self::UnknownValue(state::UnknownValue(
8494 wkt::internal::UnknownEnumValue::Integer(value),
8495 )),
8496 }
8497 }
8498 }
8499
8500 impl std::convert::From<&str> for State {
8501 fn from(value: &str) -> Self {
8502 use std::string::ToString;
8503 match value {
8504 "STATE_UNSPECIFIED" => Self::Unspecified,
8505 "CREATING" => Self::Creating,
8506 "READY" => Self::Ready,
8507 "DELETING" => Self::Deleting,
8508 "UPDATING" => Self::Updating,
8509 "COOL_OFF" => Self::CoolOff,
8510 _ => Self::UnknownValue(state::UnknownValue(
8511 wkt::internal::UnknownEnumValue::String(value.to_string()),
8512 )),
8513 }
8514 }
8515 }
8516
8517 impl serde::ser::Serialize for State {
8518 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8519 where
8520 S: serde::Serializer,
8521 {
8522 match self {
8523 Self::Unspecified => serializer.serialize_i32(0),
8524 Self::Creating => serializer.serialize_i32(1),
8525 Self::Ready => serializer.serialize_i32(2),
8526 Self::Deleting => serializer.serialize_i32(3),
8527 Self::Updating => serializer.serialize_i32(4),
8528 Self::CoolOff => serializer.serialize_i32(5),
8529 Self::UnknownValue(u) => u.0.serialize(serializer),
8530 }
8531 }
8532 }
8533
8534 impl<'de> serde::de::Deserialize<'de> for State {
8535 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8536 where
8537 D: serde::Deserializer<'de>,
8538 {
8539 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8540 ".google.cloud.baremetalsolution.v2.Volume.State",
8541 ))
8542 }
8543 }
8544
8545 #[derive(Clone, Debug, PartialEq)]
8562 #[non_exhaustive]
8563 pub enum SnapshotAutoDeleteBehavior {
8564 Unspecified,
8566 Disabled,
8569 OldestFirst,
8571 NewestFirst,
8573 UnknownValue(snapshot_auto_delete_behavior::UnknownValue),
8578 }
8579
8580 #[doc(hidden)]
8581 pub mod snapshot_auto_delete_behavior {
8582 #[allow(unused_imports)]
8583 use super::*;
8584 #[derive(Clone, Debug, PartialEq)]
8585 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8586 }
8587
8588 impl SnapshotAutoDeleteBehavior {
8589 pub fn value(&self) -> std::option::Option<i32> {
8594 match self {
8595 Self::Unspecified => std::option::Option::Some(0),
8596 Self::Disabled => std::option::Option::Some(1),
8597 Self::OldestFirst => std::option::Option::Some(2),
8598 Self::NewestFirst => std::option::Option::Some(3),
8599 Self::UnknownValue(u) => u.0.value(),
8600 }
8601 }
8602
8603 pub fn name(&self) -> std::option::Option<&str> {
8608 match self {
8609 Self::Unspecified => {
8610 std::option::Option::Some("SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED")
8611 }
8612 Self::Disabled => std::option::Option::Some("DISABLED"),
8613 Self::OldestFirst => std::option::Option::Some("OLDEST_FIRST"),
8614 Self::NewestFirst => std::option::Option::Some("NEWEST_FIRST"),
8615 Self::UnknownValue(u) => u.0.name(),
8616 }
8617 }
8618 }
8619
8620 impl std::default::Default for SnapshotAutoDeleteBehavior {
8621 fn default() -> Self {
8622 use std::convert::From;
8623 Self::from(0)
8624 }
8625 }
8626
8627 impl std::fmt::Display for SnapshotAutoDeleteBehavior {
8628 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8629 wkt::internal::display_enum(f, self.name(), self.value())
8630 }
8631 }
8632
8633 impl std::convert::From<i32> for SnapshotAutoDeleteBehavior {
8634 fn from(value: i32) -> Self {
8635 match value {
8636 0 => Self::Unspecified,
8637 1 => Self::Disabled,
8638 2 => Self::OldestFirst,
8639 3 => Self::NewestFirst,
8640 _ => Self::UnknownValue(snapshot_auto_delete_behavior::UnknownValue(
8641 wkt::internal::UnknownEnumValue::Integer(value),
8642 )),
8643 }
8644 }
8645 }
8646
8647 impl std::convert::From<&str> for SnapshotAutoDeleteBehavior {
8648 fn from(value: &str) -> Self {
8649 use std::string::ToString;
8650 match value {
8651 "SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED" => Self::Unspecified,
8652 "DISABLED" => Self::Disabled,
8653 "OLDEST_FIRST" => Self::OldestFirst,
8654 "NEWEST_FIRST" => Self::NewestFirst,
8655 _ => Self::UnknownValue(snapshot_auto_delete_behavior::UnknownValue(
8656 wkt::internal::UnknownEnumValue::String(value.to_string()),
8657 )),
8658 }
8659 }
8660 }
8661
8662 impl serde::ser::Serialize for SnapshotAutoDeleteBehavior {
8663 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8664 where
8665 S: serde::Serializer,
8666 {
8667 match self {
8668 Self::Unspecified => serializer.serialize_i32(0),
8669 Self::Disabled => serializer.serialize_i32(1),
8670 Self::OldestFirst => serializer.serialize_i32(2),
8671 Self::NewestFirst => serializer.serialize_i32(3),
8672 Self::UnknownValue(u) => u.0.serialize(serializer),
8673 }
8674 }
8675 }
8676
8677 impl<'de> serde::de::Deserialize<'de> for SnapshotAutoDeleteBehavior {
8678 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8679 where
8680 D: serde::Deserializer<'de>,
8681 {
8682 deserializer.deserialize_any(
8683 wkt::internal::EnumVisitor::<SnapshotAutoDeleteBehavior>::new(
8684 ".google.cloud.baremetalsolution.v2.Volume.SnapshotAutoDeleteBehavior",
8685 ),
8686 )
8687 }
8688 }
8689
8690 #[derive(Clone, Debug, PartialEq)]
8706 #[non_exhaustive]
8707 pub enum Protocol {
8708 Unspecified,
8710 FibreChannel,
8712 Nfs,
8715 UnknownValue(protocol::UnknownValue),
8720 }
8721
8722 #[doc(hidden)]
8723 pub mod protocol {
8724 #[allow(unused_imports)]
8725 use super::*;
8726 #[derive(Clone, Debug, PartialEq)]
8727 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8728 }
8729
8730 impl Protocol {
8731 pub fn value(&self) -> std::option::Option<i32> {
8736 match self {
8737 Self::Unspecified => std::option::Option::Some(0),
8738 Self::FibreChannel => std::option::Option::Some(1),
8739 Self::Nfs => std::option::Option::Some(2),
8740 Self::UnknownValue(u) => u.0.value(),
8741 }
8742 }
8743
8744 pub fn name(&self) -> std::option::Option<&str> {
8749 match self {
8750 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
8751 Self::FibreChannel => std::option::Option::Some("FIBRE_CHANNEL"),
8752 Self::Nfs => std::option::Option::Some("NFS"),
8753 Self::UnknownValue(u) => u.0.name(),
8754 }
8755 }
8756 }
8757
8758 impl std::default::Default for Protocol {
8759 fn default() -> Self {
8760 use std::convert::From;
8761 Self::from(0)
8762 }
8763 }
8764
8765 impl std::fmt::Display for Protocol {
8766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8767 wkt::internal::display_enum(f, self.name(), self.value())
8768 }
8769 }
8770
8771 impl std::convert::From<i32> for Protocol {
8772 fn from(value: i32) -> Self {
8773 match value {
8774 0 => Self::Unspecified,
8775 1 => Self::FibreChannel,
8776 2 => Self::Nfs,
8777 _ => Self::UnknownValue(protocol::UnknownValue(
8778 wkt::internal::UnknownEnumValue::Integer(value),
8779 )),
8780 }
8781 }
8782 }
8783
8784 impl std::convert::From<&str> for Protocol {
8785 fn from(value: &str) -> Self {
8786 use std::string::ToString;
8787 match value {
8788 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
8789 "FIBRE_CHANNEL" => Self::FibreChannel,
8790 "NFS" => Self::Nfs,
8791 _ => Self::UnknownValue(protocol::UnknownValue(
8792 wkt::internal::UnknownEnumValue::String(value.to_string()),
8793 )),
8794 }
8795 }
8796 }
8797
8798 impl serde::ser::Serialize for Protocol {
8799 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8800 where
8801 S: serde::Serializer,
8802 {
8803 match self {
8804 Self::Unspecified => serializer.serialize_i32(0),
8805 Self::FibreChannel => serializer.serialize_i32(1),
8806 Self::Nfs => serializer.serialize_i32(2),
8807 Self::UnknownValue(u) => u.0.serialize(serializer),
8808 }
8809 }
8810 }
8811
8812 impl<'de> serde::de::Deserialize<'de> for Protocol {
8813 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8814 where
8815 D: serde::Deserializer<'de>,
8816 {
8817 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
8818 ".google.cloud.baremetalsolution.v2.Volume.Protocol",
8819 ))
8820 }
8821 }
8822
8823 #[derive(Clone, Debug, PartialEq)]
8839 #[non_exhaustive]
8840 pub enum WorkloadProfile {
8841 Unspecified,
8843 Generic,
8845 Hana,
8847 UnknownValue(workload_profile::UnknownValue),
8852 }
8853
8854 #[doc(hidden)]
8855 pub mod workload_profile {
8856 #[allow(unused_imports)]
8857 use super::*;
8858 #[derive(Clone, Debug, PartialEq)]
8859 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8860 }
8861
8862 impl WorkloadProfile {
8863 pub fn value(&self) -> std::option::Option<i32> {
8868 match self {
8869 Self::Unspecified => std::option::Option::Some(0),
8870 Self::Generic => std::option::Option::Some(1),
8871 Self::Hana => std::option::Option::Some(2),
8872 Self::UnknownValue(u) => u.0.value(),
8873 }
8874 }
8875
8876 pub fn name(&self) -> std::option::Option<&str> {
8881 match self {
8882 Self::Unspecified => std::option::Option::Some("WORKLOAD_PROFILE_UNSPECIFIED"),
8883 Self::Generic => std::option::Option::Some("GENERIC"),
8884 Self::Hana => std::option::Option::Some("HANA"),
8885 Self::UnknownValue(u) => u.0.name(),
8886 }
8887 }
8888 }
8889
8890 impl std::default::Default for WorkloadProfile {
8891 fn default() -> Self {
8892 use std::convert::From;
8893 Self::from(0)
8894 }
8895 }
8896
8897 impl std::fmt::Display for WorkloadProfile {
8898 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8899 wkt::internal::display_enum(f, self.name(), self.value())
8900 }
8901 }
8902
8903 impl std::convert::From<i32> for WorkloadProfile {
8904 fn from(value: i32) -> Self {
8905 match value {
8906 0 => Self::Unspecified,
8907 1 => Self::Generic,
8908 2 => Self::Hana,
8909 _ => Self::UnknownValue(workload_profile::UnknownValue(
8910 wkt::internal::UnknownEnumValue::Integer(value),
8911 )),
8912 }
8913 }
8914 }
8915
8916 impl std::convert::From<&str> for WorkloadProfile {
8917 fn from(value: &str) -> Self {
8918 use std::string::ToString;
8919 match value {
8920 "WORKLOAD_PROFILE_UNSPECIFIED" => Self::Unspecified,
8921 "GENERIC" => Self::Generic,
8922 "HANA" => Self::Hana,
8923 _ => Self::UnknownValue(workload_profile::UnknownValue(
8924 wkt::internal::UnknownEnumValue::String(value.to_string()),
8925 )),
8926 }
8927 }
8928 }
8929
8930 impl serde::ser::Serialize for WorkloadProfile {
8931 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8932 where
8933 S: serde::Serializer,
8934 {
8935 match self {
8936 Self::Unspecified => serializer.serialize_i32(0),
8937 Self::Generic => serializer.serialize_i32(1),
8938 Self::Hana => serializer.serialize_i32(2),
8939 Self::UnknownValue(u) => u.0.serialize(serializer),
8940 }
8941 }
8942 }
8943
8944 impl<'de> serde::de::Deserialize<'de> for WorkloadProfile {
8945 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8946 where
8947 D: serde::Deserializer<'de>,
8948 {
8949 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WorkloadProfile>::new(
8950 ".google.cloud.baremetalsolution.v2.Volume.WorkloadProfile",
8951 ))
8952 }
8953 }
8954}
8955
8956#[derive(Clone, Default, PartialEq)]
8958#[non_exhaustive]
8959pub struct GetVolumeRequest {
8960 pub name: std::string::String,
8962
8963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8964}
8965
8966impl GetVolumeRequest {
8967 pub fn new() -> Self {
8968 std::default::Default::default()
8969 }
8970
8971 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8973 self.name = v.into();
8974 self
8975 }
8976}
8977
8978impl wkt::message::Message for GetVolumeRequest {
8979 fn typename() -> &'static str {
8980 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetVolumeRequest"
8981 }
8982}
8983
8984#[derive(Clone, Default, PartialEq)]
8986#[non_exhaustive]
8987pub struct ListVolumesRequest {
8988 pub parent: std::string::String,
8990
8991 pub page_size: i32,
8994
8995 pub page_token: std::string::String,
8997
8998 pub filter: std::string::String,
9000
9001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9002}
9003
9004impl ListVolumesRequest {
9005 pub fn new() -> Self {
9006 std::default::Default::default()
9007 }
9008
9009 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9011 self.parent = v.into();
9012 self
9013 }
9014
9015 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9017 self.page_size = v.into();
9018 self
9019 }
9020
9021 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9023 self.page_token = v.into();
9024 self
9025 }
9026
9027 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9029 self.filter = v.into();
9030 self
9031 }
9032}
9033
9034impl wkt::message::Message for ListVolumesRequest {
9035 fn typename() -> &'static str {
9036 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListVolumesRequest"
9037 }
9038}
9039
9040#[derive(Clone, Default, PartialEq)]
9042#[non_exhaustive]
9043pub struct ListVolumesResponse {
9044 pub volumes: std::vec::Vec<crate::model::Volume>,
9046
9047 pub next_page_token: std::string::String,
9049
9050 pub unreachable: std::vec::Vec<std::string::String>,
9052
9053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9054}
9055
9056impl ListVolumesResponse {
9057 pub fn new() -> Self {
9058 std::default::Default::default()
9059 }
9060
9061 pub fn set_volumes<T, V>(mut self, v: T) -> Self
9063 where
9064 T: std::iter::IntoIterator<Item = V>,
9065 V: std::convert::Into<crate::model::Volume>,
9066 {
9067 use std::iter::Iterator;
9068 self.volumes = v.into_iter().map(|i| i.into()).collect();
9069 self
9070 }
9071
9072 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9074 self.next_page_token = v.into();
9075 self
9076 }
9077
9078 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9080 where
9081 T: std::iter::IntoIterator<Item = V>,
9082 V: std::convert::Into<std::string::String>,
9083 {
9084 use std::iter::Iterator;
9085 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9086 self
9087 }
9088}
9089
9090impl wkt::message::Message for ListVolumesResponse {
9091 fn typename() -> &'static str {
9092 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListVolumesResponse"
9093 }
9094}
9095
9096#[doc(hidden)]
9097impl gax::paginator::internal::PageableResponse for ListVolumesResponse {
9098 type PageItem = crate::model::Volume;
9099
9100 fn items(self) -> std::vec::Vec<Self::PageItem> {
9101 self.volumes
9102 }
9103
9104 fn next_page_token(&self) -> std::string::String {
9105 use std::clone::Clone;
9106 self.next_page_token.clone()
9107 }
9108}
9109
9110#[derive(Clone, Default, PartialEq)]
9112#[non_exhaustive]
9113pub struct UpdateVolumeRequest {
9114 pub volume: std::option::Option<crate::model::Volume>,
9119
9120 pub update_mask: std::option::Option<wkt::FieldMask>,
9124
9125 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9126}
9127
9128impl UpdateVolumeRequest {
9129 pub fn new() -> Self {
9130 std::default::Default::default()
9131 }
9132
9133 pub fn set_volume<T>(mut self, v: T) -> Self
9135 where
9136 T: std::convert::Into<crate::model::Volume>,
9137 {
9138 self.volume = std::option::Option::Some(v.into());
9139 self
9140 }
9141
9142 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
9144 where
9145 T: std::convert::Into<crate::model::Volume>,
9146 {
9147 self.volume = v.map(|x| x.into());
9148 self
9149 }
9150
9151 pub fn set_update_mask<T>(mut self, v: T) -> Self
9153 where
9154 T: std::convert::Into<wkt::FieldMask>,
9155 {
9156 self.update_mask = std::option::Option::Some(v.into());
9157 self
9158 }
9159
9160 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9162 where
9163 T: std::convert::Into<wkt::FieldMask>,
9164 {
9165 self.update_mask = v.map(|x| x.into());
9166 self
9167 }
9168}
9169
9170impl wkt::message::Message for UpdateVolumeRequest {
9171 fn typename() -> &'static str {
9172 "type.googleapis.com/google.cloud.baremetalsolution.v2.UpdateVolumeRequest"
9173 }
9174}
9175
9176#[derive(Clone, Default, PartialEq)]
9178#[non_exhaustive]
9179pub struct RenameVolumeRequest {
9180 pub name: std::string::String,
9183
9184 pub new_volume_id: std::string::String,
9186
9187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9188}
9189
9190impl RenameVolumeRequest {
9191 pub fn new() -> Self {
9192 std::default::Default::default()
9193 }
9194
9195 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9197 self.name = v.into();
9198 self
9199 }
9200
9201 pub fn set_new_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9203 self.new_volume_id = v.into();
9204 self
9205 }
9206}
9207
9208impl wkt::message::Message for RenameVolumeRequest {
9209 fn typename() -> &'static str {
9210 "type.googleapis.com/google.cloud.baremetalsolution.v2.RenameVolumeRequest"
9211 }
9212}
9213
9214#[derive(Clone, Default, PartialEq)]
9216#[non_exhaustive]
9217pub struct EvictVolumeRequest {
9218 pub name: std::string::String,
9220
9221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9222}
9223
9224impl EvictVolumeRequest {
9225 pub fn new() -> Self {
9226 std::default::Default::default()
9227 }
9228
9229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9231 self.name = v.into();
9232 self
9233 }
9234}
9235
9236impl wkt::message::Message for EvictVolumeRequest {
9237 fn typename() -> &'static str {
9238 "type.googleapis.com/google.cloud.baremetalsolution.v2.EvictVolumeRequest"
9239 }
9240}
9241
9242#[derive(Clone, Default, PartialEq)]
9244#[non_exhaustive]
9245pub struct ResizeVolumeRequest {
9246 pub volume: std::string::String,
9248
9249 pub size_gib: i64,
9251
9252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9253}
9254
9255impl ResizeVolumeRequest {
9256 pub fn new() -> Self {
9257 std::default::Default::default()
9258 }
9259
9260 pub fn set_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9262 self.volume = v.into();
9263 self
9264 }
9265
9266 pub fn set_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9268 self.size_gib = v.into();
9269 self
9270 }
9271}
9272
9273impl wkt::message::Message for ResizeVolumeRequest {
9274 fn typename() -> &'static str {
9275 "type.googleapis.com/google.cloud.baremetalsolution.v2.ResizeVolumeRequest"
9276 }
9277}
9278
9279#[derive(Clone, Default, PartialEq)]
9281#[non_exhaustive]
9282pub struct VolumeSnapshot {
9283 pub name: std::string::String,
9285
9286 pub id: std::string::String,
9288
9289 pub description: std::string::String,
9291
9292 pub create_time: std::option::Option<wkt::Timestamp>,
9294
9295 pub storage_volume: std::string::String,
9297
9298 pub r#type: crate::model::volume_snapshot::SnapshotType,
9301
9302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9303}
9304
9305impl VolumeSnapshot {
9306 pub fn new() -> Self {
9307 std::default::Default::default()
9308 }
9309
9310 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9312 self.name = v.into();
9313 self
9314 }
9315
9316 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9318 self.id = v.into();
9319 self
9320 }
9321
9322 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9324 self.description = v.into();
9325 self
9326 }
9327
9328 pub fn set_create_time<T>(mut self, v: T) -> Self
9330 where
9331 T: std::convert::Into<wkt::Timestamp>,
9332 {
9333 self.create_time = std::option::Option::Some(v.into());
9334 self
9335 }
9336
9337 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9339 where
9340 T: std::convert::Into<wkt::Timestamp>,
9341 {
9342 self.create_time = v.map(|x| x.into());
9343 self
9344 }
9345
9346 pub fn set_storage_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9348 self.storage_volume = v.into();
9349 self
9350 }
9351
9352 pub fn set_type<T: std::convert::Into<crate::model::volume_snapshot::SnapshotType>>(
9354 mut self,
9355 v: T,
9356 ) -> Self {
9357 self.r#type = v.into();
9358 self
9359 }
9360}
9361
9362impl wkt::message::Message for VolumeSnapshot {
9363 fn typename() -> &'static str {
9364 "type.googleapis.com/google.cloud.baremetalsolution.v2.VolumeSnapshot"
9365 }
9366}
9367
9368pub mod volume_snapshot {
9370 #[allow(unused_imports)]
9371 use super::*;
9372
9373 #[derive(Clone, Debug, PartialEq)]
9389 #[non_exhaustive]
9390 pub enum SnapshotType {
9391 Unspecified,
9393 AdHoc,
9395 Scheduled,
9397 UnknownValue(snapshot_type::UnknownValue),
9402 }
9403
9404 #[doc(hidden)]
9405 pub mod snapshot_type {
9406 #[allow(unused_imports)]
9407 use super::*;
9408 #[derive(Clone, Debug, PartialEq)]
9409 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9410 }
9411
9412 impl SnapshotType {
9413 pub fn value(&self) -> std::option::Option<i32> {
9418 match self {
9419 Self::Unspecified => std::option::Option::Some(0),
9420 Self::AdHoc => std::option::Option::Some(1),
9421 Self::Scheduled => std::option::Option::Some(2),
9422 Self::UnknownValue(u) => u.0.value(),
9423 }
9424 }
9425
9426 pub fn name(&self) -> std::option::Option<&str> {
9431 match self {
9432 Self::Unspecified => std::option::Option::Some("SNAPSHOT_TYPE_UNSPECIFIED"),
9433 Self::AdHoc => std::option::Option::Some("AD_HOC"),
9434 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
9435 Self::UnknownValue(u) => u.0.name(),
9436 }
9437 }
9438 }
9439
9440 impl std::default::Default for SnapshotType {
9441 fn default() -> Self {
9442 use std::convert::From;
9443 Self::from(0)
9444 }
9445 }
9446
9447 impl std::fmt::Display for SnapshotType {
9448 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9449 wkt::internal::display_enum(f, self.name(), self.value())
9450 }
9451 }
9452
9453 impl std::convert::From<i32> for SnapshotType {
9454 fn from(value: i32) -> Self {
9455 match value {
9456 0 => Self::Unspecified,
9457 1 => Self::AdHoc,
9458 2 => Self::Scheduled,
9459 _ => Self::UnknownValue(snapshot_type::UnknownValue(
9460 wkt::internal::UnknownEnumValue::Integer(value),
9461 )),
9462 }
9463 }
9464 }
9465
9466 impl std::convert::From<&str> for SnapshotType {
9467 fn from(value: &str) -> Self {
9468 use std::string::ToString;
9469 match value {
9470 "SNAPSHOT_TYPE_UNSPECIFIED" => Self::Unspecified,
9471 "AD_HOC" => Self::AdHoc,
9472 "SCHEDULED" => Self::Scheduled,
9473 _ => Self::UnknownValue(snapshot_type::UnknownValue(
9474 wkt::internal::UnknownEnumValue::String(value.to_string()),
9475 )),
9476 }
9477 }
9478 }
9479
9480 impl serde::ser::Serialize for SnapshotType {
9481 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9482 where
9483 S: serde::Serializer,
9484 {
9485 match self {
9486 Self::Unspecified => serializer.serialize_i32(0),
9487 Self::AdHoc => serializer.serialize_i32(1),
9488 Self::Scheduled => serializer.serialize_i32(2),
9489 Self::UnknownValue(u) => u.0.serialize(serializer),
9490 }
9491 }
9492 }
9493
9494 impl<'de> serde::de::Deserialize<'de> for SnapshotType {
9495 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9496 where
9497 D: serde::Deserializer<'de>,
9498 {
9499 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SnapshotType>::new(
9500 ".google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType",
9501 ))
9502 }
9503 }
9504}
9505
9506#[derive(Clone, Default, PartialEq)]
9508#[non_exhaustive]
9509pub struct GetVolumeSnapshotRequest {
9510 pub name: std::string::String,
9512
9513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9514}
9515
9516impl GetVolumeSnapshotRequest {
9517 pub fn new() -> Self {
9518 std::default::Default::default()
9519 }
9520
9521 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9523 self.name = v.into();
9524 self
9525 }
9526}
9527
9528impl wkt::message::Message for GetVolumeSnapshotRequest {
9529 fn typename() -> &'static str {
9530 "type.googleapis.com/google.cloud.baremetalsolution.v2.GetVolumeSnapshotRequest"
9531 }
9532}
9533
9534#[derive(Clone, Default, PartialEq)]
9536#[non_exhaustive]
9537pub struct ListVolumeSnapshotsRequest {
9538 pub parent: std::string::String,
9540
9541 pub page_size: i32,
9544
9545 pub page_token: std::string::String,
9547
9548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9549}
9550
9551impl ListVolumeSnapshotsRequest {
9552 pub fn new() -> Self {
9553 std::default::Default::default()
9554 }
9555
9556 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9558 self.parent = v.into();
9559 self
9560 }
9561
9562 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9564 self.page_size = v.into();
9565 self
9566 }
9567
9568 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9570 self.page_token = v.into();
9571 self
9572 }
9573}
9574
9575impl wkt::message::Message for ListVolumeSnapshotsRequest {
9576 fn typename() -> &'static str {
9577 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListVolumeSnapshotsRequest"
9578 }
9579}
9580
9581#[derive(Clone, Default, PartialEq)]
9583#[non_exhaustive]
9584pub struct ListVolumeSnapshotsResponse {
9585 pub volume_snapshots: std::vec::Vec<crate::model::VolumeSnapshot>,
9587
9588 pub next_page_token: std::string::String,
9590
9591 pub unreachable: std::vec::Vec<std::string::String>,
9593
9594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9595}
9596
9597impl ListVolumeSnapshotsResponse {
9598 pub fn new() -> Self {
9599 std::default::Default::default()
9600 }
9601
9602 pub fn set_volume_snapshots<T, V>(mut self, v: T) -> Self
9604 where
9605 T: std::iter::IntoIterator<Item = V>,
9606 V: std::convert::Into<crate::model::VolumeSnapshot>,
9607 {
9608 use std::iter::Iterator;
9609 self.volume_snapshots = v.into_iter().map(|i| i.into()).collect();
9610 self
9611 }
9612
9613 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9615 self.next_page_token = v.into();
9616 self
9617 }
9618
9619 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9621 where
9622 T: std::iter::IntoIterator<Item = V>,
9623 V: std::convert::Into<std::string::String>,
9624 {
9625 use std::iter::Iterator;
9626 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9627 self
9628 }
9629}
9630
9631impl wkt::message::Message for ListVolumeSnapshotsResponse {
9632 fn typename() -> &'static str {
9633 "type.googleapis.com/google.cloud.baremetalsolution.v2.ListVolumeSnapshotsResponse"
9634 }
9635}
9636
9637#[doc(hidden)]
9638impl gax::paginator::internal::PageableResponse for ListVolumeSnapshotsResponse {
9639 type PageItem = crate::model::VolumeSnapshot;
9640
9641 fn items(self) -> std::vec::Vec<Self::PageItem> {
9642 self.volume_snapshots
9643 }
9644
9645 fn next_page_token(&self) -> std::string::String {
9646 use std::clone::Clone;
9647 self.next_page_token.clone()
9648 }
9649}
9650
9651#[derive(Clone, Default, PartialEq)]
9653#[non_exhaustive]
9654pub struct DeleteVolumeSnapshotRequest {
9655 pub name: std::string::String,
9657
9658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9659}
9660
9661impl DeleteVolumeSnapshotRequest {
9662 pub fn new() -> Self {
9663 std::default::Default::default()
9664 }
9665
9666 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9668 self.name = v.into();
9669 self
9670 }
9671}
9672
9673impl wkt::message::Message for DeleteVolumeSnapshotRequest {
9674 fn typename() -> &'static str {
9675 "type.googleapis.com/google.cloud.baremetalsolution.v2.DeleteVolumeSnapshotRequest"
9676 }
9677}
9678
9679#[derive(Clone, Default, PartialEq)]
9681#[non_exhaustive]
9682pub struct CreateVolumeSnapshotRequest {
9683 pub parent: std::string::String,
9685
9686 pub volume_snapshot: std::option::Option<crate::model::VolumeSnapshot>,
9688
9689 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9690}
9691
9692impl CreateVolumeSnapshotRequest {
9693 pub fn new() -> Self {
9694 std::default::Default::default()
9695 }
9696
9697 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9699 self.parent = v.into();
9700 self
9701 }
9702
9703 pub fn set_volume_snapshot<T>(mut self, v: T) -> Self
9705 where
9706 T: std::convert::Into<crate::model::VolumeSnapshot>,
9707 {
9708 self.volume_snapshot = std::option::Option::Some(v.into());
9709 self
9710 }
9711
9712 pub fn set_or_clear_volume_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9714 where
9715 T: std::convert::Into<crate::model::VolumeSnapshot>,
9716 {
9717 self.volume_snapshot = v.map(|x| x.into());
9718 self
9719 }
9720}
9721
9722impl wkt::message::Message for CreateVolumeSnapshotRequest {
9723 fn typename() -> &'static str {
9724 "type.googleapis.com/google.cloud.baremetalsolution.v2.CreateVolumeSnapshotRequest"
9725 }
9726}
9727
9728#[derive(Clone, Default, PartialEq)]
9730#[non_exhaustive]
9731pub struct RestoreVolumeSnapshotRequest {
9732 pub volume_snapshot: std::string::String,
9735
9736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9737}
9738
9739impl RestoreVolumeSnapshotRequest {
9740 pub fn new() -> Self {
9741 std::default::Default::default()
9742 }
9743
9744 pub fn set_volume_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9746 self.volume_snapshot = v.into();
9747 self
9748 }
9749}
9750
9751impl wkt::message::Message for RestoreVolumeSnapshotRequest {
9752 fn typename() -> &'static str {
9753 "type.googleapis.com/google.cloud.baremetalsolution.v2.RestoreVolumeSnapshotRequest"
9754 }
9755}
9756
9757#[derive(Clone, Debug, PartialEq)]
9773#[non_exhaustive]
9774pub enum VolumePerformanceTier {
9775 Unspecified,
9777 Shared,
9779 Assigned,
9781 Ht,
9783 UnknownValue(volume_performance_tier::UnknownValue),
9788}
9789
9790#[doc(hidden)]
9791pub mod volume_performance_tier {
9792 #[allow(unused_imports)]
9793 use super::*;
9794 #[derive(Clone, Debug, PartialEq)]
9795 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9796}
9797
9798impl VolumePerformanceTier {
9799 pub fn value(&self) -> std::option::Option<i32> {
9804 match self {
9805 Self::Unspecified => std::option::Option::Some(0),
9806 Self::Shared => std::option::Option::Some(1),
9807 Self::Assigned => std::option::Option::Some(2),
9808 Self::Ht => std::option::Option::Some(3),
9809 Self::UnknownValue(u) => u.0.value(),
9810 }
9811 }
9812
9813 pub fn name(&self) -> std::option::Option<&str> {
9818 match self {
9819 Self::Unspecified => std::option::Option::Some("VOLUME_PERFORMANCE_TIER_UNSPECIFIED"),
9820 Self::Shared => std::option::Option::Some("VOLUME_PERFORMANCE_TIER_SHARED"),
9821 Self::Assigned => std::option::Option::Some("VOLUME_PERFORMANCE_TIER_ASSIGNED"),
9822 Self::Ht => std::option::Option::Some("VOLUME_PERFORMANCE_TIER_HT"),
9823 Self::UnknownValue(u) => u.0.name(),
9824 }
9825 }
9826}
9827
9828impl std::default::Default for VolumePerformanceTier {
9829 fn default() -> Self {
9830 use std::convert::From;
9831 Self::from(0)
9832 }
9833}
9834
9835impl std::fmt::Display for VolumePerformanceTier {
9836 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9837 wkt::internal::display_enum(f, self.name(), self.value())
9838 }
9839}
9840
9841impl std::convert::From<i32> for VolumePerformanceTier {
9842 fn from(value: i32) -> Self {
9843 match value {
9844 0 => Self::Unspecified,
9845 1 => Self::Shared,
9846 2 => Self::Assigned,
9847 3 => Self::Ht,
9848 _ => Self::UnknownValue(volume_performance_tier::UnknownValue(
9849 wkt::internal::UnknownEnumValue::Integer(value),
9850 )),
9851 }
9852 }
9853}
9854
9855impl std::convert::From<&str> for VolumePerformanceTier {
9856 fn from(value: &str) -> Self {
9857 use std::string::ToString;
9858 match value {
9859 "VOLUME_PERFORMANCE_TIER_UNSPECIFIED" => Self::Unspecified,
9860 "VOLUME_PERFORMANCE_TIER_SHARED" => Self::Shared,
9861 "VOLUME_PERFORMANCE_TIER_ASSIGNED" => Self::Assigned,
9862 "VOLUME_PERFORMANCE_TIER_HT" => Self::Ht,
9863 _ => Self::UnknownValue(volume_performance_tier::UnknownValue(
9864 wkt::internal::UnknownEnumValue::String(value.to_string()),
9865 )),
9866 }
9867 }
9868}
9869
9870impl serde::ser::Serialize for VolumePerformanceTier {
9871 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9872 where
9873 S: serde::Serializer,
9874 {
9875 match self {
9876 Self::Unspecified => serializer.serialize_i32(0),
9877 Self::Shared => serializer.serialize_i32(1),
9878 Self::Assigned => serializer.serialize_i32(2),
9879 Self::Ht => serializer.serialize_i32(3),
9880 Self::UnknownValue(u) => u.0.serialize(serializer),
9881 }
9882 }
9883}
9884
9885impl<'de> serde::de::Deserialize<'de> for VolumePerformanceTier {
9886 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9887 where
9888 D: serde::Deserializer<'de>,
9889 {
9890 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumePerformanceTier>::new(
9891 ".google.cloud.baremetalsolution.v2.VolumePerformanceTier",
9892 ))
9893 }
9894}
9895
9896#[derive(Clone, Debug, PartialEq)]
9912#[non_exhaustive]
9913pub enum WorkloadProfile {
9914 Unspecified,
9916 Generic,
9918 Hana,
9920 UnknownValue(workload_profile::UnknownValue),
9925}
9926
9927#[doc(hidden)]
9928pub mod workload_profile {
9929 #[allow(unused_imports)]
9930 use super::*;
9931 #[derive(Clone, Debug, PartialEq)]
9932 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9933}
9934
9935impl WorkloadProfile {
9936 pub fn value(&self) -> std::option::Option<i32> {
9941 match self {
9942 Self::Unspecified => std::option::Option::Some(0),
9943 Self::Generic => std::option::Option::Some(1),
9944 Self::Hana => std::option::Option::Some(2),
9945 Self::UnknownValue(u) => u.0.value(),
9946 }
9947 }
9948
9949 pub fn name(&self) -> std::option::Option<&str> {
9954 match self {
9955 Self::Unspecified => std::option::Option::Some("WORKLOAD_PROFILE_UNSPECIFIED"),
9956 Self::Generic => std::option::Option::Some("WORKLOAD_PROFILE_GENERIC"),
9957 Self::Hana => std::option::Option::Some("WORKLOAD_PROFILE_HANA"),
9958 Self::UnknownValue(u) => u.0.name(),
9959 }
9960 }
9961}
9962
9963impl std::default::Default for WorkloadProfile {
9964 fn default() -> Self {
9965 use std::convert::From;
9966 Self::from(0)
9967 }
9968}
9969
9970impl std::fmt::Display for WorkloadProfile {
9971 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9972 wkt::internal::display_enum(f, self.name(), self.value())
9973 }
9974}
9975
9976impl std::convert::From<i32> for WorkloadProfile {
9977 fn from(value: i32) -> Self {
9978 match value {
9979 0 => Self::Unspecified,
9980 1 => Self::Generic,
9981 2 => Self::Hana,
9982 _ => Self::UnknownValue(workload_profile::UnknownValue(
9983 wkt::internal::UnknownEnumValue::Integer(value),
9984 )),
9985 }
9986 }
9987}
9988
9989impl std::convert::From<&str> for WorkloadProfile {
9990 fn from(value: &str) -> Self {
9991 use std::string::ToString;
9992 match value {
9993 "WORKLOAD_PROFILE_UNSPECIFIED" => Self::Unspecified,
9994 "WORKLOAD_PROFILE_GENERIC" => Self::Generic,
9995 "WORKLOAD_PROFILE_HANA" => Self::Hana,
9996 _ => Self::UnknownValue(workload_profile::UnknownValue(
9997 wkt::internal::UnknownEnumValue::String(value.to_string()),
9998 )),
9999 }
10000 }
10001}
10002
10003impl serde::ser::Serialize for WorkloadProfile {
10004 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10005 where
10006 S: serde::Serializer,
10007 {
10008 match self {
10009 Self::Unspecified => serializer.serialize_i32(0),
10010 Self::Generic => serializer.serialize_i32(1),
10011 Self::Hana => serializer.serialize_i32(2),
10012 Self::UnknownValue(u) => u.0.serialize(serializer),
10013 }
10014 }
10015}
10016
10017impl<'de> serde::de::Deserialize<'de> for WorkloadProfile {
10018 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10019 where
10020 D: serde::Deserializer<'de>,
10021 {
10022 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WorkloadProfile>::new(
10023 ".google.cloud.baremetalsolution.v2.WorkloadProfile",
10024 ))
10025 }
10026}