google_cloud_ids_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate lazy_static;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Endpoint describes a single IDS endpoint. It defines a forwarding rule to
39/// which packets can be sent for IDS inspection.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Endpoint {
43 /// Output only. The name of the endpoint.
44 pub name: std::string::String,
45
46 /// Output only. The create time timestamp.
47 pub create_time: std::option::Option<wkt::Timestamp>,
48
49 /// Output only. The update time timestamp.
50 pub update_time: std::option::Option<wkt::Timestamp>,
51
52 /// The labels of the endpoint.
53 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
54
55 /// Required. The fully qualified URL of the network to which the IDS Endpoint is
56 /// attached.
57 pub network: std::string::String,
58
59 /// Output only. The fully qualified URL of the endpoint's ILB Forwarding Rule.
60 pub endpoint_forwarding_rule: std::string::String,
61
62 /// Output only. The IP address of the IDS Endpoint's ILB.
63 pub endpoint_ip: std::string::String,
64
65 /// User-provided description of the endpoint
66 pub description: std::string::String,
67
68 /// Required. Lowest threat severity that this endpoint will alert on.
69 pub severity: crate::model::endpoint::Severity,
70
71 /// Output only. Current state of the endpoint.
72 pub state: crate::model::endpoint::State,
73
74 /// Whether the endpoint should report traffic logs in addition to threat logs.
75 pub traffic_logs: bool,
76
77 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
78}
79
80impl Endpoint {
81 pub fn new() -> Self {
82 std::default::Default::default()
83 }
84
85 /// Sets the value of [name][crate::model::Endpoint::name].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_ids_v1::model::Endpoint;
90 /// let x = Endpoint::new().set_name("example");
91 /// ```
92 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93 self.name = v.into();
94 self
95 }
96
97 /// Sets the value of [create_time][crate::model::Endpoint::create_time].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_ids_v1::model::Endpoint;
102 /// use wkt::Timestamp;
103 /// let x = Endpoint::new().set_create_time(Timestamp::default()/* use setters */);
104 /// ```
105 pub fn set_create_time<T>(mut self, v: T) -> Self
106 where
107 T: std::convert::Into<wkt::Timestamp>,
108 {
109 self.create_time = std::option::Option::Some(v.into());
110 self
111 }
112
113 /// Sets or clears the value of [create_time][crate::model::Endpoint::create_time].
114 ///
115 /// # Example
116 /// ```ignore,no_run
117 /// # use google_cloud_ids_v1::model::Endpoint;
118 /// use wkt::Timestamp;
119 /// let x = Endpoint::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
120 /// let x = Endpoint::new().set_or_clear_create_time(None::<Timestamp>);
121 /// ```
122 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
123 where
124 T: std::convert::Into<wkt::Timestamp>,
125 {
126 self.create_time = v.map(|x| x.into());
127 self
128 }
129
130 /// Sets the value of [update_time][crate::model::Endpoint::update_time].
131 ///
132 /// # Example
133 /// ```ignore,no_run
134 /// # use google_cloud_ids_v1::model::Endpoint;
135 /// use wkt::Timestamp;
136 /// let x = Endpoint::new().set_update_time(Timestamp::default()/* use setters */);
137 /// ```
138 pub fn set_update_time<T>(mut self, v: T) -> Self
139 where
140 T: std::convert::Into<wkt::Timestamp>,
141 {
142 self.update_time = std::option::Option::Some(v.into());
143 self
144 }
145
146 /// Sets or clears the value of [update_time][crate::model::Endpoint::update_time].
147 ///
148 /// # Example
149 /// ```ignore,no_run
150 /// # use google_cloud_ids_v1::model::Endpoint;
151 /// use wkt::Timestamp;
152 /// let x = Endpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
153 /// let x = Endpoint::new().set_or_clear_update_time(None::<Timestamp>);
154 /// ```
155 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
156 where
157 T: std::convert::Into<wkt::Timestamp>,
158 {
159 self.update_time = v.map(|x| x.into());
160 self
161 }
162
163 /// Sets the value of [labels][crate::model::Endpoint::labels].
164 ///
165 /// # Example
166 /// ```ignore,no_run
167 /// # use google_cloud_ids_v1::model::Endpoint;
168 /// let x = Endpoint::new().set_labels([
169 /// ("key0", "abc"),
170 /// ("key1", "xyz"),
171 /// ]);
172 /// ```
173 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
174 where
175 T: std::iter::IntoIterator<Item = (K, V)>,
176 K: std::convert::Into<std::string::String>,
177 V: std::convert::Into<std::string::String>,
178 {
179 use std::iter::Iterator;
180 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
181 self
182 }
183
184 /// Sets the value of [network][crate::model::Endpoint::network].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_ids_v1::model::Endpoint;
189 /// let x = Endpoint::new().set_network("example");
190 /// ```
191 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
192 self.network = v.into();
193 self
194 }
195
196 /// Sets the value of [endpoint_forwarding_rule][crate::model::Endpoint::endpoint_forwarding_rule].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_ids_v1::model::Endpoint;
201 /// let x = Endpoint::new().set_endpoint_forwarding_rule("example");
202 /// ```
203 pub fn set_endpoint_forwarding_rule<T: std::convert::Into<std::string::String>>(
204 mut self,
205 v: T,
206 ) -> Self {
207 self.endpoint_forwarding_rule = v.into();
208 self
209 }
210
211 /// Sets the value of [endpoint_ip][crate::model::Endpoint::endpoint_ip].
212 ///
213 /// # Example
214 /// ```ignore,no_run
215 /// # use google_cloud_ids_v1::model::Endpoint;
216 /// let x = Endpoint::new().set_endpoint_ip("example");
217 /// ```
218 pub fn set_endpoint_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
219 self.endpoint_ip = v.into();
220 self
221 }
222
223 /// Sets the value of [description][crate::model::Endpoint::description].
224 ///
225 /// # Example
226 /// ```ignore,no_run
227 /// # use google_cloud_ids_v1::model::Endpoint;
228 /// let x = Endpoint::new().set_description("example");
229 /// ```
230 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
231 self.description = v.into();
232 self
233 }
234
235 /// Sets the value of [severity][crate::model::Endpoint::severity].
236 ///
237 /// # Example
238 /// ```ignore,no_run
239 /// # use google_cloud_ids_v1::model::Endpoint;
240 /// use google_cloud_ids_v1::model::endpoint::Severity;
241 /// let x0 = Endpoint::new().set_severity(Severity::Informational);
242 /// let x1 = Endpoint::new().set_severity(Severity::Low);
243 /// let x2 = Endpoint::new().set_severity(Severity::Medium);
244 /// ```
245 pub fn set_severity<T: std::convert::Into<crate::model::endpoint::Severity>>(
246 mut self,
247 v: T,
248 ) -> Self {
249 self.severity = v.into();
250 self
251 }
252
253 /// Sets the value of [state][crate::model::Endpoint::state].
254 ///
255 /// # Example
256 /// ```ignore,no_run
257 /// # use google_cloud_ids_v1::model::Endpoint;
258 /// use google_cloud_ids_v1::model::endpoint::State;
259 /// let x0 = Endpoint::new().set_state(State::Creating);
260 /// let x1 = Endpoint::new().set_state(State::Ready);
261 /// let x2 = Endpoint::new().set_state(State::Deleting);
262 /// ```
263 pub fn set_state<T: std::convert::Into<crate::model::endpoint::State>>(mut self, v: T) -> Self {
264 self.state = v.into();
265 self
266 }
267
268 /// Sets the value of [traffic_logs][crate::model::Endpoint::traffic_logs].
269 ///
270 /// # Example
271 /// ```ignore,no_run
272 /// # use google_cloud_ids_v1::model::Endpoint;
273 /// let x = Endpoint::new().set_traffic_logs(true);
274 /// ```
275 pub fn set_traffic_logs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
276 self.traffic_logs = v.into();
277 self
278 }
279}
280
281impl wkt::message::Message for Endpoint {
282 fn typename() -> &'static str {
283 "type.googleapis.com/google.cloud.ids.v1.Endpoint"
284 }
285}
286
287/// Defines additional types related to [Endpoint].
288pub mod endpoint {
289 #[allow(unused_imports)]
290 use super::*;
291
292 /// Threat severity levels.
293 ///
294 /// # Working with unknown values
295 ///
296 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
297 /// additional enum variants at any time. Adding new variants is not considered
298 /// a breaking change. Applications should write their code in anticipation of:
299 ///
300 /// - New values appearing in future releases of the client library, **and**
301 /// - New values received dynamically, without application changes.
302 ///
303 /// Please consult the [Working with enums] section in the user guide for some
304 /// guidelines.
305 ///
306 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
307 #[derive(Clone, Debug, PartialEq)]
308 #[non_exhaustive]
309 pub enum Severity {
310 /// Not set.
311 Unspecified,
312 /// Informational alerts.
313 Informational,
314 /// Low severity alerts.
315 Low,
316 /// Medium severity alerts.
317 Medium,
318 /// High severity alerts.
319 High,
320 /// Critical severity alerts.
321 Critical,
322 /// If set, the enum was initialized with an unknown value.
323 ///
324 /// Applications can examine the value using [Severity::value] or
325 /// [Severity::name].
326 UnknownValue(severity::UnknownValue),
327 }
328
329 #[doc(hidden)]
330 pub mod severity {
331 #[allow(unused_imports)]
332 use super::*;
333 #[derive(Clone, Debug, PartialEq)]
334 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
335 }
336
337 impl Severity {
338 /// Gets the enum value.
339 ///
340 /// Returns `None` if the enum contains an unknown value deserialized from
341 /// the string representation of enums.
342 pub fn value(&self) -> std::option::Option<i32> {
343 match self {
344 Self::Unspecified => std::option::Option::Some(0),
345 Self::Informational => std::option::Option::Some(1),
346 Self::Low => std::option::Option::Some(2),
347 Self::Medium => std::option::Option::Some(3),
348 Self::High => std::option::Option::Some(4),
349 Self::Critical => std::option::Option::Some(5),
350 Self::UnknownValue(u) => u.0.value(),
351 }
352 }
353
354 /// Gets the enum value as a string.
355 ///
356 /// Returns `None` if the enum contains an unknown value deserialized from
357 /// the integer representation of enums.
358 pub fn name(&self) -> std::option::Option<&str> {
359 match self {
360 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
361 Self::Informational => std::option::Option::Some("INFORMATIONAL"),
362 Self::Low => std::option::Option::Some("LOW"),
363 Self::Medium => std::option::Option::Some("MEDIUM"),
364 Self::High => std::option::Option::Some("HIGH"),
365 Self::Critical => std::option::Option::Some("CRITICAL"),
366 Self::UnknownValue(u) => u.0.name(),
367 }
368 }
369 }
370
371 impl std::default::Default for Severity {
372 fn default() -> Self {
373 use std::convert::From;
374 Self::from(0)
375 }
376 }
377
378 impl std::fmt::Display for Severity {
379 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
380 wkt::internal::display_enum(f, self.name(), self.value())
381 }
382 }
383
384 impl std::convert::From<i32> for Severity {
385 fn from(value: i32) -> Self {
386 match value {
387 0 => Self::Unspecified,
388 1 => Self::Informational,
389 2 => Self::Low,
390 3 => Self::Medium,
391 4 => Self::High,
392 5 => Self::Critical,
393 _ => Self::UnknownValue(severity::UnknownValue(
394 wkt::internal::UnknownEnumValue::Integer(value),
395 )),
396 }
397 }
398 }
399
400 impl std::convert::From<&str> for Severity {
401 fn from(value: &str) -> Self {
402 use std::string::ToString;
403 match value {
404 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
405 "INFORMATIONAL" => Self::Informational,
406 "LOW" => Self::Low,
407 "MEDIUM" => Self::Medium,
408 "HIGH" => Self::High,
409 "CRITICAL" => Self::Critical,
410 _ => Self::UnknownValue(severity::UnknownValue(
411 wkt::internal::UnknownEnumValue::String(value.to_string()),
412 )),
413 }
414 }
415 }
416
417 impl serde::ser::Serialize for Severity {
418 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
419 where
420 S: serde::Serializer,
421 {
422 match self {
423 Self::Unspecified => serializer.serialize_i32(0),
424 Self::Informational => serializer.serialize_i32(1),
425 Self::Low => serializer.serialize_i32(2),
426 Self::Medium => serializer.serialize_i32(3),
427 Self::High => serializer.serialize_i32(4),
428 Self::Critical => serializer.serialize_i32(5),
429 Self::UnknownValue(u) => u.0.serialize(serializer),
430 }
431 }
432 }
433
434 impl<'de> serde::de::Deserialize<'de> for Severity {
435 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
436 where
437 D: serde::Deserializer<'de>,
438 {
439 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
440 ".google.cloud.ids.v1.Endpoint.Severity",
441 ))
442 }
443 }
444
445 /// Endpoint state
446 ///
447 /// # Working with unknown values
448 ///
449 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
450 /// additional enum variants at any time. Adding new variants is not considered
451 /// a breaking change. Applications should write their code in anticipation of:
452 ///
453 /// - New values appearing in future releases of the client library, **and**
454 /// - New values received dynamically, without application changes.
455 ///
456 /// Please consult the [Working with enums] section in the user guide for some
457 /// guidelines.
458 ///
459 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
460 #[derive(Clone, Debug, PartialEq)]
461 #[non_exhaustive]
462 pub enum State {
463 /// Not set.
464 Unspecified,
465 /// Being created.
466 Creating,
467 /// Active and ready for traffic.
468 Ready,
469 /// Being deleted.
470 Deleting,
471 /// If set, the enum was initialized with an unknown value.
472 ///
473 /// Applications can examine the value using [State::value] or
474 /// [State::name].
475 UnknownValue(state::UnknownValue),
476 }
477
478 #[doc(hidden)]
479 pub mod state {
480 #[allow(unused_imports)]
481 use super::*;
482 #[derive(Clone, Debug, PartialEq)]
483 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
484 }
485
486 impl State {
487 /// Gets the enum value.
488 ///
489 /// Returns `None` if the enum contains an unknown value deserialized from
490 /// the string representation of enums.
491 pub fn value(&self) -> std::option::Option<i32> {
492 match self {
493 Self::Unspecified => std::option::Option::Some(0),
494 Self::Creating => std::option::Option::Some(1),
495 Self::Ready => std::option::Option::Some(2),
496 Self::Deleting => std::option::Option::Some(3),
497 Self::UnknownValue(u) => u.0.value(),
498 }
499 }
500
501 /// Gets the enum value as a string.
502 ///
503 /// Returns `None` if the enum contains an unknown value deserialized from
504 /// the integer representation of enums.
505 pub fn name(&self) -> std::option::Option<&str> {
506 match self {
507 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
508 Self::Creating => std::option::Option::Some("CREATING"),
509 Self::Ready => std::option::Option::Some("READY"),
510 Self::Deleting => std::option::Option::Some("DELETING"),
511 Self::UnknownValue(u) => u.0.name(),
512 }
513 }
514 }
515
516 impl std::default::Default for State {
517 fn default() -> Self {
518 use std::convert::From;
519 Self::from(0)
520 }
521 }
522
523 impl std::fmt::Display for State {
524 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
525 wkt::internal::display_enum(f, self.name(), self.value())
526 }
527 }
528
529 impl std::convert::From<i32> for State {
530 fn from(value: i32) -> Self {
531 match value {
532 0 => Self::Unspecified,
533 1 => Self::Creating,
534 2 => Self::Ready,
535 3 => Self::Deleting,
536 _ => Self::UnknownValue(state::UnknownValue(
537 wkt::internal::UnknownEnumValue::Integer(value),
538 )),
539 }
540 }
541 }
542
543 impl std::convert::From<&str> for State {
544 fn from(value: &str) -> Self {
545 use std::string::ToString;
546 match value {
547 "STATE_UNSPECIFIED" => Self::Unspecified,
548 "CREATING" => Self::Creating,
549 "READY" => Self::Ready,
550 "DELETING" => Self::Deleting,
551 _ => Self::UnknownValue(state::UnknownValue(
552 wkt::internal::UnknownEnumValue::String(value.to_string()),
553 )),
554 }
555 }
556 }
557
558 impl serde::ser::Serialize for State {
559 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
560 where
561 S: serde::Serializer,
562 {
563 match self {
564 Self::Unspecified => serializer.serialize_i32(0),
565 Self::Creating => serializer.serialize_i32(1),
566 Self::Ready => serializer.serialize_i32(2),
567 Self::Deleting => serializer.serialize_i32(3),
568 Self::UnknownValue(u) => u.0.serialize(serializer),
569 }
570 }
571 }
572
573 impl<'de> serde::de::Deserialize<'de> for State {
574 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
575 where
576 D: serde::Deserializer<'de>,
577 {
578 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
579 ".google.cloud.ids.v1.Endpoint.State",
580 ))
581 }
582 }
583}
584
585#[derive(Clone, Default, PartialEq)]
586#[non_exhaustive]
587pub struct ListEndpointsRequest {
588 /// Required. The parent, which owns this collection of endpoints.
589 pub parent: std::string::String,
590
591 /// Optional. The maximum number of endpoints to return. The service may return fewer
592 /// than this value.
593 pub page_size: i32,
594
595 /// Optional. A page token, received from a previous `ListEndpoints` call.
596 /// Provide this to retrieve the subsequent page.
597 ///
598 /// When paginating, all other parameters provided to `ListEndpoints` must
599 /// match the call that provided the page token.
600 pub page_token: std::string::String,
601
602 /// Optional. The filter expression, following the syntax outlined in
603 /// <https://google.aip.dev/160>.
604 pub filter: std::string::String,
605
606 /// Optional. One or more fields to compare and use to sort the output.
607 /// See <https://google.aip.dev/132#ordering>.
608 pub order_by: std::string::String,
609
610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
611}
612
613impl ListEndpointsRequest {
614 pub fn new() -> Self {
615 std::default::Default::default()
616 }
617
618 /// Sets the value of [parent][crate::model::ListEndpointsRequest::parent].
619 ///
620 /// # Example
621 /// ```ignore,no_run
622 /// # use google_cloud_ids_v1::model::ListEndpointsRequest;
623 /// let x = ListEndpointsRequest::new().set_parent("example");
624 /// ```
625 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
626 self.parent = v.into();
627 self
628 }
629
630 /// Sets the value of [page_size][crate::model::ListEndpointsRequest::page_size].
631 ///
632 /// # Example
633 /// ```ignore,no_run
634 /// # use google_cloud_ids_v1::model::ListEndpointsRequest;
635 /// let x = ListEndpointsRequest::new().set_page_size(42);
636 /// ```
637 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
638 self.page_size = v.into();
639 self
640 }
641
642 /// Sets the value of [page_token][crate::model::ListEndpointsRequest::page_token].
643 ///
644 /// # Example
645 /// ```ignore,no_run
646 /// # use google_cloud_ids_v1::model::ListEndpointsRequest;
647 /// let x = ListEndpointsRequest::new().set_page_token("example");
648 /// ```
649 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650 self.page_token = v.into();
651 self
652 }
653
654 /// Sets the value of [filter][crate::model::ListEndpointsRequest::filter].
655 ///
656 /// # Example
657 /// ```ignore,no_run
658 /// # use google_cloud_ids_v1::model::ListEndpointsRequest;
659 /// let x = ListEndpointsRequest::new().set_filter("example");
660 /// ```
661 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
662 self.filter = v.into();
663 self
664 }
665
666 /// Sets the value of [order_by][crate::model::ListEndpointsRequest::order_by].
667 ///
668 /// # Example
669 /// ```ignore,no_run
670 /// # use google_cloud_ids_v1::model::ListEndpointsRequest;
671 /// let x = ListEndpointsRequest::new().set_order_by("example");
672 /// ```
673 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674 self.order_by = v.into();
675 self
676 }
677}
678
679impl wkt::message::Message for ListEndpointsRequest {
680 fn typename() -> &'static str {
681 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsRequest"
682 }
683}
684
685#[derive(Clone, Default, PartialEq)]
686#[non_exhaustive]
687pub struct ListEndpointsResponse {
688 /// The list of endpoints response.
689 pub endpoints: std::vec::Vec<crate::model::Endpoint>,
690
691 /// A token, which can be sent as `page_token` to retrieve the next page.
692 /// If this field is omitted, there are no subsequent pages.
693 pub next_page_token: std::string::String,
694
695 /// Locations that could not be reached.
696 pub unreachable: std::vec::Vec<std::string::String>,
697
698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
699}
700
701impl ListEndpointsResponse {
702 pub fn new() -> Self {
703 std::default::Default::default()
704 }
705
706 /// Sets the value of [endpoints][crate::model::ListEndpointsResponse::endpoints].
707 ///
708 /// # Example
709 /// ```ignore,no_run
710 /// # use google_cloud_ids_v1::model::ListEndpointsResponse;
711 /// use google_cloud_ids_v1::model::Endpoint;
712 /// let x = ListEndpointsResponse::new()
713 /// .set_endpoints([
714 /// Endpoint::default()/* use setters */,
715 /// Endpoint::default()/* use (different) setters */,
716 /// ]);
717 /// ```
718 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
719 where
720 T: std::iter::IntoIterator<Item = V>,
721 V: std::convert::Into<crate::model::Endpoint>,
722 {
723 use std::iter::Iterator;
724 self.endpoints = v.into_iter().map(|i| i.into()).collect();
725 self
726 }
727
728 /// Sets the value of [next_page_token][crate::model::ListEndpointsResponse::next_page_token].
729 ///
730 /// # Example
731 /// ```ignore,no_run
732 /// # use google_cloud_ids_v1::model::ListEndpointsResponse;
733 /// let x = ListEndpointsResponse::new().set_next_page_token("example");
734 /// ```
735 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
736 self.next_page_token = v.into();
737 self
738 }
739
740 /// Sets the value of [unreachable][crate::model::ListEndpointsResponse::unreachable].
741 ///
742 /// # Example
743 /// ```ignore,no_run
744 /// # use google_cloud_ids_v1::model::ListEndpointsResponse;
745 /// let x = ListEndpointsResponse::new().set_unreachable(["a", "b", "c"]);
746 /// ```
747 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
748 where
749 T: std::iter::IntoIterator<Item = V>,
750 V: std::convert::Into<std::string::String>,
751 {
752 use std::iter::Iterator;
753 self.unreachable = v.into_iter().map(|i| i.into()).collect();
754 self
755 }
756}
757
758impl wkt::message::Message for ListEndpointsResponse {
759 fn typename() -> &'static str {
760 "type.googleapis.com/google.cloud.ids.v1.ListEndpointsResponse"
761 }
762}
763
764#[doc(hidden)]
765impl google_cloud_gax::paginator::internal::PageableResponse for ListEndpointsResponse {
766 type PageItem = crate::model::Endpoint;
767
768 fn items(self) -> std::vec::Vec<Self::PageItem> {
769 self.endpoints
770 }
771
772 fn next_page_token(&self) -> std::string::String {
773 use std::clone::Clone;
774 self.next_page_token.clone()
775 }
776}
777
778#[derive(Clone, Default, PartialEq)]
779#[non_exhaustive]
780pub struct GetEndpointRequest {
781 /// Required. The name of the endpoint to retrieve.
782 /// Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
783 pub name: std::string::String,
784
785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
786}
787
788impl GetEndpointRequest {
789 pub fn new() -> Self {
790 std::default::Default::default()
791 }
792
793 /// Sets the value of [name][crate::model::GetEndpointRequest::name].
794 ///
795 /// # Example
796 /// ```ignore,no_run
797 /// # use google_cloud_ids_v1::model::GetEndpointRequest;
798 /// let x = GetEndpointRequest::new().set_name("example");
799 /// ```
800 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
801 self.name = v.into();
802 self
803 }
804}
805
806impl wkt::message::Message for GetEndpointRequest {
807 fn typename() -> &'static str {
808 "type.googleapis.com/google.cloud.ids.v1.GetEndpointRequest"
809 }
810}
811
812#[derive(Clone, Default, PartialEq)]
813#[non_exhaustive]
814pub struct CreateEndpointRequest {
815 /// Required. The endpoint's parent.
816 pub parent: std::string::String,
817
818 /// Required. The endpoint identifier. This will be part of the endpoint's
819 /// resource name.
820 /// This value must start with a lowercase letter followed by up to 62
821 /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
822 /// Values that do not match this pattern will trigger an INVALID_ARGUMENT
823 /// error.
824 pub endpoint_id: std::string::String,
825
826 /// Required. The endpoint to create.
827 pub endpoint: std::option::Option<crate::model::Endpoint>,
828
829 /// An optional request ID to identify requests. Specify a unique request ID
830 /// so that if you must retry your request, the server will know to ignore
831 /// the request if it has already been completed. The server will guarantee
832 /// that for at least 60 minutes since the first request.
833 ///
834 /// For example, consider a situation where you make an initial request and t
835 /// he request times out. If you make the request again with the same request
836 /// ID, the server can check if original operation with the same request ID
837 /// was received, and if so, will ignore the second request. This prevents
838 /// clients from accidentally creating duplicate commitments.
839 ///
840 /// The request ID must be a valid UUID with the exception that zero UUID is
841 /// not supported (00000000-0000-0000-0000-000000000000).
842 pub request_id: std::string::String,
843
844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
845}
846
847impl CreateEndpointRequest {
848 pub fn new() -> Self {
849 std::default::Default::default()
850 }
851
852 /// Sets the value of [parent][crate::model::CreateEndpointRequest::parent].
853 ///
854 /// # Example
855 /// ```ignore,no_run
856 /// # use google_cloud_ids_v1::model::CreateEndpointRequest;
857 /// let x = CreateEndpointRequest::new().set_parent("example");
858 /// ```
859 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
860 self.parent = v.into();
861 self
862 }
863
864 /// Sets the value of [endpoint_id][crate::model::CreateEndpointRequest::endpoint_id].
865 ///
866 /// # Example
867 /// ```ignore,no_run
868 /// # use google_cloud_ids_v1::model::CreateEndpointRequest;
869 /// let x = CreateEndpointRequest::new().set_endpoint_id("example");
870 /// ```
871 pub fn set_endpoint_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
872 self.endpoint_id = v.into();
873 self
874 }
875
876 /// Sets the value of [endpoint][crate::model::CreateEndpointRequest::endpoint].
877 ///
878 /// # Example
879 /// ```ignore,no_run
880 /// # use google_cloud_ids_v1::model::CreateEndpointRequest;
881 /// use google_cloud_ids_v1::model::Endpoint;
882 /// let x = CreateEndpointRequest::new().set_endpoint(Endpoint::default()/* use setters */);
883 /// ```
884 pub fn set_endpoint<T>(mut self, v: T) -> Self
885 where
886 T: std::convert::Into<crate::model::Endpoint>,
887 {
888 self.endpoint = std::option::Option::Some(v.into());
889 self
890 }
891
892 /// Sets or clears the value of [endpoint][crate::model::CreateEndpointRequest::endpoint].
893 ///
894 /// # Example
895 /// ```ignore,no_run
896 /// # use google_cloud_ids_v1::model::CreateEndpointRequest;
897 /// use google_cloud_ids_v1::model::Endpoint;
898 /// let x = CreateEndpointRequest::new().set_or_clear_endpoint(Some(Endpoint::default()/* use setters */));
899 /// let x = CreateEndpointRequest::new().set_or_clear_endpoint(None::<Endpoint>);
900 /// ```
901 pub fn set_or_clear_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
902 where
903 T: std::convert::Into<crate::model::Endpoint>,
904 {
905 self.endpoint = v.map(|x| x.into());
906 self
907 }
908
909 /// Sets the value of [request_id][crate::model::CreateEndpointRequest::request_id].
910 ///
911 /// # Example
912 /// ```ignore,no_run
913 /// # use google_cloud_ids_v1::model::CreateEndpointRequest;
914 /// let x = CreateEndpointRequest::new().set_request_id("example");
915 /// ```
916 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
917 self.request_id = v.into();
918 self
919 }
920}
921
922impl wkt::message::Message for CreateEndpointRequest {
923 fn typename() -> &'static str {
924 "type.googleapis.com/google.cloud.ids.v1.CreateEndpointRequest"
925 }
926}
927
928#[derive(Clone, Default, PartialEq)]
929#[non_exhaustive]
930pub struct DeleteEndpointRequest {
931 /// Required. The name of the endpoint to delete.
932 pub name: std::string::String,
933
934 /// An optional request ID to identify requests. Specify a unique request ID
935 /// so that if you must retry your request, the server will know to ignore
936 /// the request if it has already been completed. The server will guarantee
937 /// that for at least 60 minutes after the first request.
938 ///
939 /// For example, consider a situation where you make an initial request and t
940 /// he request times out. If you make the request again with the same request
941 /// ID, the server can check if original operation with the same request ID
942 /// was received, and if so, will ignore the second request. This prevents
943 /// clients from accidentally creating duplicate commitments.
944 ///
945 /// The request ID must be a valid UUID with the exception that zero UUID is
946 /// not supported (00000000-0000-0000-0000-000000000000).
947 pub request_id: std::string::String,
948
949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
950}
951
952impl DeleteEndpointRequest {
953 pub fn new() -> Self {
954 std::default::Default::default()
955 }
956
957 /// Sets the value of [name][crate::model::DeleteEndpointRequest::name].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_ids_v1::model::DeleteEndpointRequest;
962 /// let x = DeleteEndpointRequest::new().set_name("example");
963 /// ```
964 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
965 self.name = v.into();
966 self
967 }
968
969 /// Sets the value of [request_id][crate::model::DeleteEndpointRequest::request_id].
970 ///
971 /// # Example
972 /// ```ignore,no_run
973 /// # use google_cloud_ids_v1::model::DeleteEndpointRequest;
974 /// let x = DeleteEndpointRequest::new().set_request_id("example");
975 /// ```
976 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
977 self.request_id = v.into();
978 self
979 }
980}
981
982impl wkt::message::Message for DeleteEndpointRequest {
983 fn typename() -> &'static str {
984 "type.googleapis.com/google.cloud.ids.v1.DeleteEndpointRequest"
985 }
986}
987
988/// Represents the metadata of the long-running operation.
989#[derive(Clone, Default, PartialEq)]
990#[non_exhaustive]
991pub struct OperationMetadata {
992 /// Output only. The time the operation was created.
993 pub create_time: std::option::Option<wkt::Timestamp>,
994
995 /// Output only. The time the operation finished running.
996 pub end_time: std::option::Option<wkt::Timestamp>,
997
998 /// Output only. Server-defined resource path for the target of the operation.
999 pub target: std::string::String,
1000
1001 /// Output only. Name of the verb executed by the operation.
1002 pub verb: std::string::String,
1003
1004 /// Output only. Human-readable status of the operation, if any.
1005 pub status_message: std::string::String,
1006
1007 /// Output only. Identifies whether the user has requested cancellation
1008 /// of the operation. Operations that have successfully been cancelled
1009 /// have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1010 /// corresponding to `Code.CANCELLED`.
1011 ///
1012 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
1013 pub requested_cancellation: bool,
1014
1015 /// Output only. API version used to start the operation.
1016 pub api_version: std::string::String,
1017
1018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1019}
1020
1021impl OperationMetadata {
1022 pub fn new() -> Self {
1023 std::default::Default::default()
1024 }
1025
1026 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1027 ///
1028 /// # Example
1029 /// ```ignore,no_run
1030 /// # use google_cloud_ids_v1::model::OperationMetadata;
1031 /// use wkt::Timestamp;
1032 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1033 /// ```
1034 pub fn set_create_time<T>(mut self, v: T) -> Self
1035 where
1036 T: std::convert::Into<wkt::Timestamp>,
1037 {
1038 self.create_time = std::option::Option::Some(v.into());
1039 self
1040 }
1041
1042 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1043 ///
1044 /// # Example
1045 /// ```ignore,no_run
1046 /// # use google_cloud_ids_v1::model::OperationMetadata;
1047 /// use wkt::Timestamp;
1048 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1049 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1050 /// ```
1051 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1052 where
1053 T: std::convert::Into<wkt::Timestamp>,
1054 {
1055 self.create_time = v.map(|x| x.into());
1056 self
1057 }
1058
1059 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1060 ///
1061 /// # Example
1062 /// ```ignore,no_run
1063 /// # use google_cloud_ids_v1::model::OperationMetadata;
1064 /// use wkt::Timestamp;
1065 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1066 /// ```
1067 pub fn set_end_time<T>(mut self, v: T) -> Self
1068 where
1069 T: std::convert::Into<wkt::Timestamp>,
1070 {
1071 self.end_time = std::option::Option::Some(v.into());
1072 self
1073 }
1074
1075 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1076 ///
1077 /// # Example
1078 /// ```ignore,no_run
1079 /// # use google_cloud_ids_v1::model::OperationMetadata;
1080 /// use wkt::Timestamp;
1081 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1082 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1083 /// ```
1084 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1085 where
1086 T: std::convert::Into<wkt::Timestamp>,
1087 {
1088 self.end_time = v.map(|x| x.into());
1089 self
1090 }
1091
1092 /// Sets the value of [target][crate::model::OperationMetadata::target].
1093 ///
1094 /// # Example
1095 /// ```ignore,no_run
1096 /// # use google_cloud_ids_v1::model::OperationMetadata;
1097 /// let x = OperationMetadata::new().set_target("example");
1098 /// ```
1099 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1100 self.target = v.into();
1101 self
1102 }
1103
1104 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1105 ///
1106 /// # Example
1107 /// ```ignore,no_run
1108 /// # use google_cloud_ids_v1::model::OperationMetadata;
1109 /// let x = OperationMetadata::new().set_verb("example");
1110 /// ```
1111 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.verb = v.into();
1113 self
1114 }
1115
1116 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1117 ///
1118 /// # Example
1119 /// ```ignore,no_run
1120 /// # use google_cloud_ids_v1::model::OperationMetadata;
1121 /// let x = OperationMetadata::new().set_status_message("example");
1122 /// ```
1123 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.status_message = v.into();
1125 self
1126 }
1127
1128 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1129 ///
1130 /// # Example
1131 /// ```ignore,no_run
1132 /// # use google_cloud_ids_v1::model::OperationMetadata;
1133 /// let x = OperationMetadata::new().set_requested_cancellation(true);
1134 /// ```
1135 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1136 self.requested_cancellation = v.into();
1137 self
1138 }
1139
1140 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1141 ///
1142 /// # Example
1143 /// ```ignore,no_run
1144 /// # use google_cloud_ids_v1::model::OperationMetadata;
1145 /// let x = OperationMetadata::new().set_api_version("example");
1146 /// ```
1147 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1148 self.api_version = v.into();
1149 self
1150 }
1151}
1152
1153impl wkt::message::Message for OperationMetadata {
1154 fn typename() -> &'static str {
1155 "type.googleapis.com/google.cloud.ids.v1.OperationMetadata"
1156 }
1157}