1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct ClientGateway {
45 pub name: std::string::String,
47
48 pub create_time: std::option::Option<wkt::Timestamp>,
50
51 pub update_time: std::option::Option<wkt::Timestamp>,
53
54 pub state: crate::model::client_gateway::State,
56
57 pub id: std::string::String,
59
60 pub client_connector_service: std::string::String,
64
65 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
66}
67
68impl ClientGateway {
69 pub fn new() -> Self {
70 std::default::Default::default()
71 }
72
73 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75 self.name = v.into();
76 self
77 }
78
79 pub fn set_create_time<T>(mut self, v: T) -> Self
81 where
82 T: std::convert::Into<wkt::Timestamp>,
83 {
84 self.create_time = std::option::Option::Some(v.into());
85 self
86 }
87
88 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
90 where
91 T: std::convert::Into<wkt::Timestamp>,
92 {
93 self.create_time = v.map(|x| x.into());
94 self
95 }
96
97 pub fn set_update_time<T>(mut self, v: T) -> Self
99 where
100 T: std::convert::Into<wkt::Timestamp>,
101 {
102 self.update_time = std::option::Option::Some(v.into());
103 self
104 }
105
106 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
108 where
109 T: std::convert::Into<wkt::Timestamp>,
110 {
111 self.update_time = v.map(|x| x.into());
112 self
113 }
114
115 pub fn set_state<T: std::convert::Into<crate::model::client_gateway::State>>(
117 mut self,
118 v: T,
119 ) -> Self {
120 self.state = v.into();
121 self
122 }
123
124 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
126 self.id = v.into();
127 self
128 }
129
130 pub fn set_client_connector_service<T: std::convert::Into<std::string::String>>(
132 mut self,
133 v: T,
134 ) -> Self {
135 self.client_connector_service = v.into();
136 self
137 }
138}
139
140impl wkt::message::Message for ClientGateway {
141 fn typename() -> &'static str {
142 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.ClientGateway"
143 }
144}
145
146pub mod client_gateway {
148 #[allow(unused_imports)]
149 use super::*;
150
151 #[derive(Clone, Debug, PartialEq)]
167 #[non_exhaustive]
168 pub enum State {
169 Unspecified,
171 Creating,
173 Updating,
175 Deleting,
177 Running,
179 Down,
182 Error,
184 UnknownValue(state::UnknownValue),
189 }
190
191 #[doc(hidden)]
192 pub mod state {
193 #[allow(unused_imports)]
194 use super::*;
195 #[derive(Clone, Debug, PartialEq)]
196 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
197 }
198
199 impl State {
200 pub fn value(&self) -> std::option::Option<i32> {
205 match self {
206 Self::Unspecified => std::option::Option::Some(0),
207 Self::Creating => std::option::Option::Some(1),
208 Self::Updating => std::option::Option::Some(2),
209 Self::Deleting => std::option::Option::Some(3),
210 Self::Running => std::option::Option::Some(4),
211 Self::Down => std::option::Option::Some(5),
212 Self::Error => std::option::Option::Some(6),
213 Self::UnknownValue(u) => u.0.value(),
214 }
215 }
216
217 pub fn name(&self) -> std::option::Option<&str> {
222 match self {
223 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
224 Self::Creating => std::option::Option::Some("CREATING"),
225 Self::Updating => std::option::Option::Some("UPDATING"),
226 Self::Deleting => std::option::Option::Some("DELETING"),
227 Self::Running => std::option::Option::Some("RUNNING"),
228 Self::Down => std::option::Option::Some("DOWN"),
229 Self::Error => std::option::Option::Some("ERROR"),
230 Self::UnknownValue(u) => u.0.name(),
231 }
232 }
233 }
234
235 impl std::default::Default for State {
236 fn default() -> Self {
237 use std::convert::From;
238 Self::from(0)
239 }
240 }
241
242 impl std::fmt::Display for State {
243 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
244 wkt::internal::display_enum(f, self.name(), self.value())
245 }
246 }
247
248 impl std::convert::From<i32> for State {
249 fn from(value: i32) -> Self {
250 match value {
251 0 => Self::Unspecified,
252 1 => Self::Creating,
253 2 => Self::Updating,
254 3 => Self::Deleting,
255 4 => Self::Running,
256 5 => Self::Down,
257 6 => Self::Error,
258 _ => Self::UnknownValue(state::UnknownValue(
259 wkt::internal::UnknownEnumValue::Integer(value),
260 )),
261 }
262 }
263 }
264
265 impl std::convert::From<&str> for State {
266 fn from(value: &str) -> Self {
267 use std::string::ToString;
268 match value {
269 "STATE_UNSPECIFIED" => Self::Unspecified,
270 "CREATING" => Self::Creating,
271 "UPDATING" => Self::Updating,
272 "DELETING" => Self::Deleting,
273 "RUNNING" => Self::Running,
274 "DOWN" => Self::Down,
275 "ERROR" => Self::Error,
276 _ => Self::UnknownValue(state::UnknownValue(
277 wkt::internal::UnknownEnumValue::String(value.to_string()),
278 )),
279 }
280 }
281 }
282
283 impl serde::ser::Serialize for State {
284 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
285 where
286 S: serde::Serializer,
287 {
288 match self {
289 Self::Unspecified => serializer.serialize_i32(0),
290 Self::Creating => serializer.serialize_i32(1),
291 Self::Updating => serializer.serialize_i32(2),
292 Self::Deleting => serializer.serialize_i32(3),
293 Self::Running => serializer.serialize_i32(4),
294 Self::Down => serializer.serialize_i32(5),
295 Self::Error => serializer.serialize_i32(6),
296 Self::UnknownValue(u) => u.0.serialize(serializer),
297 }
298 }
299 }
300
301 impl<'de> serde::de::Deserialize<'de> for State {
302 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
303 where
304 D: serde::Deserializer<'de>,
305 {
306 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
307 ".google.cloud.beyondcorp.clientgateways.v1.ClientGateway.State",
308 ))
309 }
310 }
311}
312
313#[derive(Clone, Default, PartialEq)]
315#[non_exhaustive]
316pub struct ListClientGatewaysRequest {
317 pub parent: std::string::String,
319
320 pub page_size: i32,
323
324 pub page_token: std::string::String,
326
327 pub filter: std::string::String,
329
330 pub order_by: std::string::String,
332
333 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
334}
335
336impl ListClientGatewaysRequest {
337 pub fn new() -> Self {
338 std::default::Default::default()
339 }
340
341 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
343 self.parent = v.into();
344 self
345 }
346
347 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
349 self.page_size = v.into();
350 self
351 }
352
353 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
355 self.page_token = v.into();
356 self
357 }
358
359 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
361 self.filter = v.into();
362 self
363 }
364
365 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
367 self.order_by = v.into();
368 self
369 }
370}
371
372impl wkt::message::Message for ListClientGatewaysRequest {
373 fn typename() -> &'static str {
374 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysRequest"
375 }
376}
377
378#[derive(Clone, Default, PartialEq)]
380#[non_exhaustive]
381pub struct ListClientGatewaysResponse {
382 pub client_gateways: std::vec::Vec<crate::model::ClientGateway>,
384
385 pub next_page_token: std::string::String,
387
388 pub unreachable: std::vec::Vec<std::string::String>,
390
391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
392}
393
394impl ListClientGatewaysResponse {
395 pub fn new() -> Self {
396 std::default::Default::default()
397 }
398
399 pub fn set_client_gateways<T, V>(mut self, v: T) -> Self
401 where
402 T: std::iter::IntoIterator<Item = V>,
403 V: std::convert::Into<crate::model::ClientGateway>,
404 {
405 use std::iter::Iterator;
406 self.client_gateways = v.into_iter().map(|i| i.into()).collect();
407 self
408 }
409
410 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
412 self.next_page_token = v.into();
413 self
414 }
415
416 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
418 where
419 T: std::iter::IntoIterator<Item = V>,
420 V: std::convert::Into<std::string::String>,
421 {
422 use std::iter::Iterator;
423 self.unreachable = v.into_iter().map(|i| i.into()).collect();
424 self
425 }
426}
427
428impl wkt::message::Message for ListClientGatewaysResponse {
429 fn typename() -> &'static str {
430 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.ListClientGatewaysResponse"
431 }
432}
433
434#[doc(hidden)]
435impl gax::paginator::internal::PageableResponse for ListClientGatewaysResponse {
436 type PageItem = crate::model::ClientGateway;
437
438 fn items(self) -> std::vec::Vec<Self::PageItem> {
439 self.client_gateways
440 }
441
442 fn next_page_token(&self) -> std::string::String {
443 use std::clone::Clone;
444 self.next_page_token.clone()
445 }
446}
447
448#[derive(Clone, Default, PartialEq)]
450#[non_exhaustive]
451pub struct GetClientGatewayRequest {
452 pub name: std::string::String,
454
455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
456}
457
458impl GetClientGatewayRequest {
459 pub fn new() -> Self {
460 std::default::Default::default()
461 }
462
463 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
465 self.name = v.into();
466 self
467 }
468}
469
470impl wkt::message::Message for GetClientGatewayRequest {
471 fn typename() -> &'static str {
472 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.GetClientGatewayRequest"
473 }
474}
475
476#[derive(Clone, Default, PartialEq)]
478#[non_exhaustive]
479pub struct CreateClientGatewayRequest {
480 pub parent: std::string::String,
482
483 pub client_gateway_id: std::string::String,
489
490 pub client_gateway: std::option::Option<crate::model::ClientGateway>,
492
493 pub request_id: std::string::String,
507
508 pub validate_only: bool,
511
512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
513}
514
515impl CreateClientGatewayRequest {
516 pub fn new() -> Self {
517 std::default::Default::default()
518 }
519
520 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
522 self.parent = v.into();
523 self
524 }
525
526 pub fn set_client_gateway_id<T: std::convert::Into<std::string::String>>(
528 mut self,
529 v: T,
530 ) -> Self {
531 self.client_gateway_id = v.into();
532 self
533 }
534
535 pub fn set_client_gateway<T>(mut self, v: T) -> Self
537 where
538 T: std::convert::Into<crate::model::ClientGateway>,
539 {
540 self.client_gateway = std::option::Option::Some(v.into());
541 self
542 }
543
544 pub fn set_or_clear_client_gateway<T>(mut self, v: std::option::Option<T>) -> Self
546 where
547 T: std::convert::Into<crate::model::ClientGateway>,
548 {
549 self.client_gateway = v.map(|x| x.into());
550 self
551 }
552
553 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
555 self.request_id = v.into();
556 self
557 }
558
559 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
561 self.validate_only = v.into();
562 self
563 }
564}
565
566impl wkt::message::Message for CreateClientGatewayRequest {
567 fn typename() -> &'static str {
568 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.CreateClientGatewayRequest"
569 }
570}
571
572#[derive(Clone, Default, PartialEq)]
574#[non_exhaustive]
575pub struct DeleteClientGatewayRequest {
576 pub name: std::string::String,
578
579 pub request_id: std::string::String,
593
594 pub validate_only: bool,
597
598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
599}
600
601impl DeleteClientGatewayRequest {
602 pub fn new() -> Self {
603 std::default::Default::default()
604 }
605
606 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
608 self.name = v.into();
609 self
610 }
611
612 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
614 self.request_id = v.into();
615 self
616 }
617
618 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
620 self.validate_only = v.into();
621 self
622 }
623}
624
625impl wkt::message::Message for DeleteClientGatewayRequest {
626 fn typename() -> &'static str {
627 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.DeleteClientGatewayRequest"
628 }
629}
630
631#[derive(Clone, Default, PartialEq)]
633#[non_exhaustive]
634pub struct ClientGatewayOperationMetadata {
635 pub create_time: std::option::Option<wkt::Timestamp>,
637
638 pub end_time: std::option::Option<wkt::Timestamp>,
640
641 pub target: std::string::String,
643
644 pub verb: std::string::String,
646
647 pub status_message: std::string::String,
649
650 pub requested_cancellation: bool,
658
659 pub api_version: std::string::String,
661
662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
663}
664
665impl ClientGatewayOperationMetadata {
666 pub fn new() -> Self {
667 std::default::Default::default()
668 }
669
670 pub fn set_create_time<T>(mut self, v: T) -> Self
672 where
673 T: std::convert::Into<wkt::Timestamp>,
674 {
675 self.create_time = std::option::Option::Some(v.into());
676 self
677 }
678
679 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
681 where
682 T: std::convert::Into<wkt::Timestamp>,
683 {
684 self.create_time = v.map(|x| x.into());
685 self
686 }
687
688 pub fn set_end_time<T>(mut self, v: T) -> Self
690 where
691 T: std::convert::Into<wkt::Timestamp>,
692 {
693 self.end_time = std::option::Option::Some(v.into());
694 self
695 }
696
697 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
699 where
700 T: std::convert::Into<wkt::Timestamp>,
701 {
702 self.end_time = v.map(|x| x.into());
703 self
704 }
705
706 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
708 self.target = v.into();
709 self
710 }
711
712 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
714 self.verb = v.into();
715 self
716 }
717
718 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
720 self.status_message = v.into();
721 self
722 }
723
724 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
726 self.requested_cancellation = v.into();
727 self
728 }
729
730 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
732 self.api_version = v.into();
733 self
734 }
735}
736
737impl wkt::message::Message for ClientGatewayOperationMetadata {
738 fn typename() -> &'static str {
739 "type.googleapis.com/google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata"
740 }
741}