1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate lazy_static;
24extern crate longrunning;
25extern crate lro;
26extern crate reqwest;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34#[serde_with::serde_as]
39#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
40#[serde(default, rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct Environment {
43 #[serde(skip_serializing_if = "std::string::String::is_empty")]
49 pub name: std::string::String,
50
51 #[serde(skip_serializing_if = "std::string::String::is_empty")]
54 pub id: std::string::String,
55
56 #[serde(skip_serializing_if = "std::string::String::is_empty")]
59 pub docker_image: std::string::String,
60
61 pub state: crate::model::environment::State,
63
64 #[serde(skip_serializing_if = "std::string::String::is_empty")]
67 pub web_host: std::string::String,
68
69 #[serde(skip_serializing_if = "std::string::String::is_empty")]
72 pub ssh_username: std::string::String,
73
74 #[serde(skip_serializing_if = "std::string::String::is_empty")]
77 pub ssh_host: std::string::String,
78
79 pub ssh_port: i32,
82
83 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
89 pub public_keys: std::vec::Vec<std::string::String>,
90}
91
92impl Environment {
93 pub fn new() -> Self {
94 std::default::Default::default()
95 }
96
97 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99 self.name = v.into();
100 self
101 }
102
103 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.id = v.into();
106 self
107 }
108
109 pub fn set_docker_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111 self.docker_image = v.into();
112 self
113 }
114
115 pub fn set_state<T: std::convert::Into<crate::model::environment::State>>(
117 mut self,
118 v: T,
119 ) -> Self {
120 self.state = v.into();
121 self
122 }
123
124 pub fn set_web_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
126 self.web_host = v.into();
127 self
128 }
129
130 pub fn set_ssh_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.ssh_username = v.into();
133 self
134 }
135
136 pub fn set_ssh_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
138 self.ssh_host = v.into();
139 self
140 }
141
142 pub fn set_ssh_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
144 self.ssh_port = v.into();
145 self
146 }
147
148 pub fn set_public_keys<T, V>(mut self, v: T) -> Self
150 where
151 T: std::iter::IntoIterator<Item = V>,
152 V: std::convert::Into<std::string::String>,
153 {
154 use std::iter::Iterator;
155 self.public_keys = v.into_iter().map(|i| i.into()).collect();
156 self
157 }
158}
159
160impl wkt::message::Message for Environment {
161 fn typename() -> &'static str {
162 "type.googleapis.com/google.cloud.shell.v1.Environment"
163 }
164}
165
166pub mod environment {
168 #[allow(unused_imports)]
169 use super::*;
170
171 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
173 pub struct State(std::borrow::Cow<'static, str>);
174
175 impl State {
176 pub const fn new(v: &'static str) -> Self {
178 Self(std::borrow::Cow::Borrowed(v))
179 }
180
181 pub fn value(&self) -> &str {
183 &self.0
184 }
185 }
186
187 pub mod state {
189 use super::State;
190
191 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
193
194 pub const SUSPENDED: State = State::new("SUSPENDED");
197
198 pub const PENDING: State = State::new("PENDING");
201
202 pub const RUNNING: State = State::new("RUNNING");
206
207 pub const DELETING: State = State::new("DELETING");
209 }
210
211 impl std::convert::From<std::string::String> for State {
212 fn from(value: std::string::String) -> Self {
213 Self(std::borrow::Cow::Owned(value))
214 }
215 }
216}
217
218#[serde_with::serde_as]
223#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
224#[serde(default, rename_all = "camelCase")]
225#[non_exhaustive]
226pub struct GetEnvironmentRequest {
227 #[serde(skip_serializing_if = "std::string::String::is_empty")]
230 pub name: std::string::String,
231}
232
233impl GetEnvironmentRequest {
234 pub fn new() -> Self {
235 std::default::Default::default()
236 }
237
238 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
240 self.name = v.into();
241 self
242 }
243}
244
245impl wkt::message::Message for GetEnvironmentRequest {
246 fn typename() -> &'static str {
247 "type.googleapis.com/google.cloud.shell.v1.GetEnvironmentRequest"
248 }
249}
250
251#[serde_with::serde_as]
254#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
255#[serde(default, rename_all = "camelCase")]
256#[non_exhaustive]
257pub struct CreateEnvironmentMetadata {}
258
259impl CreateEnvironmentMetadata {
260 pub fn new() -> Self {
261 std::default::Default::default()
262 }
263}
264
265impl wkt::message::Message for CreateEnvironmentMetadata {
266 fn typename() -> &'static str {
267 "type.googleapis.com/google.cloud.shell.v1.CreateEnvironmentMetadata"
268 }
269}
270
271#[serde_with::serde_as]
274#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
275#[serde(default, rename_all = "camelCase")]
276#[non_exhaustive]
277pub struct DeleteEnvironmentMetadata {}
278
279impl DeleteEnvironmentMetadata {
280 pub fn new() -> Self {
281 std::default::Default::default()
282 }
283}
284
285impl wkt::message::Message for DeleteEnvironmentMetadata {
286 fn typename() -> &'static str {
287 "type.googleapis.com/google.cloud.shell.v1.DeleteEnvironmentMetadata"
288 }
289}
290
291#[serde_with::serde_as]
296#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
297#[serde(default, rename_all = "camelCase")]
298#[non_exhaustive]
299pub struct StartEnvironmentRequest {
300 #[serde(skip_serializing_if = "std::string::String::is_empty")]
304 pub name: std::string::String,
305
306 #[serde(skip_serializing_if = "std::string::String::is_empty")]
311 pub access_token: std::string::String,
312
313 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
315 pub public_keys: std::vec::Vec<std::string::String>,
316}
317
318impl StartEnvironmentRequest {
319 pub fn new() -> Self {
320 std::default::Default::default()
321 }
322
323 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
325 self.name = v.into();
326 self
327 }
328
329 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
331 self.access_token = v.into();
332 self
333 }
334
335 pub fn set_public_keys<T, V>(mut self, v: T) -> Self
337 where
338 T: std::iter::IntoIterator<Item = V>,
339 V: std::convert::Into<std::string::String>,
340 {
341 use std::iter::Iterator;
342 self.public_keys = v.into_iter().map(|i| i.into()).collect();
343 self
344 }
345}
346
347impl wkt::message::Message for StartEnvironmentRequest {
348 fn typename() -> &'static str {
349 "type.googleapis.com/google.cloud.shell.v1.StartEnvironmentRequest"
350 }
351}
352
353#[serde_with::serde_as]
358#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
359#[serde(default, rename_all = "camelCase")]
360#[non_exhaustive]
361pub struct AuthorizeEnvironmentRequest {
362 #[serde(skip_serializing_if = "std::string::String::is_empty")]
366 pub name: std::string::String,
367
368 #[serde(skip_serializing_if = "std::string::String::is_empty")]
370 pub access_token: std::string::String,
371
372 #[serde(skip_serializing_if = "std::string::String::is_empty")]
374 pub id_token: std::string::String,
375
376 #[serde(skip_serializing_if = "std::option::Option::is_none")]
379 pub expire_time: std::option::Option<wkt::Timestamp>,
380}
381
382impl AuthorizeEnvironmentRequest {
383 pub fn new() -> Self {
384 std::default::Default::default()
385 }
386
387 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
389 self.name = v.into();
390 self
391 }
392
393 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
395 self.access_token = v.into();
396 self
397 }
398
399 pub fn set_id_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
401 self.id_token = v.into();
402 self
403 }
404
405 pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
407 mut self,
408 v: T,
409 ) -> Self {
410 self.expire_time = v.into();
411 self
412 }
413}
414
415impl wkt::message::Message for AuthorizeEnvironmentRequest {
416 fn typename() -> &'static str {
417 "type.googleapis.com/google.cloud.shell.v1.AuthorizeEnvironmentRequest"
418 }
419}
420
421#[serde_with::serde_as]
426#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
427#[serde(default, rename_all = "camelCase")]
428#[non_exhaustive]
429pub struct AuthorizeEnvironmentResponse {}
430
431impl AuthorizeEnvironmentResponse {
432 pub fn new() -> Self {
433 std::default::Default::default()
434 }
435}
436
437impl wkt::message::Message for AuthorizeEnvironmentResponse {
438 fn typename() -> &'static str {
439 "type.googleapis.com/google.cloud.shell.v1.AuthorizeEnvironmentResponse"
440 }
441}
442
443#[serde_with::serde_as]
448#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
449#[serde(default, rename_all = "camelCase")]
450#[non_exhaustive]
451pub struct AuthorizeEnvironmentMetadata {}
452
453impl AuthorizeEnvironmentMetadata {
454 pub fn new() -> Self {
455 std::default::Default::default()
456 }
457}
458
459impl wkt::message::Message for AuthorizeEnvironmentMetadata {
460 fn typename() -> &'static str {
461 "type.googleapis.com/google.cloud.shell.v1.AuthorizeEnvironmentMetadata"
462 }
463}
464
465#[serde_with::serde_as]
470#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
471#[serde(default, rename_all = "camelCase")]
472#[non_exhaustive]
473pub struct StartEnvironmentMetadata {
474 pub state: crate::model::start_environment_metadata::State,
476}
477
478impl StartEnvironmentMetadata {
479 pub fn new() -> Self {
480 std::default::Default::default()
481 }
482
483 pub fn set_state<T: std::convert::Into<crate::model::start_environment_metadata::State>>(
485 mut self,
486 v: T,
487 ) -> Self {
488 self.state = v.into();
489 self
490 }
491}
492
493impl wkt::message::Message for StartEnvironmentMetadata {
494 fn typename() -> &'static str {
495 "type.googleapis.com/google.cloud.shell.v1.StartEnvironmentMetadata"
496 }
497}
498
499pub mod start_environment_metadata {
501 #[allow(unused_imports)]
502 use super::*;
503
504 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
510 pub struct State(std::borrow::Cow<'static, str>);
511
512 impl State {
513 pub const fn new(v: &'static str) -> Self {
515 Self(std::borrow::Cow::Borrowed(v))
516 }
517
518 pub fn value(&self) -> &str {
520 &self.0
521 }
522 }
523
524 pub mod state {
526 use super::State;
527
528 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
530
531 pub const STARTING: State = State::new("STARTING");
534
535 pub const UNARCHIVING_DISK: State = State::new("UNARCHIVING_DISK");
539
540 pub const AWAITING_COMPUTE_RESOURCES: State = State::new("AWAITING_COMPUTE_RESOURCES");
545
546 pub const FINISHED: State = State::new("FINISHED");
550 }
551
552 impl std::convert::From<std::string::String> for State {
553 fn from(value: std::string::String) -> Self {
554 Self(std::borrow::Cow::Owned(value))
555 }
556 }
557}
558
559#[serde_with::serde_as]
565#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
566#[serde(default, rename_all = "camelCase")]
567#[non_exhaustive]
568pub struct StartEnvironmentResponse {
569 #[serde(skip_serializing_if = "std::option::Option::is_none")]
571 pub environment: std::option::Option<crate::model::Environment>,
572}
573
574impl StartEnvironmentResponse {
575 pub fn new() -> Self {
576 std::default::Default::default()
577 }
578
579 pub fn set_environment<
581 T: std::convert::Into<std::option::Option<crate::model::Environment>>,
582 >(
583 mut self,
584 v: T,
585 ) -> Self {
586 self.environment = v.into();
587 self
588 }
589}
590
591impl wkt::message::Message for StartEnvironmentResponse {
592 fn typename() -> &'static str {
593 "type.googleapis.com/google.cloud.shell.v1.StartEnvironmentResponse"
594 }
595}
596
597#[serde_with::serde_as]
602#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
603#[serde(default, rename_all = "camelCase")]
604#[non_exhaustive]
605pub struct AddPublicKeyRequest {
606 #[serde(skip_serializing_if = "std::string::String::is_empty")]
609 pub environment: std::string::String,
610
611 #[serde(skip_serializing_if = "std::string::String::is_empty")]
618 pub key: std::string::String,
619}
620
621impl AddPublicKeyRequest {
622 pub fn new() -> Self {
623 std::default::Default::default()
624 }
625
626 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
628 self.environment = v.into();
629 self
630 }
631
632 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
634 self.key = v.into();
635 self
636 }
637}
638
639impl wkt::message::Message for AddPublicKeyRequest {
640 fn typename() -> &'static str {
641 "type.googleapis.com/google.cloud.shell.v1.AddPublicKeyRequest"
642 }
643}
644
645#[serde_with::serde_as]
650#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
651#[serde(default, rename_all = "camelCase")]
652#[non_exhaustive]
653pub struct AddPublicKeyResponse {
654 #[serde(skip_serializing_if = "std::string::String::is_empty")]
656 pub key: std::string::String,
657}
658
659impl AddPublicKeyResponse {
660 pub fn new() -> Self {
661 std::default::Default::default()
662 }
663
664 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
666 self.key = v.into();
667 self
668 }
669}
670
671impl wkt::message::Message for AddPublicKeyResponse {
672 fn typename() -> &'static str {
673 "type.googleapis.com/google.cloud.shell.v1.AddPublicKeyResponse"
674 }
675}
676
677#[serde_with::serde_as]
682#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
683#[serde(default, rename_all = "camelCase")]
684#[non_exhaustive]
685pub struct AddPublicKeyMetadata {}
686
687impl AddPublicKeyMetadata {
688 pub fn new() -> Self {
689 std::default::Default::default()
690 }
691}
692
693impl wkt::message::Message for AddPublicKeyMetadata {
694 fn typename() -> &'static str {
695 "type.googleapis.com/google.cloud.shell.v1.AddPublicKeyMetadata"
696 }
697}
698
699#[serde_with::serde_as]
704#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
705#[serde(default, rename_all = "camelCase")]
706#[non_exhaustive]
707pub struct RemovePublicKeyRequest {
708 #[serde(skip_serializing_if = "std::string::String::is_empty")]
711 pub environment: std::string::String,
712
713 #[serde(skip_serializing_if = "std::string::String::is_empty")]
715 pub key: std::string::String,
716}
717
718impl RemovePublicKeyRequest {
719 pub fn new() -> Self {
720 std::default::Default::default()
721 }
722
723 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
725 self.environment = v.into();
726 self
727 }
728
729 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
731 self.key = v.into();
732 self
733 }
734}
735
736impl wkt::message::Message for RemovePublicKeyRequest {
737 fn typename() -> &'static str {
738 "type.googleapis.com/google.cloud.shell.v1.RemovePublicKeyRequest"
739 }
740}
741
742#[serde_with::serde_as]
747#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
748#[serde(default, rename_all = "camelCase")]
749#[non_exhaustive]
750pub struct RemovePublicKeyResponse {}
751
752impl RemovePublicKeyResponse {
753 pub fn new() -> Self {
754 std::default::Default::default()
755 }
756}
757
758impl wkt::message::Message for RemovePublicKeyResponse {
759 fn typename() -> &'static str {
760 "type.googleapis.com/google.cloud.shell.v1.RemovePublicKeyResponse"
761 }
762}
763
764#[serde_with::serde_as]
769#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
770#[serde(default, rename_all = "camelCase")]
771#[non_exhaustive]
772pub struct RemovePublicKeyMetadata {}
773
774impl RemovePublicKeyMetadata {
775 pub fn new() -> Self {
776 std::default::Default::default()
777 }
778}
779
780impl wkt::message::Message for RemovePublicKeyMetadata {
781 fn typename() -> &'static str {
782 "type.googleapis.com/google.cloud.shell.v1.RemovePublicKeyMetadata"
783 }
784}
785
786#[serde_with::serde_as]
789#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
790#[serde(default, rename_all = "camelCase")]
791#[non_exhaustive]
792pub struct CloudShellErrorDetails {
793 pub code: crate::model::cloud_shell_error_details::CloudShellErrorCode,
795}
796
797impl CloudShellErrorDetails {
798 pub fn new() -> Self {
799 std::default::Default::default()
800 }
801
802 pub fn set_code<
804 T: std::convert::Into<crate::model::cloud_shell_error_details::CloudShellErrorCode>,
805 >(
806 mut self,
807 v: T,
808 ) -> Self {
809 self.code = v.into();
810 self
811 }
812}
813
814impl wkt::message::Message for CloudShellErrorDetails {
815 fn typename() -> &'static str {
816 "type.googleapis.com/google.cloud.shell.v1.CloudShellErrorDetails"
817 }
818}
819
820pub mod cloud_shell_error_details {
822 #[allow(unused_imports)]
823 use super::*;
824
825 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
827 pub struct CloudShellErrorCode(std::borrow::Cow<'static, str>);
828
829 impl CloudShellErrorCode {
830 pub const fn new(v: &'static str) -> Self {
832 Self(std::borrow::Cow::Borrowed(v))
833 }
834
835 pub fn value(&self) -> &str {
837 &self.0
838 }
839 }
840
841 pub mod cloud_shell_error_code {
843 use super::CloudShellErrorCode;
844
845 pub const CLOUD_SHELL_ERROR_CODE_UNSPECIFIED: CloudShellErrorCode =
847 CloudShellErrorCode::new("CLOUD_SHELL_ERROR_CODE_UNSPECIFIED");
848
849 pub const IMAGE_UNAVAILABLE: CloudShellErrorCode =
852 CloudShellErrorCode::new("IMAGE_UNAVAILABLE");
853
854 pub const CLOUD_SHELL_DISABLED: CloudShellErrorCode =
857 CloudShellErrorCode::new("CLOUD_SHELL_DISABLED");
858
859 pub const TOS_VIOLATION: CloudShellErrorCode = CloudShellErrorCode::new("TOS_VIOLATION");
862
863 pub const QUOTA_EXCEEDED: CloudShellErrorCode = CloudShellErrorCode::new("QUOTA_EXCEEDED");
866
867 pub const ENVIRONMENT_UNAVAILABLE: CloudShellErrorCode =
870 CloudShellErrorCode::new("ENVIRONMENT_UNAVAILABLE");
871 }
872
873 impl std::convert::From<std::string::String> for CloudShellErrorCode {
874 fn from(value: std::string::String) -> Self {
875 Self(std::borrow::Cow::Owned(value))
876 }
877 }
878}