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 iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct DiagnosticConfig {
45 pub gcs_bucket: std::string::String,
60
61 pub relative_path: std::string::String,
67
68 pub enable_repair_flag: bool,
70
71 pub enable_packet_capture_flag: bool,
73
74 pub enable_copy_home_files_flag: bool,
76
77 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
78}
79
80impl DiagnosticConfig {
81 pub fn new() -> Self {
82 std::default::Default::default()
83 }
84
85 pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
87 self.gcs_bucket = v.into();
88 self
89 }
90
91 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93 self.relative_path = v.into();
94 self
95 }
96
97 pub fn set_enable_repair_flag<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
99 self.enable_repair_flag = v.into();
100 self
101 }
102
103 pub fn set_enable_packet_capture_flag<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
105 self.enable_packet_capture_flag = v.into();
106 self
107 }
108
109 pub fn set_enable_copy_home_files_flag<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
111 self.enable_copy_home_files_flag = v.into();
112 self
113 }
114}
115
116impl wkt::message::Message for DiagnosticConfig {
117 fn typename() -> &'static str {
118 "type.googleapis.com/google.cloud.notebooks.v2.DiagnosticConfig"
119 }
120}
121
122#[derive(Clone, Default, PartialEq)]
124#[non_exhaustive]
125pub struct Event {
126 pub report_time: std::option::Option<wkt::Timestamp>,
128
129 pub r#type: crate::model::event::EventType,
131
132 pub details: std::collections::HashMap<std::string::String, std::string::String>,
134
135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
136}
137
138impl Event {
139 pub fn new() -> Self {
140 std::default::Default::default()
141 }
142
143 pub fn set_report_time<T>(mut self, v: T) -> Self
145 where
146 T: std::convert::Into<wkt::Timestamp>,
147 {
148 self.report_time = std::option::Option::Some(v.into());
149 self
150 }
151
152 pub fn set_or_clear_report_time<T>(mut self, v: std::option::Option<T>) -> Self
154 where
155 T: std::convert::Into<wkt::Timestamp>,
156 {
157 self.report_time = v.map(|x| x.into());
158 self
159 }
160
161 pub fn set_type<T: std::convert::Into<crate::model::event::EventType>>(mut self, v: T) -> Self {
163 self.r#type = v.into();
164 self
165 }
166
167 pub fn set_details<T, K, V>(mut self, v: T) -> Self
169 where
170 T: std::iter::IntoIterator<Item = (K, V)>,
171 K: std::convert::Into<std::string::String>,
172 V: std::convert::Into<std::string::String>,
173 {
174 use std::iter::Iterator;
175 self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
176 self
177 }
178}
179
180impl wkt::message::Message for Event {
181 fn typename() -> &'static str {
182 "type.googleapis.com/google.cloud.notebooks.v2.Event"
183 }
184}
185
186pub mod event {
188 #[allow(unused_imports)]
189 use super::*;
190
191 #[derive(Clone, Debug, PartialEq)]
207 #[non_exhaustive]
208 pub enum EventType {
209 Unspecified,
211 Idle,
213 Heartbeat,
217 Health,
220 Maintenance,
225 MetadataChange,
229 UnknownValue(event_type::UnknownValue),
234 }
235
236 #[doc(hidden)]
237 pub mod event_type {
238 #[allow(unused_imports)]
239 use super::*;
240 #[derive(Clone, Debug, PartialEq)]
241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
242 }
243
244 impl EventType {
245 pub fn value(&self) -> std::option::Option<i32> {
250 match self {
251 Self::Unspecified => std::option::Option::Some(0),
252 Self::Idle => std::option::Option::Some(1),
253 Self::Heartbeat => std::option::Option::Some(2),
254 Self::Health => std::option::Option::Some(3),
255 Self::Maintenance => std::option::Option::Some(4),
256 Self::MetadataChange => std::option::Option::Some(5),
257 Self::UnknownValue(u) => u.0.value(),
258 }
259 }
260
261 pub fn name(&self) -> std::option::Option<&str> {
266 match self {
267 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
268 Self::Idle => std::option::Option::Some("IDLE"),
269 Self::Heartbeat => std::option::Option::Some("HEARTBEAT"),
270 Self::Health => std::option::Option::Some("HEALTH"),
271 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
272 Self::MetadataChange => std::option::Option::Some("METADATA_CHANGE"),
273 Self::UnknownValue(u) => u.0.name(),
274 }
275 }
276 }
277
278 impl std::default::Default for EventType {
279 fn default() -> Self {
280 use std::convert::From;
281 Self::from(0)
282 }
283 }
284
285 impl std::fmt::Display for EventType {
286 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
287 wkt::internal::display_enum(f, self.name(), self.value())
288 }
289 }
290
291 impl std::convert::From<i32> for EventType {
292 fn from(value: i32) -> Self {
293 match value {
294 0 => Self::Unspecified,
295 1 => Self::Idle,
296 2 => Self::Heartbeat,
297 3 => Self::Health,
298 4 => Self::Maintenance,
299 5 => Self::MetadataChange,
300 _ => Self::UnknownValue(event_type::UnknownValue(
301 wkt::internal::UnknownEnumValue::Integer(value),
302 )),
303 }
304 }
305 }
306
307 impl std::convert::From<&str> for EventType {
308 fn from(value: &str) -> Self {
309 use std::string::ToString;
310 match value {
311 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
312 "IDLE" => Self::Idle,
313 "HEARTBEAT" => Self::Heartbeat,
314 "HEALTH" => Self::Health,
315 "MAINTENANCE" => Self::Maintenance,
316 "METADATA_CHANGE" => Self::MetadataChange,
317 _ => Self::UnknownValue(event_type::UnknownValue(
318 wkt::internal::UnknownEnumValue::String(value.to_string()),
319 )),
320 }
321 }
322 }
323
324 impl serde::ser::Serialize for EventType {
325 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
326 where
327 S: serde::Serializer,
328 {
329 match self {
330 Self::Unspecified => serializer.serialize_i32(0),
331 Self::Idle => serializer.serialize_i32(1),
332 Self::Heartbeat => serializer.serialize_i32(2),
333 Self::Health => serializer.serialize_i32(3),
334 Self::Maintenance => serializer.serialize_i32(4),
335 Self::MetadataChange => serializer.serialize_i32(5),
336 Self::UnknownValue(u) => u.0.serialize(serializer),
337 }
338 }
339 }
340
341 impl<'de> serde::de::Deserialize<'de> for EventType {
342 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
343 where
344 D: serde::Deserializer<'de>,
345 {
346 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
347 ".google.cloud.notebooks.v2.Event.EventType",
348 ))
349 }
350 }
351}
352
353#[derive(Clone, Default, PartialEq)]
355#[non_exhaustive]
356pub struct NetworkInterface {
357 pub network: std::string::String,
361
362 pub subnet: std::string::String,
366
367 pub nic_type: crate::model::network_interface::NicType,
370
371 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
372}
373
374impl NetworkInterface {
375 pub fn new() -> Self {
376 std::default::Default::default()
377 }
378
379 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
381 self.network = v.into();
382 self
383 }
384
385 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
387 self.subnet = v.into();
388 self
389 }
390
391 pub fn set_nic_type<T: std::convert::Into<crate::model::network_interface::NicType>>(
393 mut self,
394 v: T,
395 ) -> Self {
396 self.nic_type = v.into();
397 self
398 }
399}
400
401impl wkt::message::Message for NetworkInterface {
402 fn typename() -> &'static str {
403 "type.googleapis.com/google.cloud.notebooks.v2.NetworkInterface"
404 }
405}
406
407pub mod network_interface {
409 #[allow(unused_imports)]
410 use super::*;
411
412 #[derive(Clone, Debug, PartialEq)]
429 #[non_exhaustive]
430 pub enum NicType {
431 Unspecified,
433 VirtioNet,
435 Gvnic,
437 UnknownValue(nic_type::UnknownValue),
442 }
443
444 #[doc(hidden)]
445 pub mod nic_type {
446 #[allow(unused_imports)]
447 use super::*;
448 #[derive(Clone, Debug, PartialEq)]
449 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
450 }
451
452 impl NicType {
453 pub fn value(&self) -> std::option::Option<i32> {
458 match self {
459 Self::Unspecified => std::option::Option::Some(0),
460 Self::VirtioNet => std::option::Option::Some(1),
461 Self::Gvnic => std::option::Option::Some(2),
462 Self::UnknownValue(u) => u.0.value(),
463 }
464 }
465
466 pub fn name(&self) -> std::option::Option<&str> {
471 match self {
472 Self::Unspecified => std::option::Option::Some("NIC_TYPE_UNSPECIFIED"),
473 Self::VirtioNet => std::option::Option::Some("VIRTIO_NET"),
474 Self::Gvnic => std::option::Option::Some("GVNIC"),
475 Self::UnknownValue(u) => u.0.name(),
476 }
477 }
478 }
479
480 impl std::default::Default for NicType {
481 fn default() -> Self {
482 use std::convert::From;
483 Self::from(0)
484 }
485 }
486
487 impl std::fmt::Display for NicType {
488 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
489 wkt::internal::display_enum(f, self.name(), self.value())
490 }
491 }
492
493 impl std::convert::From<i32> for NicType {
494 fn from(value: i32) -> Self {
495 match value {
496 0 => Self::Unspecified,
497 1 => Self::VirtioNet,
498 2 => Self::Gvnic,
499 _ => Self::UnknownValue(nic_type::UnknownValue(
500 wkt::internal::UnknownEnumValue::Integer(value),
501 )),
502 }
503 }
504 }
505
506 impl std::convert::From<&str> for NicType {
507 fn from(value: &str) -> Self {
508 use std::string::ToString;
509 match value {
510 "NIC_TYPE_UNSPECIFIED" => Self::Unspecified,
511 "VIRTIO_NET" => Self::VirtioNet,
512 "GVNIC" => Self::Gvnic,
513 _ => Self::UnknownValue(nic_type::UnknownValue(
514 wkt::internal::UnknownEnumValue::String(value.to_string()),
515 )),
516 }
517 }
518 }
519
520 impl serde::ser::Serialize for NicType {
521 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
522 where
523 S: serde::Serializer,
524 {
525 match self {
526 Self::Unspecified => serializer.serialize_i32(0),
527 Self::VirtioNet => serializer.serialize_i32(1),
528 Self::Gvnic => serializer.serialize_i32(2),
529 Self::UnknownValue(u) => u.0.serialize(serializer),
530 }
531 }
532 }
533
534 impl<'de> serde::de::Deserialize<'de> for NicType {
535 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
536 where
537 D: serde::Deserializer<'de>,
538 {
539 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NicType>::new(
540 ".google.cloud.notebooks.v2.NetworkInterface.NicType",
541 ))
542 }
543 }
544}
545
546#[derive(Clone, Default, PartialEq)]
549#[non_exhaustive]
550pub struct VmImage {
551 pub project: std::string::String,
554
555 pub image: std::option::Option<crate::model::vm_image::Image>,
557
558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
559}
560
561impl VmImage {
562 pub fn new() -> Self {
563 std::default::Default::default()
564 }
565
566 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
568 self.project = v.into();
569 self
570 }
571
572 pub fn set_image<T: std::convert::Into<std::option::Option<crate::model::vm_image::Image>>>(
577 mut self,
578 v: T,
579 ) -> Self {
580 self.image = v.into();
581 self
582 }
583
584 pub fn name(&self) -> std::option::Option<&std::string::String> {
588 #[allow(unreachable_patterns)]
589 self.image.as_ref().and_then(|v| match v {
590 crate::model::vm_image::Image::Name(v) => std::option::Option::Some(v),
591 _ => std::option::Option::None,
592 })
593 }
594
595 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
601 self.image = std::option::Option::Some(crate::model::vm_image::Image::Name(v.into()));
602 self
603 }
604
605 pub fn family(&self) -> std::option::Option<&std::string::String> {
609 #[allow(unreachable_patterns)]
610 self.image.as_ref().and_then(|v| match v {
611 crate::model::vm_image::Image::Family(v) => std::option::Option::Some(v),
612 _ => std::option::Option::None,
613 })
614 }
615
616 pub fn set_family<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
622 self.image = std::option::Option::Some(crate::model::vm_image::Image::Family(v.into()));
623 self
624 }
625}
626
627impl wkt::message::Message for VmImage {
628 fn typename() -> &'static str {
629 "type.googleapis.com/google.cloud.notebooks.v2.VmImage"
630 }
631}
632
633pub mod vm_image {
635 #[allow(unused_imports)]
636 use super::*;
637
638 #[derive(Clone, Debug, PartialEq)]
640 #[non_exhaustive]
641 pub enum Image {
642 Name(std::string::String),
644 Family(std::string::String),
647 }
648}
649
650#[derive(Clone, Default, PartialEq)]
653#[non_exhaustive]
654pub struct ContainerImage {
655 pub repository: std::string::String,
658
659 pub tag: std::string::String,
662
663 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
664}
665
666impl ContainerImage {
667 pub fn new() -> Self {
668 std::default::Default::default()
669 }
670
671 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
673 self.repository = v.into();
674 self
675 }
676
677 pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
679 self.tag = v.into();
680 self
681 }
682}
683
684impl wkt::message::Message for ContainerImage {
685 fn typename() -> &'static str {
686 "type.googleapis.com/google.cloud.notebooks.v2.ContainerImage"
687 }
688}
689
690#[derive(Clone, Default, PartialEq)]
697#[non_exhaustive]
698pub struct AcceleratorConfig {
699 pub r#type: crate::model::accelerator_config::AcceleratorType,
701
702 pub core_count: i64,
704
705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
706}
707
708impl AcceleratorConfig {
709 pub fn new() -> Self {
710 std::default::Default::default()
711 }
712
713 pub fn set_type<T: std::convert::Into<crate::model::accelerator_config::AcceleratorType>>(
715 mut self,
716 v: T,
717 ) -> Self {
718 self.r#type = v.into();
719 self
720 }
721
722 pub fn set_core_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
724 self.core_count = v.into();
725 self
726 }
727}
728
729impl wkt::message::Message for AcceleratorConfig {
730 fn typename() -> &'static str {
731 "type.googleapis.com/google.cloud.notebooks.v2.AcceleratorConfig"
732 }
733}
734
735pub mod accelerator_config {
737 #[allow(unused_imports)]
738 use super::*;
739
740 #[derive(Clone, Debug, PartialEq)]
757 #[non_exhaustive]
758 pub enum AcceleratorType {
759 Unspecified,
761 NvidiaTeslaP100,
763 NvidiaTeslaV100,
765 NvidiaTeslaP4,
767 NvidiaTeslaT4,
769 NvidiaTeslaA100,
771 NvidiaA10080Gb,
773 NvidiaL4,
775 NvidiaTeslaT4Vws,
777 NvidiaTeslaP100Vws,
779 NvidiaTeslaP4Vws,
781 UnknownValue(accelerator_type::UnknownValue),
786 }
787
788 #[doc(hidden)]
789 pub mod accelerator_type {
790 #[allow(unused_imports)]
791 use super::*;
792 #[derive(Clone, Debug, PartialEq)]
793 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
794 }
795
796 impl AcceleratorType {
797 pub fn value(&self) -> std::option::Option<i32> {
802 match self {
803 Self::Unspecified => std::option::Option::Some(0),
804 Self::NvidiaTeslaP100 => std::option::Option::Some(2),
805 Self::NvidiaTeslaV100 => std::option::Option::Some(3),
806 Self::NvidiaTeslaP4 => std::option::Option::Some(4),
807 Self::NvidiaTeslaT4 => std::option::Option::Some(5),
808 Self::NvidiaTeslaA100 => std::option::Option::Some(11),
809 Self::NvidiaA10080Gb => std::option::Option::Some(12),
810 Self::NvidiaL4 => std::option::Option::Some(13),
811 Self::NvidiaTeslaT4Vws => std::option::Option::Some(8),
812 Self::NvidiaTeslaP100Vws => std::option::Option::Some(9),
813 Self::NvidiaTeslaP4Vws => std::option::Option::Some(10),
814 Self::UnknownValue(u) => u.0.value(),
815 }
816 }
817
818 pub fn name(&self) -> std::option::Option<&str> {
823 match self {
824 Self::Unspecified => std::option::Option::Some("ACCELERATOR_TYPE_UNSPECIFIED"),
825 Self::NvidiaTeslaP100 => std::option::Option::Some("NVIDIA_TESLA_P100"),
826 Self::NvidiaTeslaV100 => std::option::Option::Some("NVIDIA_TESLA_V100"),
827 Self::NvidiaTeslaP4 => std::option::Option::Some("NVIDIA_TESLA_P4"),
828 Self::NvidiaTeslaT4 => std::option::Option::Some("NVIDIA_TESLA_T4"),
829 Self::NvidiaTeslaA100 => std::option::Option::Some("NVIDIA_TESLA_A100"),
830 Self::NvidiaA10080Gb => std::option::Option::Some("NVIDIA_A100_80GB"),
831 Self::NvidiaL4 => std::option::Option::Some("NVIDIA_L4"),
832 Self::NvidiaTeslaT4Vws => std::option::Option::Some("NVIDIA_TESLA_T4_VWS"),
833 Self::NvidiaTeslaP100Vws => std::option::Option::Some("NVIDIA_TESLA_P100_VWS"),
834 Self::NvidiaTeslaP4Vws => std::option::Option::Some("NVIDIA_TESLA_P4_VWS"),
835 Self::UnknownValue(u) => u.0.name(),
836 }
837 }
838 }
839
840 impl std::default::Default for AcceleratorType {
841 fn default() -> Self {
842 use std::convert::From;
843 Self::from(0)
844 }
845 }
846
847 impl std::fmt::Display for AcceleratorType {
848 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
849 wkt::internal::display_enum(f, self.name(), self.value())
850 }
851 }
852
853 impl std::convert::From<i32> for AcceleratorType {
854 fn from(value: i32) -> Self {
855 match value {
856 0 => Self::Unspecified,
857 2 => Self::NvidiaTeslaP100,
858 3 => Self::NvidiaTeslaV100,
859 4 => Self::NvidiaTeslaP4,
860 5 => Self::NvidiaTeslaT4,
861 8 => Self::NvidiaTeslaT4Vws,
862 9 => Self::NvidiaTeslaP100Vws,
863 10 => Self::NvidiaTeslaP4Vws,
864 11 => Self::NvidiaTeslaA100,
865 12 => Self::NvidiaA10080Gb,
866 13 => Self::NvidiaL4,
867 _ => Self::UnknownValue(accelerator_type::UnknownValue(
868 wkt::internal::UnknownEnumValue::Integer(value),
869 )),
870 }
871 }
872 }
873
874 impl std::convert::From<&str> for AcceleratorType {
875 fn from(value: &str) -> Self {
876 use std::string::ToString;
877 match value {
878 "ACCELERATOR_TYPE_UNSPECIFIED" => Self::Unspecified,
879 "NVIDIA_TESLA_P100" => Self::NvidiaTeslaP100,
880 "NVIDIA_TESLA_V100" => Self::NvidiaTeslaV100,
881 "NVIDIA_TESLA_P4" => Self::NvidiaTeslaP4,
882 "NVIDIA_TESLA_T4" => Self::NvidiaTeslaT4,
883 "NVIDIA_TESLA_A100" => Self::NvidiaTeslaA100,
884 "NVIDIA_A100_80GB" => Self::NvidiaA10080Gb,
885 "NVIDIA_L4" => Self::NvidiaL4,
886 "NVIDIA_TESLA_T4_VWS" => Self::NvidiaTeslaT4Vws,
887 "NVIDIA_TESLA_P100_VWS" => Self::NvidiaTeslaP100Vws,
888 "NVIDIA_TESLA_P4_VWS" => Self::NvidiaTeslaP4Vws,
889 _ => Self::UnknownValue(accelerator_type::UnknownValue(
890 wkt::internal::UnknownEnumValue::String(value.to_string()),
891 )),
892 }
893 }
894 }
895
896 impl serde::ser::Serialize for AcceleratorType {
897 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
898 where
899 S: serde::Serializer,
900 {
901 match self {
902 Self::Unspecified => serializer.serialize_i32(0),
903 Self::NvidiaTeslaP100 => serializer.serialize_i32(2),
904 Self::NvidiaTeslaV100 => serializer.serialize_i32(3),
905 Self::NvidiaTeslaP4 => serializer.serialize_i32(4),
906 Self::NvidiaTeslaT4 => serializer.serialize_i32(5),
907 Self::NvidiaTeslaA100 => serializer.serialize_i32(11),
908 Self::NvidiaA10080Gb => serializer.serialize_i32(12),
909 Self::NvidiaL4 => serializer.serialize_i32(13),
910 Self::NvidiaTeslaT4Vws => serializer.serialize_i32(8),
911 Self::NvidiaTeslaP100Vws => serializer.serialize_i32(9),
912 Self::NvidiaTeslaP4Vws => serializer.serialize_i32(10),
913 Self::UnknownValue(u) => u.0.serialize(serializer),
914 }
915 }
916 }
917
918 impl<'de> serde::de::Deserialize<'de> for AcceleratorType {
919 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
920 where
921 D: serde::Deserializer<'de>,
922 {
923 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AcceleratorType>::new(
924 ".google.cloud.notebooks.v2.AcceleratorConfig.AcceleratorType",
925 ))
926 }
927 }
928}
929
930#[derive(Clone, Default, PartialEq)]
935#[non_exhaustive]
936pub struct ShieldedInstanceConfig {
937 pub enable_secure_boot: bool,
943
944 pub enable_vtpm: bool,
947
948 pub enable_integrity_monitoring: bool,
955
956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
957}
958
959impl ShieldedInstanceConfig {
960 pub fn new() -> Self {
961 std::default::Default::default()
962 }
963
964 pub fn set_enable_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
966 self.enable_secure_boot = v.into();
967 self
968 }
969
970 pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
972 self.enable_vtpm = v.into();
973 self
974 }
975
976 pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
978 self.enable_integrity_monitoring = v.into();
979 self
980 }
981}
982
983impl wkt::message::Message for ShieldedInstanceConfig {
984 fn typename() -> &'static str {
985 "type.googleapis.com/google.cloud.notebooks.v2.ShieldedInstanceConfig"
986 }
987}
988
989#[derive(Clone, Default, PartialEq)]
991#[non_exhaustive]
992pub struct GPUDriverConfig {
993 pub enable_gpu_driver: bool,
997
998 pub custom_gpu_driver_path: std::string::String,
1002
1003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1004}
1005
1006impl GPUDriverConfig {
1007 pub fn new() -> Self {
1008 std::default::Default::default()
1009 }
1010
1011 pub fn set_enable_gpu_driver<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1013 self.enable_gpu_driver = v.into();
1014 self
1015 }
1016
1017 pub fn set_custom_gpu_driver_path<T: std::convert::Into<std::string::String>>(
1019 mut self,
1020 v: T,
1021 ) -> Self {
1022 self.custom_gpu_driver_path = v.into();
1023 self
1024 }
1025}
1026
1027impl wkt::message::Message for GPUDriverConfig {
1028 fn typename() -> &'static str {
1029 "type.googleapis.com/google.cloud.notebooks.v2.GPUDriverConfig"
1030 }
1031}
1032
1033#[derive(Clone, Default, PartialEq)]
1035#[non_exhaustive]
1036pub struct DataDisk {
1037 pub disk_size_gb: i64,
1040
1041 pub disk_type: crate::model::DiskType,
1043
1044 pub disk_encryption: crate::model::DiskEncryption,
1047
1048 pub kms_key: std::string::String,
1054
1055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1056}
1057
1058impl DataDisk {
1059 pub fn new() -> Self {
1060 std::default::Default::default()
1061 }
1062
1063 pub fn set_disk_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1065 self.disk_size_gb = v.into();
1066 self
1067 }
1068
1069 pub fn set_disk_type<T: std::convert::Into<crate::model::DiskType>>(mut self, v: T) -> Self {
1071 self.disk_type = v.into();
1072 self
1073 }
1074
1075 pub fn set_disk_encryption<T: std::convert::Into<crate::model::DiskEncryption>>(
1077 mut self,
1078 v: T,
1079 ) -> Self {
1080 self.disk_encryption = v.into();
1081 self
1082 }
1083
1084 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1086 self.kms_key = v.into();
1087 self
1088 }
1089}
1090
1091impl wkt::message::Message for DataDisk {
1092 fn typename() -> &'static str {
1093 "type.googleapis.com/google.cloud.notebooks.v2.DataDisk"
1094 }
1095}
1096
1097#[derive(Clone, Default, PartialEq)]
1099#[non_exhaustive]
1100pub struct BootDisk {
1101 pub disk_size_gb: i64,
1105
1106 pub disk_type: crate::model::DiskType,
1108
1109 pub disk_encryption: crate::model::DiskEncryption,
1112
1113 pub kms_key: std::string::String,
1119
1120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1121}
1122
1123impl BootDisk {
1124 pub fn new() -> Self {
1125 std::default::Default::default()
1126 }
1127
1128 pub fn set_disk_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1130 self.disk_size_gb = v.into();
1131 self
1132 }
1133
1134 pub fn set_disk_type<T: std::convert::Into<crate::model::DiskType>>(mut self, v: T) -> Self {
1136 self.disk_type = v.into();
1137 self
1138 }
1139
1140 pub fn set_disk_encryption<T: std::convert::Into<crate::model::DiskEncryption>>(
1142 mut self,
1143 v: T,
1144 ) -> Self {
1145 self.disk_encryption = v.into();
1146 self
1147 }
1148
1149 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.kms_key = v.into();
1152 self
1153 }
1154}
1155
1156impl wkt::message::Message for BootDisk {
1157 fn typename() -> &'static str {
1158 "type.googleapis.com/google.cloud.notebooks.v2.BootDisk"
1159 }
1160}
1161
1162#[derive(Clone, Default, PartialEq)]
1164#[non_exhaustive]
1165pub struct ServiceAccount {
1166 pub email: std::string::String,
1168
1169 pub scopes: std::vec::Vec<std::string::String>,
1172
1173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1174}
1175
1176impl ServiceAccount {
1177 pub fn new() -> Self {
1178 std::default::Default::default()
1179 }
1180
1181 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1183 self.email = v.into();
1184 self
1185 }
1186
1187 pub fn set_scopes<T, V>(mut self, v: T) -> Self
1189 where
1190 T: std::iter::IntoIterator<Item = V>,
1191 V: std::convert::Into<std::string::String>,
1192 {
1193 use std::iter::Iterator;
1194 self.scopes = v.into_iter().map(|i| i.into()).collect();
1195 self
1196 }
1197}
1198
1199impl wkt::message::Message for ServiceAccount {
1200 fn typename() -> &'static str {
1201 "type.googleapis.com/google.cloud.notebooks.v2.ServiceAccount"
1202 }
1203}
1204
1205#[derive(Clone, Default, PartialEq)]
1208#[non_exhaustive]
1209pub struct GceSetup {
1210 pub machine_type: std::string::String,
1213
1214 pub accelerator_configs: std::vec::Vec<crate::model::AcceleratorConfig>,
1220
1221 pub service_accounts: std::vec::Vec<crate::model::ServiceAccount>,
1224
1225 pub boot_disk: std::option::Option<crate::model::BootDisk>,
1227
1228 pub data_disks: std::vec::Vec<crate::model::DataDisk>,
1231
1232 pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
1236
1237 pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
1240
1241 pub disable_public_ip: bool,
1243
1244 pub tags: std::vec::Vec<std::string::String>,
1247
1248 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
1250
1251 pub enable_ip_forwarding: bool,
1254
1255 pub gpu_driver_config: std::option::Option<crate::model::GPUDriverConfig>,
1257
1258 pub image: std::option::Option<crate::model::gce_setup::Image>,
1260
1261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1262}
1263
1264impl GceSetup {
1265 pub fn new() -> Self {
1266 std::default::Default::default()
1267 }
1268
1269 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.machine_type = v.into();
1272 self
1273 }
1274
1275 pub fn set_accelerator_configs<T, V>(mut self, v: T) -> Self
1277 where
1278 T: std::iter::IntoIterator<Item = V>,
1279 V: std::convert::Into<crate::model::AcceleratorConfig>,
1280 {
1281 use std::iter::Iterator;
1282 self.accelerator_configs = v.into_iter().map(|i| i.into()).collect();
1283 self
1284 }
1285
1286 pub fn set_service_accounts<T, V>(mut self, v: T) -> Self
1288 where
1289 T: std::iter::IntoIterator<Item = V>,
1290 V: std::convert::Into<crate::model::ServiceAccount>,
1291 {
1292 use std::iter::Iterator;
1293 self.service_accounts = v.into_iter().map(|i| i.into()).collect();
1294 self
1295 }
1296
1297 pub fn set_boot_disk<T>(mut self, v: T) -> Self
1299 where
1300 T: std::convert::Into<crate::model::BootDisk>,
1301 {
1302 self.boot_disk = std::option::Option::Some(v.into());
1303 self
1304 }
1305
1306 pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
1308 where
1309 T: std::convert::Into<crate::model::BootDisk>,
1310 {
1311 self.boot_disk = v.map(|x| x.into());
1312 self
1313 }
1314
1315 pub fn set_data_disks<T, V>(mut self, v: T) -> Self
1317 where
1318 T: std::iter::IntoIterator<Item = V>,
1319 V: std::convert::Into<crate::model::DataDisk>,
1320 {
1321 use std::iter::Iterator;
1322 self.data_disks = v.into_iter().map(|i| i.into()).collect();
1323 self
1324 }
1325
1326 pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
1328 where
1329 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
1330 {
1331 self.shielded_instance_config = std::option::Option::Some(v.into());
1332 self
1333 }
1334
1335 pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
1337 where
1338 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
1339 {
1340 self.shielded_instance_config = v.map(|x| x.into());
1341 self
1342 }
1343
1344 pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
1346 where
1347 T: std::iter::IntoIterator<Item = V>,
1348 V: std::convert::Into<crate::model::NetworkInterface>,
1349 {
1350 use std::iter::Iterator;
1351 self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
1352 self
1353 }
1354
1355 pub fn set_disable_public_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1357 self.disable_public_ip = v.into();
1358 self
1359 }
1360
1361 pub fn set_tags<T, V>(mut self, v: T) -> Self
1363 where
1364 T: std::iter::IntoIterator<Item = V>,
1365 V: std::convert::Into<std::string::String>,
1366 {
1367 use std::iter::Iterator;
1368 self.tags = v.into_iter().map(|i| i.into()).collect();
1369 self
1370 }
1371
1372 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
1374 where
1375 T: std::iter::IntoIterator<Item = (K, V)>,
1376 K: std::convert::Into<std::string::String>,
1377 V: std::convert::Into<std::string::String>,
1378 {
1379 use std::iter::Iterator;
1380 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1381 self
1382 }
1383
1384 pub fn set_enable_ip_forwarding<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1386 self.enable_ip_forwarding = v.into();
1387 self
1388 }
1389
1390 pub fn set_gpu_driver_config<T>(mut self, v: T) -> Self
1392 where
1393 T: std::convert::Into<crate::model::GPUDriverConfig>,
1394 {
1395 self.gpu_driver_config = std::option::Option::Some(v.into());
1396 self
1397 }
1398
1399 pub fn set_or_clear_gpu_driver_config<T>(mut self, v: std::option::Option<T>) -> Self
1401 where
1402 T: std::convert::Into<crate::model::GPUDriverConfig>,
1403 {
1404 self.gpu_driver_config = v.map(|x| x.into());
1405 self
1406 }
1407
1408 pub fn set_image<T: std::convert::Into<std::option::Option<crate::model::gce_setup::Image>>>(
1413 mut self,
1414 v: T,
1415 ) -> Self {
1416 self.image = v.into();
1417 self
1418 }
1419
1420 pub fn vm_image(&self) -> std::option::Option<&std::boxed::Box<crate::model::VmImage>> {
1424 #[allow(unreachable_patterns)]
1425 self.image.as_ref().and_then(|v| match v {
1426 crate::model::gce_setup::Image::VmImage(v) => std::option::Option::Some(v),
1427 _ => std::option::Option::None,
1428 })
1429 }
1430
1431 pub fn set_vm_image<T: std::convert::Into<std::boxed::Box<crate::model::VmImage>>>(
1437 mut self,
1438 v: T,
1439 ) -> Self {
1440 self.image = std::option::Option::Some(crate::model::gce_setup::Image::VmImage(v.into()));
1441 self
1442 }
1443
1444 pub fn container_image(
1448 &self,
1449 ) -> std::option::Option<&std::boxed::Box<crate::model::ContainerImage>> {
1450 #[allow(unreachable_patterns)]
1451 self.image.as_ref().and_then(|v| match v {
1452 crate::model::gce_setup::Image::ContainerImage(v) => std::option::Option::Some(v),
1453 _ => std::option::Option::None,
1454 })
1455 }
1456
1457 pub fn set_container_image<
1463 T: std::convert::Into<std::boxed::Box<crate::model::ContainerImage>>,
1464 >(
1465 mut self,
1466 v: T,
1467 ) -> Self {
1468 self.image =
1469 std::option::Option::Some(crate::model::gce_setup::Image::ContainerImage(v.into()));
1470 self
1471 }
1472}
1473
1474impl wkt::message::Message for GceSetup {
1475 fn typename() -> &'static str {
1476 "type.googleapis.com/google.cloud.notebooks.v2.GceSetup"
1477 }
1478}
1479
1480pub mod gce_setup {
1482 #[allow(unused_imports)]
1483 use super::*;
1484
1485 #[derive(Clone, Debug, PartialEq)]
1487 #[non_exhaustive]
1488 pub enum Image {
1489 VmImage(std::boxed::Box<crate::model::VmImage>),
1491 ContainerImage(std::boxed::Box<crate::model::ContainerImage>),
1493 }
1494}
1495
1496#[derive(Clone, Default, PartialEq)]
1498#[non_exhaustive]
1499pub struct UpgradeHistoryEntry {
1500 pub snapshot: std::string::String,
1503
1504 pub vm_image: std::string::String,
1506
1507 pub container_image: std::string::String,
1509
1510 pub framework: std::string::String,
1512
1513 pub version: std::string::String,
1515
1516 pub state: crate::model::upgrade_history_entry::State,
1518
1519 pub create_time: std::option::Option<wkt::Timestamp>,
1521
1522 pub action: crate::model::upgrade_history_entry::Action,
1524
1525 pub target_version: std::string::String,
1527
1528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1529}
1530
1531impl UpgradeHistoryEntry {
1532 pub fn new() -> Self {
1533 std::default::Default::default()
1534 }
1535
1536 pub fn set_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1538 self.snapshot = v.into();
1539 self
1540 }
1541
1542 pub fn set_vm_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1544 self.vm_image = v.into();
1545 self
1546 }
1547
1548 pub fn set_container_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1550 self.container_image = v.into();
1551 self
1552 }
1553
1554 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1556 self.framework = v.into();
1557 self
1558 }
1559
1560 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1562 self.version = v.into();
1563 self
1564 }
1565
1566 pub fn set_state<T: std::convert::Into<crate::model::upgrade_history_entry::State>>(
1568 mut self,
1569 v: T,
1570 ) -> Self {
1571 self.state = v.into();
1572 self
1573 }
1574
1575 pub fn set_create_time<T>(mut self, v: T) -> Self
1577 where
1578 T: std::convert::Into<wkt::Timestamp>,
1579 {
1580 self.create_time = std::option::Option::Some(v.into());
1581 self
1582 }
1583
1584 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1586 where
1587 T: std::convert::Into<wkt::Timestamp>,
1588 {
1589 self.create_time = v.map(|x| x.into());
1590 self
1591 }
1592
1593 pub fn set_action<T: std::convert::Into<crate::model::upgrade_history_entry::Action>>(
1595 mut self,
1596 v: T,
1597 ) -> Self {
1598 self.action = v.into();
1599 self
1600 }
1601
1602 pub fn set_target_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1604 self.target_version = v.into();
1605 self
1606 }
1607}
1608
1609impl wkt::message::Message for UpgradeHistoryEntry {
1610 fn typename() -> &'static str {
1611 "type.googleapis.com/google.cloud.notebooks.v2.UpgradeHistoryEntry"
1612 }
1613}
1614
1615pub mod upgrade_history_entry {
1617 #[allow(unused_imports)]
1618 use super::*;
1619
1620 #[derive(Clone, Debug, PartialEq)]
1636 #[non_exhaustive]
1637 pub enum State {
1638 Unspecified,
1640 Started,
1642 Succeeded,
1644 Failed,
1646 UnknownValue(state::UnknownValue),
1651 }
1652
1653 #[doc(hidden)]
1654 pub mod state {
1655 #[allow(unused_imports)]
1656 use super::*;
1657 #[derive(Clone, Debug, PartialEq)]
1658 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1659 }
1660
1661 impl State {
1662 pub fn value(&self) -> std::option::Option<i32> {
1667 match self {
1668 Self::Unspecified => std::option::Option::Some(0),
1669 Self::Started => std::option::Option::Some(1),
1670 Self::Succeeded => std::option::Option::Some(2),
1671 Self::Failed => std::option::Option::Some(3),
1672 Self::UnknownValue(u) => u.0.value(),
1673 }
1674 }
1675
1676 pub fn name(&self) -> std::option::Option<&str> {
1681 match self {
1682 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1683 Self::Started => std::option::Option::Some("STARTED"),
1684 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1685 Self::Failed => std::option::Option::Some("FAILED"),
1686 Self::UnknownValue(u) => u.0.name(),
1687 }
1688 }
1689 }
1690
1691 impl std::default::Default for State {
1692 fn default() -> Self {
1693 use std::convert::From;
1694 Self::from(0)
1695 }
1696 }
1697
1698 impl std::fmt::Display for State {
1699 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1700 wkt::internal::display_enum(f, self.name(), self.value())
1701 }
1702 }
1703
1704 impl std::convert::From<i32> for State {
1705 fn from(value: i32) -> Self {
1706 match value {
1707 0 => Self::Unspecified,
1708 1 => Self::Started,
1709 2 => Self::Succeeded,
1710 3 => Self::Failed,
1711 _ => Self::UnknownValue(state::UnknownValue(
1712 wkt::internal::UnknownEnumValue::Integer(value),
1713 )),
1714 }
1715 }
1716 }
1717
1718 impl std::convert::From<&str> for State {
1719 fn from(value: &str) -> Self {
1720 use std::string::ToString;
1721 match value {
1722 "STATE_UNSPECIFIED" => Self::Unspecified,
1723 "STARTED" => Self::Started,
1724 "SUCCEEDED" => Self::Succeeded,
1725 "FAILED" => Self::Failed,
1726 _ => Self::UnknownValue(state::UnknownValue(
1727 wkt::internal::UnknownEnumValue::String(value.to_string()),
1728 )),
1729 }
1730 }
1731 }
1732
1733 impl serde::ser::Serialize for State {
1734 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1735 where
1736 S: serde::Serializer,
1737 {
1738 match self {
1739 Self::Unspecified => serializer.serialize_i32(0),
1740 Self::Started => serializer.serialize_i32(1),
1741 Self::Succeeded => serializer.serialize_i32(2),
1742 Self::Failed => serializer.serialize_i32(3),
1743 Self::UnknownValue(u) => u.0.serialize(serializer),
1744 }
1745 }
1746 }
1747
1748 impl<'de> serde::de::Deserialize<'de> for State {
1749 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1750 where
1751 D: serde::Deserializer<'de>,
1752 {
1753 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1754 ".google.cloud.notebooks.v2.UpgradeHistoryEntry.State",
1755 ))
1756 }
1757 }
1758
1759 #[derive(Clone, Debug, PartialEq)]
1775 #[non_exhaustive]
1776 pub enum Action {
1777 Unspecified,
1779 Upgrade,
1781 Rollback,
1783 UnknownValue(action::UnknownValue),
1788 }
1789
1790 #[doc(hidden)]
1791 pub mod action {
1792 #[allow(unused_imports)]
1793 use super::*;
1794 #[derive(Clone, Debug, PartialEq)]
1795 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1796 }
1797
1798 impl Action {
1799 pub fn value(&self) -> std::option::Option<i32> {
1804 match self {
1805 Self::Unspecified => std::option::Option::Some(0),
1806 Self::Upgrade => std::option::Option::Some(1),
1807 Self::Rollback => std::option::Option::Some(2),
1808 Self::UnknownValue(u) => u.0.value(),
1809 }
1810 }
1811
1812 pub fn name(&self) -> std::option::Option<&str> {
1817 match self {
1818 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
1819 Self::Upgrade => std::option::Option::Some("UPGRADE"),
1820 Self::Rollback => std::option::Option::Some("ROLLBACK"),
1821 Self::UnknownValue(u) => u.0.name(),
1822 }
1823 }
1824 }
1825
1826 impl std::default::Default for Action {
1827 fn default() -> Self {
1828 use std::convert::From;
1829 Self::from(0)
1830 }
1831 }
1832
1833 impl std::fmt::Display for Action {
1834 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1835 wkt::internal::display_enum(f, self.name(), self.value())
1836 }
1837 }
1838
1839 impl std::convert::From<i32> for Action {
1840 fn from(value: i32) -> Self {
1841 match value {
1842 0 => Self::Unspecified,
1843 1 => Self::Upgrade,
1844 2 => Self::Rollback,
1845 _ => Self::UnknownValue(action::UnknownValue(
1846 wkt::internal::UnknownEnumValue::Integer(value),
1847 )),
1848 }
1849 }
1850 }
1851
1852 impl std::convert::From<&str> for Action {
1853 fn from(value: &str) -> Self {
1854 use std::string::ToString;
1855 match value {
1856 "ACTION_UNSPECIFIED" => Self::Unspecified,
1857 "UPGRADE" => Self::Upgrade,
1858 "ROLLBACK" => Self::Rollback,
1859 _ => Self::UnknownValue(action::UnknownValue(
1860 wkt::internal::UnknownEnumValue::String(value.to_string()),
1861 )),
1862 }
1863 }
1864 }
1865
1866 impl serde::ser::Serialize for Action {
1867 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1868 where
1869 S: serde::Serializer,
1870 {
1871 match self {
1872 Self::Unspecified => serializer.serialize_i32(0),
1873 Self::Upgrade => serializer.serialize_i32(1),
1874 Self::Rollback => serializer.serialize_i32(2),
1875 Self::UnknownValue(u) => u.0.serialize(serializer),
1876 }
1877 }
1878 }
1879
1880 impl<'de> serde::de::Deserialize<'de> for Action {
1881 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1882 where
1883 D: serde::Deserializer<'de>,
1884 {
1885 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
1886 ".google.cloud.notebooks.v2.UpgradeHistoryEntry.Action",
1887 ))
1888 }
1889 }
1890}
1891
1892#[derive(Clone, Default, PartialEq)]
1894#[non_exhaustive]
1895pub struct Instance {
1896 pub name: std::string::String,
1899
1900 pub proxy_uri: std::string::String,
1903
1904 pub instance_owners: std::vec::Vec<std::string::String>,
1911
1912 pub creator: std::string::String,
1915
1916 pub state: crate::model::State,
1918
1919 pub upgrade_history: std::vec::Vec<crate::model::UpgradeHistoryEntry>,
1921
1922 pub id: std::string::String,
1924
1925 pub health_state: crate::model::HealthState,
1927
1928 pub health_info: std::collections::HashMap<std::string::String, std::string::String>,
1941
1942 pub create_time: std::option::Option<wkt::Timestamp>,
1944
1945 pub update_time: std::option::Option<wkt::Timestamp>,
1947
1948 pub disable_proxy_access: bool,
1950
1951 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1954
1955 pub infrastructure: std::option::Option<crate::model::instance::Infrastructure>,
1957
1958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1959}
1960
1961impl Instance {
1962 pub fn new() -> Self {
1963 std::default::Default::default()
1964 }
1965
1966 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1968 self.name = v.into();
1969 self
1970 }
1971
1972 pub fn set_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1974 self.proxy_uri = v.into();
1975 self
1976 }
1977
1978 pub fn set_instance_owners<T, V>(mut self, v: T) -> Self
1980 where
1981 T: std::iter::IntoIterator<Item = V>,
1982 V: std::convert::Into<std::string::String>,
1983 {
1984 use std::iter::Iterator;
1985 self.instance_owners = v.into_iter().map(|i| i.into()).collect();
1986 self
1987 }
1988
1989 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1991 self.creator = v.into();
1992 self
1993 }
1994
1995 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
1997 self.state = v.into();
1998 self
1999 }
2000
2001 pub fn set_upgrade_history<T, V>(mut self, v: T) -> Self
2003 where
2004 T: std::iter::IntoIterator<Item = V>,
2005 V: std::convert::Into<crate::model::UpgradeHistoryEntry>,
2006 {
2007 use std::iter::Iterator;
2008 self.upgrade_history = v.into_iter().map(|i| i.into()).collect();
2009 self
2010 }
2011
2012 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2014 self.id = v.into();
2015 self
2016 }
2017
2018 pub fn set_health_state<T: std::convert::Into<crate::model::HealthState>>(
2020 mut self,
2021 v: T,
2022 ) -> Self {
2023 self.health_state = v.into();
2024 self
2025 }
2026
2027 pub fn set_health_info<T, K, V>(mut self, v: T) -> Self
2029 where
2030 T: std::iter::IntoIterator<Item = (K, V)>,
2031 K: std::convert::Into<std::string::String>,
2032 V: std::convert::Into<std::string::String>,
2033 {
2034 use std::iter::Iterator;
2035 self.health_info = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2036 self
2037 }
2038
2039 pub fn set_create_time<T>(mut self, v: T) -> Self
2041 where
2042 T: std::convert::Into<wkt::Timestamp>,
2043 {
2044 self.create_time = std::option::Option::Some(v.into());
2045 self
2046 }
2047
2048 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2050 where
2051 T: std::convert::Into<wkt::Timestamp>,
2052 {
2053 self.create_time = v.map(|x| x.into());
2054 self
2055 }
2056
2057 pub fn set_update_time<T>(mut self, v: T) -> Self
2059 where
2060 T: std::convert::Into<wkt::Timestamp>,
2061 {
2062 self.update_time = std::option::Option::Some(v.into());
2063 self
2064 }
2065
2066 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2068 where
2069 T: std::convert::Into<wkt::Timestamp>,
2070 {
2071 self.update_time = v.map(|x| x.into());
2072 self
2073 }
2074
2075 pub fn set_disable_proxy_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2077 self.disable_proxy_access = v.into();
2078 self
2079 }
2080
2081 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2083 where
2084 T: std::iter::IntoIterator<Item = (K, V)>,
2085 K: std::convert::Into<std::string::String>,
2086 V: std::convert::Into<std::string::String>,
2087 {
2088 use std::iter::Iterator;
2089 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2090 self
2091 }
2092
2093 pub fn set_infrastructure<
2098 T: std::convert::Into<std::option::Option<crate::model::instance::Infrastructure>>,
2099 >(
2100 mut self,
2101 v: T,
2102 ) -> Self {
2103 self.infrastructure = v.into();
2104 self
2105 }
2106
2107 pub fn gce_setup(&self) -> std::option::Option<&std::boxed::Box<crate::model::GceSetup>> {
2111 #[allow(unreachable_patterns)]
2112 self.infrastructure.as_ref().and_then(|v| match v {
2113 crate::model::instance::Infrastructure::GceSetup(v) => std::option::Option::Some(v),
2114 _ => std::option::Option::None,
2115 })
2116 }
2117
2118 pub fn set_gce_setup<T: std::convert::Into<std::boxed::Box<crate::model::GceSetup>>>(
2124 mut self,
2125 v: T,
2126 ) -> Self {
2127 self.infrastructure =
2128 std::option::Option::Some(crate::model::instance::Infrastructure::GceSetup(v.into()));
2129 self
2130 }
2131}
2132
2133impl wkt::message::Message for Instance {
2134 fn typename() -> &'static str {
2135 "type.googleapis.com/google.cloud.notebooks.v2.Instance"
2136 }
2137}
2138
2139pub mod instance {
2141 #[allow(unused_imports)]
2142 use super::*;
2143
2144 #[derive(Clone, Debug, PartialEq)]
2146 #[non_exhaustive]
2147 pub enum Infrastructure {
2148 GceSetup(std::boxed::Box<crate::model::GceSetup>),
2151 }
2152}
2153
2154#[derive(Clone, Default, PartialEq)]
2156#[non_exhaustive]
2157pub struct OperationMetadata {
2158 pub create_time: std::option::Option<wkt::Timestamp>,
2160
2161 pub end_time: std::option::Option<wkt::Timestamp>,
2163
2164 pub target: std::string::String,
2166
2167 pub verb: std::string::String,
2169
2170 pub status_message: std::string::String,
2172
2173 pub requested_cancellation: bool,
2181
2182 pub api_version: std::string::String,
2184
2185 pub endpoint: std::string::String,
2187
2188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2189}
2190
2191impl OperationMetadata {
2192 pub fn new() -> Self {
2193 std::default::Default::default()
2194 }
2195
2196 pub fn set_create_time<T>(mut self, v: T) -> Self
2198 where
2199 T: std::convert::Into<wkt::Timestamp>,
2200 {
2201 self.create_time = std::option::Option::Some(v.into());
2202 self
2203 }
2204
2205 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2207 where
2208 T: std::convert::Into<wkt::Timestamp>,
2209 {
2210 self.create_time = v.map(|x| x.into());
2211 self
2212 }
2213
2214 pub fn set_end_time<T>(mut self, v: T) -> Self
2216 where
2217 T: std::convert::Into<wkt::Timestamp>,
2218 {
2219 self.end_time = std::option::Option::Some(v.into());
2220 self
2221 }
2222
2223 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2225 where
2226 T: std::convert::Into<wkt::Timestamp>,
2227 {
2228 self.end_time = v.map(|x| x.into());
2229 self
2230 }
2231
2232 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2234 self.target = v.into();
2235 self
2236 }
2237
2238 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2240 self.verb = v.into();
2241 self
2242 }
2243
2244 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.status_message = v.into();
2247 self
2248 }
2249
2250 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2252 self.requested_cancellation = v.into();
2253 self
2254 }
2255
2256 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.api_version = v.into();
2259 self
2260 }
2261
2262 pub fn set_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.endpoint = v.into();
2265 self
2266 }
2267}
2268
2269impl wkt::message::Message for OperationMetadata {
2270 fn typename() -> &'static str {
2271 "type.googleapis.com/google.cloud.notebooks.v2.OperationMetadata"
2272 }
2273}
2274
2275#[derive(Clone, Default, PartialEq)]
2277#[non_exhaustive]
2278pub struct ListInstancesRequest {
2279 pub parent: std::string::String,
2282
2283 pub page_size: i32,
2285
2286 pub page_token: std::string::String,
2289
2290 pub order_by: std::string::String,
2293
2294 pub filter: std::string::String,
2296
2297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2298}
2299
2300impl ListInstancesRequest {
2301 pub fn new() -> Self {
2302 std::default::Default::default()
2303 }
2304
2305 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2307 self.parent = v.into();
2308 self
2309 }
2310
2311 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2313 self.page_size = v.into();
2314 self
2315 }
2316
2317 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2319 self.page_token = v.into();
2320 self
2321 }
2322
2323 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2325 self.order_by = v.into();
2326 self
2327 }
2328
2329 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2331 self.filter = v.into();
2332 self
2333 }
2334}
2335
2336impl wkt::message::Message for ListInstancesRequest {
2337 fn typename() -> &'static str {
2338 "type.googleapis.com/google.cloud.notebooks.v2.ListInstancesRequest"
2339 }
2340}
2341
2342#[derive(Clone, Default, PartialEq)]
2344#[non_exhaustive]
2345pub struct ListInstancesResponse {
2346 pub instances: std::vec::Vec<crate::model::Instance>,
2348
2349 pub next_page_token: std::string::String,
2352
2353 pub unreachable: std::vec::Vec<std::string::String>,
2357
2358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2359}
2360
2361impl ListInstancesResponse {
2362 pub fn new() -> Self {
2363 std::default::Default::default()
2364 }
2365
2366 pub fn set_instances<T, V>(mut self, v: T) -> Self
2368 where
2369 T: std::iter::IntoIterator<Item = V>,
2370 V: std::convert::Into<crate::model::Instance>,
2371 {
2372 use std::iter::Iterator;
2373 self.instances = v.into_iter().map(|i| i.into()).collect();
2374 self
2375 }
2376
2377 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2379 self.next_page_token = v.into();
2380 self
2381 }
2382
2383 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2385 where
2386 T: std::iter::IntoIterator<Item = V>,
2387 V: std::convert::Into<std::string::String>,
2388 {
2389 use std::iter::Iterator;
2390 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2391 self
2392 }
2393}
2394
2395impl wkt::message::Message for ListInstancesResponse {
2396 fn typename() -> &'static str {
2397 "type.googleapis.com/google.cloud.notebooks.v2.ListInstancesResponse"
2398 }
2399}
2400
2401#[doc(hidden)]
2402impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
2403 type PageItem = crate::model::Instance;
2404
2405 fn items(self) -> std::vec::Vec<Self::PageItem> {
2406 self.instances
2407 }
2408
2409 fn next_page_token(&self) -> std::string::String {
2410 use std::clone::Clone;
2411 self.next_page_token.clone()
2412 }
2413}
2414
2415#[derive(Clone, Default, PartialEq)]
2417#[non_exhaustive]
2418pub struct GetInstanceRequest {
2419 pub name: std::string::String,
2422
2423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2424}
2425
2426impl GetInstanceRequest {
2427 pub fn new() -> Self {
2428 std::default::Default::default()
2429 }
2430
2431 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2433 self.name = v.into();
2434 self
2435 }
2436}
2437
2438impl wkt::message::Message for GetInstanceRequest {
2439 fn typename() -> &'static str {
2440 "type.googleapis.com/google.cloud.notebooks.v2.GetInstanceRequest"
2441 }
2442}
2443
2444#[derive(Clone, Default, PartialEq)]
2446#[non_exhaustive]
2447pub struct CreateInstanceRequest {
2448 pub parent: std::string::String,
2451
2452 pub instance_id: std::string::String,
2454
2455 pub instance: std::option::Option<crate::model::Instance>,
2457
2458 pub request_id: std::string::String,
2460
2461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2462}
2463
2464impl CreateInstanceRequest {
2465 pub fn new() -> Self {
2466 std::default::Default::default()
2467 }
2468
2469 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2471 self.parent = v.into();
2472 self
2473 }
2474
2475 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2477 self.instance_id = v.into();
2478 self
2479 }
2480
2481 pub fn set_instance<T>(mut self, v: T) -> Self
2483 where
2484 T: std::convert::Into<crate::model::Instance>,
2485 {
2486 self.instance = std::option::Option::Some(v.into());
2487 self
2488 }
2489
2490 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2492 where
2493 T: std::convert::Into<crate::model::Instance>,
2494 {
2495 self.instance = v.map(|x| x.into());
2496 self
2497 }
2498
2499 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2501 self.request_id = v.into();
2502 self
2503 }
2504}
2505
2506impl wkt::message::Message for CreateInstanceRequest {
2507 fn typename() -> &'static str {
2508 "type.googleapis.com/google.cloud.notebooks.v2.CreateInstanceRequest"
2509 }
2510}
2511
2512#[derive(Clone, Default, PartialEq)]
2514#[non_exhaustive]
2515pub struct UpdateInstanceRequest {
2516 pub instance: std::option::Option<crate::model::Instance>,
2518
2519 pub update_mask: std::option::Option<wkt::FieldMask>,
2521
2522 pub request_id: std::string::String,
2524
2525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2526}
2527
2528impl UpdateInstanceRequest {
2529 pub fn new() -> Self {
2530 std::default::Default::default()
2531 }
2532
2533 pub fn set_instance<T>(mut self, v: T) -> Self
2535 where
2536 T: std::convert::Into<crate::model::Instance>,
2537 {
2538 self.instance = std::option::Option::Some(v.into());
2539 self
2540 }
2541
2542 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2544 where
2545 T: std::convert::Into<crate::model::Instance>,
2546 {
2547 self.instance = v.map(|x| x.into());
2548 self
2549 }
2550
2551 pub fn set_update_mask<T>(mut self, v: T) -> Self
2553 where
2554 T: std::convert::Into<wkt::FieldMask>,
2555 {
2556 self.update_mask = std::option::Option::Some(v.into());
2557 self
2558 }
2559
2560 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2562 where
2563 T: std::convert::Into<wkt::FieldMask>,
2564 {
2565 self.update_mask = v.map(|x| x.into());
2566 self
2567 }
2568
2569 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2571 self.request_id = v.into();
2572 self
2573 }
2574}
2575
2576impl wkt::message::Message for UpdateInstanceRequest {
2577 fn typename() -> &'static str {
2578 "type.googleapis.com/google.cloud.notebooks.v2.UpdateInstanceRequest"
2579 }
2580}
2581
2582#[derive(Clone, Default, PartialEq)]
2584#[non_exhaustive]
2585pub struct DeleteInstanceRequest {
2586 pub name: std::string::String,
2589
2590 pub request_id: std::string::String,
2592
2593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2594}
2595
2596impl DeleteInstanceRequest {
2597 pub fn new() -> Self {
2598 std::default::Default::default()
2599 }
2600
2601 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2603 self.name = v.into();
2604 self
2605 }
2606
2607 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2609 self.request_id = v.into();
2610 self
2611 }
2612}
2613
2614impl wkt::message::Message for DeleteInstanceRequest {
2615 fn typename() -> &'static str {
2616 "type.googleapis.com/google.cloud.notebooks.v2.DeleteInstanceRequest"
2617 }
2618}
2619
2620#[derive(Clone, Default, PartialEq)]
2622#[non_exhaustive]
2623pub struct StartInstanceRequest {
2624 pub name: std::string::String,
2627
2628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2629}
2630
2631impl StartInstanceRequest {
2632 pub fn new() -> Self {
2633 std::default::Default::default()
2634 }
2635
2636 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2638 self.name = v.into();
2639 self
2640 }
2641}
2642
2643impl wkt::message::Message for StartInstanceRequest {
2644 fn typename() -> &'static str {
2645 "type.googleapis.com/google.cloud.notebooks.v2.StartInstanceRequest"
2646 }
2647}
2648
2649#[derive(Clone, Default, PartialEq)]
2651#[non_exhaustive]
2652pub struct StopInstanceRequest {
2653 pub name: std::string::String,
2656
2657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2658}
2659
2660impl StopInstanceRequest {
2661 pub fn new() -> Self {
2662 std::default::Default::default()
2663 }
2664
2665 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2667 self.name = v.into();
2668 self
2669 }
2670}
2671
2672impl wkt::message::Message for StopInstanceRequest {
2673 fn typename() -> &'static str {
2674 "type.googleapis.com/google.cloud.notebooks.v2.StopInstanceRequest"
2675 }
2676}
2677
2678#[derive(Clone, Default, PartialEq)]
2680#[non_exhaustive]
2681pub struct ResetInstanceRequest {
2682 pub name: std::string::String,
2685
2686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2687}
2688
2689impl ResetInstanceRequest {
2690 pub fn new() -> Self {
2691 std::default::Default::default()
2692 }
2693
2694 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2696 self.name = v.into();
2697 self
2698 }
2699}
2700
2701impl wkt::message::Message for ResetInstanceRequest {
2702 fn typename() -> &'static str {
2703 "type.googleapis.com/google.cloud.notebooks.v2.ResetInstanceRequest"
2704 }
2705}
2706
2707#[derive(Clone, Default, PartialEq)]
2709#[non_exhaustive]
2710pub struct CheckInstanceUpgradabilityRequest {
2711 pub notebook_instance: std::string::String,
2714
2715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2716}
2717
2718impl CheckInstanceUpgradabilityRequest {
2719 pub fn new() -> Self {
2720 std::default::Default::default()
2721 }
2722
2723 pub fn set_notebook_instance<T: std::convert::Into<std::string::String>>(
2725 mut self,
2726 v: T,
2727 ) -> Self {
2728 self.notebook_instance = v.into();
2729 self
2730 }
2731}
2732
2733impl wkt::message::Message for CheckInstanceUpgradabilityRequest {
2734 fn typename() -> &'static str {
2735 "type.googleapis.com/google.cloud.notebooks.v2.CheckInstanceUpgradabilityRequest"
2736 }
2737}
2738
2739#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct CheckInstanceUpgradabilityResponse {
2743 pub upgradeable: bool,
2745
2746 pub upgrade_version: std::string::String,
2749
2750 pub upgrade_info: std::string::String,
2752
2753 pub upgrade_image: std::string::String,
2757
2758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2759}
2760
2761impl CheckInstanceUpgradabilityResponse {
2762 pub fn new() -> Self {
2763 std::default::Default::default()
2764 }
2765
2766 pub fn set_upgradeable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2768 self.upgradeable = v.into();
2769 self
2770 }
2771
2772 pub fn set_upgrade_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2774 self.upgrade_version = v.into();
2775 self
2776 }
2777
2778 pub fn set_upgrade_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2780 self.upgrade_info = v.into();
2781 self
2782 }
2783
2784 pub fn set_upgrade_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.upgrade_image = v.into();
2787 self
2788 }
2789}
2790
2791impl wkt::message::Message for CheckInstanceUpgradabilityResponse {
2792 fn typename() -> &'static str {
2793 "type.googleapis.com/google.cloud.notebooks.v2.CheckInstanceUpgradabilityResponse"
2794 }
2795}
2796
2797#[derive(Clone, Default, PartialEq)]
2799#[non_exhaustive]
2800pub struct UpgradeInstanceRequest {
2801 pub name: std::string::String,
2804
2805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2806}
2807
2808impl UpgradeInstanceRequest {
2809 pub fn new() -> Self {
2810 std::default::Default::default()
2811 }
2812
2813 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2815 self.name = v.into();
2816 self
2817 }
2818}
2819
2820impl wkt::message::Message for UpgradeInstanceRequest {
2821 fn typename() -> &'static str {
2822 "type.googleapis.com/google.cloud.notebooks.v2.UpgradeInstanceRequest"
2823 }
2824}
2825
2826#[derive(Clone, Default, PartialEq)]
2828#[non_exhaustive]
2829pub struct RollbackInstanceRequest {
2830 pub name: std::string::String,
2833
2834 pub target_snapshot: std::string::String,
2837
2838 pub revision_id: std::string::String,
2840
2841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2842}
2843
2844impl RollbackInstanceRequest {
2845 pub fn new() -> Self {
2846 std::default::Default::default()
2847 }
2848
2849 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2851 self.name = v.into();
2852 self
2853 }
2854
2855 pub fn set_target_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2857 self.target_snapshot = v.into();
2858 self
2859 }
2860
2861 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2863 self.revision_id = v.into();
2864 self
2865 }
2866}
2867
2868impl wkt::message::Message for RollbackInstanceRequest {
2869 fn typename() -> &'static str {
2870 "type.googleapis.com/google.cloud.notebooks.v2.RollbackInstanceRequest"
2871 }
2872}
2873
2874#[derive(Clone, Default, PartialEq)]
2876#[non_exhaustive]
2877pub struct DiagnoseInstanceRequest {
2878 pub name: std::string::String,
2881
2882 pub diagnostic_config: std::option::Option<crate::model::DiagnosticConfig>,
2884
2885 pub timeout_minutes: i32,
2887
2888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2889}
2890
2891impl DiagnoseInstanceRequest {
2892 pub fn new() -> Self {
2893 std::default::Default::default()
2894 }
2895
2896 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2898 self.name = v.into();
2899 self
2900 }
2901
2902 pub fn set_diagnostic_config<T>(mut self, v: T) -> Self
2904 where
2905 T: std::convert::Into<crate::model::DiagnosticConfig>,
2906 {
2907 self.diagnostic_config = std::option::Option::Some(v.into());
2908 self
2909 }
2910
2911 pub fn set_or_clear_diagnostic_config<T>(mut self, v: std::option::Option<T>) -> Self
2913 where
2914 T: std::convert::Into<crate::model::DiagnosticConfig>,
2915 {
2916 self.diagnostic_config = v.map(|x| x.into());
2917 self
2918 }
2919
2920 pub fn set_timeout_minutes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2922 self.timeout_minutes = v.into();
2923 self
2924 }
2925}
2926
2927impl wkt::message::Message for DiagnoseInstanceRequest {
2928 fn typename() -> &'static str {
2929 "type.googleapis.com/google.cloud.notebooks.v2.DiagnoseInstanceRequest"
2930 }
2931}
2932
2933#[derive(Clone, Debug, PartialEq)]
2949#[non_exhaustive]
2950pub enum DiskEncryption {
2951 Unspecified,
2953 Gmek,
2955 Cmek,
2957 UnknownValue(disk_encryption::UnknownValue),
2962}
2963
2964#[doc(hidden)]
2965pub mod disk_encryption {
2966 #[allow(unused_imports)]
2967 use super::*;
2968 #[derive(Clone, Debug, PartialEq)]
2969 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2970}
2971
2972impl DiskEncryption {
2973 pub fn value(&self) -> std::option::Option<i32> {
2978 match self {
2979 Self::Unspecified => std::option::Option::Some(0),
2980 Self::Gmek => std::option::Option::Some(1),
2981 Self::Cmek => std::option::Option::Some(2),
2982 Self::UnknownValue(u) => u.0.value(),
2983 }
2984 }
2985
2986 pub fn name(&self) -> std::option::Option<&str> {
2991 match self {
2992 Self::Unspecified => std::option::Option::Some("DISK_ENCRYPTION_UNSPECIFIED"),
2993 Self::Gmek => std::option::Option::Some("GMEK"),
2994 Self::Cmek => std::option::Option::Some("CMEK"),
2995 Self::UnknownValue(u) => u.0.name(),
2996 }
2997 }
2998}
2999
3000impl std::default::Default for DiskEncryption {
3001 fn default() -> Self {
3002 use std::convert::From;
3003 Self::from(0)
3004 }
3005}
3006
3007impl std::fmt::Display for DiskEncryption {
3008 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3009 wkt::internal::display_enum(f, self.name(), self.value())
3010 }
3011}
3012
3013impl std::convert::From<i32> for DiskEncryption {
3014 fn from(value: i32) -> Self {
3015 match value {
3016 0 => Self::Unspecified,
3017 1 => Self::Gmek,
3018 2 => Self::Cmek,
3019 _ => Self::UnknownValue(disk_encryption::UnknownValue(
3020 wkt::internal::UnknownEnumValue::Integer(value),
3021 )),
3022 }
3023 }
3024}
3025
3026impl std::convert::From<&str> for DiskEncryption {
3027 fn from(value: &str) -> Self {
3028 use std::string::ToString;
3029 match value {
3030 "DISK_ENCRYPTION_UNSPECIFIED" => Self::Unspecified,
3031 "GMEK" => Self::Gmek,
3032 "CMEK" => Self::Cmek,
3033 _ => Self::UnknownValue(disk_encryption::UnknownValue(
3034 wkt::internal::UnknownEnumValue::String(value.to_string()),
3035 )),
3036 }
3037 }
3038}
3039
3040impl serde::ser::Serialize for DiskEncryption {
3041 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3042 where
3043 S: serde::Serializer,
3044 {
3045 match self {
3046 Self::Unspecified => serializer.serialize_i32(0),
3047 Self::Gmek => serializer.serialize_i32(1),
3048 Self::Cmek => serializer.serialize_i32(2),
3049 Self::UnknownValue(u) => u.0.serialize(serializer),
3050 }
3051 }
3052}
3053
3054impl<'de> serde::de::Deserialize<'de> for DiskEncryption {
3055 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3056 where
3057 D: serde::Deserializer<'de>,
3058 {
3059 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiskEncryption>::new(
3060 ".google.cloud.notebooks.v2.DiskEncryption",
3061 ))
3062 }
3063}
3064
3065#[derive(Clone, Debug, PartialEq)]
3081#[non_exhaustive]
3082pub enum DiskType {
3083 Unspecified,
3085 PdStandard,
3087 PdSsd,
3089 PdBalanced,
3091 PdExtreme,
3093 UnknownValue(disk_type::UnknownValue),
3098}
3099
3100#[doc(hidden)]
3101pub mod disk_type {
3102 #[allow(unused_imports)]
3103 use super::*;
3104 #[derive(Clone, Debug, PartialEq)]
3105 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3106}
3107
3108impl DiskType {
3109 pub fn value(&self) -> std::option::Option<i32> {
3114 match self {
3115 Self::Unspecified => std::option::Option::Some(0),
3116 Self::PdStandard => std::option::Option::Some(1),
3117 Self::PdSsd => std::option::Option::Some(2),
3118 Self::PdBalanced => std::option::Option::Some(3),
3119 Self::PdExtreme => std::option::Option::Some(4),
3120 Self::UnknownValue(u) => u.0.value(),
3121 }
3122 }
3123
3124 pub fn name(&self) -> std::option::Option<&str> {
3129 match self {
3130 Self::Unspecified => std::option::Option::Some("DISK_TYPE_UNSPECIFIED"),
3131 Self::PdStandard => std::option::Option::Some("PD_STANDARD"),
3132 Self::PdSsd => std::option::Option::Some("PD_SSD"),
3133 Self::PdBalanced => std::option::Option::Some("PD_BALANCED"),
3134 Self::PdExtreme => std::option::Option::Some("PD_EXTREME"),
3135 Self::UnknownValue(u) => u.0.name(),
3136 }
3137 }
3138}
3139
3140impl std::default::Default for DiskType {
3141 fn default() -> Self {
3142 use std::convert::From;
3143 Self::from(0)
3144 }
3145}
3146
3147impl std::fmt::Display for DiskType {
3148 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3149 wkt::internal::display_enum(f, self.name(), self.value())
3150 }
3151}
3152
3153impl std::convert::From<i32> for DiskType {
3154 fn from(value: i32) -> Self {
3155 match value {
3156 0 => Self::Unspecified,
3157 1 => Self::PdStandard,
3158 2 => Self::PdSsd,
3159 3 => Self::PdBalanced,
3160 4 => Self::PdExtreme,
3161 _ => Self::UnknownValue(disk_type::UnknownValue(
3162 wkt::internal::UnknownEnumValue::Integer(value),
3163 )),
3164 }
3165 }
3166}
3167
3168impl std::convert::From<&str> for DiskType {
3169 fn from(value: &str) -> Self {
3170 use std::string::ToString;
3171 match value {
3172 "DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
3173 "PD_STANDARD" => Self::PdStandard,
3174 "PD_SSD" => Self::PdSsd,
3175 "PD_BALANCED" => Self::PdBalanced,
3176 "PD_EXTREME" => Self::PdExtreme,
3177 _ => Self::UnknownValue(disk_type::UnknownValue(
3178 wkt::internal::UnknownEnumValue::String(value.to_string()),
3179 )),
3180 }
3181 }
3182}
3183
3184impl serde::ser::Serialize for DiskType {
3185 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3186 where
3187 S: serde::Serializer,
3188 {
3189 match self {
3190 Self::Unspecified => serializer.serialize_i32(0),
3191 Self::PdStandard => serializer.serialize_i32(1),
3192 Self::PdSsd => serializer.serialize_i32(2),
3193 Self::PdBalanced => serializer.serialize_i32(3),
3194 Self::PdExtreme => serializer.serialize_i32(4),
3195 Self::UnknownValue(u) => u.0.serialize(serializer),
3196 }
3197 }
3198}
3199
3200impl<'de> serde::de::Deserialize<'de> for DiskType {
3201 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3202 where
3203 D: serde::Deserializer<'de>,
3204 {
3205 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiskType>::new(
3206 ".google.cloud.notebooks.v2.DiskType",
3207 ))
3208 }
3209}
3210
3211#[derive(Clone, Debug, PartialEq)]
3227#[non_exhaustive]
3228pub enum State {
3229 Unspecified,
3231 Starting,
3233 Provisioning,
3236 Active,
3238 Stopping,
3240 Stopped,
3242 Deleted,
3244 Upgrading,
3246 Initializing,
3248 Suspending,
3250 Suspended,
3252 UnknownValue(state::UnknownValue),
3257}
3258
3259#[doc(hidden)]
3260pub mod state {
3261 #[allow(unused_imports)]
3262 use super::*;
3263 #[derive(Clone, Debug, PartialEq)]
3264 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3265}
3266
3267impl State {
3268 pub fn value(&self) -> std::option::Option<i32> {
3273 match self {
3274 Self::Unspecified => std::option::Option::Some(0),
3275 Self::Starting => std::option::Option::Some(1),
3276 Self::Provisioning => std::option::Option::Some(2),
3277 Self::Active => std::option::Option::Some(3),
3278 Self::Stopping => std::option::Option::Some(4),
3279 Self::Stopped => std::option::Option::Some(5),
3280 Self::Deleted => std::option::Option::Some(6),
3281 Self::Upgrading => std::option::Option::Some(7),
3282 Self::Initializing => std::option::Option::Some(8),
3283 Self::Suspending => std::option::Option::Some(9),
3284 Self::Suspended => std::option::Option::Some(10),
3285 Self::UnknownValue(u) => u.0.value(),
3286 }
3287 }
3288
3289 pub fn name(&self) -> std::option::Option<&str> {
3294 match self {
3295 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3296 Self::Starting => std::option::Option::Some("STARTING"),
3297 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
3298 Self::Active => std::option::Option::Some("ACTIVE"),
3299 Self::Stopping => std::option::Option::Some("STOPPING"),
3300 Self::Stopped => std::option::Option::Some("STOPPED"),
3301 Self::Deleted => std::option::Option::Some("DELETED"),
3302 Self::Upgrading => std::option::Option::Some("UPGRADING"),
3303 Self::Initializing => std::option::Option::Some("INITIALIZING"),
3304 Self::Suspending => std::option::Option::Some("SUSPENDING"),
3305 Self::Suspended => std::option::Option::Some("SUSPENDED"),
3306 Self::UnknownValue(u) => u.0.name(),
3307 }
3308 }
3309}
3310
3311impl std::default::Default for State {
3312 fn default() -> Self {
3313 use std::convert::From;
3314 Self::from(0)
3315 }
3316}
3317
3318impl std::fmt::Display for State {
3319 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3320 wkt::internal::display_enum(f, self.name(), self.value())
3321 }
3322}
3323
3324impl std::convert::From<i32> for State {
3325 fn from(value: i32) -> Self {
3326 match value {
3327 0 => Self::Unspecified,
3328 1 => Self::Starting,
3329 2 => Self::Provisioning,
3330 3 => Self::Active,
3331 4 => Self::Stopping,
3332 5 => Self::Stopped,
3333 6 => Self::Deleted,
3334 7 => Self::Upgrading,
3335 8 => Self::Initializing,
3336 9 => Self::Suspending,
3337 10 => Self::Suspended,
3338 _ => Self::UnknownValue(state::UnknownValue(
3339 wkt::internal::UnknownEnumValue::Integer(value),
3340 )),
3341 }
3342 }
3343}
3344
3345impl std::convert::From<&str> for State {
3346 fn from(value: &str) -> Self {
3347 use std::string::ToString;
3348 match value {
3349 "STATE_UNSPECIFIED" => Self::Unspecified,
3350 "STARTING" => Self::Starting,
3351 "PROVISIONING" => Self::Provisioning,
3352 "ACTIVE" => Self::Active,
3353 "STOPPING" => Self::Stopping,
3354 "STOPPED" => Self::Stopped,
3355 "DELETED" => Self::Deleted,
3356 "UPGRADING" => Self::Upgrading,
3357 "INITIALIZING" => Self::Initializing,
3358 "SUSPENDING" => Self::Suspending,
3359 "SUSPENDED" => Self::Suspended,
3360 _ => Self::UnknownValue(state::UnknownValue(
3361 wkt::internal::UnknownEnumValue::String(value.to_string()),
3362 )),
3363 }
3364 }
3365}
3366
3367impl serde::ser::Serialize for State {
3368 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3369 where
3370 S: serde::Serializer,
3371 {
3372 match self {
3373 Self::Unspecified => serializer.serialize_i32(0),
3374 Self::Starting => serializer.serialize_i32(1),
3375 Self::Provisioning => serializer.serialize_i32(2),
3376 Self::Active => serializer.serialize_i32(3),
3377 Self::Stopping => serializer.serialize_i32(4),
3378 Self::Stopped => serializer.serialize_i32(5),
3379 Self::Deleted => serializer.serialize_i32(6),
3380 Self::Upgrading => serializer.serialize_i32(7),
3381 Self::Initializing => serializer.serialize_i32(8),
3382 Self::Suspending => serializer.serialize_i32(9),
3383 Self::Suspended => serializer.serialize_i32(10),
3384 Self::UnknownValue(u) => u.0.serialize(serializer),
3385 }
3386 }
3387}
3388
3389impl<'de> serde::de::Deserialize<'de> for State {
3390 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3391 where
3392 D: serde::Deserializer<'de>,
3393 {
3394 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3395 ".google.cloud.notebooks.v2.State",
3396 ))
3397 }
3398}
3399
3400#[derive(Clone, Debug, PartialEq)]
3416#[non_exhaustive]
3417pub enum HealthState {
3418 Unspecified,
3420 Healthy,
3424 Unhealthy,
3428 AgentNotInstalled,
3431 AgentNotRunning,
3434 UnknownValue(health_state::UnknownValue),
3439}
3440
3441#[doc(hidden)]
3442pub mod health_state {
3443 #[allow(unused_imports)]
3444 use super::*;
3445 #[derive(Clone, Debug, PartialEq)]
3446 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3447}
3448
3449impl HealthState {
3450 pub fn value(&self) -> std::option::Option<i32> {
3455 match self {
3456 Self::Unspecified => std::option::Option::Some(0),
3457 Self::Healthy => std::option::Option::Some(1),
3458 Self::Unhealthy => std::option::Option::Some(2),
3459 Self::AgentNotInstalled => std::option::Option::Some(3),
3460 Self::AgentNotRunning => std::option::Option::Some(4),
3461 Self::UnknownValue(u) => u.0.value(),
3462 }
3463 }
3464
3465 pub fn name(&self) -> std::option::Option<&str> {
3470 match self {
3471 Self::Unspecified => std::option::Option::Some("HEALTH_STATE_UNSPECIFIED"),
3472 Self::Healthy => std::option::Option::Some("HEALTHY"),
3473 Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
3474 Self::AgentNotInstalled => std::option::Option::Some("AGENT_NOT_INSTALLED"),
3475 Self::AgentNotRunning => std::option::Option::Some("AGENT_NOT_RUNNING"),
3476 Self::UnknownValue(u) => u.0.name(),
3477 }
3478 }
3479}
3480
3481impl std::default::Default for HealthState {
3482 fn default() -> Self {
3483 use std::convert::From;
3484 Self::from(0)
3485 }
3486}
3487
3488impl std::fmt::Display for HealthState {
3489 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3490 wkt::internal::display_enum(f, self.name(), self.value())
3491 }
3492}
3493
3494impl std::convert::From<i32> for HealthState {
3495 fn from(value: i32) -> Self {
3496 match value {
3497 0 => Self::Unspecified,
3498 1 => Self::Healthy,
3499 2 => Self::Unhealthy,
3500 3 => Self::AgentNotInstalled,
3501 4 => Self::AgentNotRunning,
3502 _ => Self::UnknownValue(health_state::UnknownValue(
3503 wkt::internal::UnknownEnumValue::Integer(value),
3504 )),
3505 }
3506 }
3507}
3508
3509impl std::convert::From<&str> for HealthState {
3510 fn from(value: &str) -> Self {
3511 use std::string::ToString;
3512 match value {
3513 "HEALTH_STATE_UNSPECIFIED" => Self::Unspecified,
3514 "HEALTHY" => Self::Healthy,
3515 "UNHEALTHY" => Self::Unhealthy,
3516 "AGENT_NOT_INSTALLED" => Self::AgentNotInstalled,
3517 "AGENT_NOT_RUNNING" => Self::AgentNotRunning,
3518 _ => Self::UnknownValue(health_state::UnknownValue(
3519 wkt::internal::UnknownEnumValue::String(value.to_string()),
3520 )),
3521 }
3522 }
3523}
3524
3525impl serde::ser::Serialize for HealthState {
3526 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3527 where
3528 S: serde::Serializer,
3529 {
3530 match self {
3531 Self::Unspecified => serializer.serialize_i32(0),
3532 Self::Healthy => serializer.serialize_i32(1),
3533 Self::Unhealthy => serializer.serialize_i32(2),
3534 Self::AgentNotInstalled => serializer.serialize_i32(3),
3535 Self::AgentNotRunning => serializer.serialize_i32(4),
3536 Self::UnknownValue(u) => u.0.serialize(serializer),
3537 }
3538 }
3539}
3540
3541impl<'de> serde::de::Deserialize<'de> for HealthState {
3542 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3543 where
3544 D: serde::Deserializer<'de>,
3545 {
3546 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthState>::new(
3547 ".google.cloud.notebooks.v2.HealthState",
3548 ))
3549 }
3550}