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 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
35mod debug;
36mod deserialize;
37mod serialize;
38
39#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct Endpoint {
44 pub name: std::string::String,
46
47 pub create_time: std::option::Option<wkt::Timestamp>,
49
50 pub update_time: std::option::Option<wkt::Timestamp>,
52
53 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
55
56 pub network: std::string::String,
59
60 pub endpoint_forwarding_rule: std::string::String,
62
63 pub endpoint_ip: std::string::String,
65
66 pub description: std::string::String,
68
69 pub severity: crate::model::endpoint::Severity,
71
72 pub state: crate::model::endpoint::State,
74
75 pub traffic_logs: bool,
77
78 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
79}
80
81impl Endpoint {
82 pub fn new() -> Self {
83 std::default::Default::default()
84 }
85
86 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88 self.name = v.into();
89 self
90 }
91
92 pub fn set_create_time<T>(mut self, v: T) -> Self
94 where
95 T: std::convert::Into<wkt::Timestamp>,
96 {
97 self.create_time = std::option::Option::Some(v.into());
98 self
99 }
100
101 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
103 where
104 T: std::convert::Into<wkt::Timestamp>,
105 {
106 self.create_time = v.map(|x| x.into());
107 self
108 }
109
110 pub fn set_update_time<T>(mut self, v: T) -> Self
112 where
113 T: std::convert::Into<wkt::Timestamp>,
114 {
115 self.update_time = std::option::Option::Some(v.into());
116 self
117 }
118
119 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
121 where
122 T: std::convert::Into<wkt::Timestamp>,
123 {
124 self.update_time = v.map(|x| x.into());
125 self
126 }
127
128 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
130 where
131 T: std::iter::IntoIterator<Item = (K, V)>,
132 K: std::convert::Into<std::string::String>,
133 V: std::convert::Into<std::string::String>,
134 {
135 use std::iter::Iterator;
136 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
137 self
138 }
139
140 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142 self.network = v.into();
143 self
144 }
145
146 pub fn set_endpoint_forwarding_rule<T: std::convert::Into<std::string::String>>(
148 mut self,
149 v: T,
150 ) -> Self {
151 self.endpoint_forwarding_rule = v.into();
152 self
153 }
154
155 pub fn set_endpoint_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157 self.endpoint_ip = v.into();
158 self
159 }
160
161 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
163 self.description = v.into();
164 self
165 }
166
167 pub fn set_severity<T: std::convert::Into<crate::model::endpoint::Severity>>(
169 mut self,
170 v: T,
171 ) -> Self {
172 self.severity = v.into();
173 self
174 }
175
176 pub fn set_state<T: std::convert::Into<crate::model::endpoint::State>>(mut self, v: T) -> Self {
178 self.state = v.into();
179 self
180 }
181
182 pub fn set_traffic_logs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
184 self.traffic_logs = v.into();
185 self
186 }
187}
188
189impl wkt::message::Message for Endpoint {
190 fn typename() -> &'static str {
191 "type.googleapis.com/google.cloud.ids.v1.Endpoint"
192 }
193}
194
195pub mod endpoint {
197 #[allow(unused_imports)]
198 use super::*;
199
200 #[derive(Clone, Debug, PartialEq)]
216 #[non_exhaustive]
217 pub enum Severity {
218 Unspecified,
220 Informational,
222 Low,
224 Medium,
226 High,
228 Critical,
230 UnknownValue(severity::UnknownValue),
235 }
236
237 #[doc(hidden)]
238 pub mod severity {
239 #[allow(unused_imports)]
240 use super::*;
241 #[derive(Clone, Debug, PartialEq)]
242 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
243 }
244
245 impl Severity {
246 pub fn value(&self) -> std::option::Option<i32> {
251 match self {
252 Self::Unspecified => std::option::Option::Some(0),
253 Self::Informational => std::option::Option::Some(1),
254 Self::Low => std::option::Option::Some(2),
255 Self::Medium => std::option::Option::Some(3),
256 Self::High => std::option::Option::Some(4),
257 Self::Critical => std::option::Option::Some(5),
258 Self::UnknownValue(u) => u.0.value(),
259 }
260 }
261
262 pub fn name(&self) -> std::option::Option<&str> {
267 match self {
268 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
269 Self::Informational => std::option::Option::Some("INFORMATIONAL"),
270 Self::Low => std::option::Option::Some("LOW"),
271 Self::Medium => std::option::Option::Some("MEDIUM"),
272 Self::High => std::option::Option::Some("HIGH"),
273 Self::Critical => std::option::Option::Some("CRITICAL"),
274 Self::UnknownValue(u) => u.0.name(),
275 }
276 }
277 }
278
279 impl std::default::Default for Severity {
280 fn default() -> Self {
281 use std::convert::From;
282 Self::from(0)
283 }
284 }
285
286 impl std::fmt::Display for Severity {
287 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
288 wkt::internal::display_enum(f, self.name(), self.value())
289 }
290 }
291
292 impl std::convert::From<i32> for Severity {
293 fn from(value: i32) -> Self {
294 match value {
295 0 => Self::Unspecified,
296 1 => Self::Informational,
297 2 => Self::Low,
298 3 => Self::Medium,
299 4 => Self::High,
300 5 => Self::Critical,
301 _ => Self::UnknownValue(severity::UnknownValue(
302 wkt::internal::UnknownEnumValue::Integer(value),
303 )),
304 }
305 }
306 }
307
308 impl std::convert::From<&str> for Severity {
309 fn from(value: &str) -> Self {
310 use std::string::ToString;
311 match value {
312 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
313 "INFORMATIONAL" => Self::Informational,
314 "LOW" => Self::Low,
315 "MEDIUM" => Self::Medium,
316 "HIGH" => Self::High,
317 "CRITICAL" => Self::Critical,
318 _ => Self::UnknownValue(severity::UnknownValue(
319 wkt::internal::UnknownEnumValue::String(value.to_string()),
320 )),
321 }
322 }
323 }
324
325 impl serde::ser::Serialize for Severity {
326 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
327 where
328 S: serde::Serializer,
329 {
330 match self {
331 Self::Unspecified => serializer.serialize_i32(0),
332 Self::Informational => serializer.serialize_i32(1),
333 Self::Low => serializer.serialize_i32(2),
334 Self::Medium => serializer.serialize_i32(3),
335 Self::High => serializer.serialize_i32(4),
336 Self::Critical => serializer.serialize_i32(5),
337 Self::UnknownValue(u) => u.0.serialize(serializer),
338 }
339 }
340 }
341
342 impl<'de> serde::de::Deserialize<'de> for Severity {
343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
344 where
345 D: serde::Deserializer<'de>,
346 {
347 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
348 ".google.cloud.ids.v1.Endpoint.Severity",
349 ))
350 }
351 }
352
353 #[derive(Clone, Debug, PartialEq)]
369 #[non_exhaustive]
370 pub enum State {
371 Unspecified,
373 Creating,
375 Ready,
377 Deleting,
379 UnknownValue(state::UnknownValue),
384 }
385
386 #[doc(hidden)]
387 pub mod state {
388 #[allow(unused_imports)]
389 use super::*;
390 #[derive(Clone, Debug, PartialEq)]
391 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
392 }
393
394 impl State {
395 pub fn value(&self) -> std::option::Option<i32> {
400 match self {
401 Self::Unspecified => std::option::Option::Some(0),
402 Self::Creating => std::option::Option::Some(1),
403 Self::Ready => std::option::Option::Some(2),
404 Self::Deleting => std::option::Option::Some(3),
405 Self::UnknownValue(u) => u.0.value(),
406 }
407 }
408
409 pub fn name(&self) -> std::option::Option<&str> {
414 match self {
415 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
416 Self::Creating => std::option::Option::Some("CREATING"),
417 Self::Ready => std::option::Option::Some("READY"),
418 Self::Deleting => std::option::Option::Some("DELETING"),
419 Self::UnknownValue(u) => u.0.name(),
420 }
421 }
422 }
423
424 impl std::default::Default for State {
425 fn default() -> Self {
426 use std::convert::From;
427 Self::from(0)
428 }
429 }
430
431 impl std::fmt::Display for State {
432 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
433 wkt::internal::display_enum(f, self.name(), self.value())
434 }
435 }
436
437 impl std::convert::From<i32> for State {
438 fn from(value: i32) -> Self {
439 match value {
440 0 => Self::Unspecified,
441 1 => Self::Creating,
442 2 => Self::Ready,
443 3 => Self::Deleting,
444 _ => Self::UnknownValue(state::UnknownValue(
445 wkt::internal::UnknownEnumValue::Integer(value),
446 )),
447 }
448 }
449 }
450
451 impl std::convert::From<&str> for State {
452 fn from(value: &str) -> Self {
453 use std::string::ToString;
454 match value {
455 "STATE_UNSPECIFIED" => Self::Unspecified,
456 "CREATING" => Self::Creating,
457 "READY" => Self::Ready,
458 "DELETING" => Self::Deleting,
459 _ => Self::UnknownValue(state::UnknownValue(
460 wkt::internal::UnknownEnumValue::String(value.to_string()),
461 )),
462 }
463 }
464 }
465
466 impl serde::ser::Serialize for State {
467 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
468 where
469 S: serde::Serializer,
470 {
471 match self {
472 Self::Unspecified => serializer.serialize_i32(0),
473 Self::Creating => serializer.serialize_i32(1),
474 Self::Ready => serializer.serialize_i32(2),
475 Self::Deleting => serializer.serialize_i32(3),
476 Self::UnknownValue(u) => u.0.serialize(serializer),
477 }
478 }
479 }
480
481 impl<'de> serde::de::Deserialize<'de> for State {
482 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
483 where
484 D: serde::Deserializer<'de>,
485 {
486 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
487 ".google.cloud.ids.v1.Endpoint.State",
488 ))
489 }
490 }
491}
492
493#[derive(Clone, Default, PartialEq)]
494#[non_exhaustive]
495pub struct ListEndpointsRequest {
496 pub parent: std::string::String,
498
499 pub page_size: i32,
502
503 pub page_token: std::string::String,
509
510 pub filter: std::string::String,
513
514 pub order_by: std::string::String,
517
518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
519}
520
521impl ListEndpointsRequest {
522 pub fn new() -> Self {
523 std::default::Default::default()
524 }
525
526 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
528 self.parent = v.into();
529 self
530 }
531
532 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
534 self.page_size = v.into();
535 self
536 }
537
538 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
540 self.page_token = v.into();
541 self
542 }
543
544 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
546 self.filter = v.into();
547 self
548 }
549
550 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
552 self.order_by = v.into();
553 self
554 }
555}
556
557impl wkt::message::Message for ListEndpointsRequest {
558 fn typename() -> &'static str {
559 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsRequest"
560 }
561}
562
563#[derive(Clone, Default, PartialEq)]
564#[non_exhaustive]
565pub struct ListEndpointsResponse {
566 pub endpoints: std::vec::Vec<crate::model::Endpoint>,
568
569 pub next_page_token: std::string::String,
572
573 pub unreachable: std::vec::Vec<std::string::String>,
575
576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
577}
578
579impl ListEndpointsResponse {
580 pub fn new() -> Self {
581 std::default::Default::default()
582 }
583
584 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
586 where
587 T: std::iter::IntoIterator<Item = V>,
588 V: std::convert::Into<crate::model::Endpoint>,
589 {
590 use std::iter::Iterator;
591 self.endpoints = v.into_iter().map(|i| i.into()).collect();
592 self
593 }
594
595 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
597 self.next_page_token = v.into();
598 self
599 }
600
601 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
603 where
604 T: std::iter::IntoIterator<Item = V>,
605 V: std::convert::Into<std::string::String>,
606 {
607 use std::iter::Iterator;
608 self.unreachable = v.into_iter().map(|i| i.into()).collect();
609 self
610 }
611}
612
613impl wkt::message::Message for ListEndpointsResponse {
614 fn typename() -> &'static str {
615 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsResponse"
616 }
617}
618
619#[doc(hidden)]
620impl gax::paginator::internal::PageableResponse for ListEndpointsResponse {
621 type PageItem = crate::model::Endpoint;
622
623 fn items(self) -> std::vec::Vec<Self::PageItem> {
624 self.endpoints
625 }
626
627 fn next_page_token(&self) -> std::string::String {
628 use std::clone::Clone;
629 self.next_page_token.clone()
630 }
631}
632
633#[derive(Clone, Default, PartialEq)]
634#[non_exhaustive]
635pub struct GetEndpointRequest {
636 pub name: std::string::String,
639
640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
641}
642
643impl GetEndpointRequest {
644 pub fn new() -> Self {
645 std::default::Default::default()
646 }
647
648 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650 self.name = v.into();
651 self
652 }
653}
654
655impl wkt::message::Message for GetEndpointRequest {
656 fn typename() -> &'static str {
657 "type.googleapis.com/google.cloud.ids.v1.GetEndpointRequest"
658 }
659}
660
661#[derive(Clone, Default, PartialEq)]
662#[non_exhaustive]
663pub struct CreateEndpointRequest {
664 pub parent: std::string::String,
666
667 pub endpoint_id: std::string::String,
674
675 pub endpoint: std::option::Option<crate::model::Endpoint>,
677
678 pub request_id: std::string::String,
692
693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
694}
695
696impl CreateEndpointRequest {
697 pub fn new() -> Self {
698 std::default::Default::default()
699 }
700
701 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
703 self.parent = v.into();
704 self
705 }
706
707 pub fn set_endpoint_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
709 self.endpoint_id = v.into();
710 self
711 }
712
713 pub fn set_endpoint<T>(mut self, v: T) -> Self
715 where
716 T: std::convert::Into<crate::model::Endpoint>,
717 {
718 self.endpoint = std::option::Option::Some(v.into());
719 self
720 }
721
722 pub fn set_or_clear_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
724 where
725 T: std::convert::Into<crate::model::Endpoint>,
726 {
727 self.endpoint = v.map(|x| x.into());
728 self
729 }
730
731 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
733 self.request_id = v.into();
734 self
735 }
736}
737
738impl wkt::message::Message for CreateEndpointRequest {
739 fn typename() -> &'static str {
740 "type.googleapis.com/google.cloud.ids.v1.CreateEndpointRequest"
741 }
742}
743
744#[derive(Clone, Default, PartialEq)]
745#[non_exhaustive]
746pub struct DeleteEndpointRequest {
747 pub name: std::string::String,
749
750 pub request_id: std::string::String,
764
765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
766}
767
768impl DeleteEndpointRequest {
769 pub fn new() -> Self {
770 std::default::Default::default()
771 }
772
773 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
775 self.name = v.into();
776 self
777 }
778
779 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
781 self.request_id = v.into();
782 self
783 }
784}
785
786impl wkt::message::Message for DeleteEndpointRequest {
787 fn typename() -> &'static str {
788 "type.googleapis.com/google.cloud.ids.v1.DeleteEndpointRequest"
789 }
790}
791
792#[derive(Clone, Default, PartialEq)]
794#[non_exhaustive]
795pub struct OperationMetadata {
796 pub create_time: std::option::Option<wkt::Timestamp>,
798
799 pub end_time: std::option::Option<wkt::Timestamp>,
801
802 pub target: std::string::String,
804
805 pub verb: std::string::String,
807
808 pub status_message: std::string::String,
810
811 pub requested_cancellation: bool,
818
819 pub api_version: std::string::String,
821
822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
823}
824
825impl OperationMetadata {
826 pub fn new() -> Self {
827 std::default::Default::default()
828 }
829
830 pub fn set_create_time<T>(mut self, v: T) -> Self
832 where
833 T: std::convert::Into<wkt::Timestamp>,
834 {
835 self.create_time = std::option::Option::Some(v.into());
836 self
837 }
838
839 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
841 where
842 T: std::convert::Into<wkt::Timestamp>,
843 {
844 self.create_time = v.map(|x| x.into());
845 self
846 }
847
848 pub fn set_end_time<T>(mut self, v: T) -> Self
850 where
851 T: std::convert::Into<wkt::Timestamp>,
852 {
853 self.end_time = std::option::Option::Some(v.into());
854 self
855 }
856
857 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
859 where
860 T: std::convert::Into<wkt::Timestamp>,
861 {
862 self.end_time = v.map(|x| x.into());
863 self
864 }
865
866 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
868 self.target = v.into();
869 self
870 }
871
872 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
874 self.verb = v.into();
875 self
876 }
877
878 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
880 self.status_message = v.into();
881 self
882 }
883
884 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
886 self.requested_cancellation = v.into();
887 self
888 }
889
890 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
892 self.api_version = v.into();
893 self
894 }
895}
896
897impl wkt::message::Message for OperationMetadata {
898 fn typename() -> &'static str {
899 "type.googleapis.com/google.cloud.ids.v1.OperationMetadata"
900 }
901}