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 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/// Endpoint describes a single IDS endpoint. It defines a forwarding rule to
36/// which packets can be sent for IDS inspection.
37#[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    /// Output only. The name of the endpoint.
43    #[serde(skip_serializing_if = "std::string::String::is_empty")]
44    pub name: std::string::String,
45
46    /// Output only. The create time timestamp.
47    #[serde(skip_serializing_if = "std::option::Option::is_none")]
48    pub create_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. The update time timestamp.
51    #[serde(skip_serializing_if = "std::option::Option::is_none")]
52    pub update_time: std::option::Option<wkt::Timestamp>,
53
54    /// The labels of the endpoint.
55    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
56    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58    /// Required. The fully qualified URL of the network to which the IDS Endpoint is
59    /// attached.
60    #[serde(skip_serializing_if = "std::string::String::is_empty")]
61    pub network: std::string::String,
62
63    /// Output only. The fully qualified URL of the endpoint's ILB Forwarding Rule.
64    #[serde(skip_serializing_if = "std::string::String::is_empty")]
65    pub endpoint_forwarding_rule: std::string::String,
66
67    /// Output only. The IP address of the IDS Endpoint's ILB.
68    #[serde(skip_serializing_if = "std::string::String::is_empty")]
69    pub endpoint_ip: std::string::String,
70
71    /// User-provided description of the endpoint
72    #[serde(skip_serializing_if = "std::string::String::is_empty")]
73    pub description: std::string::String,
74
75    /// Required. Lowest threat severity that this endpoint will alert on.
76    pub severity: crate::model::endpoint::Severity,
77
78    /// Output only. Current state of the endpoint.
79    pub state: crate::model::endpoint::State,
80
81    /// Whether the endpoint should report traffic logs in addition to threat logs.
82    #[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    /// Sets the value of [name][crate::model::Endpoint::name].
95    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    /// Sets the value of [create_time][crate::model::Endpoint::create_time].
101    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    /// Sets the value of [update_time][crate::model::Endpoint::update_time].
110    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    /// Sets the value of [labels][crate::model::Endpoint::labels].
119    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    /// Sets the value of [network][crate::model::Endpoint::network].
131    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    /// Sets the value of [endpoint_forwarding_rule][crate::model::Endpoint::endpoint_forwarding_rule].
137    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    /// Sets the value of [endpoint_ip][crate::model::Endpoint::endpoint_ip].
146    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    /// Sets the value of [description][crate::model::Endpoint::description].
152    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    /// Sets the value of [severity][crate::model::Endpoint::severity].
158    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    /// Sets the value of [state][crate::model::Endpoint::state].
167    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    /// Sets the value of [traffic_logs][crate::model::Endpoint::traffic_logs].
173    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
185/// Defines additional types related to [Endpoint].
186pub mod endpoint {
187    #[allow(unused_imports)]
188    use super::*;
189
190    /// Threat severity levels.
191    ///
192    /// # Working with unknown values
193    ///
194    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
195    /// additional enum variants at any time. Adding new variants is not considered
196    /// a breaking change. Applications should write their code in anticipation of:
197    ///
198    /// - New values appearing in future releases of the client library, **and**
199    /// - New values received dynamically, without application changes.
200    ///
201    /// Please consult the [Working with enums] section in the user guide for some
202    /// guidelines.
203    ///
204    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
205    #[derive(Clone, Debug, PartialEq)]
206    #[non_exhaustive]
207    pub enum Severity {
208        /// Not set.
209        Unspecified,
210        /// Informational alerts.
211        Informational,
212        /// Low severity alerts.
213        Low,
214        /// Medium severity alerts.
215        Medium,
216        /// High severity alerts.
217        High,
218        /// Critical severity alerts.
219        Critical,
220        /// If set, the enum was initialized with an unknown value.
221        ///
222        /// Applications can examine the value using [Severity::value] or
223        /// [Severity::name].
224        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        /// Gets the enum value.
237        ///
238        /// Returns `None` if the enum contains an unknown value deserialized from
239        /// the string representation of enums.
240        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        /// Gets the enum value as a string.
253        ///
254        /// Returns `None` if the enum contains an unknown value deserialized from
255        /// the integer representation of enums.
256        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    /// Endpoint state
344    ///
345    /// # Working with unknown values
346    ///
347    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
348    /// additional enum variants at any time. Adding new variants is not considered
349    /// a breaking change. Applications should write their code in anticipation of:
350    ///
351    /// - New values appearing in future releases of the client library, **and**
352    /// - New values received dynamically, without application changes.
353    ///
354    /// Please consult the [Working with enums] section in the user guide for some
355    /// guidelines.
356    ///
357    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
358    #[derive(Clone, Debug, PartialEq)]
359    #[non_exhaustive]
360    pub enum State {
361        /// Not set.
362        Unspecified,
363        /// Being created.
364        Creating,
365        /// Active and ready for traffic.
366        Ready,
367        /// Being deleted.
368        Deleting,
369        /// If set, the enum was initialized with an unknown value.
370        ///
371        /// Applications can examine the value using [State::value] or
372        /// [State::name].
373        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        /// Gets the enum value.
386        ///
387        /// Returns `None` if the enum contains an unknown value deserialized from
388        /// the string representation of enums.
389        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        /// Gets the enum value as a string.
400        ///
401        /// Returns `None` if the enum contains an unknown value deserialized from
402        /// the integer representation of enums.
403        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    /// Required. The parent, which owns this collection of endpoints.
489    #[serde(skip_serializing_if = "std::string::String::is_empty")]
490    pub parent: std::string::String,
491
492    /// Optional. The maximum number of endpoints to return. The service may return fewer
493    /// than this value.
494    #[serde(skip_serializing_if = "wkt::internal::is_default")]
495    pub page_size: i32,
496
497    /// Optional. A page token, received from a previous `ListEndpoints` call.
498    /// Provide this to retrieve the subsequent page.
499    ///
500    /// When paginating, all other parameters provided to `ListEndpoints` must
501    /// match the call that provided the page token.
502    #[serde(skip_serializing_if = "std::string::String::is_empty")]
503    pub page_token: std::string::String,
504
505    /// Optional. The filter expression, following the syntax outlined in
506    /// <https://google.aip.dev/160>.
507    #[serde(skip_serializing_if = "std::string::String::is_empty")]
508    pub filter: std::string::String,
509
510    /// Optional. One or more fields to compare and use to sort the output.
511    /// See <https://google.aip.dev/132#ordering>.
512    #[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    /// Sets the value of [parent][crate::model::ListEndpointsRequest::parent].
525    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    /// Sets the value of [page_size][crate::model::ListEndpointsRequest::page_size].
531    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    /// Sets the value of [page_token][crate::model::ListEndpointsRequest::page_token].
537    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    /// Sets the value of [filter][crate::model::ListEndpointsRequest::filter].
543    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    /// Sets the value of [order_by][crate::model::ListEndpointsRequest::order_by].
549    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    /// The list of endpoints response.
567    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
568    pub endpoints: std::vec::Vec<crate::model::Endpoint>,
569
570    /// A token, which can be sent as `page_token` to retrieve the next page.
571    /// If this field is omitted, there are no subsequent pages.
572    #[serde(skip_serializing_if = "std::string::String::is_empty")]
573    pub next_page_token: std::string::String,
574
575    /// Locations that could not be reached.
576    #[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    /// Sets the value of [endpoints][crate::model::ListEndpointsResponse::endpoints].
589    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    /// Sets the value of [next_page_token][crate::model::ListEndpointsResponse::next_page_token].
600    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    /// Sets the value of [unreachable][crate::model::ListEndpointsResponse::unreachable].
606    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    /// Required. The name of the endpoint to retrieve.
643    /// Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
644    #[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    /// Sets the value of [name][crate::model::GetEndpointRequest::name].
657    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    /// Required. The endpoint's parent.
675    #[serde(skip_serializing_if = "std::string::String::is_empty")]
676    pub parent: std::string::String,
677
678    /// Required. The endpoint identifier. This will be part of the endpoint's
679    /// resource name.
680    /// This value must start with a lowercase letter followed by up to 62
681    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
682    /// Values that do not match this pattern will trigger an INVALID_ARGUMENT
683    /// error.
684    #[serde(skip_serializing_if = "std::string::String::is_empty")]
685    pub endpoint_id: std::string::String,
686
687    /// Required. The endpoint to create.
688    #[serde(skip_serializing_if = "std::option::Option::is_none")]
689    pub endpoint: std::option::Option<crate::model::Endpoint>,
690
691    /// An optional request ID to identify requests. Specify a unique request ID
692    /// so that if you must retry your request, the server will know to ignore
693    /// the request if it has already been completed. The server will guarantee
694    /// that for at least 60 minutes since the first request.
695    ///
696    /// For example, consider a situation where you make an initial request and t
697    /// he request times out. If you make the request again with the same request
698    /// ID, the server can check if original operation with the same request ID
699    /// was received, and if so, will ignore the second request. This prevents
700    /// clients from accidentally creating duplicate commitments.
701    ///
702    /// The request ID must be a valid UUID with the exception that zero UUID is
703    /// not supported (00000000-0000-0000-0000-000000000000).
704    #[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    /// Sets the value of [parent][crate::model::CreateEndpointRequest::parent].
717    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    /// Sets the value of [endpoint_id][crate::model::CreateEndpointRequest::endpoint_id].
723    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    /// Sets the value of [endpoint][crate::model::CreateEndpointRequest::endpoint].
729    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    /// Sets the value of [request_id][crate::model::CreateEndpointRequest::request_id].
738    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    /// Required. The name of the endpoint to delete.
756    #[serde(skip_serializing_if = "std::string::String::is_empty")]
757    pub name: std::string::String,
758
759    /// An optional request ID to identify requests. Specify a unique request ID
760    /// so that if you must retry your request, the server will know to ignore
761    /// the request if it has already been completed. The server will guarantee
762    /// that for at least 60 minutes after the first request.
763    ///
764    /// For example, consider a situation where you make an initial request and t
765    /// he request times out. If you make the request again with the same request
766    /// ID, the server can check if original operation with the same request ID
767    /// was received, and if so, will ignore the second request. This prevents
768    /// clients from accidentally creating duplicate commitments.
769    ///
770    /// The request ID must be a valid UUID with the exception that zero UUID is
771    /// not supported (00000000-0000-0000-0000-000000000000).
772    #[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    /// Sets the value of [name][crate::model::DeleteEndpointRequest::name].
785    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    /// Sets the value of [request_id][crate::model::DeleteEndpointRequest::request_id].
791    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/// Represents the metadata of the long-running operation.
804#[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    /// Output only. The time the operation was created.
810    #[serde(skip_serializing_if = "std::option::Option::is_none")]
811    pub create_time: std::option::Option<wkt::Timestamp>,
812
813    /// Output only. The time the operation finished running.
814    #[serde(skip_serializing_if = "std::option::Option::is_none")]
815    pub end_time: std::option::Option<wkt::Timestamp>,
816
817    /// Output only. Server-defined resource path for the target of the operation.
818    #[serde(skip_serializing_if = "std::string::String::is_empty")]
819    pub target: std::string::String,
820
821    /// Output only. Name of the verb executed by the operation.
822    #[serde(skip_serializing_if = "std::string::String::is_empty")]
823    pub verb: std::string::String,
824
825    /// Output only. Human-readable status of the operation, if any.
826    #[serde(skip_serializing_if = "std::string::String::is_empty")]
827    pub status_message: std::string::String,
828
829    /// Output only. Identifies whether the user has requested cancellation
830    /// of the operation. Operations that have successfully been cancelled
831    /// have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
832    /// corresponding to `Code.CANCELLED`.
833    ///
834    /// [google.rpc.Status.code]: rpc::model::Status::code
835    #[serde(skip_serializing_if = "wkt::internal::is_default")]
836    pub requested_cancellation: bool,
837
838    /// Output only. API version used to start the operation.
839    #[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    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
852    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    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
861    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    /// Sets the value of [target][crate::model::OperationMetadata::target].
870    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    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
876    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    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
882    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    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
888    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    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
894    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}