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 pub traffic_logs: bool,
83
84 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
85 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
86}
87
88impl Endpoint {
89 pub fn new() -> Self {
90 std::default::Default::default()
91 }
92
93 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
95 self.name = v.into();
96 self
97 }
98
99 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
101 mut self,
102 v: T,
103 ) -> Self {
104 self.create_time = v.into();
105 self
106 }
107
108 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
110 mut self,
111 v: T,
112 ) -> Self {
113 self.update_time = v.into();
114 self
115 }
116
117 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
119 self.network = v.into();
120 self
121 }
122
123 pub fn set_endpoint_forwarding_rule<T: std::convert::Into<std::string::String>>(
125 mut self,
126 v: T,
127 ) -> Self {
128 self.endpoint_forwarding_rule = v.into();
129 self
130 }
131
132 pub fn set_endpoint_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
134 self.endpoint_ip = v.into();
135 self
136 }
137
138 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140 self.description = v.into();
141 self
142 }
143
144 pub fn set_severity<T: std::convert::Into<crate::model::endpoint::Severity>>(
146 mut self,
147 v: T,
148 ) -> Self {
149 self.severity = v.into();
150 self
151 }
152
153 pub fn set_state<T: std::convert::Into<crate::model::endpoint::State>>(mut self, v: T) -> Self {
155 self.state = v.into();
156 self
157 }
158
159 pub fn set_traffic_logs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
161 self.traffic_logs = v.into();
162 self
163 }
164
165 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
167 where
168 T: std::iter::IntoIterator<Item = (K, V)>,
169 K: std::convert::Into<std::string::String>,
170 V: std::convert::Into<std::string::String>,
171 {
172 use std::iter::Iterator;
173 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
174 self
175 }
176}
177
178impl wkt::message::Message for Endpoint {
179 fn typename() -> &'static str {
180 "type.googleapis.com/google.cloud.ids.v1.Endpoint"
181 }
182}
183
184pub mod endpoint {
186 #[allow(unused_imports)]
187 use super::*;
188
189 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
191 pub struct Severity(i32);
192
193 impl Severity {
194 pub const SEVERITY_UNSPECIFIED: Severity = Severity::new(0);
196
197 pub const INFORMATIONAL: Severity = Severity::new(1);
199
200 pub const LOW: Severity = Severity::new(2);
202
203 pub const MEDIUM: Severity = Severity::new(3);
205
206 pub const HIGH: Severity = Severity::new(4);
208
209 pub const CRITICAL: Severity = Severity::new(5);
211
212 pub(crate) const fn new(value: i32) -> Self {
214 Self(value)
215 }
216
217 pub fn value(&self) -> i32 {
219 self.0
220 }
221
222 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
224 match self.0 {
225 0 => std::borrow::Cow::Borrowed("SEVERITY_UNSPECIFIED"),
226 1 => std::borrow::Cow::Borrowed("INFORMATIONAL"),
227 2 => std::borrow::Cow::Borrowed("LOW"),
228 3 => std::borrow::Cow::Borrowed("MEDIUM"),
229 4 => std::borrow::Cow::Borrowed("HIGH"),
230 5 => std::borrow::Cow::Borrowed("CRITICAL"),
231 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
232 }
233 }
234
235 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
237 match name {
238 "SEVERITY_UNSPECIFIED" => std::option::Option::Some(Self::SEVERITY_UNSPECIFIED),
239 "INFORMATIONAL" => std::option::Option::Some(Self::INFORMATIONAL),
240 "LOW" => std::option::Option::Some(Self::LOW),
241 "MEDIUM" => std::option::Option::Some(Self::MEDIUM),
242 "HIGH" => std::option::Option::Some(Self::HIGH),
243 "CRITICAL" => std::option::Option::Some(Self::CRITICAL),
244 _ => std::option::Option::None,
245 }
246 }
247 }
248
249 impl std::convert::From<i32> for Severity {
250 fn from(value: i32) -> Self {
251 Self::new(value)
252 }
253 }
254
255 impl std::default::Default for Severity {
256 fn default() -> Self {
257 Self::new(0)
258 }
259 }
260
261 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
263 pub struct State(i32);
264
265 impl State {
266 pub const STATE_UNSPECIFIED: State = State::new(0);
268
269 pub const CREATING: State = State::new(1);
271
272 pub const READY: State = State::new(2);
274
275 pub const DELETING: State = State::new(3);
277
278 pub(crate) const fn new(value: i32) -> Self {
280 Self(value)
281 }
282
283 pub fn value(&self) -> i32 {
285 self.0
286 }
287
288 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
290 match self.0 {
291 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
292 1 => std::borrow::Cow::Borrowed("CREATING"),
293 2 => std::borrow::Cow::Borrowed("READY"),
294 3 => std::borrow::Cow::Borrowed("DELETING"),
295 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
296 }
297 }
298
299 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
301 match name {
302 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
303 "CREATING" => std::option::Option::Some(Self::CREATING),
304 "READY" => std::option::Option::Some(Self::READY),
305 "DELETING" => std::option::Option::Some(Self::DELETING),
306 _ => std::option::Option::None,
307 }
308 }
309 }
310
311 impl std::convert::From<i32> for State {
312 fn from(value: i32) -> Self {
313 Self::new(value)
314 }
315 }
316
317 impl std::default::Default for State {
318 fn default() -> Self {
319 Self::new(0)
320 }
321 }
322}
323
324#[serde_with::serde_as]
325#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
326#[serde(default, rename_all = "camelCase")]
327#[non_exhaustive]
328pub struct ListEndpointsRequest {
329 #[serde(skip_serializing_if = "std::string::String::is_empty")]
331 pub parent: std::string::String,
332
333 pub page_size: i32,
336
337 #[serde(skip_serializing_if = "std::string::String::is_empty")]
343 pub page_token: std::string::String,
344
345 #[serde(skip_serializing_if = "std::string::String::is_empty")]
348 pub filter: std::string::String,
349
350 #[serde(skip_serializing_if = "std::string::String::is_empty")]
353 pub order_by: std::string::String,
354
355 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
356 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
357}
358
359impl ListEndpointsRequest {
360 pub fn new() -> Self {
361 std::default::Default::default()
362 }
363
364 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
366 self.parent = v.into();
367 self
368 }
369
370 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
372 self.page_size = v.into();
373 self
374 }
375
376 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
378 self.page_token = v.into();
379 self
380 }
381
382 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
384 self.filter = v.into();
385 self
386 }
387
388 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
390 self.order_by = v.into();
391 self
392 }
393}
394
395impl wkt::message::Message for ListEndpointsRequest {
396 fn typename() -> &'static str {
397 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsRequest"
398 }
399}
400
401#[serde_with::serde_as]
402#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
403#[serde(default, rename_all = "camelCase")]
404#[non_exhaustive]
405pub struct ListEndpointsResponse {
406 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
408 pub endpoints: std::vec::Vec<crate::model::Endpoint>,
409
410 #[serde(skip_serializing_if = "std::string::String::is_empty")]
413 pub next_page_token: std::string::String,
414
415 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
417 pub unreachable: std::vec::Vec<std::string::String>,
418
419 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
420 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
421}
422
423impl ListEndpointsResponse {
424 pub fn new() -> Self {
425 std::default::Default::default()
426 }
427
428 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
430 self.next_page_token = v.into();
431 self
432 }
433
434 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
436 where
437 T: std::iter::IntoIterator<Item = V>,
438 V: std::convert::Into<crate::model::Endpoint>,
439 {
440 use std::iter::Iterator;
441 self.endpoints = v.into_iter().map(|i| i.into()).collect();
442 self
443 }
444
445 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
447 where
448 T: std::iter::IntoIterator<Item = V>,
449 V: std::convert::Into<std::string::String>,
450 {
451 use std::iter::Iterator;
452 self.unreachable = v.into_iter().map(|i| i.into()).collect();
453 self
454 }
455}
456
457impl wkt::message::Message for ListEndpointsResponse {
458 fn typename() -> &'static str {
459 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsResponse"
460 }
461}
462
463#[doc(hidden)]
464impl gax::paginator::internal::PageableResponse for ListEndpointsResponse {
465 type PageItem = crate::model::Endpoint;
466
467 fn items(self) -> std::vec::Vec<Self::PageItem> {
468 self.endpoints
469 }
470
471 fn next_page_token(&self) -> std::string::String {
472 use std::clone::Clone;
473 self.next_page_token.clone()
474 }
475}
476
477#[serde_with::serde_as]
478#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
479#[serde(default, rename_all = "camelCase")]
480#[non_exhaustive]
481pub struct GetEndpointRequest {
482 #[serde(skip_serializing_if = "std::string::String::is_empty")]
485 pub name: std::string::String,
486
487 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
488 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
489}
490
491impl GetEndpointRequest {
492 pub fn new() -> Self {
493 std::default::Default::default()
494 }
495
496 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
498 self.name = v.into();
499 self
500 }
501}
502
503impl wkt::message::Message for GetEndpointRequest {
504 fn typename() -> &'static str {
505 "type.googleapis.com/google.cloud.ids.v1.GetEndpointRequest"
506 }
507}
508
509#[serde_with::serde_as]
510#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
511#[serde(default, rename_all = "camelCase")]
512#[non_exhaustive]
513pub struct CreateEndpointRequest {
514 #[serde(skip_serializing_if = "std::string::String::is_empty")]
516 pub parent: std::string::String,
517
518 #[serde(skip_serializing_if = "std::string::String::is_empty")]
525 pub endpoint_id: std::string::String,
526
527 #[serde(skip_serializing_if = "std::option::Option::is_none")]
529 pub endpoint: std::option::Option<crate::model::Endpoint>,
530
531 #[serde(skip_serializing_if = "std::string::String::is_empty")]
545 pub request_id: std::string::String,
546
547 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
548 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
549}
550
551impl CreateEndpointRequest {
552 pub fn new() -> Self {
553 std::default::Default::default()
554 }
555
556 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
558 self.parent = v.into();
559 self
560 }
561
562 pub fn set_endpoint_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
564 self.endpoint_id = v.into();
565 self
566 }
567
568 pub fn set_endpoint<T: std::convert::Into<std::option::Option<crate::model::Endpoint>>>(
570 mut self,
571 v: T,
572 ) -> Self {
573 self.endpoint = v.into();
574 self
575 }
576
577 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
579 self.request_id = v.into();
580 self
581 }
582}
583
584impl wkt::message::Message for CreateEndpointRequest {
585 fn typename() -> &'static str {
586 "type.googleapis.com/google.cloud.ids.v1.CreateEndpointRequest"
587 }
588}
589
590#[serde_with::serde_as]
591#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
592#[serde(default, rename_all = "camelCase")]
593#[non_exhaustive]
594pub struct DeleteEndpointRequest {
595 #[serde(skip_serializing_if = "std::string::String::is_empty")]
597 pub name: std::string::String,
598
599 #[serde(skip_serializing_if = "std::string::String::is_empty")]
613 pub request_id: std::string::String,
614
615 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
616 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
617}
618
619impl DeleteEndpointRequest {
620 pub fn new() -> Self {
621 std::default::Default::default()
622 }
623
624 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
626 self.name = v.into();
627 self
628 }
629
630 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
632 self.request_id = v.into();
633 self
634 }
635}
636
637impl wkt::message::Message for DeleteEndpointRequest {
638 fn typename() -> &'static str {
639 "type.googleapis.com/google.cloud.ids.v1.DeleteEndpointRequest"
640 }
641}
642
643#[serde_with::serde_as]
645#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
646#[serde(default, rename_all = "camelCase")]
647#[non_exhaustive]
648pub struct OperationMetadata {
649 #[serde(skip_serializing_if = "std::option::Option::is_none")]
651 pub create_time: std::option::Option<wkt::Timestamp>,
652
653 #[serde(skip_serializing_if = "std::option::Option::is_none")]
655 pub end_time: std::option::Option<wkt::Timestamp>,
656
657 #[serde(skip_serializing_if = "std::string::String::is_empty")]
659 pub target: std::string::String,
660
661 #[serde(skip_serializing_if = "std::string::String::is_empty")]
663 pub verb: std::string::String,
664
665 #[serde(skip_serializing_if = "std::string::String::is_empty")]
667 pub status_message: std::string::String,
668
669 pub requested_cancellation: bool,
676
677 #[serde(skip_serializing_if = "std::string::String::is_empty")]
679 pub api_version: std::string::String,
680
681 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
682 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
683}
684
685impl OperationMetadata {
686 pub fn new() -> Self {
687 std::default::Default::default()
688 }
689
690 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
692 mut self,
693 v: T,
694 ) -> Self {
695 self.create_time = v.into();
696 self
697 }
698
699 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
701 mut self,
702 v: T,
703 ) -> Self {
704 self.end_time = v.into();
705 self
706 }
707
708 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
710 self.target = v.into();
711 self
712 }
713
714 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
716 self.verb = v.into();
717 self
718 }
719
720 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
722 self.status_message = v.into();
723 self
724 }
725
726 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
728 self.requested_cancellation = v.into();
729 self
730 }
731
732 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
734 self.api_version = v.into();
735 self
736 }
737}
738
739impl wkt::message::Message for OperationMetadata {
740 fn typename() -> &'static str {
741 "type.googleapis.com/google.cloud.ids.v1.OperationMetadata"
742 }
743}