google_cloud_shell_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate longrunning;
26extern crate lro;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35/// A Cloud Shell environment, which is defined as the combination of a Docker
36/// image specifying what is installed on the environment and a home directory
37/// containing the user's data that will remain across sessions. Each user has
38/// at least an environment with the ID "default".
39#[serde_with::serde_as]
40#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
41#[serde(default, rename_all = "camelCase")]
42#[non_exhaustive]
43pub struct Environment {
44    /// Immutable. Full name of this resource, in the format
45    /// `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
46    /// email address of the user to whom this environment belongs, and
47    /// `{environment_id}` is the identifier of this environment. For example,
48    /// `users/someone@example.com/environments/default`.
49    #[serde(skip_serializing_if = "std::string::String::is_empty")]
50    pub name: std::string::String,
51
52    /// Output only. The environment's identifier, unique among the user's
53    /// environments.
54    #[serde(skip_serializing_if = "std::string::String::is_empty")]
55    pub id: std::string::String,
56
57    /// Required. Immutable. Full path to the Docker image used to run this environment, e.g.
58    /// "gcr.io/dev-con/cloud-devshell:latest".
59    #[serde(skip_serializing_if = "std::string::String::is_empty")]
60    pub docker_image: std::string::String,
61
62    /// Output only. Current execution state of this environment.
63    pub state: crate::model::environment::State,
64
65    /// Output only. Host to which clients can connect to initiate HTTPS or WSS
66    /// connections with the environment.
67    #[serde(skip_serializing_if = "std::string::String::is_empty")]
68    pub web_host: std::string::String,
69
70    /// Output only. Username that clients should use when initiating SSH sessions
71    /// with the environment.
72    #[serde(skip_serializing_if = "std::string::String::is_empty")]
73    pub ssh_username: std::string::String,
74
75    /// Output only. Host to which clients can connect to initiate SSH sessions
76    /// with the environment.
77    #[serde(skip_serializing_if = "std::string::String::is_empty")]
78    pub ssh_host: std::string::String,
79
80    /// Output only. Port to which clients can connect to initiate SSH sessions
81    /// with the environment.
82    #[serde(skip_serializing_if = "wkt::internal::is_default")]
83    pub ssh_port: i32,
84
85    /// Output only. Public keys associated with the environment. Clients can
86    /// connect to this environment via SSH only if they possess a private key
87    /// corresponding to at least one of these public keys. Keys can be added to or
88    /// removed from the environment using the AddPublicKey and RemovePublicKey
89    /// methods.
90    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
91    pub public_keys: std::vec::Vec<std::string::String>,
92
93    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
94    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
95}
96
97impl Environment {
98    pub fn new() -> Self {
99        std::default::Default::default()
100    }
101
102    /// Sets the value of [name][crate::model::Environment::name].
103    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
104        self.name = v.into();
105        self
106    }
107
108    /// Sets the value of [id][crate::model::Environment::id].
109    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110        self.id = v.into();
111        self
112    }
113
114    /// Sets the value of [docker_image][crate::model::Environment::docker_image].
115    pub fn set_docker_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
116        self.docker_image = v.into();
117        self
118    }
119
120    /// Sets the value of [state][crate::model::Environment::state].
121    pub fn set_state<T: std::convert::Into<crate::model::environment::State>>(
122        mut self,
123        v: T,
124    ) -> Self {
125        self.state = v.into();
126        self
127    }
128
129    /// Sets the value of [web_host][crate::model::Environment::web_host].
130    pub fn set_web_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
131        self.web_host = v.into();
132        self
133    }
134
135    /// Sets the value of [ssh_username][crate::model::Environment::ssh_username].
136    pub fn set_ssh_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
137        self.ssh_username = v.into();
138        self
139    }
140
141    /// Sets the value of [ssh_host][crate::model::Environment::ssh_host].
142    pub fn set_ssh_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
143        self.ssh_host = v.into();
144        self
145    }
146
147    /// Sets the value of [ssh_port][crate::model::Environment::ssh_port].
148    pub fn set_ssh_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
149        self.ssh_port = v.into();
150        self
151    }
152
153    /// Sets the value of [public_keys][crate::model::Environment::public_keys].
154    pub fn set_public_keys<T, V>(mut self, v: T) -> Self
155    where
156        T: std::iter::IntoIterator<Item = V>,
157        V: std::convert::Into<std::string::String>,
158    {
159        use std::iter::Iterator;
160        self.public_keys = v.into_iter().map(|i| i.into()).collect();
161        self
162    }
163}
164
165impl wkt::message::Message for Environment {
166    fn typename() -> &'static str {
167        "type.googleapis.com/google.cloud.shell.v1.Environment"
168    }
169}
170
171/// Defines additional types related to [Environment].
172pub mod environment {
173    #[allow(unused_imports)]
174    use super::*;
175
176    /// Possible execution states for an environment.
177    ///
178    /// # Working with unknown values
179    ///
180    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
181    /// additional enum variants at any time. Adding new variants is not considered
182    /// a breaking change. Applications should write their code in anticipation of:
183    ///
184    /// - New values appearing in future releases of the client library, **and**
185    /// - New values received dynamically, without application changes.
186    ///
187    /// Please consult the [Working with enums] section in the user guide for some
188    /// guidelines.
189    ///
190    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
191    #[derive(Clone, Debug, PartialEq)]
192    #[non_exhaustive]
193    pub enum State {
194        /// The environment's states is unknown.
195        Unspecified,
196        /// The environment is not running and can't be connected to. Starting the
197        /// environment will transition it to the PENDING state.
198        Suspended,
199        /// The environment is being started but is not yet ready to accept
200        /// connections.
201        Pending,
202        /// The environment is running and ready to accept connections. It will
203        /// automatically transition back to DISABLED after a period of inactivity or
204        /// if another environment is started.
205        Running,
206        /// The environment is being deleted and can't be connected to.
207        Deleting,
208        /// If set, the enum was initialized with an unknown value.
209        ///
210        /// Applications can examine the value using [State::value] or
211        /// [State::name].
212        UnknownValue(state::UnknownValue),
213    }
214
215    #[doc(hidden)]
216    pub mod state {
217        #[allow(unused_imports)]
218        use super::*;
219        #[derive(Clone, Debug, PartialEq)]
220        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
221    }
222
223    impl State {
224        /// Gets the enum value.
225        ///
226        /// Returns `None` if the enum contains an unknown value deserialized from
227        /// the string representation of enums.
228        pub fn value(&self) -> std::option::Option<i32> {
229            match self {
230                Self::Unspecified => std::option::Option::Some(0),
231                Self::Suspended => std::option::Option::Some(1),
232                Self::Pending => std::option::Option::Some(2),
233                Self::Running => std::option::Option::Some(3),
234                Self::Deleting => std::option::Option::Some(4),
235                Self::UnknownValue(u) => u.0.value(),
236            }
237        }
238
239        /// Gets the enum value as a string.
240        ///
241        /// Returns `None` if the enum contains an unknown value deserialized from
242        /// the integer representation of enums.
243        pub fn name(&self) -> std::option::Option<&str> {
244            match self {
245                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
246                Self::Suspended => std::option::Option::Some("SUSPENDED"),
247                Self::Pending => std::option::Option::Some("PENDING"),
248                Self::Running => std::option::Option::Some("RUNNING"),
249                Self::Deleting => std::option::Option::Some("DELETING"),
250                Self::UnknownValue(u) => u.0.name(),
251            }
252        }
253    }
254
255    impl std::default::Default for State {
256        fn default() -> Self {
257            use std::convert::From;
258            Self::from(0)
259        }
260    }
261
262    impl std::fmt::Display for State {
263        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
264            wkt::internal::display_enum(f, self.name(), self.value())
265        }
266    }
267
268    impl std::convert::From<i32> for State {
269        fn from(value: i32) -> Self {
270            match value {
271                0 => Self::Unspecified,
272                1 => Self::Suspended,
273                2 => Self::Pending,
274                3 => Self::Running,
275                4 => Self::Deleting,
276                _ => Self::UnknownValue(state::UnknownValue(
277                    wkt::internal::UnknownEnumValue::Integer(value),
278                )),
279            }
280        }
281    }
282
283    impl std::convert::From<&str> for State {
284        fn from(value: &str) -> Self {
285            use std::string::ToString;
286            match value {
287                "STATE_UNSPECIFIED" => Self::Unspecified,
288                "SUSPENDED" => Self::Suspended,
289                "PENDING" => Self::Pending,
290                "RUNNING" => Self::Running,
291                "DELETING" => Self::Deleting,
292                _ => Self::UnknownValue(state::UnknownValue(
293                    wkt::internal::UnknownEnumValue::String(value.to_string()),
294                )),
295            }
296        }
297    }
298
299    impl serde::ser::Serialize for State {
300        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
301        where
302            S: serde::Serializer,
303        {
304            match self {
305                Self::Unspecified => serializer.serialize_i32(0),
306                Self::Suspended => serializer.serialize_i32(1),
307                Self::Pending => serializer.serialize_i32(2),
308                Self::Running => serializer.serialize_i32(3),
309                Self::Deleting => serializer.serialize_i32(4),
310                Self::UnknownValue(u) => u.0.serialize(serializer),
311            }
312        }
313    }
314
315    impl<'de> serde::de::Deserialize<'de> for State {
316        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
317        where
318            D: serde::Deserializer<'de>,
319        {
320            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
321                ".google.cloud.shell.v1.Environment.State",
322            ))
323        }
324    }
325}
326
327/// Request message for
328/// [GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment].
329///
330/// [google.cloud.shell.v1.CloudShellService.GetEnvironment]: crate::client::CloudShellService::get_environment
331#[serde_with::serde_as]
332#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
333#[serde(default, rename_all = "camelCase")]
334#[non_exhaustive]
335pub struct GetEnvironmentRequest {
336    /// Required. Name of the requested resource, for example `users/me/environments/default`
337    /// or `users/someone@example.com/environments/default`.
338    #[serde(skip_serializing_if = "std::string::String::is_empty")]
339    pub name: std::string::String,
340
341    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
342    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
343}
344
345impl GetEnvironmentRequest {
346    pub fn new() -> Self {
347        std::default::Default::default()
348    }
349
350    /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
351    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
352        self.name = v.into();
353        self
354    }
355}
356
357impl wkt::message::Message for GetEnvironmentRequest {
358    fn typename() -> &'static str {
359        "type.googleapis.com/google.cloud.shell.v1.GetEnvironmentRequest"
360    }
361}
362
363/// Message included in the metadata field of operations returned from
364/// [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment].
365#[serde_with::serde_as]
366#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
367#[serde(default, rename_all = "camelCase")]
368#[non_exhaustive]
369pub struct CreateEnvironmentMetadata {
370    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
371    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
372}
373
374impl CreateEnvironmentMetadata {
375    pub fn new() -> Self {
376        std::default::Default::default()
377    }
378}
379
380impl wkt::message::Message for CreateEnvironmentMetadata {
381    fn typename() -> &'static str {
382        "type.googleapis.com/google.cloud.shell.v1.CreateEnvironmentMetadata"
383    }
384}
385
386/// Message included in the metadata field of operations returned from
387/// [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment].
388#[serde_with::serde_as]
389#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
390#[serde(default, rename_all = "camelCase")]
391#[non_exhaustive]
392pub struct DeleteEnvironmentMetadata {
393    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
394    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
395}
396
397impl DeleteEnvironmentMetadata {
398    pub fn new() -> Self {
399        std::default::Default::default()
400    }
401}
402
403impl wkt::message::Message for DeleteEnvironmentMetadata {
404    fn typename() -> &'static str {
405        "type.googleapis.com/google.cloud.shell.v1.DeleteEnvironmentMetadata"
406    }
407}
408
409/// Request message for
410/// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
411///
412/// [google.cloud.shell.v1.CloudShellService.StartEnvironment]: crate::client::CloudShellService::start_environment
413#[serde_with::serde_as]
414#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
415#[serde(default, rename_all = "camelCase")]
416#[non_exhaustive]
417pub struct StartEnvironmentRequest {
418    /// Name of the resource that should be started, for example
419    /// `users/me/environments/default` or
420    /// `users/someone@example.com/environments/default`.
421    #[serde(skip_serializing_if = "std::string::String::is_empty")]
422    pub name: std::string::String,
423
424    /// The initial access token passed to the environment. If this is present and
425    /// valid, the environment will be pre-authenticated with gcloud so that the
426    /// user can run gcloud commands in Cloud Shell without having to log in. This
427    /// code can be updated later by calling AuthorizeEnvironment.
428    #[serde(skip_serializing_if = "std::string::String::is_empty")]
429    pub access_token: std::string::String,
430
431    /// Public keys that should be added to the environment before it is started.
432    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
433    pub public_keys: std::vec::Vec<std::string::String>,
434
435    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
436    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
437}
438
439impl StartEnvironmentRequest {
440    pub fn new() -> Self {
441        std::default::Default::default()
442    }
443
444    /// Sets the value of [name][crate::model::StartEnvironmentRequest::name].
445    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
446        self.name = v.into();
447        self
448    }
449
450    /// Sets the value of [access_token][crate::model::StartEnvironmentRequest::access_token].
451    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452        self.access_token = v.into();
453        self
454    }
455
456    /// Sets the value of [public_keys][crate::model::StartEnvironmentRequest::public_keys].
457    pub fn set_public_keys<T, V>(mut self, v: T) -> Self
458    where
459        T: std::iter::IntoIterator<Item = V>,
460        V: std::convert::Into<std::string::String>,
461    {
462        use std::iter::Iterator;
463        self.public_keys = v.into_iter().map(|i| i.into()).collect();
464        self
465    }
466}
467
468impl wkt::message::Message for StartEnvironmentRequest {
469    fn typename() -> &'static str {
470        "type.googleapis.com/google.cloud.shell.v1.StartEnvironmentRequest"
471    }
472}
473
474/// Request message for
475/// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
476///
477/// [google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]: crate::client::CloudShellService::authorize_environment
478#[serde_with::serde_as]
479#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
480#[serde(default, rename_all = "camelCase")]
481#[non_exhaustive]
482pub struct AuthorizeEnvironmentRequest {
483    /// Name of the resource that should receive the credentials, for example
484    /// `users/me/environments/default` or
485    /// `users/someone@example.com/environments/default`.
486    #[serde(skip_serializing_if = "std::string::String::is_empty")]
487    pub name: std::string::String,
488
489    /// The OAuth access token that should be sent to the environment.
490    #[serde(skip_serializing_if = "std::string::String::is_empty")]
491    pub access_token: std::string::String,
492
493    /// The OAuth ID token that should be sent to the environment.
494    #[serde(skip_serializing_if = "std::string::String::is_empty")]
495    pub id_token: std::string::String,
496
497    /// The time when the credentials expire. If not set, defaults to one hour from
498    /// when the server received the request.
499    #[serde(skip_serializing_if = "std::option::Option::is_none")]
500    pub expire_time: std::option::Option<wkt::Timestamp>,
501
502    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
503    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
504}
505
506impl AuthorizeEnvironmentRequest {
507    pub fn new() -> Self {
508        std::default::Default::default()
509    }
510
511    /// Sets the value of [name][crate::model::AuthorizeEnvironmentRequest::name].
512    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
513        self.name = v.into();
514        self
515    }
516
517    /// Sets the value of [access_token][crate::model::AuthorizeEnvironmentRequest::access_token].
518    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
519        self.access_token = v.into();
520        self
521    }
522
523    /// Sets the value of [id_token][crate::model::AuthorizeEnvironmentRequest::id_token].
524    pub fn set_id_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
525        self.id_token = v.into();
526        self
527    }
528
529    /// Sets the value of [expire_time][crate::model::AuthorizeEnvironmentRequest::expire_time].
530    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
531        mut self,
532        v: T,
533    ) -> Self {
534        self.expire_time = v.into();
535        self
536    }
537}
538
539impl wkt::message::Message for AuthorizeEnvironmentRequest {
540    fn typename() -> &'static str {
541        "type.googleapis.com/google.cloud.shell.v1.AuthorizeEnvironmentRequest"
542    }
543}
544
545/// Response message for
546/// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
547///
548/// [google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]: crate::client::CloudShellService::authorize_environment
549#[serde_with::serde_as]
550#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
551#[serde(default, rename_all = "camelCase")]
552#[non_exhaustive]
553pub struct AuthorizeEnvironmentResponse {
554    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
555    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
556}
557
558impl AuthorizeEnvironmentResponse {
559    pub fn new() -> Self {
560        std::default::Default::default()
561    }
562}
563
564impl wkt::message::Message for AuthorizeEnvironmentResponse {
565    fn typename() -> &'static str {
566        "type.googleapis.com/google.cloud.shell.v1.AuthorizeEnvironmentResponse"
567    }
568}
569
570/// Message included in the metadata field of operations returned from
571/// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
572///
573/// [google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]: crate::client::CloudShellService::authorize_environment
574#[serde_with::serde_as]
575#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
576#[serde(default, rename_all = "camelCase")]
577#[non_exhaustive]
578pub struct AuthorizeEnvironmentMetadata {
579    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
580    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
581}
582
583impl AuthorizeEnvironmentMetadata {
584    pub fn new() -> Self {
585        std::default::Default::default()
586    }
587}
588
589impl wkt::message::Message for AuthorizeEnvironmentMetadata {
590    fn typename() -> &'static str {
591        "type.googleapis.com/google.cloud.shell.v1.AuthorizeEnvironmentMetadata"
592    }
593}
594
595/// Message included in the metadata field of operations returned from
596/// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
597///
598/// [google.cloud.shell.v1.CloudShellService.StartEnvironment]: crate::client::CloudShellService::start_environment
599#[serde_with::serde_as]
600#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
601#[serde(default, rename_all = "camelCase")]
602#[non_exhaustive]
603pub struct StartEnvironmentMetadata {
604    /// Current state of the environment being started.
605    pub state: crate::model::start_environment_metadata::State,
606
607    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
608    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
609}
610
611impl StartEnvironmentMetadata {
612    pub fn new() -> Self {
613        std::default::Default::default()
614    }
615
616    /// Sets the value of [state][crate::model::StartEnvironmentMetadata::state].
617    pub fn set_state<T: std::convert::Into<crate::model::start_environment_metadata::State>>(
618        mut self,
619        v: T,
620    ) -> Self {
621        self.state = v.into();
622        self
623    }
624}
625
626impl wkt::message::Message for StartEnvironmentMetadata {
627    fn typename() -> &'static str {
628        "type.googleapis.com/google.cloud.shell.v1.StartEnvironmentMetadata"
629    }
630}
631
632/// Defines additional types related to [StartEnvironmentMetadata].
633pub mod start_environment_metadata {
634    #[allow(unused_imports)]
635    use super::*;
636
637    /// Possible states an environment might transition between during startup.
638    /// These states are not normally actionable by clients, but may be used to
639    /// show a progress message to the user. An environment won't necessarily go
640    /// through all of these states when starting. More states are likely to be
641    /// added in the future.
642    ///
643    /// # Working with unknown values
644    ///
645    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
646    /// additional enum variants at any time. Adding new variants is not considered
647    /// a breaking change. Applications should write their code in anticipation of:
648    ///
649    /// - New values appearing in future releases of the client library, **and**
650    /// - New values received dynamically, without application changes.
651    ///
652    /// Please consult the [Working with enums] section in the user guide for some
653    /// guidelines.
654    ///
655    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
656    #[derive(Clone, Debug, PartialEq)]
657    #[non_exhaustive]
658    pub enum State {
659        /// The environment's start state is unknown.
660        Unspecified,
661        /// The environment is in the process of being started, but no additional
662        /// details are available.
663        Starting,
664        /// Startup is waiting for the user's disk to be unarchived. This can happen
665        /// when the user returns to Cloud Shell after not having used it for a
666        /// while, and suggests that startup will take longer than normal.
667        UnarchivingDisk,
668        /// Startup is waiting for compute resources to be assigned to the
669        /// environment. This should normally happen very quickly, but an environment
670        /// might stay in this state for an extended period of time if the system is
671        /// experiencing heavy load.
672        AwaitingComputeResources,
673        /// Startup has completed. If the start operation was successful, the user
674        /// should be able to establish an SSH connection to their environment.
675        /// Otherwise, the operation will contain details of the failure.
676        Finished,
677        /// If set, the enum was initialized with an unknown value.
678        ///
679        /// Applications can examine the value using [State::value] or
680        /// [State::name].
681        UnknownValue(state::UnknownValue),
682    }
683
684    #[doc(hidden)]
685    pub mod state {
686        #[allow(unused_imports)]
687        use super::*;
688        #[derive(Clone, Debug, PartialEq)]
689        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
690    }
691
692    impl State {
693        /// Gets the enum value.
694        ///
695        /// Returns `None` if the enum contains an unknown value deserialized from
696        /// the string representation of enums.
697        pub fn value(&self) -> std::option::Option<i32> {
698            match self {
699                Self::Unspecified => std::option::Option::Some(0),
700                Self::Starting => std::option::Option::Some(1),
701                Self::UnarchivingDisk => std::option::Option::Some(2),
702                Self::AwaitingComputeResources => std::option::Option::Some(4),
703                Self::Finished => std::option::Option::Some(3),
704                Self::UnknownValue(u) => u.0.value(),
705            }
706        }
707
708        /// Gets the enum value as a string.
709        ///
710        /// Returns `None` if the enum contains an unknown value deserialized from
711        /// the integer representation of enums.
712        pub fn name(&self) -> std::option::Option<&str> {
713            match self {
714                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
715                Self::Starting => std::option::Option::Some("STARTING"),
716                Self::UnarchivingDisk => std::option::Option::Some("UNARCHIVING_DISK"),
717                Self::AwaitingComputeResources => {
718                    std::option::Option::Some("AWAITING_COMPUTE_RESOURCES")
719                }
720                Self::Finished => std::option::Option::Some("FINISHED"),
721                Self::UnknownValue(u) => u.0.name(),
722            }
723        }
724    }
725
726    impl std::default::Default for State {
727        fn default() -> Self {
728            use std::convert::From;
729            Self::from(0)
730        }
731    }
732
733    impl std::fmt::Display for State {
734        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
735            wkt::internal::display_enum(f, self.name(), self.value())
736        }
737    }
738
739    impl std::convert::From<i32> for State {
740        fn from(value: i32) -> Self {
741            match value {
742                0 => Self::Unspecified,
743                1 => Self::Starting,
744                2 => Self::UnarchivingDisk,
745                3 => Self::Finished,
746                4 => Self::AwaitingComputeResources,
747                _ => Self::UnknownValue(state::UnknownValue(
748                    wkt::internal::UnknownEnumValue::Integer(value),
749                )),
750            }
751        }
752    }
753
754    impl std::convert::From<&str> for State {
755        fn from(value: &str) -> Self {
756            use std::string::ToString;
757            match value {
758                "STATE_UNSPECIFIED" => Self::Unspecified,
759                "STARTING" => Self::Starting,
760                "UNARCHIVING_DISK" => Self::UnarchivingDisk,
761                "AWAITING_COMPUTE_RESOURCES" => Self::AwaitingComputeResources,
762                "FINISHED" => Self::Finished,
763                _ => Self::UnknownValue(state::UnknownValue(
764                    wkt::internal::UnknownEnumValue::String(value.to_string()),
765                )),
766            }
767        }
768    }
769
770    impl serde::ser::Serialize for State {
771        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
772        where
773            S: serde::Serializer,
774        {
775            match self {
776                Self::Unspecified => serializer.serialize_i32(0),
777                Self::Starting => serializer.serialize_i32(1),
778                Self::UnarchivingDisk => serializer.serialize_i32(2),
779                Self::AwaitingComputeResources => serializer.serialize_i32(4),
780                Self::Finished => serializer.serialize_i32(3),
781                Self::UnknownValue(u) => u.0.serialize(serializer),
782            }
783        }
784    }
785
786    impl<'de> serde::de::Deserialize<'de> for State {
787        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
788        where
789            D: serde::Deserializer<'de>,
790        {
791            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
792                ".google.cloud.shell.v1.StartEnvironmentMetadata.State",
793            ))
794        }
795    }
796}
797
798/// Message included in the response field of operations returned from
799/// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]
800/// once the operation is complete.
801///
802/// [google.cloud.shell.v1.CloudShellService.StartEnvironment]: crate::client::CloudShellService::start_environment
803#[serde_with::serde_as]
804#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
805#[serde(default, rename_all = "camelCase")]
806#[non_exhaustive]
807pub struct StartEnvironmentResponse {
808    /// Environment that was started.
809    #[serde(skip_serializing_if = "std::option::Option::is_none")]
810    pub environment: std::option::Option<crate::model::Environment>,
811
812    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
813    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
814}
815
816impl StartEnvironmentResponse {
817    pub fn new() -> Self {
818        std::default::Default::default()
819    }
820
821    /// Sets the value of [environment][crate::model::StartEnvironmentResponse::environment].
822    pub fn set_environment<
823        T: std::convert::Into<std::option::Option<crate::model::Environment>>,
824    >(
825        mut self,
826        v: T,
827    ) -> Self {
828        self.environment = v.into();
829        self
830    }
831}
832
833impl wkt::message::Message for StartEnvironmentResponse {
834    fn typename() -> &'static str {
835        "type.googleapis.com/google.cloud.shell.v1.StartEnvironmentResponse"
836    }
837}
838
839/// Request message for
840/// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
841///
842/// [google.cloud.shell.v1.CloudShellService.AddPublicKey]: crate::client::CloudShellService::add_public_key
843#[serde_with::serde_as]
844#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
845#[serde(default, rename_all = "camelCase")]
846#[non_exhaustive]
847pub struct AddPublicKeyRequest {
848    /// Environment this key should be added to, e.g.
849    /// `users/me/environments/default`.
850    #[serde(skip_serializing_if = "std::string::String::is_empty")]
851    pub environment: std::string::String,
852
853    /// Key that should be added to the environment. Supported formats are
854    /// `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
855    /// (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
856    /// `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
857    /// &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
858    /// Base64.
859    #[serde(skip_serializing_if = "std::string::String::is_empty")]
860    pub key: std::string::String,
861
862    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
863    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
864}
865
866impl AddPublicKeyRequest {
867    pub fn new() -> Self {
868        std::default::Default::default()
869    }
870
871    /// Sets the value of [environment][crate::model::AddPublicKeyRequest::environment].
872    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
873        self.environment = v.into();
874        self
875    }
876
877    /// Sets the value of [key][crate::model::AddPublicKeyRequest::key].
878    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
879        self.key = v.into();
880        self
881    }
882}
883
884impl wkt::message::Message for AddPublicKeyRequest {
885    fn typename() -> &'static str {
886        "type.googleapis.com/google.cloud.shell.v1.AddPublicKeyRequest"
887    }
888}
889
890/// Response message for
891/// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
892///
893/// [google.cloud.shell.v1.CloudShellService.AddPublicKey]: crate::client::CloudShellService::add_public_key
894#[serde_with::serde_as]
895#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
896#[serde(default, rename_all = "camelCase")]
897#[non_exhaustive]
898pub struct AddPublicKeyResponse {
899    /// Key that was added to the environment.
900    #[serde(skip_serializing_if = "std::string::String::is_empty")]
901    pub key: std::string::String,
902
903    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
904    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
905}
906
907impl AddPublicKeyResponse {
908    pub fn new() -> Self {
909        std::default::Default::default()
910    }
911
912    /// Sets the value of [key][crate::model::AddPublicKeyResponse::key].
913    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
914        self.key = v.into();
915        self
916    }
917}
918
919impl wkt::message::Message for AddPublicKeyResponse {
920    fn typename() -> &'static str {
921        "type.googleapis.com/google.cloud.shell.v1.AddPublicKeyResponse"
922    }
923}
924
925/// Message included in the metadata field of operations returned from
926/// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
927///
928/// [google.cloud.shell.v1.CloudShellService.AddPublicKey]: crate::client::CloudShellService::add_public_key
929#[serde_with::serde_as]
930#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
931#[serde(default, rename_all = "camelCase")]
932#[non_exhaustive]
933pub struct AddPublicKeyMetadata {
934    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
935    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
936}
937
938impl AddPublicKeyMetadata {
939    pub fn new() -> Self {
940        std::default::Default::default()
941    }
942}
943
944impl wkt::message::Message for AddPublicKeyMetadata {
945    fn typename() -> &'static str {
946        "type.googleapis.com/google.cloud.shell.v1.AddPublicKeyMetadata"
947    }
948}
949
950/// Request message for
951/// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
952///
953/// [google.cloud.shell.v1.CloudShellService.RemovePublicKey]: crate::client::CloudShellService::remove_public_key
954#[serde_with::serde_as]
955#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
956#[serde(default, rename_all = "camelCase")]
957#[non_exhaustive]
958pub struct RemovePublicKeyRequest {
959    /// Environment this key should be removed from, e.g.
960    /// `users/me/environments/default`.
961    #[serde(skip_serializing_if = "std::string::String::is_empty")]
962    pub environment: std::string::String,
963
964    /// Key that should be removed from the environment.
965    #[serde(skip_serializing_if = "std::string::String::is_empty")]
966    pub key: std::string::String,
967
968    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
969    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
970}
971
972impl RemovePublicKeyRequest {
973    pub fn new() -> Self {
974        std::default::Default::default()
975    }
976
977    /// Sets the value of [environment][crate::model::RemovePublicKeyRequest::environment].
978    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
979        self.environment = v.into();
980        self
981    }
982
983    /// Sets the value of [key][crate::model::RemovePublicKeyRequest::key].
984    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
985        self.key = v.into();
986        self
987    }
988}
989
990impl wkt::message::Message for RemovePublicKeyRequest {
991    fn typename() -> &'static str {
992        "type.googleapis.com/google.cloud.shell.v1.RemovePublicKeyRequest"
993    }
994}
995
996/// Response message for
997/// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
998///
999/// [google.cloud.shell.v1.CloudShellService.RemovePublicKey]: crate::client::CloudShellService::remove_public_key
1000#[serde_with::serde_as]
1001#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1002#[serde(default, rename_all = "camelCase")]
1003#[non_exhaustive]
1004pub struct RemovePublicKeyResponse {
1005    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1006    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1007}
1008
1009impl RemovePublicKeyResponse {
1010    pub fn new() -> Self {
1011        std::default::Default::default()
1012    }
1013}
1014
1015impl wkt::message::Message for RemovePublicKeyResponse {
1016    fn typename() -> &'static str {
1017        "type.googleapis.com/google.cloud.shell.v1.RemovePublicKeyResponse"
1018    }
1019}
1020
1021/// Message included in the metadata field of operations returned from
1022/// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
1023///
1024/// [google.cloud.shell.v1.CloudShellService.RemovePublicKey]: crate::client::CloudShellService::remove_public_key
1025#[serde_with::serde_as]
1026#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1027#[serde(default, rename_all = "camelCase")]
1028#[non_exhaustive]
1029pub struct RemovePublicKeyMetadata {
1030    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1031    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1032}
1033
1034impl RemovePublicKeyMetadata {
1035    pub fn new() -> Self {
1036        std::default::Default::default()
1037    }
1038}
1039
1040impl wkt::message::Message for RemovePublicKeyMetadata {
1041    fn typename() -> &'static str {
1042        "type.googleapis.com/google.cloud.shell.v1.RemovePublicKeyMetadata"
1043    }
1044}
1045
1046/// Cloud-shell specific information that will be included as details in failure
1047/// responses.
1048#[serde_with::serde_as]
1049#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1050#[serde(default, rename_all = "camelCase")]
1051#[non_exhaustive]
1052pub struct CloudShellErrorDetails {
1053    /// Code indicating the specific error the occurred.
1054    pub code: crate::model::cloud_shell_error_details::CloudShellErrorCode,
1055
1056    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1057    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1058}
1059
1060impl CloudShellErrorDetails {
1061    pub fn new() -> Self {
1062        std::default::Default::default()
1063    }
1064
1065    /// Sets the value of [code][crate::model::CloudShellErrorDetails::code].
1066    pub fn set_code<
1067        T: std::convert::Into<crate::model::cloud_shell_error_details::CloudShellErrorCode>,
1068    >(
1069        mut self,
1070        v: T,
1071    ) -> Self {
1072        self.code = v.into();
1073        self
1074    }
1075}
1076
1077impl wkt::message::Message for CloudShellErrorDetails {
1078    fn typename() -> &'static str {
1079        "type.googleapis.com/google.cloud.shell.v1.CloudShellErrorDetails"
1080    }
1081}
1082
1083/// Defines additional types related to [CloudShellErrorDetails].
1084pub mod cloud_shell_error_details {
1085    #[allow(unused_imports)]
1086    use super::*;
1087
1088    /// Set of possible errors returned from API calls.
1089    ///
1090    /// # Working with unknown values
1091    ///
1092    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1093    /// additional enum variants at any time. Adding new variants is not considered
1094    /// a breaking change. Applications should write their code in anticipation of:
1095    ///
1096    /// - New values appearing in future releases of the client library, **and**
1097    /// - New values received dynamically, without application changes.
1098    ///
1099    /// Please consult the [Working with enums] section in the user guide for some
1100    /// guidelines.
1101    ///
1102    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1103    #[derive(Clone, Debug, PartialEq)]
1104    #[non_exhaustive]
1105    pub enum CloudShellErrorCode {
1106        /// An unknown error occurred.
1107        Unspecified,
1108        /// The image used by the Cloud Shell environment either does not exist or
1109        /// the user does not have access to it.
1110        ImageUnavailable,
1111        /// Cloud Shell has been disabled by an administrator for the user making the
1112        /// request.
1113        CloudShellDisabled,
1114        /// Cloud Shell has been permanently disabled due to a Terms of Service
1115        /// violation by the user.
1116        TosViolation,
1117        /// The user has exhausted their weekly Cloud Shell quota, and Cloud Shell
1118        /// will be disabled until the quota resets.
1119        QuotaExceeded,
1120        /// The Cloud Shell environment is unavailable and cannot be connected to at
1121        /// the moment.
1122        EnvironmentUnavailable,
1123        /// If set, the enum was initialized with an unknown value.
1124        ///
1125        /// Applications can examine the value using [CloudShellErrorCode::value] or
1126        /// [CloudShellErrorCode::name].
1127        UnknownValue(cloud_shell_error_code::UnknownValue),
1128    }
1129
1130    #[doc(hidden)]
1131    pub mod cloud_shell_error_code {
1132        #[allow(unused_imports)]
1133        use super::*;
1134        #[derive(Clone, Debug, PartialEq)]
1135        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1136    }
1137
1138    impl CloudShellErrorCode {
1139        /// Gets the enum value.
1140        ///
1141        /// Returns `None` if the enum contains an unknown value deserialized from
1142        /// the string representation of enums.
1143        pub fn value(&self) -> std::option::Option<i32> {
1144            match self {
1145                Self::Unspecified => std::option::Option::Some(0),
1146                Self::ImageUnavailable => std::option::Option::Some(1),
1147                Self::CloudShellDisabled => std::option::Option::Some(2),
1148                Self::TosViolation => std::option::Option::Some(4),
1149                Self::QuotaExceeded => std::option::Option::Some(5),
1150                Self::EnvironmentUnavailable => std::option::Option::Some(6),
1151                Self::UnknownValue(u) => u.0.value(),
1152            }
1153        }
1154
1155        /// Gets the enum value as a string.
1156        ///
1157        /// Returns `None` if the enum contains an unknown value deserialized from
1158        /// the integer representation of enums.
1159        pub fn name(&self) -> std::option::Option<&str> {
1160            match self {
1161                Self::Unspecified => {
1162                    std::option::Option::Some("CLOUD_SHELL_ERROR_CODE_UNSPECIFIED")
1163                }
1164                Self::ImageUnavailable => std::option::Option::Some("IMAGE_UNAVAILABLE"),
1165                Self::CloudShellDisabled => std::option::Option::Some("CLOUD_SHELL_DISABLED"),
1166                Self::TosViolation => std::option::Option::Some("TOS_VIOLATION"),
1167                Self::QuotaExceeded => std::option::Option::Some("QUOTA_EXCEEDED"),
1168                Self::EnvironmentUnavailable => {
1169                    std::option::Option::Some("ENVIRONMENT_UNAVAILABLE")
1170                }
1171                Self::UnknownValue(u) => u.0.name(),
1172            }
1173        }
1174    }
1175
1176    impl std::default::Default for CloudShellErrorCode {
1177        fn default() -> Self {
1178            use std::convert::From;
1179            Self::from(0)
1180        }
1181    }
1182
1183    impl std::fmt::Display for CloudShellErrorCode {
1184        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1185            wkt::internal::display_enum(f, self.name(), self.value())
1186        }
1187    }
1188
1189    impl std::convert::From<i32> for CloudShellErrorCode {
1190        fn from(value: i32) -> Self {
1191            match value {
1192                0 => Self::Unspecified,
1193                1 => Self::ImageUnavailable,
1194                2 => Self::CloudShellDisabled,
1195                4 => Self::TosViolation,
1196                5 => Self::QuotaExceeded,
1197                6 => Self::EnvironmentUnavailable,
1198                _ => Self::UnknownValue(cloud_shell_error_code::UnknownValue(
1199                    wkt::internal::UnknownEnumValue::Integer(value),
1200                )),
1201            }
1202        }
1203    }
1204
1205    impl std::convert::From<&str> for CloudShellErrorCode {
1206        fn from(value: &str) -> Self {
1207            use std::string::ToString;
1208            match value {
1209                "CLOUD_SHELL_ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1210                "IMAGE_UNAVAILABLE" => Self::ImageUnavailable,
1211                "CLOUD_SHELL_DISABLED" => Self::CloudShellDisabled,
1212                "TOS_VIOLATION" => Self::TosViolation,
1213                "QUOTA_EXCEEDED" => Self::QuotaExceeded,
1214                "ENVIRONMENT_UNAVAILABLE" => Self::EnvironmentUnavailable,
1215                _ => Self::UnknownValue(cloud_shell_error_code::UnknownValue(
1216                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1217                )),
1218            }
1219        }
1220    }
1221
1222    impl serde::ser::Serialize for CloudShellErrorCode {
1223        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1224        where
1225            S: serde::Serializer,
1226        {
1227            match self {
1228                Self::Unspecified => serializer.serialize_i32(0),
1229                Self::ImageUnavailable => serializer.serialize_i32(1),
1230                Self::CloudShellDisabled => serializer.serialize_i32(2),
1231                Self::TosViolation => serializer.serialize_i32(4),
1232                Self::QuotaExceeded => serializer.serialize_i32(5),
1233                Self::EnvironmentUnavailable => serializer.serialize_i32(6),
1234                Self::UnknownValue(u) => u.0.serialize(serializer),
1235            }
1236        }
1237    }
1238
1239    impl<'de> serde::de::Deserialize<'de> for CloudShellErrorCode {
1240        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1241        where
1242            D: serde::Deserializer<'de>,
1243        {
1244            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudShellErrorCode>::new(
1245                ".google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode",
1246            ))
1247        }
1248    }
1249}