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
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Endpoint describes a single IDS endpoint. It defines a forwarding rule to
40/// which packets can be sent for IDS inspection.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct Endpoint {
44    /// Output only. The name of the endpoint.
45    pub name: std::string::String,
46
47    /// Output only. The create time timestamp.
48    pub create_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. The update time timestamp.
51    pub update_time: std::option::Option<wkt::Timestamp>,
52
53    /// The labels of the endpoint.
54    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
55
56    /// Required. The fully qualified URL of the network to which the IDS Endpoint is
57    /// attached.
58    pub network: std::string::String,
59
60    /// Output only. The fully qualified URL of the endpoint's ILB Forwarding Rule.
61    pub endpoint_forwarding_rule: std::string::String,
62
63    /// Output only. The IP address of the IDS Endpoint's ILB.
64    pub endpoint_ip: std::string::String,
65
66    /// User-provided description of the endpoint
67    pub description: std::string::String,
68
69    /// Required. Lowest threat severity that this endpoint will alert on.
70    pub severity: crate::model::endpoint::Severity,
71
72    /// Output only. Current state of the endpoint.
73    pub state: crate::model::endpoint::State,
74
75    /// Whether the endpoint should report traffic logs in addition to threat logs.
76    pub traffic_logs: bool,
77
78    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
79}
80
81impl Endpoint {
82    pub fn new() -> Self {
83        std::default::Default::default()
84    }
85
86    /// Sets the value of [name][crate::model::Endpoint::name].
87    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.name = v.into();
89        self
90    }
91
92    /// Sets the value of [create_time][crate::model::Endpoint::create_time].
93    pub fn set_create_time<T>(mut self, v: T) -> Self
94    where
95        T: std::convert::Into<wkt::Timestamp>,
96    {
97        self.create_time = std::option::Option::Some(v.into());
98        self
99    }
100
101    /// Sets or clears the value of [create_time][crate::model::Endpoint::create_time].
102    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
103    where
104        T: std::convert::Into<wkt::Timestamp>,
105    {
106        self.create_time = v.map(|x| x.into());
107        self
108    }
109
110    /// Sets the value of [update_time][crate::model::Endpoint::update_time].
111    pub fn set_update_time<T>(mut self, v: T) -> Self
112    where
113        T: std::convert::Into<wkt::Timestamp>,
114    {
115        self.update_time = std::option::Option::Some(v.into());
116        self
117    }
118
119    /// Sets or clears the value of [update_time][crate::model::Endpoint::update_time].
120    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
121    where
122        T: std::convert::Into<wkt::Timestamp>,
123    {
124        self.update_time = v.map(|x| x.into());
125        self
126    }
127
128    /// Sets the value of [labels][crate::model::Endpoint::labels].
129    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
130    where
131        T: std::iter::IntoIterator<Item = (K, V)>,
132        K: std::convert::Into<std::string::String>,
133        V: std::convert::Into<std::string::String>,
134    {
135        use std::iter::Iterator;
136        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
137        self
138    }
139
140    /// Sets the value of [network][crate::model::Endpoint::network].
141    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142        self.network = v.into();
143        self
144    }
145
146    /// Sets the value of [endpoint_forwarding_rule][crate::model::Endpoint::endpoint_forwarding_rule].
147    pub fn set_endpoint_forwarding_rule<T: std::convert::Into<std::string::String>>(
148        mut self,
149        v: T,
150    ) -> Self {
151        self.endpoint_forwarding_rule = v.into();
152        self
153    }
154
155    /// Sets the value of [endpoint_ip][crate::model::Endpoint::endpoint_ip].
156    pub fn set_endpoint_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157        self.endpoint_ip = v.into();
158        self
159    }
160
161    /// Sets the value of [description][crate::model::Endpoint::description].
162    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
163        self.description = v.into();
164        self
165    }
166
167    /// Sets the value of [severity][crate::model::Endpoint::severity].
168    pub fn set_severity<T: std::convert::Into<crate::model::endpoint::Severity>>(
169        mut self,
170        v: T,
171    ) -> Self {
172        self.severity = v.into();
173        self
174    }
175
176    /// Sets the value of [state][crate::model::Endpoint::state].
177    pub fn set_state<T: std::convert::Into<crate::model::endpoint::State>>(mut self, v: T) -> Self {
178        self.state = v.into();
179        self
180    }
181
182    /// Sets the value of [traffic_logs][crate::model::Endpoint::traffic_logs].
183    pub fn set_traffic_logs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
184        self.traffic_logs = v.into();
185        self
186    }
187}
188
189impl wkt::message::Message for Endpoint {
190    fn typename() -> &'static str {
191        "type.googleapis.com/google.cloud.ids.v1.Endpoint"
192    }
193}
194
195/// Defines additional types related to [Endpoint].
196pub mod endpoint {
197    #[allow(unused_imports)]
198    use super::*;
199
200    /// Threat severity levels.
201    ///
202    /// # Working with unknown values
203    ///
204    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
205    /// additional enum variants at any time. Adding new variants is not considered
206    /// a breaking change. Applications should write their code in anticipation of:
207    ///
208    /// - New values appearing in future releases of the client library, **and**
209    /// - New values received dynamically, without application changes.
210    ///
211    /// Please consult the [Working with enums] section in the user guide for some
212    /// guidelines.
213    ///
214    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
215    #[derive(Clone, Debug, PartialEq)]
216    #[non_exhaustive]
217    pub enum Severity {
218        /// Not set.
219        Unspecified,
220        /// Informational alerts.
221        Informational,
222        /// Low severity alerts.
223        Low,
224        /// Medium severity alerts.
225        Medium,
226        /// High severity alerts.
227        High,
228        /// Critical severity alerts.
229        Critical,
230        /// If set, the enum was initialized with an unknown value.
231        ///
232        /// Applications can examine the value using [Severity::value] or
233        /// [Severity::name].
234        UnknownValue(severity::UnknownValue),
235    }
236
237    #[doc(hidden)]
238    pub mod severity {
239        #[allow(unused_imports)]
240        use super::*;
241        #[derive(Clone, Debug, PartialEq)]
242        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
243    }
244
245    impl Severity {
246        /// Gets the enum value.
247        ///
248        /// Returns `None` if the enum contains an unknown value deserialized from
249        /// the string representation of enums.
250        pub fn value(&self) -> std::option::Option<i32> {
251            match self {
252                Self::Unspecified => std::option::Option::Some(0),
253                Self::Informational => std::option::Option::Some(1),
254                Self::Low => std::option::Option::Some(2),
255                Self::Medium => std::option::Option::Some(3),
256                Self::High => std::option::Option::Some(4),
257                Self::Critical => std::option::Option::Some(5),
258                Self::UnknownValue(u) => u.0.value(),
259            }
260        }
261
262        /// Gets the enum value as a string.
263        ///
264        /// Returns `None` if the enum contains an unknown value deserialized from
265        /// the integer representation of enums.
266        pub fn name(&self) -> std::option::Option<&str> {
267            match self {
268                Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
269                Self::Informational => std::option::Option::Some("INFORMATIONAL"),
270                Self::Low => std::option::Option::Some("LOW"),
271                Self::Medium => std::option::Option::Some("MEDIUM"),
272                Self::High => std::option::Option::Some("HIGH"),
273                Self::Critical => std::option::Option::Some("CRITICAL"),
274                Self::UnknownValue(u) => u.0.name(),
275            }
276        }
277    }
278
279    impl std::default::Default for Severity {
280        fn default() -> Self {
281            use std::convert::From;
282            Self::from(0)
283        }
284    }
285
286    impl std::fmt::Display for Severity {
287        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
288            wkt::internal::display_enum(f, self.name(), self.value())
289        }
290    }
291
292    impl std::convert::From<i32> for Severity {
293        fn from(value: i32) -> Self {
294            match value {
295                0 => Self::Unspecified,
296                1 => Self::Informational,
297                2 => Self::Low,
298                3 => Self::Medium,
299                4 => Self::High,
300                5 => Self::Critical,
301                _ => Self::UnknownValue(severity::UnknownValue(
302                    wkt::internal::UnknownEnumValue::Integer(value),
303                )),
304            }
305        }
306    }
307
308    impl std::convert::From<&str> for Severity {
309        fn from(value: &str) -> Self {
310            use std::string::ToString;
311            match value {
312                "SEVERITY_UNSPECIFIED" => Self::Unspecified,
313                "INFORMATIONAL" => Self::Informational,
314                "LOW" => Self::Low,
315                "MEDIUM" => Self::Medium,
316                "HIGH" => Self::High,
317                "CRITICAL" => Self::Critical,
318                _ => Self::UnknownValue(severity::UnknownValue(
319                    wkt::internal::UnknownEnumValue::String(value.to_string()),
320                )),
321            }
322        }
323    }
324
325    impl serde::ser::Serialize for Severity {
326        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
327        where
328            S: serde::Serializer,
329        {
330            match self {
331                Self::Unspecified => serializer.serialize_i32(0),
332                Self::Informational => serializer.serialize_i32(1),
333                Self::Low => serializer.serialize_i32(2),
334                Self::Medium => serializer.serialize_i32(3),
335                Self::High => serializer.serialize_i32(4),
336                Self::Critical => serializer.serialize_i32(5),
337                Self::UnknownValue(u) => u.0.serialize(serializer),
338            }
339        }
340    }
341
342    impl<'de> serde::de::Deserialize<'de> for Severity {
343        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
344        where
345            D: serde::Deserializer<'de>,
346        {
347            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
348                ".google.cloud.ids.v1.Endpoint.Severity",
349            ))
350        }
351    }
352
353    /// Endpoint state
354    ///
355    /// # Working with unknown values
356    ///
357    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
358    /// additional enum variants at any time. Adding new variants is not considered
359    /// a breaking change. Applications should write their code in anticipation of:
360    ///
361    /// - New values appearing in future releases of the client library, **and**
362    /// - New values received dynamically, without application changes.
363    ///
364    /// Please consult the [Working with enums] section in the user guide for some
365    /// guidelines.
366    ///
367    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
368    #[derive(Clone, Debug, PartialEq)]
369    #[non_exhaustive]
370    pub enum State {
371        /// Not set.
372        Unspecified,
373        /// Being created.
374        Creating,
375        /// Active and ready for traffic.
376        Ready,
377        /// Being deleted.
378        Deleting,
379        /// If set, the enum was initialized with an unknown value.
380        ///
381        /// Applications can examine the value using [State::value] or
382        /// [State::name].
383        UnknownValue(state::UnknownValue),
384    }
385
386    #[doc(hidden)]
387    pub mod state {
388        #[allow(unused_imports)]
389        use super::*;
390        #[derive(Clone, Debug, PartialEq)]
391        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
392    }
393
394    impl State {
395        /// Gets the enum value.
396        ///
397        /// Returns `None` if the enum contains an unknown value deserialized from
398        /// the string representation of enums.
399        pub fn value(&self) -> std::option::Option<i32> {
400            match self {
401                Self::Unspecified => std::option::Option::Some(0),
402                Self::Creating => std::option::Option::Some(1),
403                Self::Ready => std::option::Option::Some(2),
404                Self::Deleting => std::option::Option::Some(3),
405                Self::UnknownValue(u) => u.0.value(),
406            }
407        }
408
409        /// Gets the enum value as a string.
410        ///
411        /// Returns `None` if the enum contains an unknown value deserialized from
412        /// the integer representation of enums.
413        pub fn name(&self) -> std::option::Option<&str> {
414            match self {
415                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
416                Self::Creating => std::option::Option::Some("CREATING"),
417                Self::Ready => std::option::Option::Some("READY"),
418                Self::Deleting => std::option::Option::Some("DELETING"),
419                Self::UnknownValue(u) => u.0.name(),
420            }
421        }
422    }
423
424    impl std::default::Default for State {
425        fn default() -> Self {
426            use std::convert::From;
427            Self::from(0)
428        }
429    }
430
431    impl std::fmt::Display for State {
432        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
433            wkt::internal::display_enum(f, self.name(), self.value())
434        }
435    }
436
437    impl std::convert::From<i32> for State {
438        fn from(value: i32) -> Self {
439            match value {
440                0 => Self::Unspecified,
441                1 => Self::Creating,
442                2 => Self::Ready,
443                3 => Self::Deleting,
444                _ => Self::UnknownValue(state::UnknownValue(
445                    wkt::internal::UnknownEnumValue::Integer(value),
446                )),
447            }
448        }
449    }
450
451    impl std::convert::From<&str> for State {
452        fn from(value: &str) -> Self {
453            use std::string::ToString;
454            match value {
455                "STATE_UNSPECIFIED" => Self::Unspecified,
456                "CREATING" => Self::Creating,
457                "READY" => Self::Ready,
458                "DELETING" => Self::Deleting,
459                _ => Self::UnknownValue(state::UnknownValue(
460                    wkt::internal::UnknownEnumValue::String(value.to_string()),
461                )),
462            }
463        }
464    }
465
466    impl serde::ser::Serialize for State {
467        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
468        where
469            S: serde::Serializer,
470        {
471            match self {
472                Self::Unspecified => serializer.serialize_i32(0),
473                Self::Creating => serializer.serialize_i32(1),
474                Self::Ready => serializer.serialize_i32(2),
475                Self::Deleting => serializer.serialize_i32(3),
476                Self::UnknownValue(u) => u.0.serialize(serializer),
477            }
478        }
479    }
480
481    impl<'de> serde::de::Deserialize<'de> for State {
482        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
483        where
484            D: serde::Deserializer<'de>,
485        {
486            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
487                ".google.cloud.ids.v1.Endpoint.State",
488            ))
489        }
490    }
491}
492
493#[derive(Clone, Default, PartialEq)]
494#[non_exhaustive]
495pub struct ListEndpointsRequest {
496    /// Required. The parent, which owns this collection of endpoints.
497    pub parent: std::string::String,
498
499    /// Optional. The maximum number of endpoints to return. The service may return fewer
500    /// than this value.
501    pub page_size: i32,
502
503    /// Optional. A page token, received from a previous `ListEndpoints` call.
504    /// Provide this to retrieve the subsequent page.
505    ///
506    /// When paginating, all other parameters provided to `ListEndpoints` must
507    /// match the call that provided the page token.
508    pub page_token: std::string::String,
509
510    /// Optional. The filter expression, following the syntax outlined in
511    /// <https://google.aip.dev/160>.
512    pub filter: std::string::String,
513
514    /// Optional. One or more fields to compare and use to sort the output.
515    /// See <https://google.aip.dev/132#ordering>.
516    pub order_by: std::string::String,
517
518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
519}
520
521impl ListEndpointsRequest {
522    pub fn new() -> Self {
523        std::default::Default::default()
524    }
525
526    /// Sets the value of [parent][crate::model::ListEndpointsRequest::parent].
527    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
528        self.parent = v.into();
529        self
530    }
531
532    /// Sets the value of [page_size][crate::model::ListEndpointsRequest::page_size].
533    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
534        self.page_size = v.into();
535        self
536    }
537
538    /// Sets the value of [page_token][crate::model::ListEndpointsRequest::page_token].
539    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
540        self.page_token = v.into();
541        self
542    }
543
544    /// Sets the value of [filter][crate::model::ListEndpointsRequest::filter].
545    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
546        self.filter = v.into();
547        self
548    }
549
550    /// Sets the value of [order_by][crate::model::ListEndpointsRequest::order_by].
551    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
552        self.order_by = v.into();
553        self
554    }
555}
556
557impl wkt::message::Message for ListEndpointsRequest {
558    fn typename() -> &'static str {
559        "type.googleapis.com/google.cloud.ids.v1.ListEndpointsRequest"
560    }
561}
562
563#[derive(Clone, Default, PartialEq)]
564#[non_exhaustive]
565pub struct ListEndpointsResponse {
566    /// The list of endpoints response.
567    pub endpoints: std::vec::Vec<crate::model::Endpoint>,
568
569    /// A token, which can be sent as `page_token` to retrieve the next page.
570    /// If this field is omitted, there are no subsequent pages.
571    pub next_page_token: std::string::String,
572
573    /// Locations that could not be reached.
574    pub unreachable: std::vec::Vec<std::string::String>,
575
576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
577}
578
579impl ListEndpointsResponse {
580    pub fn new() -> Self {
581        std::default::Default::default()
582    }
583
584    /// Sets the value of [endpoints][crate::model::ListEndpointsResponse::endpoints].
585    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
586    where
587        T: std::iter::IntoIterator<Item = V>,
588        V: std::convert::Into<crate::model::Endpoint>,
589    {
590        use std::iter::Iterator;
591        self.endpoints = v.into_iter().map(|i| i.into()).collect();
592        self
593    }
594
595    /// Sets the value of [next_page_token][crate::model::ListEndpointsResponse::next_page_token].
596    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
597        self.next_page_token = v.into();
598        self
599    }
600
601    /// Sets the value of [unreachable][crate::model::ListEndpointsResponse::unreachable].
602    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
603    where
604        T: std::iter::IntoIterator<Item = V>,
605        V: std::convert::Into<std::string::String>,
606    {
607        use std::iter::Iterator;
608        self.unreachable = v.into_iter().map(|i| i.into()).collect();
609        self
610    }
611}
612
613impl wkt::message::Message for ListEndpointsResponse {
614    fn typename() -> &'static str {
615        "type.googleapis.com/google.cloud.ids.v1.ListEndpointsResponse"
616    }
617}
618
619#[doc(hidden)]
620impl gax::paginator::internal::PageableResponse for ListEndpointsResponse {
621    type PageItem = crate::model::Endpoint;
622
623    fn items(self) -> std::vec::Vec<Self::PageItem> {
624        self.endpoints
625    }
626
627    fn next_page_token(&self) -> std::string::String {
628        use std::clone::Clone;
629        self.next_page_token.clone()
630    }
631}
632
633#[derive(Clone, Default, PartialEq)]
634#[non_exhaustive]
635pub struct GetEndpointRequest {
636    /// Required. The name of the endpoint to retrieve.
637    /// Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
638    pub name: std::string::String,
639
640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
641}
642
643impl GetEndpointRequest {
644    pub fn new() -> Self {
645        std::default::Default::default()
646    }
647
648    /// Sets the value of [name][crate::model::GetEndpointRequest::name].
649    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650        self.name = v.into();
651        self
652    }
653}
654
655impl wkt::message::Message for GetEndpointRequest {
656    fn typename() -> &'static str {
657        "type.googleapis.com/google.cloud.ids.v1.GetEndpointRequest"
658    }
659}
660
661#[derive(Clone, Default, PartialEq)]
662#[non_exhaustive]
663pub struct CreateEndpointRequest {
664    /// Required. The endpoint's parent.
665    pub parent: std::string::String,
666
667    /// Required. The endpoint identifier. This will be part of the endpoint's
668    /// resource name.
669    /// This value must start with a lowercase letter followed by up to 62
670    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
671    /// Values that do not match this pattern will trigger an INVALID_ARGUMENT
672    /// error.
673    pub endpoint_id: std::string::String,
674
675    /// Required. The endpoint to create.
676    pub endpoint: std::option::Option<crate::model::Endpoint>,
677
678    /// An optional request ID to identify requests. Specify a unique request ID
679    /// so that if you must retry your request, the server will know to ignore
680    /// the request if it has already been completed. The server will guarantee
681    /// that for at least 60 minutes since the first request.
682    ///
683    /// For example, consider a situation where you make an initial request and t
684    /// he request times out. If you make the request again with the same request
685    /// ID, the server can check if original operation with the same request ID
686    /// was received, and if so, will ignore the second request. This prevents
687    /// clients from accidentally creating duplicate commitments.
688    ///
689    /// The request ID must be a valid UUID with the exception that zero UUID is
690    /// not supported (00000000-0000-0000-0000-000000000000).
691    pub request_id: std::string::String,
692
693    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
694}
695
696impl CreateEndpointRequest {
697    pub fn new() -> Self {
698        std::default::Default::default()
699    }
700
701    /// Sets the value of [parent][crate::model::CreateEndpointRequest::parent].
702    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
703        self.parent = v.into();
704        self
705    }
706
707    /// Sets the value of [endpoint_id][crate::model::CreateEndpointRequest::endpoint_id].
708    pub fn set_endpoint_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
709        self.endpoint_id = v.into();
710        self
711    }
712
713    /// Sets the value of [endpoint][crate::model::CreateEndpointRequest::endpoint].
714    pub fn set_endpoint<T>(mut self, v: T) -> Self
715    where
716        T: std::convert::Into<crate::model::Endpoint>,
717    {
718        self.endpoint = std::option::Option::Some(v.into());
719        self
720    }
721
722    /// Sets or clears the value of [endpoint][crate::model::CreateEndpointRequest::endpoint].
723    pub fn set_or_clear_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
724    where
725        T: std::convert::Into<crate::model::Endpoint>,
726    {
727        self.endpoint = v.map(|x| x.into());
728        self
729    }
730
731    /// Sets the value of [request_id][crate::model::CreateEndpointRequest::request_id].
732    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
733        self.request_id = v.into();
734        self
735    }
736}
737
738impl wkt::message::Message for CreateEndpointRequest {
739    fn typename() -> &'static str {
740        "type.googleapis.com/google.cloud.ids.v1.CreateEndpointRequest"
741    }
742}
743
744#[derive(Clone, Default, PartialEq)]
745#[non_exhaustive]
746pub struct DeleteEndpointRequest {
747    /// Required. The name of the endpoint to delete.
748    pub name: std::string::String,
749
750    /// An optional request ID to identify requests. Specify a unique request ID
751    /// so that if you must retry your request, the server will know to ignore
752    /// the request if it has already been completed. The server will guarantee
753    /// that for at least 60 minutes after the first request.
754    ///
755    /// For example, consider a situation where you make an initial request and t
756    /// he request times out. If you make the request again with the same request
757    /// ID, the server can check if original operation with the same request ID
758    /// was received, and if so, will ignore the second request. This prevents
759    /// clients from accidentally creating duplicate commitments.
760    ///
761    /// The request ID must be a valid UUID with the exception that zero UUID is
762    /// not supported (00000000-0000-0000-0000-000000000000).
763    pub request_id: std::string::String,
764
765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
766}
767
768impl DeleteEndpointRequest {
769    pub fn new() -> Self {
770        std::default::Default::default()
771    }
772
773    /// Sets the value of [name][crate::model::DeleteEndpointRequest::name].
774    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
775        self.name = v.into();
776        self
777    }
778
779    /// Sets the value of [request_id][crate::model::DeleteEndpointRequest::request_id].
780    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
781        self.request_id = v.into();
782        self
783    }
784}
785
786impl wkt::message::Message for DeleteEndpointRequest {
787    fn typename() -> &'static str {
788        "type.googleapis.com/google.cloud.ids.v1.DeleteEndpointRequest"
789    }
790}
791
792/// Represents the metadata of the long-running operation.
793#[derive(Clone, Default, PartialEq)]
794#[non_exhaustive]
795pub struct OperationMetadata {
796    /// Output only. The time the operation was created.
797    pub create_time: std::option::Option<wkt::Timestamp>,
798
799    /// Output only. The time the operation finished running.
800    pub end_time: std::option::Option<wkt::Timestamp>,
801
802    /// Output only. Server-defined resource path for the target of the operation.
803    pub target: std::string::String,
804
805    /// Output only. Name of the verb executed by the operation.
806    pub verb: std::string::String,
807
808    /// Output only. Human-readable status of the operation, if any.
809    pub status_message: std::string::String,
810
811    /// Output only. Identifies whether the user has requested cancellation
812    /// of the operation. Operations that have successfully been cancelled
813    /// have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
814    /// corresponding to `Code.CANCELLED`.
815    ///
816    /// [google.rpc.Status.code]: rpc::model::Status::code
817    pub requested_cancellation: bool,
818
819    /// Output only. API version used to start the operation.
820    pub api_version: std::string::String,
821
822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
823}
824
825impl OperationMetadata {
826    pub fn new() -> Self {
827        std::default::Default::default()
828    }
829
830    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
831    pub fn set_create_time<T>(mut self, v: T) -> Self
832    where
833        T: std::convert::Into<wkt::Timestamp>,
834    {
835        self.create_time = std::option::Option::Some(v.into());
836        self
837    }
838
839    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
840    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
841    where
842        T: std::convert::Into<wkt::Timestamp>,
843    {
844        self.create_time = v.map(|x| x.into());
845        self
846    }
847
848    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
849    pub fn set_end_time<T>(mut self, v: T) -> Self
850    where
851        T: std::convert::Into<wkt::Timestamp>,
852    {
853        self.end_time = std::option::Option::Some(v.into());
854        self
855    }
856
857    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
858    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
859    where
860        T: std::convert::Into<wkt::Timestamp>,
861    {
862        self.end_time = v.map(|x| x.into());
863        self
864    }
865
866    /// Sets the value of [target][crate::model::OperationMetadata::target].
867    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
868        self.target = v.into();
869        self
870    }
871
872    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
873    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
874        self.verb = v.into();
875        self
876    }
877
878    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
879    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
880        self.status_message = v.into();
881        self
882    }
883
884    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
885    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
886        self.requested_cancellation = v.into();
887        self
888    }
889
890    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
891    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
892        self.api_version = v.into();
893        self
894    }
895}
896
897impl wkt::message::Message for OperationMetadata {
898    fn typename() -> &'static str {
899        "type.googleapis.com/google.cloud.ids.v1.OperationMetadata"
900    }
901}