google_cloud_baremetalsolution_v2/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Represents the metadata from a long-running operation.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct OperationMetadata {
44    /// Output only. The time the operation was created.
45    pub create_time: std::option::Option<wkt::Timestamp>,
46
47    /// Output only. The time the operation finished running.
48    pub end_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. Server-defined resource path for the target of the operation.
51    pub target: std::string::String,
52
53    /// Output only. Name of the action executed by the operation.
54    pub verb: std::string::String,
55
56    /// Output only. Human-readable status of the operation, if any.
57    pub status_message: std::string::String,
58
59    /// Output only. Identifies whether the user requested the cancellation
60    /// of the operation. Operations that have been successfully cancelled
61    /// have [Operation.error][] value with a
62    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
63    /// `Code.CANCELLED`.
64    ///
65    /// [google.rpc.Status.code]: rpc::model::Status::code
66    pub requested_cancellation: bool,
67
68    /// Output only. API version used with the operation.
69    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    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
80    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    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
89    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    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
98    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    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
107    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    /// Sets the value of [target][crate::model::OperationMetadata::target].
116    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    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
122    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    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
128    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    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
134    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    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
140    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/// Response message from resetting a server.
153#[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/// A server.
172#[derive(Clone, Default, PartialEq)]
173#[non_exhaustive]
174pub struct Instance {
175    /// Immutable. The resource name of this `Instance`.
176    /// Resource names are schemeless URIs that follow the conventions in
177    /// <https://cloud.google.com/apis/design/resource_names>.
178    /// Format:
179    /// `projects/{project}/locations/{location}/instances/{instance}`
180    pub name: std::string::String,
181
182    /// Output only. An identifier for the `Instance`, generated by the backend.
183    pub id: std::string::String,
184
185    /// Output only. Create a time stamp.
186    pub create_time: std::option::Option<wkt::Timestamp>,
187
188    /// Output only. Update a time stamp.
189    pub update_time: std::option::Option<wkt::Timestamp>,
190
191    /// Immutable. The server type.
192    /// [Available server
193    /// types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
194    pub machine_type: std::string::String,
195
196    /// Output only. The state of the server.
197    pub state: crate::model::instance::State,
198
199    /// True if you enable hyperthreading for the server, otherwise false.
200    /// The default value is false.
201    pub hyperthreading_enabled: bool,
202
203    /// Labels as key value pairs.
204    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
205
206    /// Immutable. List of LUNs associated with this server.
207    pub luns: std::vec::Vec<crate::model::Lun>,
208
209    /// Input only. List of Volumes to attach to this Instance on creation.
210    /// This field won't be populated in Get/List responses.
211    pub volumes: std::vec::Vec<crate::model::Volume>,
212
213    /// Output only. List of networks associated with this server.
214    pub networks: std::vec::Vec<crate::model::Network>,
215
216    /// Output only. True if the interactive serial console feature is enabled for
217    /// the instance, false otherwise. The default value is false.
218    pub interactive_serial_console_enabled: bool,
219
220    /// The OS image currently installed on the server.
221    pub os_image: std::string::String,
222
223    /// Immutable. Pod name.
224    /// Pod is an independent part of infrastructure.
225    /// Instance can be connected to the assets (networks, volumes) allocated
226    /// in the same pod only.
227    pub pod: std::string::String,
228
229    /// Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
230    /// Generally, the template name follows the syntax of
231    /// "bond<bond_mode>" or "nic".
232    pub network_template: std::string::String,
233
234    /// List of logical interfaces for the instance. The number of logical
235    /// interfaces will be the same as number of hardware bond/nic on the chosen
236    /// network template. For the non-multivlan configurations (for eg, existing
237    /// servers) that use existing default network template (bondaa-bondaa), both
238    /// the Instance.networks field and the Instance.logical_interfaces fields will
239    /// be filled to ensure backward compatibility. For the others, only
240    /// Instance.logical_interfaces will be filled.
241    pub logical_interfaces: std::vec::Vec<crate::model::LogicalInterface>,
242
243    /// Output only. Text field about info for logging in.
244    pub login_info: std::string::String,
245
246    /// The workload profile for the instance.
247    pub workload_profile: crate::model::WorkloadProfile,
248
249    /// Output only. The firmware version for the instance.
250    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    /// Sets the value of [name][crate::model::Instance::name].
261    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    /// Sets the value of [id][crate::model::Instance::id].
267    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    /// Sets the value of [create_time][crate::model::Instance::create_time].
273    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    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
282    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    /// Sets the value of [update_time][crate::model::Instance::update_time].
291    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    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
300    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    /// Sets the value of [machine_type][crate::model::Instance::machine_type].
309    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    /// Sets the value of [state][crate::model::Instance::state].
315    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    /// Sets the value of [hyperthreading_enabled][crate::model::Instance::hyperthreading_enabled].
321    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    /// Sets the value of [labels][crate::model::Instance::labels].
327    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    /// Sets the value of [luns][crate::model::Instance::luns].
339    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    /// Sets the value of [volumes][crate::model::Instance::volumes].
350    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    /// Sets the value of [networks][crate::model::Instance::networks].
361    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    /// Sets the value of [interactive_serial_console_enabled][crate::model::Instance::interactive_serial_console_enabled].
372    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    /// Sets the value of [os_image][crate::model::Instance::os_image].
381    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    /// Sets the value of [pod][crate::model::Instance::pod].
387    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    /// Sets the value of [network_template][crate::model::Instance::network_template].
393    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    /// Sets the value of [logical_interfaces][crate::model::Instance::logical_interfaces].
402    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    /// Sets the value of [login_info][crate::model::Instance::login_info].
413    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    /// Sets the value of [workload_profile][crate::model::Instance::workload_profile].
419    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    /// Sets the value of [firmware_version][crate::model::Instance::firmware_version].
428    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
443/// Defines additional types related to [Instance].
444pub mod instance {
445    #[allow(unused_imports)]
446    use super::*;
447
448    /// The possible states for this server.
449    ///
450    /// # Working with unknown values
451    ///
452    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
453    /// additional enum variants at any time. Adding new variants is not considered
454    /// a breaking change. Applications should write their code in anticipation of:
455    ///
456    /// - New values appearing in future releases of the client library, **and**
457    /// - New values received dynamically, without application changes.
458    ///
459    /// Please consult the [Working with enums] section in the user guide for some
460    /// guidelines.
461    ///
462    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
463    #[derive(Clone, Debug, PartialEq)]
464    #[non_exhaustive]
465    pub enum State {
466        /// The server is in an unknown state.
467        Unspecified,
468        /// The server is being provisioned.
469        Provisioning,
470        /// The server is running.
471        Running,
472        /// The server has been deleted.
473        Deleted,
474        /// The server is being updated.
475        Updating,
476        /// The server is starting.
477        Starting,
478        /// The server is stopping.
479        Stopping,
480        /// The server is shutdown.
481        Shutdown,
482        /// If set, the enum was initialized with an unknown value.
483        ///
484        /// Applications can examine the value using [State::value] or
485        /// [State::name].
486        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        /// Gets the enum value.
499        ///
500        /// Returns `None` if the enum contains an unknown value deserialized from
501        /// the string representation of enums.
502        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        /// Gets the enum value as a string.
517        ///
518        /// Returns `None` if the enum contains an unknown value deserialized from
519        /// the integer representation of enums.
520        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/// Message for requesting server information.
617#[derive(Clone, Default, PartialEq)]
618#[non_exhaustive]
619pub struct GetInstanceRequest {
620    /// Required. Name of the resource.
621    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    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
632    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/// Message for requesting the list of servers.
645#[derive(Clone, Default, PartialEq)]
646#[non_exhaustive]
647pub struct ListInstancesRequest {
648    /// Required. Parent value for ListInstancesRequest.
649    pub parent: std::string::String,
650
651    /// Requested page size. Server may return fewer items than requested.
652    /// If unspecified, the server will pick an appropriate default.
653    pub page_size: i32,
654
655    /// A token identifying a page of results from the server.
656    pub page_token: std::string::String,
657
658    /// List filter.
659    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    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
670    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    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
676    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    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
682    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    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
688    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/// Response message for the list of servers.
701#[derive(Clone, Default, PartialEq)]
702#[non_exhaustive]
703pub struct ListInstancesResponse {
704    /// The list of servers.
705    pub instances: std::vec::Vec<crate::model::Instance>,
706
707    /// A token identifying a page of results from the server.
708    pub next_page_token: std::string::String,
709
710    /// Locations that could not be reached.
711    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    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
722    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    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
733    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    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
739    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/// Message requesting to updating a server.
771#[derive(Clone, Default, PartialEq)]
772#[non_exhaustive]
773pub struct UpdateInstanceRequest {
774    /// Required. The server to update.
775    ///
776    /// The `name` field is used to identify the instance to update.
777    /// Format: projects/{project}/locations/{location}/instances/{instance}
778    pub instance: std::option::Option<crate::model::Instance>,
779
780    /// The list of fields to update.
781    /// The currently supported fields are:
782    /// `labels`
783    /// `hyperthreading_enabled`
784    /// `os_image`
785    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    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
796    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    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
805    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    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
814    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    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
823    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/// Message requesting rename of a server.
839#[derive(Clone, Default, PartialEq)]
840#[non_exhaustive]
841pub struct RenameInstanceRequest {
842    /// Required. The `name` field is used to identify the instance.
843    /// Format: projects/{project}/locations/{location}/instances/{instance}
844    pub name: std::string::String,
845
846    /// Required. The new `id` of the instance.
847    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    /// Sets the value of [name][crate::model::RenameInstanceRequest::name].
858    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    /// Sets the value of [new_instance_id][crate::model::RenameInstanceRequest::new_instance_id].
864    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/// Message requesting to reset a server.
877#[derive(Clone, Default, PartialEq)]
878#[non_exhaustive]
879pub struct ResetInstanceRequest {
880    /// Required. Name of the resource.
881    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    /// Sets the value of [name][crate::model::ResetInstanceRequest::name].
892    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/// Message requesting to start a server.
905#[derive(Clone, Default, PartialEq)]
906#[non_exhaustive]
907pub struct StartInstanceRequest {
908    /// Required. Name of the resource.
909    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    /// Sets the value of [name][crate::model::StartInstanceRequest::name].
920    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/// Response message from starting a server.
933#[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/// Message requesting to stop a server.
952#[derive(Clone, Default, PartialEq)]
953#[non_exhaustive]
954pub struct StopInstanceRequest {
955    /// Required. Name of the resource.
956    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    /// Sets the value of [name][crate::model::StopInstanceRequest::name].
967    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/// Response message from stopping a server.
980#[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/// Message for enabling the interactive serial console on an instance.
999#[derive(Clone, Default, PartialEq)]
1000#[non_exhaustive]
1001pub struct EnableInteractiveSerialConsoleRequest {
1002    /// Required. Name of the resource.
1003    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    /// Sets the value of [name][crate::model::EnableInteractiveSerialConsoleRequest::name].
1014    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/// Message for response of EnableInteractiveSerialConsole.
1027#[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/// Message for disabling the interactive serial console on an instance.
1046#[derive(Clone, Default, PartialEq)]
1047#[non_exhaustive]
1048pub struct DisableInteractiveSerialConsoleRequest {
1049    /// Required. Name of the resource.
1050    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    /// Sets the value of [name][crate::model::DisableInteractiveSerialConsoleRequest::name].
1061    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/// Message for response of DisableInteractiveSerialConsole.
1074#[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/// Message for detach specific LUN from an Instance.
1093#[derive(Clone, Default, PartialEq)]
1094#[non_exhaustive]
1095pub struct DetachLunRequest {
1096    /// Required. Name of the instance.
1097    pub instance: std::string::String,
1098
1099    /// Required. Name of the Lun to detach.
1100    pub lun: std::string::String,
1101
1102    /// If true, performs lun unmapping without instance reboot.
1103    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    /// Sets the value of [instance][crate::model::DetachLunRequest::instance].
1114    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    /// Sets the value of [lun][crate::model::DetachLunRequest::lun].
1120    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    /// Sets the value of [skip_reboot][crate::model::DetachLunRequest::skip_reboot].
1126    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/// Network template.
1139#[derive(Clone, Default, PartialEq)]
1140#[non_exhaustive]
1141pub struct ServerNetworkTemplate {
1142    /// Output only. Template's unique name. The full resource name follows the
1143    /// pattern:
1144    /// `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}`
1145    /// Generally, the {server_network_template} follows the syntax of
1146    /// "bond<interface_type_index><bond_mode>" or "nic<interface_type_index>".
1147    pub name: std::string::String,
1148
1149    /// Instance types this template is applicable to.
1150    pub applicable_instance_types: std::vec::Vec<std::string::String>,
1151
1152    /// Logical interfaces.
1153    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    /// Sets the value of [name][crate::model::ServerNetworkTemplate::name].
1164    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    /// Sets the value of [applicable_instance_types][crate::model::ServerNetworkTemplate::applicable_instance_types].
1170    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    /// Sets the value of [logical_interfaces][crate::model::ServerNetworkTemplate::logical_interfaces].
1181    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
1198/// Defines additional types related to [ServerNetworkTemplate].
1199pub mod server_network_template {
1200    #[allow(unused_imports)]
1201    use super::*;
1202
1203    /// Logical interface.
1204    #[derive(Clone, Default, PartialEq)]
1205    #[non_exhaustive]
1206    pub struct LogicalInterface {
1207        /// Interface name.
1208        /// This is not a globally unique identifier.
1209        /// Name is unique only inside the ServerNetworkTemplate. This is of syntax
1210        /// \<bond\><interface_type_index><bond_mode> or \<nic\><interface_type_index>
1211        /// and forms part of the network template name.
1212        pub name: std::string::String,
1213
1214        /// Interface type.
1215        pub r#type: crate::model::server_network_template::logical_interface::InterfaceType,
1216
1217        /// If true, interface must have network connected.
1218        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        /// Sets the value of [name][crate::model::server_network_template::LogicalInterface::name].
1229        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        /// Sets the value of [r#type][crate::model::server_network_template::LogicalInterface::type].
1235        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        /// Sets the value of [required][crate::model::server_network_template::LogicalInterface::required].
1248        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    /// Defines additional types related to [LogicalInterface].
1261    pub mod logical_interface {
1262        #[allow(unused_imports)]
1263        use super::*;
1264
1265        /// Interface type.
1266        ///
1267        /// # Working with unknown values
1268        ///
1269        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1270        /// additional enum variants at any time. Adding new variants is not considered
1271        /// a breaking change. Applications should write their code in anticipation of:
1272        ///
1273        /// - New values appearing in future releases of the client library, **and**
1274        /// - New values received dynamically, without application changes.
1275        ///
1276        /// Please consult the [Working with enums] section in the user guide for some
1277        /// guidelines.
1278        ///
1279        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1280        #[derive(Clone, Debug, PartialEq)]
1281        #[non_exhaustive]
1282        pub enum InterfaceType {
1283            /// Unspecified value.
1284            Unspecified,
1285            /// Bond interface type.
1286            Bond,
1287            /// NIC interface type.
1288            Nic,
1289            /// If set, the enum was initialized with an unknown value.
1290            ///
1291            /// Applications can examine the value using [InterfaceType::value] or
1292            /// [InterfaceType::name].
1293            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            /// Gets the enum value.
1306            ///
1307            /// Returns `None` if the enum contains an unknown value deserialized from
1308            /// the string representation of enums.
1309            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            /// Gets the enum value as a string.
1319            ///
1320            /// Returns `None` if the enum contains an unknown value deserialized from
1321            /// the integer representation of enums.
1322            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/// A storage volume logical unit number (LUN).
1402#[derive(Clone, Default, PartialEq)]
1403#[non_exhaustive]
1404pub struct Lun {
1405    /// Output only. The name of the LUN.
1406    pub name: std::string::String,
1407
1408    /// An identifier for the LUN, generated by the backend.
1409    pub id: std::string::String,
1410
1411    /// The state of this storage volume.
1412    pub state: crate::model::lun::State,
1413
1414    /// The size of this LUN, in gigabytes.
1415    pub size_gb: i64,
1416
1417    /// The LUN multiprotocol type ensures the characteristics of the LUN are
1418    /// optimized for each operating system.
1419    pub multiprotocol_type: crate::model::lun::MultiprotocolType,
1420
1421    /// Display the storage volume for this LUN.
1422    pub storage_volume: std::string::String,
1423
1424    /// Display if this LUN can be shared between multiple physical servers.
1425    pub shareable: bool,
1426
1427    /// Display if this LUN is a boot LUN.
1428    pub boot_lun: bool,
1429
1430    /// The storage type for this LUN.
1431    pub storage_type: crate::model::lun::StorageType,
1432
1433    /// The WWID for this LUN.
1434    pub wwid: std::string::String,
1435
1436    /// Output only. Time after which LUN will be fully deleted.
1437    /// It is filled only for LUNs in COOL_OFF state.
1438    pub expire_time: std::option::Option<wkt::Timestamp>,
1439
1440    /// Output only. Instances this Lun is attached to.
1441    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    /// Sets the value of [name][crate::model::Lun::name].
1452    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    /// Sets the value of [id][crate::model::Lun::id].
1458    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    /// Sets the value of [state][crate::model::Lun::state].
1464    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    /// Sets the value of [size_gb][crate::model::Lun::size_gb].
1470    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    /// Sets the value of [multiprotocol_type][crate::model::Lun::multiprotocol_type].
1476    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    /// Sets the value of [storage_volume][crate::model::Lun::storage_volume].
1485    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    /// Sets the value of [shareable][crate::model::Lun::shareable].
1491    pub fn set_shareable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1492        self.shareable = v.into();
1493        self
1494    }
1495
1496    /// Sets the value of [boot_lun][crate::model::Lun::boot_lun].
1497    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    /// Sets the value of [storage_type][crate::model::Lun::storage_type].
1503    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    /// Sets the value of [wwid][crate::model::Lun::wwid].
1512    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    /// Sets the value of [expire_time][crate::model::Lun::expire_time].
1518    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    /// Sets or clears the value of [expire_time][crate::model::Lun::expire_time].
1527    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    /// Sets the value of [instances][crate::model::Lun::instances].
1536    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
1553/// Defines additional types related to [Lun].
1554pub mod lun {
1555    #[allow(unused_imports)]
1556    use super::*;
1557
1558    /// The possible states for the LUN.
1559    ///
1560    /// # Working with unknown values
1561    ///
1562    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1563    /// additional enum variants at any time. Adding new variants is not considered
1564    /// a breaking change. Applications should write their code in anticipation of:
1565    ///
1566    /// - New values appearing in future releases of the client library, **and**
1567    /// - New values received dynamically, without application changes.
1568    ///
1569    /// Please consult the [Working with enums] section in the user guide for some
1570    /// guidelines.
1571    ///
1572    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1573    #[derive(Clone, Debug, PartialEq)]
1574    #[non_exhaustive]
1575    pub enum State {
1576        /// The LUN is in an unknown state.
1577        Unspecified,
1578        /// The LUN is being created.
1579        Creating,
1580        /// The LUN is being updated.
1581        Updating,
1582        /// The LUN is ready for use.
1583        Ready,
1584        /// The LUN has been requested to be deleted.
1585        Deleting,
1586        /// The LUN is in cool off state. It will be deleted after `expire_time`.
1587        CoolOff,
1588        /// If set, the enum was initialized with an unknown value.
1589        ///
1590        /// Applications can examine the value using [State::value] or
1591        /// [State::name].
1592        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        /// Gets the enum value.
1605        ///
1606        /// Returns `None` if the enum contains an unknown value deserialized from
1607        /// the string representation of enums.
1608        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        /// Gets the enum value as a string.
1621        ///
1622        /// Returns `None` if the enum contains an unknown value deserialized from
1623        /// the integer representation of enums.
1624        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    /// Display the operating systems present for the LUN multiprotocol type.
1712    ///
1713    /// # Working with unknown values
1714    ///
1715    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1716    /// additional enum variants at any time. Adding new variants is not considered
1717    /// a breaking change. Applications should write their code in anticipation of:
1718    ///
1719    /// - New values appearing in future releases of the client library, **and**
1720    /// - New values received dynamically, without application changes.
1721    ///
1722    /// Please consult the [Working with enums] section in the user guide for some
1723    /// guidelines.
1724    ///
1725    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1726    #[derive(Clone, Debug, PartialEq)]
1727    #[non_exhaustive]
1728    pub enum MultiprotocolType {
1729        /// Server has no OS specified.
1730        Unspecified,
1731        /// Server with Linux OS.
1732        Linux,
1733        /// If set, the enum was initialized with an unknown value.
1734        ///
1735        /// Applications can examine the value using [MultiprotocolType::value] or
1736        /// [MultiprotocolType::name].
1737        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        /// Gets the enum value.
1750        ///
1751        /// Returns `None` if the enum contains an unknown value deserialized from
1752        /// the string representation of enums.
1753        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        /// Gets the enum value as a string.
1762        ///
1763        /// Returns `None` if the enum contains an unknown value deserialized from
1764        /// the integer representation of enums.
1765        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    /// The storage types for a LUN.
1837    ///
1838    /// # Working with unknown values
1839    ///
1840    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1841    /// additional enum variants at any time. Adding new variants is not considered
1842    /// a breaking change. Applications should write their code in anticipation of:
1843    ///
1844    /// - New values appearing in future releases of the client library, **and**
1845    /// - New values received dynamically, without application changes.
1846    ///
1847    /// Please consult the [Working with enums] section in the user guide for some
1848    /// guidelines.
1849    ///
1850    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1851    #[derive(Clone, Debug, PartialEq)]
1852    #[non_exhaustive]
1853    pub enum StorageType {
1854        /// The storage type for this LUN is unknown.
1855        Unspecified,
1856        /// This storage type for this LUN is SSD.
1857        Ssd,
1858        /// This storage type for this LUN is HDD.
1859        Hdd,
1860        /// If set, the enum was initialized with an unknown value.
1861        ///
1862        /// Applications can examine the value using [StorageType::value] or
1863        /// [StorageType::name].
1864        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        /// Gets the enum value.
1877        ///
1878        /// Returns `None` if the enum contains an unknown value deserialized from
1879        /// the string representation of enums.
1880        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        /// Gets the enum value as a string.
1890        ///
1891        /// Returns `None` if the enum contains an unknown value deserialized from
1892        /// the integer representation of enums.
1893        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/// Message for requesting storage lun information.
1970#[derive(Clone, Default, PartialEq)]
1971#[non_exhaustive]
1972pub struct GetLunRequest {
1973    /// Required. Name of the resource.
1974    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    /// Sets the value of [name][crate::model::GetLunRequest::name].
1985    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/// Message for requesting a list of storage volume luns.
1998#[derive(Clone, Default, PartialEq)]
1999#[non_exhaustive]
2000pub struct ListLunsRequest {
2001    /// Required. Parent value for ListLunsRequest.
2002    pub parent: std::string::String,
2003
2004    /// Requested page size. The server might return fewer items than requested.
2005    /// If unspecified, server will pick an appropriate default.
2006    pub page_size: i32,
2007
2008    /// A token identifying a page of results from the server.
2009    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    /// Sets the value of [parent][crate::model::ListLunsRequest::parent].
2020    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    /// Sets the value of [page_size][crate::model::ListLunsRequest::page_size].
2026    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    /// Sets the value of [page_token][crate::model::ListLunsRequest::page_token].
2032    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/// Response message containing the list of storage volume luns.
2045#[derive(Clone, Default, PartialEq)]
2046#[non_exhaustive]
2047pub struct ListLunsResponse {
2048    /// The list of luns.
2049    pub luns: std::vec::Vec<crate::model::Lun>,
2050
2051    /// A token identifying a page of results from the server.
2052    pub next_page_token: std::string::String,
2053
2054    /// Locations that could not be reached.
2055    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    /// Sets the value of [luns][crate::model::ListLunsResponse::luns].
2066    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    /// Sets the value of [next_page_token][crate::model::ListLunsResponse::next_page_token].
2077    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    /// Sets the value of [unreachable][crate::model::ListLunsResponse::unreachable].
2083    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/// Request for skip lun cooloff and delete it.
2115#[derive(Clone, Default, PartialEq)]
2116#[non_exhaustive]
2117pub struct EvictLunRequest {
2118    /// Required. The name of the lun.
2119    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    /// Sets the value of [name][crate::model::EvictLunRequest::name].
2130    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/// A Network.
2143#[derive(Clone, Default, PartialEq)]
2144#[non_exhaustive]
2145pub struct Network {
2146    /// Output only. The resource name of this `Network`.
2147    /// Resource names are schemeless URIs that follow the conventions in
2148    /// <https://cloud.google.com/apis/design/resource_names>.
2149    /// Format:
2150    /// `projects/{project}/locations/{location}/networks/{network}`
2151    pub name: std::string::String,
2152
2153    /// An identifier for the `Network`, generated by the backend.
2154    pub id: std::string::String,
2155
2156    /// The type of this network.
2157    pub r#type: crate::model::network::Type,
2158
2159    /// IP address configured.
2160    pub ip_address: std::string::String,
2161
2162    /// List of physical interfaces.
2163    pub mac_address: std::vec::Vec<std::string::String>,
2164
2165    /// The Network state.
2166    pub state: crate::model::network::State,
2167
2168    /// The vlan id of the Network.
2169    pub vlan_id: std::string::String,
2170
2171    /// The cidr of the Network.
2172    pub cidr: std::string::String,
2173
2174    /// The vrf for the Network.
2175    pub vrf: std::option::Option<crate::model::Vrf>,
2176
2177    /// Labels as key value pairs.
2178    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2179
2180    /// IP range for reserved for services (e.g. NFS).
2181    pub services_cidr: std::string::String,
2182
2183    /// List of IP address reservations in this network.
2184    /// When updating this field, an error will be generated if a reservation
2185    /// conflicts with an IP address already allocated to a physical server.
2186    pub reservations: std::vec::Vec<crate::model::NetworkAddressReservation>,
2187
2188    /// Output only. Pod name.
2189    pub pod: std::string::String,
2190
2191    /// Input only. List of mount points to attach the network to.
2192    pub mount_points: std::vec::Vec<crate::model::NetworkMountPoint>,
2193
2194    /// Whether network uses standard frames or jumbo ones.
2195    pub jumbo_frames_enabled: bool,
2196
2197    /// Output only. Gateway ip address.
2198    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    /// Sets the value of [name][crate::model::Network::name].
2209    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    /// Sets the value of [id][crate::model::Network::id].
2215    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    /// Sets the value of [r#type][crate::model::Network::type].
2221    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    /// Sets the value of [ip_address][crate::model::Network::ip_address].
2227    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    /// Sets the value of [mac_address][crate::model::Network::mac_address].
2233    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    /// Sets the value of [state][crate::model::Network::state].
2244    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    /// Sets the value of [vlan_id][crate::model::Network::vlan_id].
2250    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    /// Sets the value of [cidr][crate::model::Network::cidr].
2256    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    /// Sets the value of [vrf][crate::model::Network::vrf].
2262    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    /// Sets or clears the value of [vrf][crate::model::Network::vrf].
2271    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    /// Sets the value of [labels][crate::model::Network::labels].
2280    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    /// Sets the value of [services_cidr][crate::model::Network::services_cidr].
2292    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    /// Sets the value of [reservations][crate::model::Network::reservations].
2298    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    /// Sets the value of [pod][crate::model::Network::pod].
2309    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    /// Sets the value of [mount_points][crate::model::Network::mount_points].
2315    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    /// Sets the value of [jumbo_frames_enabled][crate::model::Network::jumbo_frames_enabled].
2326    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    /// Sets the value of [gateway_ip][crate::model::Network::gateway_ip].
2332    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
2344/// Defines additional types related to [Network].
2345pub mod network {
2346    #[allow(unused_imports)]
2347    use super::*;
2348
2349    /// Network type.
2350    ///
2351    /// # Working with unknown values
2352    ///
2353    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2354    /// additional enum variants at any time. Adding new variants is not considered
2355    /// a breaking change. Applications should write their code in anticipation of:
2356    ///
2357    /// - New values appearing in future releases of the client library, **and**
2358    /// - New values received dynamically, without application changes.
2359    ///
2360    /// Please consult the [Working with enums] section in the user guide for some
2361    /// guidelines.
2362    ///
2363    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2364    #[derive(Clone, Debug, PartialEq)]
2365    #[non_exhaustive]
2366    pub enum Type {
2367        /// Unspecified value.
2368        Unspecified,
2369        /// Client network, a network peered to a Google Cloud VPC.
2370        Client,
2371        /// Private network, a network local to the Bare Metal Solution environment.
2372        Private,
2373        /// If set, the enum was initialized with an unknown value.
2374        ///
2375        /// Applications can examine the value using [Type::value] or
2376        /// [Type::name].
2377        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        /// Gets the enum value.
2390        ///
2391        /// Returns `None` if the enum contains an unknown value deserialized from
2392        /// the string representation of enums.
2393        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        /// Gets the enum value as a string.
2403        ///
2404        /// Returns `None` if the enum contains an unknown value deserialized from
2405        /// the integer representation of enums.
2406        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    /// The possible states for this Network.
2482    ///
2483    /// # Working with unknown values
2484    ///
2485    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2486    /// additional enum variants at any time. Adding new variants is not considered
2487    /// a breaking change. Applications should write their code in anticipation of:
2488    ///
2489    /// - New values appearing in future releases of the client library, **and**
2490    /// - New values received dynamically, without application changes.
2491    ///
2492    /// Please consult the [Working with enums] section in the user guide for some
2493    /// guidelines.
2494    ///
2495    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2496    #[derive(Clone, Debug, PartialEq)]
2497    #[non_exhaustive]
2498    pub enum State {
2499        /// The Network is in an unknown state.
2500        Unspecified,
2501        /// The Network is provisioning.
2502        Provisioning,
2503        /// The Network has been provisioned.
2504        Provisioned,
2505        /// The Network is being deprovisioned.
2506        Deprovisioning,
2507        /// The Network is being updated.
2508        Updating,
2509        /// If set, the enum was initialized with an unknown value.
2510        ///
2511        /// Applications can examine the value using [State::value] or
2512        /// [State::name].
2513        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        /// Gets the enum value.
2526        ///
2527        /// Returns `None` if the enum contains an unknown value deserialized from
2528        /// the string representation of enums.
2529        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        /// Gets the enum value as a string.
2541        ///
2542        /// Returns `None` if the enum contains an unknown value deserialized from
2543        /// the integer representation of enums.
2544        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/// A reservation of one or more addresses in a network.
2629#[derive(Clone, Default, PartialEq)]
2630#[non_exhaustive]
2631pub struct NetworkAddressReservation {
2632    /// The first address of this reservation block.
2633    /// Must be specified as a single IPv4 address, e.g. 10.1.2.2.
2634    pub start_address: std::string::String,
2635
2636    /// The last address of this reservation block, inclusive. I.e., for cases when
2637    /// reservations are only single addresses, end_address and start_address will
2638    /// be the same.
2639    /// Must be specified as a single IPv4 address, e.g. 10.1.2.2.
2640    pub end_address: std::string::String,
2641
2642    /// A note about this reservation, intended for human consumption.
2643    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    /// Sets the value of [start_address][crate::model::NetworkAddressReservation::start_address].
2654    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    /// Sets the value of [end_address][crate::model::NetworkAddressReservation::end_address].
2660    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    /// Sets the value of [note][crate::model::NetworkAddressReservation::note].
2666    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/// A network VRF.
2679#[derive(Clone, Default, PartialEq)]
2680#[non_exhaustive]
2681pub struct Vrf {
2682    /// The name of the VRF.
2683    pub name: std::string::String,
2684
2685    /// The possible state of VRF.
2686    pub state: crate::model::vrf::State,
2687
2688    /// The QOS policy applied to this VRF.
2689    /// The value is only meaningful when all the vlan attachments have the same
2690    /// QoS. This field should not be used for new integrations, use vlan
2691    /// attachment level qos instead. The field is left for backward-compatibility.
2692    pub qos_policy: std::option::Option<crate::model::vrf::QosPolicy>,
2693
2694    /// The list of VLAN attachments for the VRF.
2695    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    /// Sets the value of [name][crate::model::Vrf::name].
2706    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    /// Sets the value of [state][crate::model::Vrf::state].
2712    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    /// Sets the value of [qos_policy][crate::model::Vrf::qos_policy].
2718    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    /// Sets or clears the value of [qos_policy][crate::model::Vrf::qos_policy].
2727    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    /// Sets the value of [vlan_attachments][crate::model::Vrf::vlan_attachments].
2736    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
2753/// Defines additional types related to [Vrf].
2754pub mod vrf {
2755    #[allow(unused_imports)]
2756    use super::*;
2757
2758    /// QOS policy parameters.
2759    #[derive(Clone, Default, PartialEq)]
2760    #[non_exhaustive]
2761    pub struct QosPolicy {
2762        /// The bandwidth permitted by the QOS policy, in gbps.
2763        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        /// Sets the value of [bandwidth_gbps][crate::model::vrf::QosPolicy::bandwidth_gbps].
2774        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    /// VLAN attachment details.
2787    #[derive(Clone, Default, PartialEq)]
2788    #[non_exhaustive]
2789    pub struct VlanAttachment {
2790        /// The peer vlan ID of the attachment.
2791        pub peer_vlan_id: i64,
2792
2793        /// The peer IP of the attachment.
2794        pub peer_ip: std::string::String,
2795
2796        /// The router IP of the attachment.
2797        pub router_ip: std::string::String,
2798
2799        /// Input only. Pairing key.
2800        pub pairing_key: std::string::String,
2801
2802        /// The QOS policy applied to this VLAN attachment.
2803        /// This value should be preferred to using qos at vrf level.
2804        pub qos_policy: std::option::Option<crate::model::vrf::QosPolicy>,
2805
2806        /// Immutable. The identifier of the attachment within vrf.
2807        pub id: std::string::String,
2808
2809        /// Optional. The name of the vlan attachment within vrf. This is of the form
2810        /// projects/{project_number}/regions/{region}/interconnectAttachments/{interconnect_attachment}
2811        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        /// Sets the value of [peer_vlan_id][crate::model::vrf::VlanAttachment::peer_vlan_id].
2822        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        /// Sets the value of [peer_ip][crate::model::vrf::VlanAttachment::peer_ip].
2828        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        /// Sets the value of [router_ip][crate::model::vrf::VlanAttachment::router_ip].
2834        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        /// Sets the value of [pairing_key][crate::model::vrf::VlanAttachment::pairing_key].
2840        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        /// Sets the value of [qos_policy][crate::model::vrf::VlanAttachment::qos_policy].
2846        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        /// Sets or clears the value of [qos_policy][crate::model::vrf::VlanAttachment::qos_policy].
2855        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        /// Sets the value of [id][crate::model::vrf::VlanAttachment::id].
2864        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        /// Sets the value of [interconnect_attachment][crate::model::vrf::VlanAttachment::interconnect_attachment].
2870        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    /// The possible states for this VRF.
2886    ///
2887    /// # Working with unknown values
2888    ///
2889    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2890    /// additional enum variants at any time. Adding new variants is not considered
2891    /// a breaking change. Applications should write their code in anticipation of:
2892    ///
2893    /// - New values appearing in future releases of the client library, **and**
2894    /// - New values received dynamically, without application changes.
2895    ///
2896    /// Please consult the [Working with enums] section in the user guide for some
2897    /// guidelines.
2898    ///
2899    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2900    #[derive(Clone, Debug, PartialEq)]
2901    #[non_exhaustive]
2902    pub enum State {
2903        /// The unspecified state.
2904        Unspecified,
2905        /// The vrf is provisioning.
2906        Provisioning,
2907        /// The vrf is provisioned.
2908        Provisioned,
2909        /// If set, the enum was initialized with an unknown value.
2910        ///
2911        /// Applications can examine the value using [State::value] or
2912        /// [State::name].
2913        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        /// Gets the enum value.
2926        ///
2927        /// Returns `None` if the enum contains an unknown value deserialized from
2928        /// the string representation of enums.
2929        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        /// Gets the enum value as a string.
2939        ///
2940        /// Returns `None` if the enum contains an unknown value deserialized from
2941        /// the integer representation of enums.
2942        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/// Each logical interface represents a logical abstraction of the underlying
3019/// physical interface (for eg. bond, nic) of the instance. Each logical
3020/// interface can effectively map to multiple network-IP pairs and still be
3021/// mapped to one underlying physical interface.
3022#[derive(Clone, Default, PartialEq)]
3023#[non_exhaustive]
3024pub struct LogicalInterface {
3025    /// List of logical network interfaces within a logical interface.
3026    pub logical_network_interfaces:
3027        std::vec::Vec<crate::model::logical_interface::LogicalNetworkInterface>,
3028
3029    /// Interface name. This is of syntax \<bond\><bond_mode> or \<nic\> and
3030    /// forms part of the network template name.
3031    pub name: std::string::String,
3032
3033    /// The index of the logical interface mapping to the index of the hardware
3034    /// bond or nic on the chosen network template. This field is deprecated.
3035    #[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    /// Sets the value of [logical_network_interfaces][crate::model::LogicalInterface::logical_network_interfaces].
3047    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    /// Sets the value of [name][crate::model::LogicalInterface::name].
3058    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    /// Sets the value of [interface_index][crate::model::LogicalInterface::interface_index].
3064    #[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
3077/// Defines additional types related to [LogicalInterface].
3078pub mod logical_interface {
3079    #[allow(unused_imports)]
3080    use super::*;
3081
3082    /// Each logical network interface is effectively a network and IP pair.
3083    #[derive(Clone, Default, PartialEq)]
3084    #[non_exhaustive]
3085    pub struct LogicalNetworkInterface {
3086        /// Name of the network
3087        pub network: std::string::String,
3088
3089        /// IP address in the network
3090        pub ip_address: std::string::String,
3091
3092        /// Whether this interface is the default gateway for the instance. Only
3093        /// one interface can be the default gateway for the instance.
3094        pub default_gateway: bool,
3095
3096        /// Type of network.
3097        pub network_type: crate::model::network::Type,
3098
3099        /// An identifier for the `Network`, generated by the backend.
3100        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        /// Sets the value of [network][crate::model::logical_interface::LogicalNetworkInterface::network].
3111        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        /// Sets the value of [ip_address][crate::model::logical_interface::LogicalNetworkInterface::ip_address].
3117        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        /// Sets the value of [default_gateway][crate::model::logical_interface::LogicalNetworkInterface::default_gateway].
3123        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        /// Sets the value of [network_type][crate::model::logical_interface::LogicalNetworkInterface::network_type].
3129        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        /// Sets the value of [id][crate::model::logical_interface::LogicalNetworkInterface::id].
3138        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/// Message for requesting network information.
3152#[derive(Clone, Default, PartialEq)]
3153#[non_exhaustive]
3154pub struct GetNetworkRequest {
3155    /// Required. Name of the resource.
3156    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    /// Sets the value of [name][crate::model::GetNetworkRequest::name].
3167    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/// Message for requesting a list of networks.
3180#[derive(Clone, Default, PartialEq)]
3181#[non_exhaustive]
3182pub struct ListNetworksRequest {
3183    /// Required. Parent value for ListNetworksRequest.
3184    pub parent: std::string::String,
3185
3186    /// Requested page size. The server might return fewer items than requested.
3187    /// If unspecified, server will pick an appropriate default.
3188    pub page_size: i32,
3189
3190    /// A token identifying a page of results from the server.
3191    pub page_token: std::string::String,
3192
3193    /// List filter.
3194    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    /// Sets the value of [parent][crate::model::ListNetworksRequest::parent].
3205    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    /// Sets the value of [page_size][crate::model::ListNetworksRequest::page_size].
3211    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    /// Sets the value of [page_token][crate::model::ListNetworksRequest::page_token].
3217    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    /// Sets the value of [filter][crate::model::ListNetworksRequest::filter].
3223    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/// Response message containing the list of networks.
3236#[derive(Clone, Default, PartialEq)]
3237#[non_exhaustive]
3238pub struct ListNetworksResponse {
3239    /// The list of networks.
3240    pub networks: std::vec::Vec<crate::model::Network>,
3241
3242    /// A token identifying a page of results from the server.
3243    pub next_page_token: std::string::String,
3244
3245    /// Locations that could not be reached.
3246    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    /// Sets the value of [networks][crate::model::ListNetworksResponse::networks].
3257    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    /// Sets the value of [next_page_token][crate::model::ListNetworksResponse::next_page_token].
3268    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    /// Sets the value of [unreachable][crate::model::ListNetworksResponse::unreachable].
3274    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/// Message requesting to updating a network.
3306#[derive(Clone, Default, PartialEq)]
3307#[non_exhaustive]
3308pub struct UpdateNetworkRequest {
3309    /// Required. The network to update.
3310    ///
3311    /// The `name` field is used to identify the instance to update.
3312    /// Format: projects/{project}/locations/{location}/networks/{network}
3313    pub network: std::option::Option<crate::model::Network>,
3314
3315    /// The list of fields to update.
3316    /// The only currently supported fields are:
3317    /// `labels`, `reservations`, `vrf.vlan_attachments`
3318    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    /// Sets the value of [network][crate::model::UpdateNetworkRequest::network].
3329    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    /// Sets or clears the value of [network][crate::model::UpdateNetworkRequest::network].
3338    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    /// Sets the value of [update_mask][crate::model::UpdateNetworkRequest::update_mask].
3347    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    /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkRequest::update_mask].
3356    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/// Network with all used IP addresses.
3372#[derive(Clone, Default, PartialEq)]
3373#[non_exhaustive]
3374pub struct NetworkUsage {
3375    /// Network.
3376    pub network: std::option::Option<crate::model::Network>,
3377
3378    /// All used IP addresses in this network.
3379    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    /// Sets the value of [network][crate::model::NetworkUsage::network].
3390    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    /// Sets or clears the value of [network][crate::model::NetworkUsage::network].
3399    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    /// Sets the value of [used_ips][crate::model::NetworkUsage::used_ips].
3408    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/// Request to get networks with IPs.
3426#[derive(Clone, Default, PartialEq)]
3427#[non_exhaustive]
3428pub struct ListNetworkUsageRequest {
3429    /// Required. Parent value (project and location).
3430    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    /// Sets the value of [location][crate::model::ListNetworkUsageRequest::location].
3441    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/// Response with Networks with IPs
3454#[derive(Clone, Default, PartialEq)]
3455#[non_exhaustive]
3456pub struct ListNetworkUsageResponse {
3457    /// Networks with IPs.
3458    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    /// Sets the value of [networks][crate::model::ListNetworkUsageResponse::networks].
3469    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/// Mount point for a network.
3487#[derive(Clone, Default, PartialEq)]
3488#[non_exhaustive]
3489pub struct NetworkMountPoint {
3490    /// Instance to attach network to.
3491    pub instance: std::string::String,
3492
3493    /// Logical interface to detach from.
3494    pub logical_interface: std::string::String,
3495
3496    /// Network should be a default gateway.
3497    pub default_gateway: bool,
3498
3499    /// Ip address of the server.
3500    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    /// Sets the value of [instance][crate::model::NetworkMountPoint::instance].
3511    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    /// Sets the value of [logical_interface][crate::model::NetworkMountPoint::logical_interface].
3517    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    /// Sets the value of [default_gateway][crate::model::NetworkMountPoint::default_gateway].
3526    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    /// Sets the value of [ip_address][crate::model::NetworkMountPoint::ip_address].
3532    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/// Message requesting rename of a server.
3545#[derive(Clone, Default, PartialEq)]
3546#[non_exhaustive]
3547pub struct RenameNetworkRequest {
3548    /// Required. The `name` field is used to identify the network.
3549    /// Format: projects/{project}/locations/{location}/networks/{network}
3550    pub name: std::string::String,
3551
3552    /// Required. The new `id` of the network.
3553    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    /// Sets the value of [name][crate::model::RenameNetworkRequest::name].
3564    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    /// Sets the value of [new_network_id][crate::model::RenameNetworkRequest::new_network_id].
3570    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/// An NFS share.
3583#[derive(Clone, Default, PartialEq)]
3584#[non_exhaustive]
3585pub struct NfsShare {
3586    /// Immutable. The name of the NFS share.
3587    pub name: std::string::String,
3588
3589    /// Output only. An identifier for the NFS share, generated by the backend.
3590    /// This field will be deprecated in the future, use `id` instead.
3591    pub nfs_share_id: std::string::String,
3592
3593    /// Output only. An identifier for the NFS share, generated by the backend.
3594    /// This is the same value as nfs_share_id and will replace it in the future.
3595    pub id: std::string::String,
3596
3597    /// Output only. The state of the NFS share.
3598    pub state: crate::model::nfs_share::State,
3599
3600    /// Output only. The underlying volume of the share. Created automatically
3601    /// during provisioning.
3602    pub volume: std::string::String,
3603
3604    /// List of allowed access points.
3605    pub allowed_clients: std::vec::Vec<crate::model::nfs_share::AllowedClient>,
3606
3607    /// Labels as key value pairs.
3608    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3609
3610    /// The requested size, in GiB.
3611    pub requested_size_gib: i64,
3612
3613    /// Immutable. The storage type of the underlying volume.
3614    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    /// Sets the value of [name][crate::model::NfsShare::name].
3625    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    /// Sets the value of [nfs_share_id][crate::model::NfsShare::nfs_share_id].
3631    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    /// Sets the value of [id][crate::model::NfsShare::id].
3637    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    /// Sets the value of [state][crate::model::NfsShare::state].
3643    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    /// Sets the value of [volume][crate::model::NfsShare::volume].
3652    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    /// Sets the value of [allowed_clients][crate::model::NfsShare::allowed_clients].
3658    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    /// Sets the value of [labels][crate::model::NfsShare::labels].
3669    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    /// Sets the value of [requested_size_gib][crate::model::NfsShare::requested_size_gib].
3681    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    /// Sets the value of [storage_type][crate::model::NfsShare::storage_type].
3687    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
3702/// Defines additional types related to [NfsShare].
3703pub mod nfs_share {
3704    #[allow(unused_imports)]
3705    use super::*;
3706
3707    /// Represents an 'access point' for the share.
3708    #[derive(Clone, Default, PartialEq)]
3709    #[non_exhaustive]
3710    pub struct AllowedClient {
3711        /// The network the access point sits on.
3712        pub network: std::string::String,
3713
3714        /// Output only. The IP address of the share on this network. Assigned
3715        /// automatically during provisioning based on the network's services_cidr.
3716        pub share_ip: std::string::String,
3717
3718        /// The subnet of IP addresses permitted to access the share.
3719        pub allowed_clients_cidr: std::string::String,
3720
3721        /// Mount permissions.
3722        pub mount_permissions: crate::model::nfs_share::MountPermissions,
3723
3724        /// Allow dev flag.  Which controls whether to allow creation of devices.
3725        pub allow_dev: bool,
3726
3727        /// Allow the setuid flag.
3728        pub allow_suid: bool,
3729
3730        /// Disable root squashing, which is a feature of NFS.
3731        /// Root squash is a special mapping of the remote superuser (root) identity
3732        /// when using identity authentication.
3733        pub no_root_squash: bool,
3734
3735        /// Output only. The path to access NFS, in format shareIP:/InstanceID
3736        /// InstanceID is the generated ID instead of customer provided name.
3737        /// example like "10.0.0.0:/g123456789-nfs001"
3738        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        /// Sets the value of [network][crate::model::nfs_share::AllowedClient::network].
3749        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        /// Sets the value of [share_ip][crate::model::nfs_share::AllowedClient::share_ip].
3755        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        /// Sets the value of [allowed_clients_cidr][crate::model::nfs_share::AllowedClient::allowed_clients_cidr].
3761        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        /// Sets the value of [mount_permissions][crate::model::nfs_share::AllowedClient::mount_permissions].
3770        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        /// Sets the value of [allow_dev][crate::model::nfs_share::AllowedClient::allow_dev].
3781        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        /// Sets the value of [allow_suid][crate::model::nfs_share::AllowedClient::allow_suid].
3787        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        /// Sets the value of [no_root_squash][crate::model::nfs_share::AllowedClient::no_root_squash].
3793        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        /// Sets the value of [nfs_path][crate::model::nfs_share::AllowedClient::nfs_path].
3799        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    /// The possible states for this NFS share.
3812    ///
3813    /// # Working with unknown values
3814    ///
3815    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3816    /// additional enum variants at any time. Adding new variants is not considered
3817    /// a breaking change. Applications should write their code in anticipation of:
3818    ///
3819    /// - New values appearing in future releases of the client library, **and**
3820    /// - New values received dynamically, without application changes.
3821    ///
3822    /// Please consult the [Working with enums] section in the user guide for some
3823    /// guidelines.
3824    ///
3825    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3826    #[derive(Clone, Debug, PartialEq)]
3827    #[non_exhaustive]
3828    pub enum State {
3829        /// The share is in an unknown state.
3830        Unspecified,
3831        /// The share has been provisioned.
3832        Provisioned,
3833        /// The NFS Share is being created.
3834        Creating,
3835        /// The NFS Share is being updated.
3836        Updating,
3837        /// The NFS Share has been requested to be deleted.
3838        Deleting,
3839        /// If set, the enum was initialized with an unknown value.
3840        ///
3841        /// Applications can examine the value using [State::value] or
3842        /// [State::name].
3843        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        /// Gets the enum value.
3856        ///
3857        /// Returns `None` if the enum contains an unknown value deserialized from
3858        /// the string representation of enums.
3859        pub fn value(&self) -> std::option::Option<i32> {
3860            match self {
3861                Self::Unspecified => std::option::Option::Some(0),
3862                Self::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        /// Gets the enum value as a string.
3871        ///
3872        /// Returns `None` if the enum contains an unknown value deserialized from
3873        /// the integer representation of enums.
3874        pub fn name(&self) -> std::option::Option<&str> {
3875            match self {
3876                Self::Unspecified => std::option::Option::Some("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    /// The possible mount permissions.
3958    ///
3959    /// # Working with unknown values
3960    ///
3961    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3962    /// additional enum variants at any time. Adding new variants is not considered
3963    /// a breaking change. Applications should write their code in anticipation of:
3964    ///
3965    /// - New values appearing in future releases of the client library, **and**
3966    /// - New values received dynamically, without application changes.
3967    ///
3968    /// Please consult the [Working with enums] section in the user guide for some
3969    /// guidelines.
3970    ///
3971    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3972    #[derive(Clone, Debug, PartialEq)]
3973    #[non_exhaustive]
3974    pub enum MountPermissions {
3975        /// Permissions were not specified.
3976        Unspecified,
3977        /// NFS share can be mount with read-only permissions.
3978        Read,
3979        /// NFS share can be mount with read-write permissions.
3980        ReadWrite,
3981        /// If set, the enum was initialized with an unknown value.
3982        ///
3983        /// Applications can examine the value using [MountPermissions::value] or
3984        /// [MountPermissions::name].
3985        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        /// Gets the enum value.
3998        ///
3999        /// Returns `None` if the enum contains an unknown value deserialized from
4000        /// the string representation of enums.
4001        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        /// Gets the enum value as a string.
4011        ///
4012        /// Returns `None` if the enum contains an unknown value deserialized from
4013        /// the integer representation of enums.
4014        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    /// The storage type for a volume.
4090    ///
4091    /// # Working with unknown values
4092    ///
4093    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4094    /// additional enum variants at any time. Adding new variants is not considered
4095    /// a breaking change. Applications should write their code in anticipation of:
4096    ///
4097    /// - New values appearing in future releases of the client library, **and**
4098    /// - New values received dynamically, without application changes.
4099    ///
4100    /// Please consult the [Working with enums] section in the user guide for some
4101    /// guidelines.
4102    ///
4103    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4104    #[derive(Clone, Debug, PartialEq)]
4105    #[non_exhaustive]
4106    pub enum StorageType {
4107        /// The storage type for this volume is unknown.
4108        Unspecified,
4109        /// The storage type for this volume is SSD.
4110        Ssd,
4111        /// This storage type for this volume is HDD.
4112        Hdd,
4113        /// If set, the enum was initialized with an unknown value.
4114        ///
4115        /// Applications can examine the value using [StorageType::value] or
4116        /// [StorageType::name].
4117        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        /// Gets the enum value.
4130        ///
4131        /// Returns `None` if the enum contains an unknown value deserialized from
4132        /// the string representation of enums.
4133        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        /// Gets the enum value as a string.
4143        ///
4144        /// Returns `None` if the enum contains an unknown value deserialized from
4145        /// the integer representation of enums.
4146        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/// Message for requesting NFS share information.
4223#[derive(Clone, Default, PartialEq)]
4224#[non_exhaustive]
4225pub struct GetNfsShareRequest {
4226    /// Required. Name of the resource.
4227    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    /// Sets the value of [name][crate::model::GetNfsShareRequest::name].
4238    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/// Message for requesting a list of NFS shares.
4251#[derive(Clone, Default, PartialEq)]
4252#[non_exhaustive]
4253pub struct ListNfsSharesRequest {
4254    /// Required. Parent value for ListNfsSharesRequest.
4255    pub parent: std::string::String,
4256
4257    /// Requested page size. The server might return fewer items than requested.
4258    /// If unspecified, server will pick an appropriate default.
4259    pub page_size: i32,
4260
4261    /// A token identifying a page of results from the server.
4262    pub page_token: std::string::String,
4263
4264    /// List filter.
4265    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    /// Sets the value of [parent][crate::model::ListNfsSharesRequest::parent].
4276    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    /// Sets the value of [page_size][crate::model::ListNfsSharesRequest::page_size].
4282    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    /// Sets the value of [page_token][crate::model::ListNfsSharesRequest::page_token].
4288    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    /// Sets the value of [filter][crate::model::ListNfsSharesRequest::filter].
4294    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/// Response message containing the list of NFS shares.
4307#[derive(Clone, Default, PartialEq)]
4308#[non_exhaustive]
4309pub struct ListNfsSharesResponse {
4310    /// The list of NFS shares.
4311    pub nfs_shares: std::vec::Vec<crate::model::NfsShare>,
4312
4313    /// A token identifying a page of results from the server.
4314    pub next_page_token: std::string::String,
4315
4316    /// Locations that could not be reached.
4317    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    /// Sets the value of [nfs_shares][crate::model::ListNfsSharesResponse::nfs_shares].
4328    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    /// Sets the value of [next_page_token][crate::model::ListNfsSharesResponse::next_page_token].
4339    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    /// Sets the value of [unreachable][crate::model::ListNfsSharesResponse::unreachable].
4345    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/// Message requesting to updating an NFS share.
4377#[derive(Clone, Default, PartialEq)]
4378#[non_exhaustive]
4379pub struct UpdateNfsShareRequest {
4380    /// Required. The NFS share to update.
4381    ///
4382    /// The `name` field is used to identify the NFS share to update.
4383    /// Format: projects/{project}/locations/{location}/nfsShares/{nfs_share}
4384    pub nfs_share: std::option::Option<crate::model::NfsShare>,
4385
4386    /// The list of fields to update.
4387    /// The only currently supported fields are:
4388    /// `labels`
4389    /// `allowed_clients`
4390    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    /// Sets the value of [nfs_share][crate::model::UpdateNfsShareRequest::nfs_share].
4401    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    /// Sets or clears the value of [nfs_share][crate::model::UpdateNfsShareRequest::nfs_share].
4410    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    /// Sets the value of [update_mask][crate::model::UpdateNfsShareRequest::update_mask].
4419    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    /// Sets or clears the value of [update_mask][crate::model::UpdateNfsShareRequest::update_mask].
4428    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/// Message requesting rename of a server.
4444#[derive(Clone, Default, PartialEq)]
4445#[non_exhaustive]
4446pub struct RenameNfsShareRequest {
4447    /// Required. The `name` field is used to identify the nfsshare.
4448    /// Format: projects/{project}/locations/{location}/nfsshares/{nfsshare}
4449    pub name: std::string::String,
4450
4451    /// Required. The new `id` of the nfsshare.
4452    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    /// Sets the value of [name][crate::model::RenameNfsShareRequest::name].
4463    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    /// Sets the value of [new_nfsshare_id][crate::model::RenameNfsShareRequest::new_nfsshare_id].
4469    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/// Message for creating an NFS share.
4482#[derive(Clone, Default, PartialEq)]
4483#[non_exhaustive]
4484pub struct CreateNfsShareRequest {
4485    /// Required. The parent project and location.
4486    pub parent: std::string::String,
4487
4488    /// Required. The NfsShare to create.
4489    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    /// Sets the value of [parent][crate::model::CreateNfsShareRequest::parent].
4500    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    /// Sets the value of [nfs_share][crate::model::CreateNfsShareRequest::nfs_share].
4506    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    /// Sets or clears the value of [nfs_share][crate::model::CreateNfsShareRequest::nfs_share].
4515    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/// Message for deleting an NFS share.
4531#[derive(Clone, Default, PartialEq)]
4532#[non_exhaustive]
4533pub struct DeleteNfsShareRequest {
4534    /// Required. The name of the NFS share to delete.
4535    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    /// Sets the value of [name][crate::model::DeleteNfsShareRequest::name].
4546    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/// Operation System image.
4559#[derive(Clone, Default, PartialEq)]
4560#[non_exhaustive]
4561pub struct OSImage {
4562    /// Output only. OS Image's unique name.
4563    pub name: std::string::String,
4564
4565    /// OS Image code.
4566    pub code: std::string::String,
4567
4568    /// OS Image description.
4569    pub description: std::string::String,
4570
4571    /// Instance types this image is applicable to.
4572    /// [Available
4573    /// types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
4574    pub applicable_instance_types: std::vec::Vec<std::string::String>,
4575
4576    /// Network templates that can be used with this OS Image.
4577    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    /// Sets the value of [name][crate::model::OSImage::name].
4588    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    /// Sets the value of [code][crate::model::OSImage::code].
4594    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    /// Sets the value of [description][crate::model::OSImage::description].
4600    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    /// Sets the value of [applicable_instance_types][crate::model::OSImage::applicable_instance_types].
4606    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    /// Sets the value of [supported_network_templates][crate::model::OSImage::supported_network_templates].
4617    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/// Request for getting all available OS images.
4635#[derive(Clone, Default, PartialEq)]
4636#[non_exhaustive]
4637pub struct ListOSImagesRequest {
4638    /// Required. Parent value for ListProvisioningQuotasRequest.
4639    pub parent: std::string::String,
4640
4641    /// Requested page size. The server might return fewer items than requested.
4642    /// If unspecified, server will pick an appropriate default.
4643    /// Notice that page_size field is not supported and won't be respected in
4644    /// the API request for now, will be updated when pagination is supported.
4645    pub page_size: i32,
4646
4647    /// A token identifying a page of results from the server.
4648    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    /// Sets the value of [parent][crate::model::ListOSImagesRequest::parent].
4659    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    /// Sets the value of [page_size][crate::model::ListOSImagesRequest::page_size].
4665    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    /// Sets the value of [page_token][crate::model::ListOSImagesRequest::page_token].
4671    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/// Request for getting all available OS images.
4684#[derive(Clone, Default, PartialEq)]
4685#[non_exhaustive]
4686pub struct ListOSImagesResponse {
4687    /// The OS images available.
4688    pub os_images: std::vec::Vec<crate::model::OSImage>,
4689
4690    /// Token to retrieve the next page of results, or empty if there are no more
4691    /// results in the list.
4692    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    /// Sets the value of [os_images][crate::model::ListOSImagesResponse::os_images].
4703    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    /// Sets the value of [next_page_token][crate::model::ListOSImagesResponse::next_page_token].
4714    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/// A provisioning configuration.
4741#[derive(Clone, Default, PartialEq)]
4742#[non_exhaustive]
4743pub struct ProvisioningConfig {
4744    /// Output only. The system-generated name of the provisioning config. This
4745    /// follows the UUID format.
4746    pub name: std::string::String,
4747
4748    /// Instances to be created.
4749    pub instances: std::vec::Vec<crate::model::InstanceConfig>,
4750
4751    /// Networks to be created.
4752    pub networks: std::vec::Vec<crate::model::NetworkConfig>,
4753
4754    /// Volumes to be created.
4755    pub volumes: std::vec::Vec<crate::model::VolumeConfig>,
4756
4757    /// A generated ticket id to track provisioning request.
4758    pub ticket_id: std::string::String,
4759
4760    /// A service account to enable customers to access instance credentials upon
4761    /// handover.
4762    pub handover_service_account: std::string::String,
4763
4764    /// Email provided to send a confirmation with provisioning config to.
4765    /// Deprecated in favour of email field in request messages.
4766    #[deprecated]
4767    pub email: std::string::String,
4768
4769    /// Output only. State of ProvisioningConfig.
4770    pub state: crate::model::provisioning_config::State,
4771
4772    /// Optional. Location name of this ProvisioningConfig.
4773    /// It is optional only for Intake UI transition period.
4774    pub location: std::string::String,
4775
4776    /// Output only. Last update timestamp.
4777    pub update_time: std::option::Option<wkt::Timestamp>,
4778
4779    /// Output only. URI to Cloud Console UI view of this provisioning config.
4780    pub cloud_console_uri: std::string::String,
4781
4782    /// If true, VPC SC is enabled for the cluster.
4783    pub vpc_sc_enabled: bool,
4784
4785    /// Optional status messages associated with the FAILED state.
4786    pub status_message: std::string::String,
4787
4788    /// Optional. The user-defined identifier of the provisioning config.
4789    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    /// Sets the value of [name][crate::model::ProvisioningConfig::name].
4800    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    /// Sets the value of [instances][crate::model::ProvisioningConfig::instances].
4806    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    /// Sets the value of [networks][crate::model::ProvisioningConfig::networks].
4817    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    /// Sets the value of [volumes][crate::model::ProvisioningConfig::volumes].
4828    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    /// Sets the value of [ticket_id][crate::model::ProvisioningConfig::ticket_id].
4839    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    /// Sets the value of [handover_service_account][crate::model::ProvisioningConfig::handover_service_account].
4845    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    /// Sets the value of [email][crate::model::ProvisioningConfig::email].
4854    #[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    /// Sets the value of [state][crate::model::ProvisioningConfig::state].
4861    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    /// Sets the value of [location][crate::model::ProvisioningConfig::location].
4870    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    /// Sets the value of [update_time][crate::model::ProvisioningConfig::update_time].
4876    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    /// Sets or clears the value of [update_time][crate::model::ProvisioningConfig::update_time].
4885    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    /// Sets the value of [cloud_console_uri][crate::model::ProvisioningConfig::cloud_console_uri].
4894    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    /// Sets the value of [vpc_sc_enabled][crate::model::ProvisioningConfig::vpc_sc_enabled].
4903    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    /// Sets the value of [status_message][crate::model::ProvisioningConfig::status_message].
4909    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    /// Sets the value of [custom_id][crate::model::ProvisioningConfig::custom_id].
4915    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
4927/// Defines additional types related to [ProvisioningConfig].
4928pub mod provisioning_config {
4929    #[allow(unused_imports)]
4930    use super::*;
4931
4932    /// The possible states for this ProvisioningConfig.
4933    ///
4934    /// # Working with unknown values
4935    ///
4936    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4937    /// additional enum variants at any time. Adding new variants is not considered
4938    /// a breaking change. Applications should write their code in anticipation of:
4939    ///
4940    /// - New values appearing in future releases of the client library, **and**
4941    /// - New values received dynamically, without application changes.
4942    ///
4943    /// Please consult the [Working with enums] section in the user guide for some
4944    /// guidelines.
4945    ///
4946    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4947    #[derive(Clone, Debug, PartialEq)]
4948    #[non_exhaustive]
4949    pub enum State {
4950        /// State wasn't specified.
4951        Unspecified,
4952        /// ProvisioningConfig is a draft and can be freely modified.
4953        Draft,
4954        /// ProvisioningConfig was already submitted and cannot be modified.
4955        Submitted,
4956        /// ProvisioningConfig was in the provisioning state.  Initially this state
4957        /// comes from the work order table in big query when SNOW is used.  Later
4958        /// this field can be set by the work order API.
4959        Provisioning,
4960        /// ProvisioningConfig was provisioned, meaning the resources exist.
4961        Provisioned,
4962        /// ProvisioningConfig was validated.  A validation tool will be run to
4963        /// set this state.
4964        Validated,
4965        /// ProvisioningConfig was canceled.
4966        Cancelled,
4967        /// The request is submitted for provisioning, with error return.
4968        Failed,
4969        /// If set, the enum was initialized with an unknown value.
4970        ///
4971        /// Applications can examine the value using [State::value] or
4972        /// [State::name].
4973        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        /// Gets the enum value.
4986        ///
4987        /// Returns `None` if the enum contains an unknown value deserialized from
4988        /// the string representation of enums.
4989        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        /// Gets the enum value as a string.
5004        ///
5005        /// Returns `None` if the enum contains an unknown value deserialized from
5006        /// the integer representation of enums.
5007        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/// Request for SubmitProvisioningConfig.
5104#[derive(Clone, Default, PartialEq)]
5105#[non_exhaustive]
5106pub struct SubmitProvisioningConfigRequest {
5107    /// Required. The parent project and location containing the
5108    /// ProvisioningConfig.
5109    pub parent: std::string::String,
5110
5111    /// Required. The ProvisioningConfig to create.
5112    pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
5113
5114    /// Optional. Email provided to send a confirmation with provisioning config
5115    /// to.
5116    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    /// Sets the value of [parent][crate::model::SubmitProvisioningConfigRequest::parent].
5127    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    /// Sets the value of [provisioning_config][crate::model::SubmitProvisioningConfigRequest::provisioning_config].
5133    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    /// Sets or clears the value of [provisioning_config][crate::model::SubmitProvisioningConfigRequest::provisioning_config].
5142    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    /// Sets the value of [email][crate::model::SubmitProvisioningConfigRequest::email].
5151    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/// Response for SubmitProvisioningConfig.
5164#[derive(Clone, Default, PartialEq)]
5165#[non_exhaustive]
5166pub struct SubmitProvisioningConfigResponse {
5167    /// The submitted provisioning config.
5168    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    /// Sets the value of [provisioning_config][crate::model::SubmitProvisioningConfigResponse::provisioning_config].
5179    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    /// Sets or clears the value of [provisioning_config][crate::model::SubmitProvisioningConfigResponse::provisioning_config].
5188    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/// A provisioning quota for a given project.
5204#[derive(Clone, Default, PartialEq)]
5205#[non_exhaustive]
5206pub struct ProvisioningQuota {
5207    /// Output only. The name of the provisioning quota.
5208    pub name: std::string::String,
5209
5210    /// The asset type of this provisioning quota.
5211    pub asset_type: crate::model::provisioning_quota::AssetType,
5212
5213    /// The gcp service of the provisioning quota.
5214    pub gcp_service: std::string::String,
5215
5216    /// The specific location of the provisioining quota.
5217    pub location: std::string::String,
5218
5219    /// The available count of the provisioning quota.
5220    pub available_count: i32,
5221
5222    /// The quota of one asset type.
5223    pub quota: std::option::Option<crate::model::provisioning_quota::Quota>,
5224
5225    /// Available quantity based on asset type.
5226    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    /// Sets the value of [name][crate::model::ProvisioningQuota::name].
5237    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    /// Sets the value of [asset_type][crate::model::ProvisioningQuota::asset_type].
5243    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    /// Sets the value of [gcp_service][crate::model::ProvisioningQuota::gcp_service].
5252    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    /// Sets the value of [location][crate::model::ProvisioningQuota::location].
5258    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    /// Sets the value of [available_count][crate::model::ProvisioningQuota::available_count].
5264    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    /// Sets the value of [quota][crate::model::ProvisioningQuota::quota].
5270    ///
5271    /// Note that all the setters affecting `quota` are mutually
5272    /// exclusive.
5273    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    /// The value of [quota][crate::model::ProvisioningQuota::quota]
5284    /// if it holds a `InstanceQuota`, `None` if the field is not set or
5285    /// holds a different branch.
5286    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    /// Sets the value of [quota][crate::model::ProvisioningQuota::quota]
5299    /// to hold a `InstanceQuota`.
5300    ///
5301    /// Note that all the setters affecting `quota` are
5302    /// mutually exclusive.
5303    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    /// Sets the value of [availability][crate::model::ProvisioningQuota::availability].
5316    ///
5317    /// Note that all the setters affecting `availability` are mutually
5318    /// exclusive.
5319    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    /// The value of [availability][crate::model::ProvisioningQuota::availability]
5330    /// if it holds a `ServerCount`, `None` if the field is not set or
5331    /// holds a different branch.
5332    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    /// Sets the value of [availability][crate::model::ProvisioningQuota::availability]
5343    /// to hold a `ServerCount`.
5344    ///
5345    /// Note that all the setters affecting `availability` are
5346    /// mutually exclusive.
5347    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    /// The value of [availability][crate::model::ProvisioningQuota::availability]
5355    /// if it holds a `NetworkBandwidth`, `None` if the field is not set or
5356    /// holds a different branch.
5357    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    /// Sets the value of [availability][crate::model::ProvisioningQuota::availability]
5368    /// to hold a `NetworkBandwidth`.
5369    ///
5370    /// Note that all the setters affecting `availability` are
5371    /// mutually exclusive.
5372    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    /// The value of [availability][crate::model::ProvisioningQuota::availability]
5380    /// if it holds a `StorageGib`, `None` if the field is not set or
5381    /// holds a different branch.
5382    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    /// Sets the value of [availability][crate::model::ProvisioningQuota::availability]
5393    /// to hold a `StorageGib`.
5394    ///
5395    /// Note that all the setters affecting `availability` are
5396    /// mutually exclusive.
5397    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
5411/// Defines additional types related to [ProvisioningQuota].
5412pub mod provisioning_quota {
5413    #[allow(unused_imports)]
5414    use super::*;
5415
5416    /// The available asset types for intake.
5417    ///
5418    /// # Working with unknown values
5419    ///
5420    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5421    /// additional enum variants at any time. Adding new variants is not considered
5422    /// a breaking change. Applications should write their code in anticipation of:
5423    ///
5424    /// - New values appearing in future releases of the client library, **and**
5425    /// - New values received dynamically, without application changes.
5426    ///
5427    /// Please consult the [Working with enums] section in the user guide for some
5428    /// guidelines.
5429    ///
5430    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5431    #[derive(Clone, Debug, PartialEq)]
5432    #[non_exhaustive]
5433    pub enum AssetType {
5434        /// The unspecified type.
5435        Unspecified,
5436        /// The server asset type.
5437        Server,
5438        /// The storage asset type.
5439        Storage,
5440        /// The network asset type.
5441        Network,
5442        /// If set, the enum was initialized with an unknown value.
5443        ///
5444        /// Applications can examine the value using [AssetType::value] or
5445        /// [AssetType::name].
5446        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        /// Gets the enum value.
5459        ///
5460        /// Returns `None` if the enum contains an unknown value deserialized from
5461        /// the string representation of enums.
5462        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        /// Gets the enum value as a string.
5473        ///
5474        /// Returns `None` if the enum contains an unknown value deserialized from
5475        /// the integer representation of enums.
5476        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    /// The quota of one asset type.
5556    #[derive(Clone, Debug, PartialEq)]
5557    #[non_exhaustive]
5558    pub enum Quota {
5559        /// Instance quota.
5560        InstanceQuota(std::boxed::Box<crate::model::InstanceQuota>),
5561    }
5562
5563    /// Available quantity based on asset type.
5564    #[derive(Clone, Debug, PartialEq)]
5565    #[non_exhaustive]
5566    pub enum Availability {
5567        /// Server count.
5568        ServerCount(i64),
5569        /// Network bandwidth, Gbps
5570        NetworkBandwidth(i64),
5571        /// Storage size (GB).
5572        StorageGib(i64),
5573    }
5574}
5575
5576/// Message for requesting the list of provisioning quotas.
5577#[derive(Clone, Default, PartialEq)]
5578#[non_exhaustive]
5579pub struct ListProvisioningQuotasRequest {
5580    /// Required. Parent value for ListProvisioningQuotasRequest.
5581    pub parent: std::string::String,
5582
5583    /// Requested page size. The server might return fewer items than requested.
5584    /// If unspecified, server will pick an appropriate default.
5585    /// Notice that page_size field is not supported and won't be respected in
5586    /// the API request for now, will be updated when pagination is supported.
5587    pub page_size: i32,
5588
5589    /// A token identifying a page of results from the server.
5590    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    /// Sets the value of [parent][crate::model::ListProvisioningQuotasRequest::parent].
5601    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    /// Sets the value of [page_size][crate::model::ListProvisioningQuotasRequest::page_size].
5607    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    /// Sets the value of [page_token][crate::model::ListProvisioningQuotasRequest::page_token].
5613    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/// Response message for the list of provisioning quotas.
5626#[derive(Clone, Default, PartialEq)]
5627#[non_exhaustive]
5628pub struct ListProvisioningQuotasResponse {
5629    /// The provisioning quotas registered in this project.
5630    pub provisioning_quotas: std::vec::Vec<crate::model::ProvisioningQuota>,
5631
5632    /// Token to retrieve the next page of results, or empty if there are no more
5633    /// results in the list.
5634    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    /// Sets the value of [provisioning_quotas][crate::model::ListProvisioningQuotasResponse::provisioning_quotas].
5645    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    /// Sets the value of [next_page_token][crate::model::ListProvisioningQuotasResponse::next_page_token].
5656    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/// Configuration parameters for a new instance.
5683#[derive(Clone, Default, PartialEq)]
5684#[non_exhaustive]
5685pub struct InstanceConfig {
5686    /// Output only. The name of the instance config.
5687    pub name: std::string::String,
5688
5689    /// A transient unique identifier to idenfity an instance within an
5690    /// ProvisioningConfig request.
5691    pub id: std::string::String,
5692
5693    /// Instance type.
5694    /// [Available
5695    /// types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
5696    pub instance_type: std::string::String,
5697
5698    /// Whether the instance should be provisioned with Hyperthreading enabled.
5699    pub hyperthreading: bool,
5700
5701    /// OS image to initialize the instance.
5702    /// [Available
5703    /// images](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
5704    pub os_image: std::string::String,
5705
5706    /// Client network address. Filled if InstanceConfig.multivlan_config is false.
5707    #[deprecated]
5708    pub client_network: std::option::Option<crate::model::instance_config::NetworkAddress>,
5709
5710    /// Private network address, if any. Filled if InstanceConfig.multivlan_config
5711    /// is false.
5712    #[deprecated]
5713    pub private_network: std::option::Option<crate::model::instance_config::NetworkAddress>,
5714
5715    /// User note field, it can be used by customers to add additional information
5716    /// for the BMS Ops team .
5717    pub user_note: std::string::String,
5718
5719    /// If true networks can be from different projects of the same vendor account.
5720    pub account_networks_enabled: bool,
5721
5722    /// The type of network configuration on the instance.
5723    pub network_config: crate::model::instance_config::NetworkConfig,
5724
5725    /// Server network template name. Filled if InstanceConfig.multivlan_config is
5726    /// true.
5727    pub network_template: std::string::String,
5728
5729    /// List of logical interfaces for the instance. The number of logical
5730    /// interfaces will be the same as number of hardware bond/nic on the chosen
5731    /// network template. Filled if InstanceConfig.multivlan_config is true.
5732    pub logical_interfaces: std::vec::Vec<crate::model::LogicalInterface>,
5733
5734    /// List of names of ssh keys used to provision the instance.
5735    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    /// Sets the value of [name][crate::model::InstanceConfig::name].
5746    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    /// Sets the value of [id][crate::model::InstanceConfig::id].
5752    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    /// Sets the value of [instance_type][crate::model::InstanceConfig::instance_type].
5758    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    /// Sets the value of [hyperthreading][crate::model::InstanceConfig::hyperthreading].
5764    pub fn set_hyperthreading<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5765        self.hyperthreading = v.into();
5766        self
5767    }
5768
5769    /// Sets the value of [os_image][crate::model::InstanceConfig::os_image].
5770    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    /// Sets the value of [client_network][crate::model::InstanceConfig::client_network].
5776    #[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    /// Sets or clears the value of [client_network][crate::model::InstanceConfig::client_network].
5786    #[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    /// Sets the value of [private_network][crate::model::InstanceConfig::private_network].
5796    #[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    /// Sets or clears the value of [private_network][crate::model::InstanceConfig::private_network].
5806    #[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    /// Sets the value of [user_note][crate::model::InstanceConfig::user_note].
5816    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    /// Sets the value of [account_networks_enabled][crate::model::InstanceConfig::account_networks_enabled].
5822    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    /// Sets the value of [network_config][crate::model::InstanceConfig::network_config].
5828    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    /// Sets the value of [network_template][crate::model::InstanceConfig::network_template].
5839    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    /// Sets the value of [logical_interfaces][crate::model::InstanceConfig::logical_interfaces].
5848    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    /// Sets the value of [ssh_key_names][crate::model::InstanceConfig::ssh_key_names].
5859    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
5876/// Defines additional types related to [InstanceConfig].
5877pub mod instance_config {
5878    #[allow(unused_imports)]
5879    use super::*;
5880
5881    /// A network.
5882    #[derive(Clone, Default, PartialEq)]
5883    #[non_exhaustive]
5884    pub struct NetworkAddress {
5885        /// Id of the network to use, within the same ProvisioningConfig request.
5886        pub network_id: std::string::String,
5887
5888        /// IPv4 address to be assigned to the server.
5889        pub address: std::string::String,
5890
5891        /// Name of the existing network to use.
5892        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        /// Sets the value of [network_id][crate::model::instance_config::NetworkAddress::network_id].
5903        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        /// Sets the value of [address][crate::model::instance_config::NetworkAddress::address].
5909        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        /// Sets the value of [existing_network_id][crate::model::instance_config::NetworkAddress::existing_network_id].
5915        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    /// The network configuration of the instance.
5931    ///
5932    /// # Working with unknown values
5933    ///
5934    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5935    /// additional enum variants at any time. Adding new variants is not considered
5936    /// a breaking change. Applications should write their code in anticipation of:
5937    ///
5938    /// - New values appearing in future releases of the client library, **and**
5939    /// - New values received dynamically, without application changes.
5940    ///
5941    /// Please consult the [Working with enums] section in the user guide for some
5942    /// guidelines.
5943    ///
5944    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5945    #[derive(Clone, Debug, PartialEq)]
5946    #[non_exhaustive]
5947    pub enum NetworkConfig {
5948        /// The unspecified network configuration.
5949        NetworkconfigUnspecified,
5950        /// Instance part of single client network and single private network.
5951        SingleVlan,
5952        /// Instance part of multiple (or single) client networks and private
5953        /// networks.
5954        MultiVlan,
5955        /// If set, the enum was initialized with an unknown value.
5956        ///
5957        /// Applications can examine the value using [NetworkConfig::value] or
5958        /// [NetworkConfig::name].
5959        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        /// Gets the enum value.
5972        ///
5973        /// Returns `None` if the enum contains an unknown value deserialized from
5974        /// the string representation of enums.
5975        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        /// Gets the enum value as a string.
5985        ///
5986        /// Returns `None` if the enum contains an unknown value deserialized from
5987        /// the integer representation of enums.
5988        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/// Configuration parameters for a new volume.
6067#[derive(Clone, Default, PartialEq)]
6068#[non_exhaustive]
6069pub struct VolumeConfig {
6070    /// Output only. The name of the volume config.
6071    pub name: std::string::String,
6072
6073    /// A transient unique identifier to identify a volume within an
6074    /// ProvisioningConfig request.
6075    pub id: std::string::String,
6076
6077    /// Whether snapshots should be enabled.
6078    pub snapshots_enabled: bool,
6079
6080    /// The type of this Volume.
6081    pub r#type: crate::model::volume_config::Type,
6082
6083    /// Volume protocol.
6084    pub protocol: crate::model::volume_config::Protocol,
6085
6086    /// The requested size of this volume, in GB.
6087    pub size_gb: i32,
6088
6089    /// LUN ranges to be configured. Set only when protocol is PROTOCOL_FC.
6090    pub lun_ranges: std::vec::Vec<crate::model::volume_config::LunRange>,
6091
6092    /// Machine ids connected to this volume. Set only when protocol is
6093    /// PROTOCOL_FC.
6094    pub machine_ids: std::vec::Vec<std::string::String>,
6095
6096    /// NFS exports. Set only when protocol is PROTOCOL_NFS.
6097    pub nfs_exports: std::vec::Vec<crate::model::volume_config::NfsExport>,
6098
6099    /// User note field, it can be used by customers to add additional information
6100    /// for the BMS Ops team .
6101    pub user_note: std::string::String,
6102
6103    /// The GCP service of the storage volume. Available gcp_service are in
6104    /// <https://cloud.google.com/bare-metal/docs/bms-planning>.
6105    pub gcp_service: std::string::String,
6106
6107    /// Performance tier of the Volume.
6108    /// Default is SHARED.
6109    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    /// Sets the value of [name][crate::model::VolumeConfig::name].
6120    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    /// Sets the value of [id][crate::model::VolumeConfig::id].
6126    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    /// Sets the value of [snapshots_enabled][crate::model::VolumeConfig::snapshots_enabled].
6132    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    /// Sets the value of [r#type][crate::model::VolumeConfig::type].
6138    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    /// Sets the value of [protocol][crate::model::VolumeConfig::protocol].
6147    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    /// Sets the value of [size_gb][crate::model::VolumeConfig::size_gb].
6156    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    /// Sets the value of [lun_ranges][crate::model::VolumeConfig::lun_ranges].
6162    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    /// Sets the value of [machine_ids][crate::model::VolumeConfig::machine_ids].
6173    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    /// Sets the value of [nfs_exports][crate::model::VolumeConfig::nfs_exports].
6184    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    /// Sets the value of [user_note][crate::model::VolumeConfig::user_note].
6195    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    /// Sets the value of [gcp_service][crate::model::VolumeConfig::gcp_service].
6201    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    /// Sets the value of [performance_tier][crate::model::VolumeConfig::performance_tier].
6207    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
6222/// Defines additional types related to [VolumeConfig].
6223pub mod volume_config {
6224    #[allow(unused_imports)]
6225    use super::*;
6226
6227    /// A LUN(Logical Unit Number) range.
6228    #[derive(Clone, Default, PartialEq)]
6229    #[non_exhaustive]
6230    pub struct LunRange {
6231        /// Number of LUNs to create.
6232        pub quantity: i32,
6233
6234        /// The requested size of each LUN, in GB.
6235        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        /// Sets the value of [quantity][crate::model::volume_config::LunRange::quantity].
6246        pub fn set_quantity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6247            self.quantity = v.into();
6248            self
6249        }
6250
6251        /// Sets the value of [size_gb][crate::model::volume_config::LunRange::size_gb].
6252        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    /// A NFS export entry.
6265    #[derive(Clone, Default, PartialEq)]
6266    #[non_exhaustive]
6267    pub struct NfsExport {
6268        /// Network to use to publish the export.
6269        pub network_id: std::string::String,
6270
6271        /// Export permissions.
6272        pub permissions: crate::model::volume_config::nfs_export::Permissions,
6273
6274        /// Disable root squashing, which is a feature of NFS.
6275        /// Root squash is a special mapping of the remote superuser (root) identity
6276        /// when using identity authentication.
6277        pub no_root_squash: bool,
6278
6279        /// Allow the setuid flag.
6280        pub allow_suid: bool,
6281
6282        /// Allow dev flag in NfsShare AllowedClientsRequest.
6283        pub allow_dev: bool,
6284
6285        /// A client object.
6286        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        /// Sets the value of [network_id][crate::model::volume_config::NfsExport::network_id].
6297        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        /// Sets the value of [permissions][crate::model::volume_config::NfsExport::permissions].
6303        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        /// Sets the value of [no_root_squash][crate::model::volume_config::NfsExport::no_root_squash].
6314        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        /// Sets the value of [allow_suid][crate::model::volume_config::NfsExport::allow_suid].
6320        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        /// Sets the value of [allow_dev][crate::model::volume_config::NfsExport::allow_dev].
6326        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        /// Sets the value of [client][crate::model::volume_config::NfsExport::client].
6332        ///
6333        /// Note that all the setters affecting `client` are mutually
6334        /// exclusive.
6335        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        /// The value of [client][crate::model::volume_config::NfsExport::client]
6348        /// if it holds a `MachineId`, `None` if the field is not set or
6349        /// holds a different branch.
6350        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        /// Sets the value of [client][crate::model::volume_config::NfsExport::client]
6361        /// to hold a `MachineId`.
6362        ///
6363        /// Note that all the setters affecting `client` are
6364        /// mutually exclusive.
6365        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        /// The value of [client][crate::model::volume_config::NfsExport::client]
6373        /// if it holds a `Cidr`, `None` if the field is not set or
6374        /// holds a different branch.
6375        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        /// Sets the value of [client][crate::model::volume_config::NfsExport::client]
6386        /// to hold a `Cidr`.
6387        ///
6388        /// Note that all the setters affecting `client` are
6389        /// mutually exclusive.
6390        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    /// Defines additional types related to [NfsExport].
6405    pub mod nfs_export {
6406        #[allow(unused_imports)]
6407        use super::*;
6408
6409        /// Permissions that can granted for an export.
6410        ///
6411        /// # Working with unknown values
6412        ///
6413        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6414        /// additional enum variants at any time. Adding new variants is not considered
6415        /// a breaking change. Applications should write their code in anticipation of:
6416        ///
6417        /// - New values appearing in future releases of the client library, **and**
6418        /// - New values received dynamically, without application changes.
6419        ///
6420        /// Please consult the [Working with enums] section in the user guide for some
6421        /// guidelines.
6422        ///
6423        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6424        #[derive(Clone, Debug, PartialEq)]
6425        #[non_exhaustive]
6426        pub enum Permissions {
6427            /// Unspecified value.
6428            Unspecified,
6429            /// Read-only permission.
6430            ReadOnly,
6431            /// Read-write permission.
6432            ReadWrite,
6433            /// If set, the enum was initialized with an unknown value.
6434            ///
6435            /// Applications can examine the value using [Permissions::value] or
6436            /// [Permissions::name].
6437            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            /// Gets the enum value.
6450            ///
6451            /// Returns `None` if the enum contains an unknown value deserialized from
6452            /// the string representation of enums.
6453            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            /// Gets the enum value as a string.
6463            ///
6464            /// Returns `None` if the enum contains an unknown value deserialized from
6465            /// the integer representation of enums.
6466            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        /// A client object.
6545        #[derive(Clone, Debug, PartialEq)]
6546        #[non_exhaustive]
6547        pub enum Client {
6548            /// Either a single machine, identified by an ID, or a comma-separated
6549            /// list of machine IDs.
6550            MachineId(std::string::String),
6551            /// A CIDR range.
6552            Cidr(std::string::String),
6553        }
6554    }
6555
6556    /// The types of Volumes.
6557    ///
6558    /// # Working with unknown values
6559    ///
6560    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6561    /// additional enum variants at any time. Adding new variants is not considered
6562    /// a breaking change. Applications should write their code in anticipation of:
6563    ///
6564    /// - New values appearing in future releases of the client library, **and**
6565    /// - New values received dynamically, without application changes.
6566    ///
6567    /// Please consult the [Working with enums] section in the user guide for some
6568    /// guidelines.
6569    ///
6570    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6571    #[derive(Clone, Debug, PartialEq)]
6572    #[non_exhaustive]
6573    pub enum Type {
6574        /// The unspecified type.
6575        Unspecified,
6576        /// This Volume is on flash.
6577        Flash,
6578        /// This Volume is on disk.
6579        Disk,
6580        /// If set, the enum was initialized with an unknown value.
6581        ///
6582        /// Applications can examine the value using [Type::value] or
6583        /// [Type::name].
6584        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        /// Gets the enum value.
6597        ///
6598        /// Returns `None` if the enum contains an unknown value deserialized from
6599        /// the string representation of enums.
6600        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        /// Gets the enum value as a string.
6610        ///
6611        /// Returns `None` if the enum contains an unknown value deserialized from
6612        /// the integer representation of enums.
6613        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    /// The protocol used to access the volume.
6689    ///
6690    /// # Working with unknown values
6691    ///
6692    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6693    /// additional enum variants at any time. Adding new variants is not considered
6694    /// a breaking change. Applications should write their code in anticipation of:
6695    ///
6696    /// - New values appearing in future releases of the client library, **and**
6697    /// - New values received dynamically, without application changes.
6698    ///
6699    /// Please consult the [Working with enums] section in the user guide for some
6700    /// guidelines.
6701    ///
6702    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6703    #[derive(Clone, Debug, PartialEq)]
6704    #[non_exhaustive]
6705    pub enum Protocol {
6706        /// Unspecified value.
6707        Unspecified,
6708        /// Fibre channel.
6709        Fc,
6710        /// Network file system.
6711        Nfs,
6712        /// If set, the enum was initialized with an unknown value.
6713        ///
6714        /// Applications can examine the value using [Protocol::value] or
6715        /// [Protocol::name].
6716        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        /// Gets the enum value.
6729        ///
6730        /// Returns `None` if the enum contains an unknown value deserialized from
6731        /// the string representation of enums.
6732        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        /// Gets the enum value as a string.
6742        ///
6743        /// Returns `None` if the enum contains an unknown value deserialized from
6744        /// the integer representation of enums.
6745        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/// Configuration parameters for a new network.
6822#[derive(Clone, Default, PartialEq)]
6823#[non_exhaustive]
6824pub struct NetworkConfig {
6825    /// Output only. The name of the network config.
6826    pub name: std::string::String,
6827
6828    /// A transient unique identifier to identify a volume within an
6829    /// ProvisioningConfig request.
6830    pub id: std::string::String,
6831
6832    /// The type of this network, either Client or Private.
6833    pub r#type: crate::model::network_config::Type,
6834
6835    /// Interconnect bandwidth. Set only when type is CLIENT.
6836    pub bandwidth: crate::model::network_config::Bandwidth,
6837
6838    /// List of VLAN attachments. As of now there are always 2 attachments, but it
6839    /// is going to change in  the future (multi vlan).
6840    pub vlan_attachments: std::vec::Vec<crate::model::network_config::IntakeVlanAttachment>,
6841
6842    /// CIDR range of the network.
6843    pub cidr: std::string::String,
6844
6845    /// Service CIDR, if any.
6846    pub service_cidr: crate::model::network_config::ServiceCidr,
6847
6848    /// User note field, it can be used by customers to add additional information
6849    /// for the BMS Ops team .
6850    pub user_note: std::string::String,
6851
6852    /// The GCP service of the network. Available gcp_service are in
6853    /// <https://cloud.google.com/bare-metal/docs/bms-planning>.
6854    pub gcp_service: std::string::String,
6855
6856    /// Whether the VLAN attachment pair is located in the same project.
6857    pub vlan_same_project: bool,
6858
6859    /// The JumboFramesEnabled option for customer to set.
6860    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    /// Sets the value of [name][crate::model::NetworkConfig::name].
6871    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    /// Sets the value of [id][crate::model::NetworkConfig::id].
6877    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    /// Sets the value of [r#type][crate::model::NetworkConfig::type].
6883    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    /// Sets the value of [bandwidth][crate::model::NetworkConfig::bandwidth].
6892    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    /// Sets the value of [vlan_attachments][crate::model::NetworkConfig::vlan_attachments].
6901    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    /// Sets the value of [cidr][crate::model::NetworkConfig::cidr].
6912    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    /// Sets the value of [service_cidr][crate::model::NetworkConfig::service_cidr].
6918    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    /// Sets the value of [user_note][crate::model::NetworkConfig::user_note].
6927    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    /// Sets the value of [gcp_service][crate::model::NetworkConfig::gcp_service].
6933    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    /// Sets the value of [vlan_same_project][crate::model::NetworkConfig::vlan_same_project].
6939    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    /// Sets the value of [jumbo_frames_enabled][crate::model::NetworkConfig::jumbo_frames_enabled].
6945    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
6957/// Defines additional types related to [NetworkConfig].
6958pub mod network_config {
6959    #[allow(unused_imports)]
6960    use super::*;
6961
6962    /// A GCP vlan attachment.
6963    #[derive(Clone, Default, PartialEq)]
6964    #[non_exhaustive]
6965    pub struct IntakeVlanAttachment {
6966        /// Identifier of the VLAN attachment.
6967        pub id: std::string::String,
6968
6969        /// Attachment pairing key.
6970        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        /// Sets the value of [id][crate::model::network_config::IntakeVlanAttachment::id].
6981        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        /// Sets the value of [pairing_key][crate::model::network_config::IntakeVlanAttachment::pairing_key].
6987        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    /// Network type.
7000    ///
7001    /// # Working with unknown values
7002    ///
7003    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7004    /// additional enum variants at any time. Adding new variants is not considered
7005    /// a breaking change. Applications should write their code in anticipation of:
7006    ///
7007    /// - New values appearing in future releases of the client library, **and**
7008    /// - New values received dynamically, without application changes.
7009    ///
7010    /// Please consult the [Working with enums] section in the user guide for some
7011    /// guidelines.
7012    ///
7013    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7014    #[derive(Clone, Debug, PartialEq)]
7015    #[non_exhaustive]
7016    pub enum Type {
7017        /// Unspecified value.
7018        Unspecified,
7019        /// Client network, that is a network peered to a GCP VPC.
7020        Client,
7021        /// Private network, that is a network local to the BMS POD.
7022        Private,
7023        /// If set, the enum was initialized with an unknown value.
7024        ///
7025        /// Applications can examine the value using [Type::value] or
7026        /// [Type::name].
7027        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        /// Gets the enum value.
7040        ///
7041        /// Returns `None` if the enum contains an unknown value deserialized from
7042        /// the string representation of enums.
7043        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        /// Gets the enum value as a string.
7053        ///
7054        /// Returns `None` if the enum contains an unknown value deserialized from
7055        /// the integer representation of enums.
7056        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    /// Interconnect bandwidth.
7132    ///
7133    /// # Working with unknown values
7134    ///
7135    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7136    /// additional enum variants at any time. Adding new variants is not considered
7137    /// a breaking change. Applications should write their code in anticipation of:
7138    ///
7139    /// - New values appearing in future releases of the client library, **and**
7140    /// - New values received dynamically, without application changes.
7141    ///
7142    /// Please consult the [Working with enums] section in the user guide for some
7143    /// guidelines.
7144    ///
7145    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7146    #[derive(Clone, Debug, PartialEq)]
7147    #[non_exhaustive]
7148    pub enum Bandwidth {
7149        /// Unspecified value.
7150        Unspecified,
7151        /// 1 Gbps.
7152        Bw1Gbps,
7153        /// 2 Gbps.
7154        Bw2Gbps,
7155        /// 5 Gbps.
7156        Bw5Gbps,
7157        /// 10 Gbps.
7158        Bw10Gbps,
7159        /// If set, the enum was initialized with an unknown value.
7160        ///
7161        /// Applications can examine the value using [Bandwidth::value] or
7162        /// [Bandwidth::name].
7163        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        /// Gets the enum value.
7176        ///
7177        /// Returns `None` if the enum contains an unknown value deserialized from
7178        /// the string representation of enums.
7179        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        /// Gets the enum value as a string.
7191        ///
7192        /// Returns `None` if the enum contains an unknown value deserialized from
7193        /// the integer representation of enums.
7194        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    /// Service network block.
7278    ///
7279    /// # Working with unknown values
7280    ///
7281    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7282    /// additional enum variants at any time. Adding new variants is not considered
7283    /// a breaking change. Applications should write their code in anticipation of:
7284    ///
7285    /// - New values appearing in future releases of the client library, **and**
7286    /// - New values received dynamically, without application changes.
7287    ///
7288    /// Please consult the [Working with enums] section in the user guide for some
7289    /// guidelines.
7290    ///
7291    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7292    #[derive(Clone, Debug, PartialEq)]
7293    #[non_exhaustive]
7294    pub enum ServiceCidr {
7295        /// Unspecified value.
7296        Unspecified,
7297        /// Services are disabled for the given network.
7298        Disabled,
7299        /// Use the highest /26 block of the network to host services.
7300        High26,
7301        /// Use the highest /27 block of the network to host services.
7302        High27,
7303        /// Use the highest /28 block of the network to host services.
7304        High28,
7305        /// If set, the enum was initialized with an unknown value.
7306        ///
7307        /// Applications can examine the value using [ServiceCidr::value] or
7308        /// [ServiceCidr::name].
7309        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        /// Gets the enum value.
7322        ///
7323        /// Returns `None` if the enum contains an unknown value deserialized from
7324        /// the string representation of enums.
7325        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        /// Gets the enum value as a string.
7337        ///
7338        /// Returns `None` if the enum contains an unknown value deserialized from
7339        /// the integer representation of enums.
7340        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/// A resource budget.
7425#[derive(Clone, Default, PartialEq)]
7426#[non_exhaustive]
7427pub struct InstanceQuota {
7428    /// Output only. The name of the instance quota.
7429    pub name: std::string::String,
7430
7431    /// Instance type.
7432    /// Deprecated: use gcp_service.
7433    #[deprecated]
7434    pub instance_type: std::string::String,
7435
7436    /// The gcp service of the provisioning quota.
7437    pub gcp_service: std::string::String,
7438
7439    /// Location where the quota applies.
7440    pub location: std::string::String,
7441
7442    /// Number of machines than can be created for the given location and
7443    /// instance_type.
7444    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    /// Sets the value of [name][crate::model::InstanceQuota::name].
7455    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    /// Sets the value of [instance_type][crate::model::InstanceQuota::instance_type].
7461    #[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    /// Sets the value of [gcp_service][crate::model::InstanceQuota::gcp_service].
7468    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    /// Sets the value of [location][crate::model::InstanceQuota::location].
7474    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    /// Sets the value of [available_machine_count][crate::model::InstanceQuota::available_machine_count].
7480    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/// Request for GetProvisioningConfig.
7493#[derive(Clone, Default, PartialEq)]
7494#[non_exhaustive]
7495pub struct GetProvisioningConfigRequest {
7496    /// Required. Name of the ProvisioningConfig.
7497    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    /// Sets the value of [name][crate::model::GetProvisioningConfigRequest::name].
7508    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/// Request for CreateProvisioningConfig.
7521#[derive(Clone, Default, PartialEq)]
7522#[non_exhaustive]
7523pub struct CreateProvisioningConfigRequest {
7524    /// Required. The parent project and location containing the
7525    /// ProvisioningConfig.
7526    pub parent: std::string::String,
7527
7528    /// Required. The ProvisioningConfig to create.
7529    pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
7530
7531    /// Optional. Email provided to send a confirmation with provisioning config
7532    /// to.
7533    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    /// Sets the value of [parent][crate::model::CreateProvisioningConfigRequest::parent].
7544    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    /// Sets the value of [provisioning_config][crate::model::CreateProvisioningConfigRequest::provisioning_config].
7550    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    /// Sets or clears the value of [provisioning_config][crate::model::CreateProvisioningConfigRequest::provisioning_config].
7559    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    /// Sets the value of [email][crate::model::CreateProvisioningConfigRequest::email].
7568    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/// Message for updating a ProvisioningConfig.
7581#[derive(Clone, Default, PartialEq)]
7582#[non_exhaustive]
7583pub struct UpdateProvisioningConfigRequest {
7584    /// Required. The ProvisioningConfig to update.
7585    pub provisioning_config: std::option::Option<crate::model::ProvisioningConfig>,
7586
7587    /// Required. The list of fields to update.
7588    pub update_mask: std::option::Option<wkt::FieldMask>,
7589
7590    /// Optional. Email provided to send a confirmation with provisioning config
7591    /// to.
7592    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    /// Sets the value of [provisioning_config][crate::model::UpdateProvisioningConfigRequest::provisioning_config].
7603    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    /// Sets or clears the value of [provisioning_config][crate::model::UpdateProvisioningConfigRequest::provisioning_config].
7612    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    /// Sets the value of [update_mask][crate::model::UpdateProvisioningConfigRequest::update_mask].
7621    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    /// Sets or clears the value of [update_mask][crate::model::UpdateProvisioningConfigRequest::update_mask].
7630    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    /// Sets the value of [email][crate::model::UpdateProvisioningConfigRequest::email].
7639    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/// An SSH key, used for authorizing with the interactive serial console feature.
7652#[derive(Clone, Default, PartialEq)]
7653#[non_exhaustive]
7654pub struct SSHKey {
7655    /// Output only. The name of this SSH key.
7656    /// Currently, the only valid value for the location is "global".
7657    pub name: std::string::String,
7658
7659    /// The public SSH key. This must be in OpenSSH .authorized_keys format.
7660    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    /// Sets the value of [name][crate::model::SSHKey::name].
7671    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    /// Sets the value of [public_key][crate::model::SSHKey::public_key].
7677    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/// Message for listing the public SSH keys in a project.
7690#[derive(Clone, Default, PartialEq)]
7691#[non_exhaustive]
7692pub struct ListSSHKeysRequest {
7693    /// Required. The parent containing the SSH keys.
7694    /// Currently, the only valid value for the location is "global".
7695    pub parent: std::string::String,
7696
7697    /// The maximum number of items to return.
7698    pub page_size: i32,
7699
7700    /// The next_page_token value returned from a previous List request, if any.
7701    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    /// Sets the value of [parent][crate::model::ListSSHKeysRequest::parent].
7712    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    /// Sets the value of [page_size][crate::model::ListSSHKeysRequest::page_size].
7718    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    /// Sets the value of [page_token][crate::model::ListSSHKeysRequest::page_token].
7724    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/// Message for response of ListSSHKeys.
7737#[derive(Clone, Default, PartialEq)]
7738#[non_exhaustive]
7739pub struct ListSSHKeysResponse {
7740    /// The SSH keys registered in the project.
7741    pub ssh_keys: std::vec::Vec<crate::model::SSHKey>,
7742
7743    /// Token to retrieve the next page of results, or empty if there are no more
7744    /// results in the list.
7745    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    /// Sets the value of [ssh_keys][crate::model::ListSSHKeysResponse::ssh_keys].
7756    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    /// Sets the value of [next_page_token][crate::model::ListSSHKeysResponse::next_page_token].
7767    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/// Message for registering a public SSH key in a project.
7794#[derive(Clone, Default, PartialEq)]
7795#[non_exhaustive]
7796pub struct CreateSSHKeyRequest {
7797    /// Required. The parent containing the SSH keys.
7798    pub parent: std::string::String,
7799
7800    /// Required. The SSH key to register.
7801    pub ssh_key: std::option::Option<crate::model::SSHKey>,
7802
7803    /// Required. The ID to use for the key, which will become the final component
7804    /// of the key's resource name.
7805    ///
7806    /// This value must match the regex:
7807    /// [a-zA-Z0-9@.\-_]{1,64}
7808    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    /// Sets the value of [parent][crate::model::CreateSSHKeyRequest::parent].
7819    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    /// Sets the value of [ssh_key][crate::model::CreateSSHKeyRequest::ssh_key].
7825    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    /// Sets or clears the value of [ssh_key][crate::model::CreateSSHKeyRequest::ssh_key].
7834    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    /// Sets the value of [ssh_key_id][crate::model::CreateSSHKeyRequest::ssh_key_id].
7843    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/// Message for deleting an SSH key from a project.
7856#[derive(Clone, Default, PartialEq)]
7857#[non_exhaustive]
7858pub struct DeleteSSHKeyRequest {
7859    /// Required. The name of the SSH key to delete.
7860    /// Currently, the only valid value for the location is "global".
7861    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    /// Sets the value of [name][crate::model::DeleteSSHKeyRequest::name].
7872    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/// A storage volume.
7885#[derive(Clone, Default, PartialEq)]
7886#[non_exhaustive]
7887pub struct Volume {
7888    /// Output only. The resource name of this `Volume`.
7889    /// Resource names are schemeless URIs that follow the conventions in
7890    /// <https://cloud.google.com/apis/design/resource_names>.
7891    /// Format:
7892    /// `projects/{project}/locations/{location}/volumes/{volume}`
7893    pub name: std::string::String,
7894
7895    /// An identifier for the `Volume`, generated by the backend.
7896    pub id: std::string::String,
7897
7898    /// The storage type for this volume.
7899    pub storage_type: crate::model::volume::StorageType,
7900
7901    /// The state of this storage volume.
7902    pub state: crate::model::volume::State,
7903
7904    /// The requested size of this storage volume, in GiB.
7905    pub requested_size_gib: i64,
7906
7907    /// Originally requested size, in GiB.
7908    pub originally_requested_size_gib: i64,
7909
7910    /// The current size of this storage volume, in GiB, including space reserved
7911    /// for snapshots. This size might be different than the requested size if the
7912    /// storage volume has been configured with auto grow or auto shrink.
7913    pub current_size_gib: i64,
7914
7915    /// Additional emergency size that was requested for this Volume, in GiB.
7916    /// current_size_gib includes this value.
7917    pub emergency_size_gib: i64,
7918
7919    /// Maximum size volume can be expanded to in case of evergency, in GiB.
7920    pub max_size_gib: i64,
7921
7922    /// The size, in GiB, that this storage volume has expanded as a result of an
7923    /// auto grow policy. In the absence of auto-grow, the value is 0.
7924    pub auto_grown_size_gib: i64,
7925
7926    /// The space remaining in the storage volume for new LUNs, in GiB, excluding
7927    /// space reserved for snapshots.
7928    pub remaining_space_gib: i64,
7929
7930    /// Details about snapshot space reservation and usage on the storage volume.
7931    pub snapshot_reservation_detail:
7932        std::option::Option<crate::model::volume::SnapshotReservationDetail>,
7933
7934    /// The behavior to use when snapshot reserved space is full.
7935    pub snapshot_auto_delete_behavior: crate::model::volume::SnapshotAutoDeleteBehavior,
7936
7937    /// Labels as key value pairs.
7938    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7939
7940    /// Whether snapshots are enabled.
7941    pub snapshot_enabled: bool,
7942
7943    /// Immutable. Pod name.
7944    pub pod: std::string::String,
7945
7946    /// Output only. Storage protocol for the Volume.
7947    pub protocol: crate::model::volume::Protocol,
7948
7949    /// Output only. Whether this volume is a boot volume. A boot volume is one
7950    /// which contains a boot LUN.
7951    pub boot_volume: bool,
7952
7953    /// Immutable. Performance tier of the Volume.
7954    /// Default is SHARED.
7955    pub performance_tier: crate::model::VolumePerformanceTier,
7956
7957    /// Input only. User-specified notes for new Volume.
7958    /// Used to provision Volumes that require manual intervention.
7959    pub notes: std::string::String,
7960
7961    /// The workload profile for the volume.
7962    pub workload_profile: crate::model::volume::WorkloadProfile,
7963
7964    /// Output only. Time after which volume will be fully deleted.
7965    /// It is filled only for volumes in COOLOFF state.
7966    pub expire_time: std::option::Option<wkt::Timestamp>,
7967
7968    /// Output only. Instances this Volume is attached to.
7969    /// This field is set only in Get requests.
7970    pub instances: std::vec::Vec<std::string::String>,
7971
7972    /// Output only. Is the Volume attached at at least one instance.
7973    /// This field is a lightweight counterpart of `instances` field.
7974    /// It is filled in List responses as well.
7975    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    /// Sets the value of [name][crate::model::Volume::name].
7986    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    /// Sets the value of [id][crate::model::Volume::id].
7992    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    /// Sets the value of [storage_type][crate::model::Volume::storage_type].
7998    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    /// Sets the value of [state][crate::model::Volume::state].
8007    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    /// Sets the value of [requested_size_gib][crate::model::Volume::requested_size_gib].
8013    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    /// Sets the value of [originally_requested_size_gib][crate::model::Volume::originally_requested_size_gib].
8019    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    /// Sets the value of [current_size_gib][crate::model::Volume::current_size_gib].
8025    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    /// Sets the value of [emergency_size_gib][crate::model::Volume::emergency_size_gib].
8031    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    /// Sets the value of [max_size_gib][crate::model::Volume::max_size_gib].
8037    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    /// Sets the value of [auto_grown_size_gib][crate::model::Volume::auto_grown_size_gib].
8043    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    /// Sets the value of [remaining_space_gib][crate::model::Volume::remaining_space_gib].
8049    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    /// Sets the value of [snapshot_reservation_detail][crate::model::Volume::snapshot_reservation_detail].
8055    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    /// Sets or clears the value of [snapshot_reservation_detail][crate::model::Volume::snapshot_reservation_detail].
8064    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    /// Sets the value of [snapshot_auto_delete_behavior][crate::model::Volume::snapshot_auto_delete_behavior].
8073    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    /// Sets the value of [labels][crate::model::Volume::labels].
8084    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    /// Sets the value of [snapshot_enabled][crate::model::Volume::snapshot_enabled].
8096    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    /// Sets the value of [pod][crate::model::Volume::pod].
8102    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    /// Sets the value of [protocol][crate::model::Volume::protocol].
8108    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    /// Sets the value of [boot_volume][crate::model::Volume::boot_volume].
8117    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    /// Sets the value of [performance_tier][crate::model::Volume::performance_tier].
8123    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    /// Sets the value of [notes][crate::model::Volume::notes].
8132    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    /// Sets the value of [workload_profile][crate::model::Volume::workload_profile].
8138    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    /// Sets the value of [expire_time][crate::model::Volume::expire_time].
8147    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    /// Sets or clears the value of [expire_time][crate::model::Volume::expire_time].
8156    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    /// Sets the value of [instances][crate::model::Volume::instances].
8165    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    /// Sets the value of [attached][crate::model::Volume::attached].
8176    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
8188/// Defines additional types related to [Volume].
8189pub mod volume {
8190    #[allow(unused_imports)]
8191    use super::*;
8192
8193    /// Details about snapshot space reservation and usage on the storage volume.
8194    #[derive(Clone, Default, PartialEq)]
8195    #[non_exhaustive]
8196    pub struct SnapshotReservationDetail {
8197        /// The space on this storage volume reserved for snapshots, shown in GiB.
8198        pub reserved_space_gib: i64,
8199
8200        /// The percent of snapshot space on this storage volume actually being used
8201        /// by the snapshot copies. This value might be higher than 100% if the
8202        /// snapshot copies have overflowed into the data portion of the storage
8203        /// volume.
8204        pub reserved_space_used_percent: i32,
8205
8206        /// The amount, in GiB, of available space in this storage volume's reserved
8207        /// snapshot space.
8208        pub reserved_space_remaining_gib: i64,
8209
8210        /// Percent of the total Volume size reserved for snapshot copies.
8211        /// Enabling snapshots requires reserving 20% or more of
8212        /// the storage volume space for snapshots. Maximum reserved space for
8213        /// snapshots is 40%.
8214        /// Setting this field will effectively set snapshot_enabled to true.
8215        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        /// Sets the value of [reserved_space_gib][crate::model::volume::SnapshotReservationDetail::reserved_space_gib].
8226        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        /// Sets the value of [reserved_space_used_percent][crate::model::volume::SnapshotReservationDetail::reserved_space_used_percent].
8232        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        /// Sets the value of [reserved_space_remaining_gib][crate::model::volume::SnapshotReservationDetail::reserved_space_remaining_gib].
8238        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        /// Sets the value of [reserved_space_percent][crate::model::volume::SnapshotReservationDetail::reserved_space_percent].
8247        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    /// The storage type for a volume.
8260    ///
8261    /// # Working with unknown values
8262    ///
8263    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8264    /// additional enum variants at any time. Adding new variants is not considered
8265    /// a breaking change. Applications should write their code in anticipation of:
8266    ///
8267    /// - New values appearing in future releases of the client library, **and**
8268    /// - New values received dynamically, without application changes.
8269    ///
8270    /// Please consult the [Working with enums] section in the user guide for some
8271    /// guidelines.
8272    ///
8273    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8274    #[derive(Clone, Debug, PartialEq)]
8275    #[non_exhaustive]
8276    pub enum StorageType {
8277        /// The storage type for this volume is unknown.
8278        Unspecified,
8279        /// The storage type for this volume is SSD.
8280        Ssd,
8281        /// This storage type for this volume is HDD.
8282        Hdd,
8283        /// If set, the enum was initialized with an unknown value.
8284        ///
8285        /// Applications can examine the value using [StorageType::value] or
8286        /// [StorageType::name].
8287        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        /// Gets the enum value.
8300        ///
8301        /// Returns `None` if the enum contains an unknown value deserialized from
8302        /// the string representation of enums.
8303        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        /// Gets the enum value as a string.
8313        ///
8314        /// Returns `None` if the enum contains an unknown value deserialized from
8315        /// the integer representation of enums.
8316        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    /// The possible states for a storage volume.
8392    ///
8393    /// # Working with unknown values
8394    ///
8395    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8396    /// additional enum variants at any time. Adding new variants is not considered
8397    /// a breaking change. Applications should write their code in anticipation of:
8398    ///
8399    /// - New values appearing in future releases of the client library, **and**
8400    /// - New values received dynamically, without application changes.
8401    ///
8402    /// Please consult the [Working with enums] section in the user guide for some
8403    /// guidelines.
8404    ///
8405    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8406    #[derive(Clone, Debug, PartialEq)]
8407    #[non_exhaustive]
8408    pub enum State {
8409        /// The storage volume is in an unknown state.
8410        Unspecified,
8411        /// The storage volume is being created.
8412        Creating,
8413        /// The storage volume is ready for use.
8414        Ready,
8415        /// The storage volume has been requested to be deleted.
8416        Deleting,
8417        /// The storage volume is being updated.
8418        Updating,
8419        /// The storage volume is in cool off state. It will be deleted after
8420        /// `expire_time`.
8421        CoolOff,
8422        /// If set, the enum was initialized with an unknown value.
8423        ///
8424        /// Applications can examine the value using [State::value] or
8425        /// [State::name].
8426        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        /// Gets the enum value.
8439        ///
8440        /// Returns `None` if the enum contains an unknown value deserialized from
8441        /// the string representation of enums.
8442        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        /// Gets the enum value as a string.
8455        ///
8456        /// Returns `None` if the enum contains an unknown value deserialized from
8457        /// the integer representation of enums.
8458        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    /// The kinds of auto delete behavior to use when snapshot reserved space is
8546    /// full.
8547    ///
8548    /// # Working with unknown values
8549    ///
8550    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8551    /// additional enum variants at any time. Adding new variants is not considered
8552    /// a breaking change. Applications should write their code in anticipation of:
8553    ///
8554    /// - New values appearing in future releases of the client library, **and**
8555    /// - New values received dynamically, without application changes.
8556    ///
8557    /// Please consult the [Working with enums] section in the user guide for some
8558    /// guidelines.
8559    ///
8560    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8561    #[derive(Clone, Debug, PartialEq)]
8562    #[non_exhaustive]
8563    pub enum SnapshotAutoDeleteBehavior {
8564        /// The unspecified behavior.
8565        Unspecified,
8566        /// Don't delete any snapshots. This disables new snapshot creation, as
8567        /// long as the snapshot reserved space is full.
8568        Disabled,
8569        /// Delete the oldest snapshots first.
8570        OldestFirst,
8571        /// Delete the newest snapshots first.
8572        NewestFirst,
8573        /// If set, the enum was initialized with an unknown value.
8574        ///
8575        /// Applications can examine the value using [SnapshotAutoDeleteBehavior::value] or
8576        /// [SnapshotAutoDeleteBehavior::name].
8577        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        /// Gets the enum value.
8590        ///
8591        /// Returns `None` if the enum contains an unknown value deserialized from
8592        /// the string representation of enums.
8593        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        /// Gets the enum value as a string.
8604        ///
8605        /// Returns `None` if the enum contains an unknown value deserialized from
8606        /// the integer representation of enums.
8607        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    /// Storage protocol.
8691    ///
8692    /// # Working with unknown values
8693    ///
8694    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8695    /// additional enum variants at any time. Adding new variants is not considered
8696    /// a breaking change. Applications should write their code in anticipation of:
8697    ///
8698    /// - New values appearing in future releases of the client library, **and**
8699    /// - New values received dynamically, without application changes.
8700    ///
8701    /// Please consult the [Working with enums] section in the user guide for some
8702    /// guidelines.
8703    ///
8704    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8705    #[derive(Clone, Debug, PartialEq)]
8706    #[non_exhaustive]
8707    pub enum Protocol {
8708        /// Value is not specified.
8709        Unspecified,
8710        /// Fibre Channel protocol.
8711        FibreChannel,
8712        /// NFS protocol means Volume is a NFS Share volume.
8713        /// Such volumes cannot be manipulated via Volumes API.
8714        Nfs,
8715        /// If set, the enum was initialized with an unknown value.
8716        ///
8717        /// Applications can examine the value using [Protocol::value] or
8718        /// [Protocol::name].
8719        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        /// Gets the enum value.
8732        ///
8733        /// Returns `None` if the enum contains an unknown value deserialized from
8734        /// the string representation of enums.
8735        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        /// Gets the enum value as a string.
8745        ///
8746        /// Returns `None` if the enum contains an unknown value deserialized from
8747        /// the integer representation of enums.
8748        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    /// The possible values for a workload profile.
8824    ///
8825    /// # Working with unknown values
8826    ///
8827    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8828    /// additional enum variants at any time. Adding new variants is not considered
8829    /// a breaking change. Applications should write their code in anticipation of:
8830    ///
8831    /// - New values appearing in future releases of the client library, **and**
8832    /// - New values received dynamically, without application changes.
8833    ///
8834    /// Please consult the [Working with enums] section in the user guide for some
8835    /// guidelines.
8836    ///
8837    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8838    #[derive(Clone, Debug, PartialEq)]
8839    #[non_exhaustive]
8840    pub enum WorkloadProfile {
8841        /// The workload profile is in an unknown state.
8842        Unspecified,
8843        /// The workload profile is generic.
8844        Generic,
8845        /// The workload profile is hana.
8846        Hana,
8847        /// If set, the enum was initialized with an unknown value.
8848        ///
8849        /// Applications can examine the value using [WorkloadProfile::value] or
8850        /// [WorkloadProfile::name].
8851        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        /// Gets the enum value.
8864        ///
8865        /// Returns `None` if the enum contains an unknown value deserialized from
8866        /// the string representation of enums.
8867        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        /// Gets the enum value as a string.
8877        ///
8878        /// Returns `None` if the enum contains an unknown value deserialized from
8879        /// the integer representation of enums.
8880        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/// Message for requesting storage volume information.
8957#[derive(Clone, Default, PartialEq)]
8958#[non_exhaustive]
8959pub struct GetVolumeRequest {
8960    /// Required. Name of the resource.
8961    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    /// Sets the value of [name][crate::model::GetVolumeRequest::name].
8972    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/// Message for requesting a list of storage volumes.
8985#[derive(Clone, Default, PartialEq)]
8986#[non_exhaustive]
8987pub struct ListVolumesRequest {
8988    /// Required. Parent value for ListVolumesRequest.
8989    pub parent: std::string::String,
8990
8991    /// Requested page size. The server might return fewer items than requested.
8992    /// If unspecified, server will pick an appropriate default.
8993    pub page_size: i32,
8994
8995    /// A token identifying a page of results from the server.
8996    pub page_token: std::string::String,
8997
8998    /// List filter.
8999    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    /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
9010    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    /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
9016    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    /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
9022    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    /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
9028    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/// Response message containing the list of storage volumes.
9041#[derive(Clone, Default, PartialEq)]
9042#[non_exhaustive]
9043pub struct ListVolumesResponse {
9044    /// The list of storage volumes.
9045    pub volumes: std::vec::Vec<crate::model::Volume>,
9046
9047    /// A token identifying a page of results from the server.
9048    pub next_page_token: std::string::String,
9049
9050    /// Locations that could not be reached.
9051    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    /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
9062    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    /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
9073    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    /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
9079    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/// Message for updating a volume.
9111#[derive(Clone, Default, PartialEq)]
9112#[non_exhaustive]
9113pub struct UpdateVolumeRequest {
9114    /// Required. The volume to update.
9115    ///
9116    /// The `name` field is used to identify the volume to update.
9117    /// Format: projects/{project}/locations/{location}/volumes/{volume}
9118    pub volume: std::option::Option<crate::model::Volume>,
9119
9120    /// The list of fields to update.
9121    /// The only currently supported fields are:
9122    /// 'labels'
9123    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    /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
9134    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    /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
9143    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    /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
9152    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    /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
9161    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/// Message requesting rename of a server.
9177#[derive(Clone, Default, PartialEq)]
9178#[non_exhaustive]
9179pub struct RenameVolumeRequest {
9180    /// Required. The `name` field is used to identify the volume.
9181    /// Format: projects/{project}/locations/{location}/volumes/{volume}
9182    pub name: std::string::String,
9183
9184    /// Required. The new `id` of the volume.
9185    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    /// Sets the value of [name][crate::model::RenameVolumeRequest::name].
9196    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    /// Sets the value of [new_volume_id][crate::model::RenameVolumeRequest::new_volume_id].
9202    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/// Request for skip volume cooloff and delete it.
9215#[derive(Clone, Default, PartialEq)]
9216#[non_exhaustive]
9217pub struct EvictVolumeRequest {
9218    /// Required. The name of the Volume.
9219    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    /// Sets the value of [name][crate::model::EvictVolumeRequest::name].
9230    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/// Request for emergency resize Volume.
9243#[derive(Clone, Default, PartialEq)]
9244#[non_exhaustive]
9245pub struct ResizeVolumeRequest {
9246    /// Required. Volume to resize.
9247    pub volume: std::string::String,
9248
9249    /// New Volume size, in GiB.
9250    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    /// Sets the value of [volume][crate::model::ResizeVolumeRequest::volume].
9261    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    /// Sets the value of [size_gib][crate::model::ResizeVolumeRequest::size_gib].
9267    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/// A snapshot of a volume. Only boot volumes can have snapshots.
9280#[derive(Clone, Default, PartialEq)]
9281#[non_exhaustive]
9282pub struct VolumeSnapshot {
9283    /// The name of the snapshot.
9284    pub name: std::string::String,
9285
9286    /// Output only. An identifier for the snapshot, generated by the backend.
9287    pub id: std::string::String,
9288
9289    /// The description of the snapshot.
9290    pub description: std::string::String,
9291
9292    /// Output only. The creation time of the snapshot.
9293    pub create_time: std::option::Option<wkt::Timestamp>,
9294
9295    /// Output only. The name of the volume which this snapshot belongs to.
9296    pub storage_volume: std::string::String,
9297
9298    /// Output only. The type of the snapshot which indicates whether it was
9299    /// scheduled or manual/ad-hoc.
9300    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    /// Sets the value of [name][crate::model::VolumeSnapshot::name].
9311    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    /// Sets the value of [id][crate::model::VolumeSnapshot::id].
9317    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    /// Sets the value of [description][crate::model::VolumeSnapshot::description].
9323    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    /// Sets the value of [create_time][crate::model::VolumeSnapshot::create_time].
9329    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    /// Sets or clears the value of [create_time][crate::model::VolumeSnapshot::create_time].
9338    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    /// Sets the value of [storage_volume][crate::model::VolumeSnapshot::storage_volume].
9347    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    /// Sets the value of [r#type][crate::model::VolumeSnapshot::type].
9353    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
9368/// Defines additional types related to [VolumeSnapshot].
9369pub mod volume_snapshot {
9370    #[allow(unused_imports)]
9371    use super::*;
9372
9373    /// Represents the type of a snapshot.
9374    ///
9375    /// # Working with unknown values
9376    ///
9377    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9378    /// additional enum variants at any time. Adding new variants is not considered
9379    /// a breaking change. Applications should write their code in anticipation of:
9380    ///
9381    /// - New values appearing in future releases of the client library, **and**
9382    /// - New values received dynamically, without application changes.
9383    ///
9384    /// Please consult the [Working with enums] section in the user guide for some
9385    /// guidelines.
9386    ///
9387    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9388    #[derive(Clone, Debug, PartialEq)]
9389    #[non_exhaustive]
9390    pub enum SnapshotType {
9391        /// Type is not specified.
9392        Unspecified,
9393        /// Snapshot was taken manually by user.
9394        AdHoc,
9395        /// Snapshot was taken automatically as a part of a snapshot schedule.
9396        Scheduled,
9397        /// If set, the enum was initialized with an unknown value.
9398        ///
9399        /// Applications can examine the value using [SnapshotType::value] or
9400        /// [SnapshotType::name].
9401        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        /// Gets the enum value.
9414        ///
9415        /// Returns `None` if the enum contains an unknown value deserialized from
9416        /// the string representation of enums.
9417        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        /// Gets the enum value as a string.
9427        ///
9428        /// Returns `None` if the enum contains an unknown value deserialized from
9429        /// the integer representation of enums.
9430        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/// Message for requesting volume snapshot information.
9507#[derive(Clone, Default, PartialEq)]
9508#[non_exhaustive]
9509pub struct GetVolumeSnapshotRequest {
9510    /// Required. The name of the snapshot.
9511    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    /// Sets the value of [name][crate::model::GetVolumeSnapshotRequest::name].
9522    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/// Message for requesting a list of volume snapshots.
9535#[derive(Clone, Default, PartialEq)]
9536#[non_exhaustive]
9537pub struct ListVolumeSnapshotsRequest {
9538    /// Required. Parent value for ListVolumesRequest.
9539    pub parent: std::string::String,
9540
9541    /// Requested page size. The server might return fewer items than requested.
9542    /// If unspecified, server will pick an appropriate default.
9543    pub page_size: i32,
9544
9545    /// A token identifying a page of results from the server.
9546    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    /// Sets the value of [parent][crate::model::ListVolumeSnapshotsRequest::parent].
9557    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    /// Sets the value of [page_size][crate::model::ListVolumeSnapshotsRequest::page_size].
9563    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    /// Sets the value of [page_token][crate::model::ListVolumeSnapshotsRequest::page_token].
9569    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/// Response message containing the list of volume snapshots.
9582#[derive(Clone, Default, PartialEq)]
9583#[non_exhaustive]
9584pub struct ListVolumeSnapshotsResponse {
9585    /// The list of snapshots.
9586    pub volume_snapshots: std::vec::Vec<crate::model::VolumeSnapshot>,
9587
9588    /// A token identifying a page of results from the server.
9589    pub next_page_token: std::string::String,
9590
9591    /// Locations that could not be reached.
9592    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    /// Sets the value of [volume_snapshots][crate::model::ListVolumeSnapshotsResponse::volume_snapshots].
9603    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    /// Sets the value of [next_page_token][crate::model::ListVolumeSnapshotsResponse::next_page_token].
9614    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    /// Sets the value of [unreachable][crate::model::ListVolumeSnapshotsResponse::unreachable].
9620    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/// Message for deleting named Volume snapshot.
9652#[derive(Clone, Default, PartialEq)]
9653#[non_exhaustive]
9654pub struct DeleteVolumeSnapshotRequest {
9655    /// Required. The name of the snapshot to delete.
9656    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    /// Sets the value of [name][crate::model::DeleteVolumeSnapshotRequest::name].
9667    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/// Message for creating a volume snapshot.
9680#[derive(Clone, Default, PartialEq)]
9681#[non_exhaustive]
9682pub struct CreateVolumeSnapshotRequest {
9683    /// Required. The volume to snapshot.
9684    pub parent: std::string::String,
9685
9686    /// Required. The snapshot to create.
9687    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    /// Sets the value of [parent][crate::model::CreateVolumeSnapshotRequest::parent].
9698    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    /// Sets the value of [volume_snapshot][crate::model::CreateVolumeSnapshotRequest::volume_snapshot].
9704    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    /// Sets or clears the value of [volume_snapshot][crate::model::CreateVolumeSnapshotRequest::volume_snapshot].
9713    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/// Message for restoring a volume snapshot.
9729#[derive(Clone, Default, PartialEq)]
9730#[non_exhaustive]
9731pub struct RestoreVolumeSnapshotRequest {
9732    /// Required. Name of the snapshot which will be used to restore its parent
9733    /// volume.
9734    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    /// Sets the value of [volume_snapshot][crate::model::RestoreVolumeSnapshotRequest::volume_snapshot].
9745    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/// Performance tier of the Volume.
9758///
9759/// # Working with unknown values
9760///
9761/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9762/// additional enum variants at any time. Adding new variants is not considered
9763/// a breaking change. Applications should write their code in anticipation of:
9764///
9765/// - New values appearing in future releases of the client library, **and**
9766/// - New values received dynamically, without application changes.
9767///
9768/// Please consult the [Working with enums] section in the user guide for some
9769/// guidelines.
9770///
9771/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9772#[derive(Clone, Debug, PartialEq)]
9773#[non_exhaustive]
9774pub enum VolumePerformanceTier {
9775    /// Value is not specified.
9776    Unspecified,
9777    /// Regular volumes, shared aggregates.
9778    Shared,
9779    /// Assigned aggregates.
9780    Assigned,
9781    /// High throughput aggregates.
9782    Ht,
9783    /// If set, the enum was initialized with an unknown value.
9784    ///
9785    /// Applications can examine the value using [VolumePerformanceTier::value] or
9786    /// [VolumePerformanceTier::name].
9787    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    /// Gets the enum value.
9800    ///
9801    /// Returns `None` if the enum contains an unknown value deserialized from
9802    /// the string representation of enums.
9803    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    /// Gets the enum value as a string.
9814    ///
9815    /// Returns `None` if the enum contains an unknown value deserialized from
9816    /// the integer representation of enums.
9817    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/// The possible values for a workload profile.
9897///
9898/// # Working with unknown values
9899///
9900/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9901/// additional enum variants at any time. Adding new variants is not considered
9902/// a breaking change. Applications should write their code in anticipation of:
9903///
9904/// - New values appearing in future releases of the client library, **and**
9905/// - New values received dynamically, without application changes.
9906///
9907/// Please consult the [Working with enums] section in the user guide for some
9908/// guidelines.
9909///
9910/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9911#[derive(Clone, Debug, PartialEq)]
9912#[non_exhaustive]
9913pub enum WorkloadProfile {
9914    /// The workload profile is in an unknown state.
9915    Unspecified,
9916    /// The workload profile is generic.
9917    Generic,
9918    /// The workload profile is hana.
9919    Hana,
9920    /// If set, the enum was initialized with an unknown value.
9921    ///
9922    /// Applications can examine the value using [WorkloadProfile::value] or
9923    /// [WorkloadProfile::name].
9924    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    /// Gets the enum value.
9937    ///
9938    /// Returns `None` if the enum contains an unknown value deserialized from
9939    /// the string representation of enums.
9940    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    /// Gets the enum value as a string.
9950    ///
9951    /// Returns `None` if the enum contains an unknown value deserialized from
9952    /// the integer representation of enums.
9953    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}