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
35#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct Endpoint {
42 #[serde(skip_serializing_if = "std::string::String::is_empty")]
44 pub name: std::string::String,
45
46 #[serde(skip_serializing_if = "std::option::Option::is_none")]
48 pub create_time: std::option::Option<wkt::Timestamp>,
49
50 #[serde(skip_serializing_if = "std::option::Option::is_none")]
52 pub update_time: std::option::Option<wkt::Timestamp>,
53
54 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
56 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58 #[serde(skip_serializing_if = "std::string::String::is_empty")]
61 pub network: std::string::String,
62
63 #[serde(skip_serializing_if = "std::string::String::is_empty")]
65 pub endpoint_forwarding_rule: std::string::String,
66
67 #[serde(skip_serializing_if = "std::string::String::is_empty")]
69 pub endpoint_ip: std::string::String,
70
71 #[serde(skip_serializing_if = "std::string::String::is_empty")]
73 pub description: std::string::String,
74
75 pub severity: crate::model::endpoint::Severity,
77
78 pub state: crate::model::endpoint::State,
80
81 #[serde(skip_serializing_if = "wkt::internal::is_default")]
83 pub traffic_logs: bool,
84
85 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
86 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
87}
88
89impl Endpoint {
90 pub fn new() -> Self {
91 std::default::Default::default()
92 }
93
94 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
96 self.name = v.into();
97 self
98 }
99
100 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
102 mut self,
103 v: T,
104 ) -> Self {
105 self.create_time = v.into();
106 self
107 }
108
109 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
111 mut self,
112 v: T,
113 ) -> Self {
114 self.update_time = v.into();
115 self
116 }
117
118 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
120 where
121 T: std::iter::IntoIterator<Item = (K, V)>,
122 K: std::convert::Into<std::string::String>,
123 V: std::convert::Into<std::string::String>,
124 {
125 use std::iter::Iterator;
126 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
127 self
128 }
129
130 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.network = v.into();
133 self
134 }
135
136 pub fn set_endpoint_forwarding_rule<T: std::convert::Into<std::string::String>>(
138 mut self,
139 v: T,
140 ) -> Self {
141 self.endpoint_forwarding_rule = v.into();
142 self
143 }
144
145 pub fn set_endpoint_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
147 self.endpoint_ip = v.into();
148 self
149 }
150
151 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
153 self.description = v.into();
154 self
155 }
156
157 pub fn set_severity<T: std::convert::Into<crate::model::endpoint::Severity>>(
159 mut self,
160 v: T,
161 ) -> Self {
162 self.severity = v.into();
163 self
164 }
165
166 pub fn set_state<T: std::convert::Into<crate::model::endpoint::State>>(mut self, v: T) -> Self {
168 self.state = v.into();
169 self
170 }
171
172 pub fn set_traffic_logs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
174 self.traffic_logs = v.into();
175 self
176 }
177}
178
179impl wkt::message::Message for Endpoint {
180 fn typename() -> &'static str {
181 "type.googleapis.com/google.cloud.ids.v1.Endpoint"
182 }
183}
184
185pub mod endpoint {
187 #[allow(unused_imports)]
188 use super::*;
189
190 #[derive(Clone, Debug, PartialEq)]
206 #[non_exhaustive]
207 pub enum Severity {
208 Unspecified,
210 Informational,
212 Low,
214 Medium,
216 High,
218 Critical,
220 UnknownValue(severity::UnknownValue),
225 }
226
227 #[doc(hidden)]
228 pub mod severity {
229 #[allow(unused_imports)]
230 use super::*;
231 #[derive(Clone, Debug, PartialEq)]
232 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
233 }
234
235 impl Severity {
236 pub fn value(&self) -> std::option::Option<i32> {
241 match self {
242 Self::Unspecified => std::option::Option::Some(0),
243 Self::Informational => std::option::Option::Some(1),
244 Self::Low => std::option::Option::Some(2),
245 Self::Medium => std::option::Option::Some(3),
246 Self::High => std::option::Option::Some(4),
247 Self::Critical => std::option::Option::Some(5),
248 Self::UnknownValue(u) => u.0.value(),
249 }
250 }
251
252 pub fn name(&self) -> std::option::Option<&str> {
257 match self {
258 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
259 Self::Informational => std::option::Option::Some("INFORMATIONAL"),
260 Self::Low => std::option::Option::Some("LOW"),
261 Self::Medium => std::option::Option::Some("MEDIUM"),
262 Self::High => std::option::Option::Some("HIGH"),
263 Self::Critical => std::option::Option::Some("CRITICAL"),
264 Self::UnknownValue(u) => u.0.name(),
265 }
266 }
267 }
268
269 impl std::default::Default for Severity {
270 fn default() -> Self {
271 use std::convert::From;
272 Self::from(0)
273 }
274 }
275
276 impl std::fmt::Display for Severity {
277 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
278 wkt::internal::display_enum(f, self.name(), self.value())
279 }
280 }
281
282 impl std::convert::From<i32> for Severity {
283 fn from(value: i32) -> Self {
284 match value {
285 0 => Self::Unspecified,
286 1 => Self::Informational,
287 2 => Self::Low,
288 3 => Self::Medium,
289 4 => Self::High,
290 5 => Self::Critical,
291 _ => Self::UnknownValue(severity::UnknownValue(
292 wkt::internal::UnknownEnumValue::Integer(value),
293 )),
294 }
295 }
296 }
297
298 impl std::convert::From<&str> for Severity {
299 fn from(value: &str) -> Self {
300 use std::string::ToString;
301 match value {
302 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
303 "INFORMATIONAL" => Self::Informational,
304 "LOW" => Self::Low,
305 "MEDIUM" => Self::Medium,
306 "HIGH" => Self::High,
307 "CRITICAL" => Self::Critical,
308 _ => Self::UnknownValue(severity::UnknownValue(
309 wkt::internal::UnknownEnumValue::String(value.to_string()),
310 )),
311 }
312 }
313 }
314
315 impl serde::ser::Serialize for Severity {
316 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
317 where
318 S: serde::Serializer,
319 {
320 match self {
321 Self::Unspecified => serializer.serialize_i32(0),
322 Self::Informational => serializer.serialize_i32(1),
323 Self::Low => serializer.serialize_i32(2),
324 Self::Medium => serializer.serialize_i32(3),
325 Self::High => serializer.serialize_i32(4),
326 Self::Critical => serializer.serialize_i32(5),
327 Self::UnknownValue(u) => u.0.serialize(serializer),
328 }
329 }
330 }
331
332 impl<'de> serde::de::Deserialize<'de> for Severity {
333 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
334 where
335 D: serde::Deserializer<'de>,
336 {
337 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
338 ".google.cloud.ids.v1.Endpoint.Severity",
339 ))
340 }
341 }
342
343 #[derive(Clone, Debug, PartialEq)]
359 #[non_exhaustive]
360 pub enum State {
361 Unspecified,
363 Creating,
365 Ready,
367 Deleting,
369 UnknownValue(state::UnknownValue),
374 }
375
376 #[doc(hidden)]
377 pub mod state {
378 #[allow(unused_imports)]
379 use super::*;
380 #[derive(Clone, Debug, PartialEq)]
381 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
382 }
383
384 impl State {
385 pub fn value(&self) -> std::option::Option<i32> {
390 match self {
391 Self::Unspecified => std::option::Option::Some(0),
392 Self::Creating => std::option::Option::Some(1),
393 Self::Ready => std::option::Option::Some(2),
394 Self::Deleting => std::option::Option::Some(3),
395 Self::UnknownValue(u) => u.0.value(),
396 }
397 }
398
399 pub fn name(&self) -> std::option::Option<&str> {
404 match self {
405 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
406 Self::Creating => std::option::Option::Some("CREATING"),
407 Self::Ready => std::option::Option::Some("READY"),
408 Self::Deleting => std::option::Option::Some("DELETING"),
409 Self::UnknownValue(u) => u.0.name(),
410 }
411 }
412 }
413
414 impl std::default::Default for State {
415 fn default() -> Self {
416 use std::convert::From;
417 Self::from(0)
418 }
419 }
420
421 impl std::fmt::Display for State {
422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
423 wkt::internal::display_enum(f, self.name(), self.value())
424 }
425 }
426
427 impl std::convert::From<i32> for State {
428 fn from(value: i32) -> Self {
429 match value {
430 0 => Self::Unspecified,
431 1 => Self::Creating,
432 2 => Self::Ready,
433 3 => Self::Deleting,
434 _ => Self::UnknownValue(state::UnknownValue(
435 wkt::internal::UnknownEnumValue::Integer(value),
436 )),
437 }
438 }
439 }
440
441 impl std::convert::From<&str> for State {
442 fn from(value: &str) -> Self {
443 use std::string::ToString;
444 match value {
445 "STATE_UNSPECIFIED" => Self::Unspecified,
446 "CREATING" => Self::Creating,
447 "READY" => Self::Ready,
448 "DELETING" => Self::Deleting,
449 _ => Self::UnknownValue(state::UnknownValue(
450 wkt::internal::UnknownEnumValue::String(value.to_string()),
451 )),
452 }
453 }
454 }
455
456 impl serde::ser::Serialize for State {
457 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
458 where
459 S: serde::Serializer,
460 {
461 match self {
462 Self::Unspecified => serializer.serialize_i32(0),
463 Self::Creating => serializer.serialize_i32(1),
464 Self::Ready => serializer.serialize_i32(2),
465 Self::Deleting => serializer.serialize_i32(3),
466 Self::UnknownValue(u) => u.0.serialize(serializer),
467 }
468 }
469 }
470
471 impl<'de> serde::de::Deserialize<'de> for State {
472 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
473 where
474 D: serde::Deserializer<'de>,
475 {
476 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
477 ".google.cloud.ids.v1.Endpoint.State",
478 ))
479 }
480 }
481}
482
483#[serde_with::serde_as]
484#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
485#[serde(default, rename_all = "camelCase")]
486#[non_exhaustive]
487pub struct ListEndpointsRequest {
488 #[serde(skip_serializing_if = "std::string::String::is_empty")]
490 pub parent: std::string::String,
491
492 #[serde(skip_serializing_if = "wkt::internal::is_default")]
495 pub page_size: i32,
496
497 #[serde(skip_serializing_if = "std::string::String::is_empty")]
503 pub page_token: std::string::String,
504
505 #[serde(skip_serializing_if = "std::string::String::is_empty")]
508 pub filter: std::string::String,
509
510 #[serde(skip_serializing_if = "std::string::String::is_empty")]
513 pub order_by: std::string::String,
514
515 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
516 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
517}
518
519impl ListEndpointsRequest {
520 pub fn new() -> Self {
521 std::default::Default::default()
522 }
523
524 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
526 self.parent = v.into();
527 self
528 }
529
530 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
532 self.page_size = v.into();
533 self
534 }
535
536 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
538 self.page_token = v.into();
539 self
540 }
541
542 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
544 self.filter = v.into();
545 self
546 }
547
548 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
550 self.order_by = v.into();
551 self
552 }
553}
554
555impl wkt::message::Message for ListEndpointsRequest {
556 fn typename() -> &'static str {
557 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsRequest"
558 }
559}
560
561#[serde_with::serde_as]
562#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
563#[serde(default, rename_all = "camelCase")]
564#[non_exhaustive]
565pub struct ListEndpointsResponse {
566 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
568 pub endpoints: std::vec::Vec<crate::model::Endpoint>,
569
570 #[serde(skip_serializing_if = "std::string::String::is_empty")]
573 pub next_page_token: std::string::String,
574
575 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
577 pub unreachable: std::vec::Vec<std::string::String>,
578
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 ListEndpointsResponse {
584 pub fn new() -> Self {
585 std::default::Default::default()
586 }
587
588 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
590 where
591 T: std::iter::IntoIterator<Item = V>,
592 V: std::convert::Into<crate::model::Endpoint>,
593 {
594 use std::iter::Iterator;
595 self.endpoints = v.into_iter().map(|i| i.into()).collect();
596 self
597 }
598
599 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
601 self.next_page_token = v.into();
602 self
603 }
604
605 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
607 where
608 T: std::iter::IntoIterator<Item = V>,
609 V: std::convert::Into<std::string::String>,
610 {
611 use std::iter::Iterator;
612 self.unreachable = v.into_iter().map(|i| i.into()).collect();
613 self
614 }
615}
616
617impl wkt::message::Message for ListEndpointsResponse {
618 fn typename() -> &'static str {
619 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsResponse"
620 }
621}
622
623#[doc(hidden)]
624impl gax::paginator::internal::PageableResponse for ListEndpointsResponse {
625 type PageItem = crate::model::Endpoint;
626
627 fn items(self) -> std::vec::Vec<Self::PageItem> {
628 self.endpoints
629 }
630
631 fn next_page_token(&self) -> std::string::String {
632 use std::clone::Clone;
633 self.next_page_token.clone()
634 }
635}
636
637#[serde_with::serde_as]
638#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
639#[serde(default, rename_all = "camelCase")]
640#[non_exhaustive]
641pub struct GetEndpointRequest {
642 #[serde(skip_serializing_if = "std::string::String::is_empty")]
645 pub name: std::string::String,
646
647 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
648 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
649}
650
651impl GetEndpointRequest {
652 pub fn new() -> Self {
653 std::default::Default::default()
654 }
655
656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
658 self.name = v.into();
659 self
660 }
661}
662
663impl wkt::message::Message for GetEndpointRequest {
664 fn typename() -> &'static str {
665 "type.googleapis.com/google.cloud.ids.v1.GetEndpointRequest"
666 }
667}
668
669#[serde_with::serde_as]
670#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
671#[serde(default, rename_all = "camelCase")]
672#[non_exhaustive]
673pub struct CreateEndpointRequest {
674 #[serde(skip_serializing_if = "std::string::String::is_empty")]
676 pub parent: std::string::String,
677
678 #[serde(skip_serializing_if = "std::string::String::is_empty")]
685 pub endpoint_id: std::string::String,
686
687 #[serde(skip_serializing_if = "std::option::Option::is_none")]
689 pub endpoint: std::option::Option<crate::model::Endpoint>,
690
691 #[serde(skip_serializing_if = "std::string::String::is_empty")]
705 pub request_id: std::string::String,
706
707 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
708 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
709}
710
711impl CreateEndpointRequest {
712 pub fn new() -> Self {
713 std::default::Default::default()
714 }
715
716 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
718 self.parent = v.into();
719 self
720 }
721
722 pub fn set_endpoint_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
724 self.endpoint_id = v.into();
725 self
726 }
727
728 pub fn set_endpoint<T: std::convert::Into<std::option::Option<crate::model::Endpoint>>>(
730 mut self,
731 v: T,
732 ) -> Self {
733 self.endpoint = v.into();
734 self
735 }
736
737 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
739 self.request_id = v.into();
740 self
741 }
742}
743
744impl wkt::message::Message for CreateEndpointRequest {
745 fn typename() -> &'static str {
746 "type.googleapis.com/google.cloud.ids.v1.CreateEndpointRequest"
747 }
748}
749
750#[serde_with::serde_as]
751#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
752#[serde(default, rename_all = "camelCase")]
753#[non_exhaustive]
754pub struct DeleteEndpointRequest {
755 #[serde(skip_serializing_if = "std::string::String::is_empty")]
757 pub name: std::string::String,
758
759 #[serde(skip_serializing_if = "std::string::String::is_empty")]
773 pub request_id: std::string::String,
774
775 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
776 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
777}
778
779impl DeleteEndpointRequest {
780 pub fn new() -> Self {
781 std::default::Default::default()
782 }
783
784 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
786 self.name = v.into();
787 self
788 }
789
790 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
792 self.request_id = v.into();
793 self
794 }
795}
796
797impl wkt::message::Message for DeleteEndpointRequest {
798 fn typename() -> &'static str {
799 "type.googleapis.com/google.cloud.ids.v1.DeleteEndpointRequest"
800 }
801}
802
803#[serde_with::serde_as]
805#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
806#[serde(default, rename_all = "camelCase")]
807#[non_exhaustive]
808pub struct OperationMetadata {
809 #[serde(skip_serializing_if = "std::option::Option::is_none")]
811 pub create_time: std::option::Option<wkt::Timestamp>,
812
813 #[serde(skip_serializing_if = "std::option::Option::is_none")]
815 pub end_time: std::option::Option<wkt::Timestamp>,
816
817 #[serde(skip_serializing_if = "std::string::String::is_empty")]
819 pub target: std::string::String,
820
821 #[serde(skip_serializing_if = "std::string::String::is_empty")]
823 pub verb: std::string::String,
824
825 #[serde(skip_serializing_if = "std::string::String::is_empty")]
827 pub status_message: std::string::String,
828
829 #[serde(skip_serializing_if = "wkt::internal::is_default")]
836 pub requested_cancellation: bool,
837
838 #[serde(skip_serializing_if = "std::string::String::is_empty")]
840 pub api_version: std::string::String,
841
842 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
843 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
844}
845
846impl OperationMetadata {
847 pub fn new() -> Self {
848 std::default::Default::default()
849 }
850
851 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
853 mut self,
854 v: T,
855 ) -> Self {
856 self.create_time = v.into();
857 self
858 }
859
860 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
862 mut self,
863 v: T,
864 ) -> Self {
865 self.end_time = v.into();
866 self
867 }
868
869 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
871 self.target = v.into();
872 self
873 }
874
875 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
877 self.verb = v.into();
878 self
879 }
880
881 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
883 self.status_message = v.into();
884 self
885 }
886
887 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
889 self.requested_cancellation = v.into();
890 self
891 }
892
893 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
895 self.api_version = v.into();
896 self
897 }
898}
899
900impl wkt::message::Message for OperationMetadata {
901 fn typename() -> &'static str {
902 "type.googleapis.com/google.cloud.ids.v1.OperationMetadata"
903 }
904}