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    pub traffic_logs: bool,
83
84    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
85    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
86}
87
88impl Endpoint {
89    pub fn new() -> Self {
90        std::default::Default::default()
91    }
92
93    /// Sets the value of [name][crate::model::Endpoint::name].
94    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
95        self.name = v.into();
96        self
97    }
98
99    /// Sets the value of [create_time][crate::model::Endpoint::create_time].
100    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
101        mut self,
102        v: T,
103    ) -> Self {
104        self.create_time = v.into();
105        self
106    }
107
108    /// Sets the value of [update_time][crate::model::Endpoint::update_time].
109    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
110        mut self,
111        v: T,
112    ) -> Self {
113        self.update_time = v.into();
114        self
115    }
116
117    /// Sets the value of [network][crate::model::Endpoint::network].
118    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
119        self.network = v.into();
120        self
121    }
122
123    /// Sets the value of [endpoint_forwarding_rule][crate::model::Endpoint::endpoint_forwarding_rule].
124    pub fn set_endpoint_forwarding_rule<T: std::convert::Into<std::string::String>>(
125        mut self,
126        v: T,
127    ) -> Self {
128        self.endpoint_forwarding_rule = v.into();
129        self
130    }
131
132    /// Sets the value of [endpoint_ip][crate::model::Endpoint::endpoint_ip].
133    pub fn set_endpoint_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
134        self.endpoint_ip = v.into();
135        self
136    }
137
138    /// Sets the value of [description][crate::model::Endpoint::description].
139    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140        self.description = v.into();
141        self
142    }
143
144    /// Sets the value of [severity][crate::model::Endpoint::severity].
145    pub fn set_severity<T: std::convert::Into<crate::model::endpoint::Severity>>(
146        mut self,
147        v: T,
148    ) -> Self {
149        self.severity = v.into();
150        self
151    }
152
153    /// Sets the value of [state][crate::model::Endpoint::state].
154    pub fn set_state<T: std::convert::Into<crate::model::endpoint::State>>(mut self, v: T) -> Self {
155        self.state = v.into();
156        self
157    }
158
159    /// Sets the value of [traffic_logs][crate::model::Endpoint::traffic_logs].
160    pub fn set_traffic_logs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
161        self.traffic_logs = v.into();
162        self
163    }
164
165    /// Sets the value of [labels][crate::model::Endpoint::labels].
166    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
167    where
168        T: std::iter::IntoIterator<Item = (K, V)>,
169        K: std::convert::Into<std::string::String>,
170        V: std::convert::Into<std::string::String>,
171    {
172        use std::iter::Iterator;
173        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
174        self
175    }
176}
177
178impl wkt::message::Message for Endpoint {
179    fn typename() -> &'static str {
180        "type.googleapis.com/google.cloud.ids.v1.Endpoint"
181    }
182}
183
184/// Defines additional types related to [Endpoint].
185pub mod endpoint {
186    #[allow(unused_imports)]
187    use super::*;
188
189    /// Threat severity levels.
190    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
191    pub struct Severity(i32);
192
193    impl Severity {
194        /// Not set.
195        pub const SEVERITY_UNSPECIFIED: Severity = Severity::new(0);
196
197        /// Informational alerts.
198        pub const INFORMATIONAL: Severity = Severity::new(1);
199
200        /// Low severity alerts.
201        pub const LOW: Severity = Severity::new(2);
202
203        /// Medium severity alerts.
204        pub const MEDIUM: Severity = Severity::new(3);
205
206        /// High severity alerts.
207        pub const HIGH: Severity = Severity::new(4);
208
209        /// Critical severity alerts.
210        pub const CRITICAL: Severity = Severity::new(5);
211
212        /// Creates a new Severity instance.
213        pub(crate) const fn new(value: i32) -> Self {
214            Self(value)
215        }
216
217        /// Gets the enum value.
218        pub fn value(&self) -> i32 {
219            self.0
220        }
221
222        /// Gets the enum value as a string.
223        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
224            match self.0 {
225                0 => std::borrow::Cow::Borrowed("SEVERITY_UNSPECIFIED"),
226                1 => std::borrow::Cow::Borrowed("INFORMATIONAL"),
227                2 => std::borrow::Cow::Borrowed("LOW"),
228                3 => std::borrow::Cow::Borrowed("MEDIUM"),
229                4 => std::borrow::Cow::Borrowed("HIGH"),
230                5 => std::borrow::Cow::Borrowed("CRITICAL"),
231                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
232            }
233        }
234
235        /// Creates an enum value from the value name.
236        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
237            match name {
238                "SEVERITY_UNSPECIFIED" => std::option::Option::Some(Self::SEVERITY_UNSPECIFIED),
239                "INFORMATIONAL" => std::option::Option::Some(Self::INFORMATIONAL),
240                "LOW" => std::option::Option::Some(Self::LOW),
241                "MEDIUM" => std::option::Option::Some(Self::MEDIUM),
242                "HIGH" => std::option::Option::Some(Self::HIGH),
243                "CRITICAL" => std::option::Option::Some(Self::CRITICAL),
244                _ => std::option::Option::None,
245            }
246        }
247    }
248
249    impl std::convert::From<i32> for Severity {
250        fn from(value: i32) -> Self {
251            Self::new(value)
252        }
253    }
254
255    impl std::default::Default for Severity {
256        fn default() -> Self {
257            Self::new(0)
258        }
259    }
260
261    /// Endpoint state
262    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
263    pub struct State(i32);
264
265    impl State {
266        /// Not set.
267        pub const STATE_UNSPECIFIED: State = State::new(0);
268
269        /// Being created.
270        pub const CREATING: State = State::new(1);
271
272        /// Active and ready for traffic.
273        pub const READY: State = State::new(2);
274
275        /// Being deleted.
276        pub const DELETING: State = State::new(3);
277
278        /// Creates a new State instance.
279        pub(crate) const fn new(value: i32) -> Self {
280            Self(value)
281        }
282
283        /// Gets the enum value.
284        pub fn value(&self) -> i32 {
285            self.0
286        }
287
288        /// Gets the enum value as a string.
289        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
290            match self.0 {
291                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
292                1 => std::borrow::Cow::Borrowed("CREATING"),
293                2 => std::borrow::Cow::Borrowed("READY"),
294                3 => std::borrow::Cow::Borrowed("DELETING"),
295                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
296            }
297        }
298
299        /// Creates an enum value from the value name.
300        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
301            match name {
302                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
303                "CREATING" => std::option::Option::Some(Self::CREATING),
304                "READY" => std::option::Option::Some(Self::READY),
305                "DELETING" => std::option::Option::Some(Self::DELETING),
306                _ => std::option::Option::None,
307            }
308        }
309    }
310
311    impl std::convert::From<i32> for State {
312        fn from(value: i32) -> Self {
313            Self::new(value)
314        }
315    }
316
317    impl std::default::Default for State {
318        fn default() -> Self {
319            Self::new(0)
320        }
321    }
322}
323
324#[serde_with::serde_as]
325#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
326#[serde(default, rename_all = "camelCase")]
327#[non_exhaustive]
328pub struct ListEndpointsRequest {
329    /// Required. The parent, which owns this collection of endpoints.
330    #[serde(skip_serializing_if = "std::string::String::is_empty")]
331    pub parent: std::string::String,
332
333    /// Optional. The maximum number of endpoints to return. The service may return fewer
334    /// than this value.
335    pub page_size: i32,
336
337    /// Optional. A page token, received from a previous `ListEndpoints` call.
338    /// Provide this to retrieve the subsequent page.
339    ///
340    /// When paginating, all other parameters provided to `ListEndpoints` must
341    /// match the call that provided the page token.
342    #[serde(skip_serializing_if = "std::string::String::is_empty")]
343    pub page_token: std::string::String,
344
345    /// Optional. The filter expression, following the syntax outlined in
346    /// <https://google.aip.dev/160>.
347    #[serde(skip_serializing_if = "std::string::String::is_empty")]
348    pub filter: std::string::String,
349
350    /// Optional. One or more fields to compare and use to sort the output.
351    /// See <https://google.aip.dev/132#ordering>.
352    #[serde(skip_serializing_if = "std::string::String::is_empty")]
353    pub order_by: std::string::String,
354
355    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
356    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
357}
358
359impl ListEndpointsRequest {
360    pub fn new() -> Self {
361        std::default::Default::default()
362    }
363
364    /// Sets the value of [parent][crate::model::ListEndpointsRequest::parent].
365    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
366        self.parent = v.into();
367        self
368    }
369
370    /// Sets the value of [page_size][crate::model::ListEndpointsRequest::page_size].
371    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
372        self.page_size = v.into();
373        self
374    }
375
376    /// Sets the value of [page_token][crate::model::ListEndpointsRequest::page_token].
377    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
378        self.page_token = v.into();
379        self
380    }
381
382    /// Sets the value of [filter][crate::model::ListEndpointsRequest::filter].
383    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
384        self.filter = v.into();
385        self
386    }
387
388    /// Sets the value of [order_by][crate::model::ListEndpointsRequest::order_by].
389    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
390        self.order_by = v.into();
391        self
392    }
393}
394
395impl wkt::message::Message for ListEndpointsRequest {
396    fn typename() -> &'static str {
397        "type.googleapis.com/google.cloud.ids.v1.ListEndpointsRequest"
398    }
399}
400
401#[serde_with::serde_as]
402#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
403#[serde(default, rename_all = "camelCase")]
404#[non_exhaustive]
405pub struct ListEndpointsResponse {
406    /// The list of endpoints response.
407    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
408    pub endpoints: std::vec::Vec<crate::model::Endpoint>,
409
410    /// A token, which can be sent as `page_token` to retrieve the next page.
411    /// If this field is omitted, there are no subsequent pages.
412    #[serde(skip_serializing_if = "std::string::String::is_empty")]
413    pub next_page_token: std::string::String,
414
415    /// Locations that could not be reached.
416    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
417    pub unreachable: std::vec::Vec<std::string::String>,
418
419    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
420    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
421}
422
423impl ListEndpointsResponse {
424    pub fn new() -> Self {
425        std::default::Default::default()
426    }
427
428    /// Sets the value of [next_page_token][crate::model::ListEndpointsResponse::next_page_token].
429    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
430        self.next_page_token = v.into();
431        self
432    }
433
434    /// Sets the value of [endpoints][crate::model::ListEndpointsResponse::endpoints].
435    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
436    where
437        T: std::iter::IntoIterator<Item = V>,
438        V: std::convert::Into<crate::model::Endpoint>,
439    {
440        use std::iter::Iterator;
441        self.endpoints = v.into_iter().map(|i| i.into()).collect();
442        self
443    }
444
445    /// Sets the value of [unreachable][crate::model::ListEndpointsResponse::unreachable].
446    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
447    where
448        T: std::iter::IntoIterator<Item = V>,
449        V: std::convert::Into<std::string::String>,
450    {
451        use std::iter::Iterator;
452        self.unreachable = v.into_iter().map(|i| i.into()).collect();
453        self
454    }
455}
456
457impl wkt::message::Message for ListEndpointsResponse {
458    fn typename() -> &'static str {
459        "type.googleapis.com/google.cloud.ids.v1.ListEndpointsResponse"
460    }
461}
462
463#[doc(hidden)]
464impl gax::paginator::internal::PageableResponse for ListEndpointsResponse {
465    type PageItem = crate::model::Endpoint;
466
467    fn items(self) -> std::vec::Vec<Self::PageItem> {
468        self.endpoints
469    }
470
471    fn next_page_token(&self) -> std::string::String {
472        use std::clone::Clone;
473        self.next_page_token.clone()
474    }
475}
476
477#[serde_with::serde_as]
478#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
479#[serde(default, rename_all = "camelCase")]
480#[non_exhaustive]
481pub struct GetEndpointRequest {
482    /// Required. The name of the endpoint to retrieve.
483    /// Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
484    #[serde(skip_serializing_if = "std::string::String::is_empty")]
485    pub name: std::string::String,
486
487    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
488    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
489}
490
491impl GetEndpointRequest {
492    pub fn new() -> Self {
493        std::default::Default::default()
494    }
495
496    /// Sets the value of [name][crate::model::GetEndpointRequest::name].
497    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
498        self.name = v.into();
499        self
500    }
501}
502
503impl wkt::message::Message for GetEndpointRequest {
504    fn typename() -> &'static str {
505        "type.googleapis.com/google.cloud.ids.v1.GetEndpointRequest"
506    }
507}
508
509#[serde_with::serde_as]
510#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
511#[serde(default, rename_all = "camelCase")]
512#[non_exhaustive]
513pub struct CreateEndpointRequest {
514    /// Required. The endpoint's parent.
515    #[serde(skip_serializing_if = "std::string::String::is_empty")]
516    pub parent: std::string::String,
517
518    /// Required. The endpoint identifier. This will be part of the endpoint's
519    /// resource name.
520    /// This value must start with a lowercase letter followed by up to 62
521    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
522    /// Values that do not match this pattern will trigger an INVALID_ARGUMENT
523    /// error.
524    #[serde(skip_serializing_if = "std::string::String::is_empty")]
525    pub endpoint_id: std::string::String,
526
527    /// Required. The endpoint to create.
528    #[serde(skip_serializing_if = "std::option::Option::is_none")]
529    pub endpoint: std::option::Option<crate::model::Endpoint>,
530
531    /// An optional request ID to identify requests. Specify a unique request ID
532    /// so that if you must retry your request, the server will know to ignore
533    /// the request if it has already been completed. The server will guarantee
534    /// that for at least 60 minutes since the first request.
535    ///
536    /// For example, consider a situation where you make an initial request and t
537    /// he request times out. If you make the request again with the same request
538    /// ID, the server can check if original operation with the same request ID
539    /// was received, and if so, will ignore the second request. This prevents
540    /// clients from accidentally creating duplicate commitments.
541    ///
542    /// The request ID must be a valid UUID with the exception that zero UUID is
543    /// not supported (00000000-0000-0000-0000-000000000000).
544    #[serde(skip_serializing_if = "std::string::String::is_empty")]
545    pub request_id: std::string::String,
546
547    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
548    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
549}
550
551impl CreateEndpointRequest {
552    pub fn new() -> Self {
553        std::default::Default::default()
554    }
555
556    /// Sets the value of [parent][crate::model::CreateEndpointRequest::parent].
557    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
558        self.parent = v.into();
559        self
560    }
561
562    /// Sets the value of [endpoint_id][crate::model::CreateEndpointRequest::endpoint_id].
563    pub fn set_endpoint_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
564        self.endpoint_id = v.into();
565        self
566    }
567
568    /// Sets the value of [endpoint][crate::model::CreateEndpointRequest::endpoint].
569    pub fn set_endpoint<T: std::convert::Into<std::option::Option<crate::model::Endpoint>>>(
570        mut self,
571        v: T,
572    ) -> Self {
573        self.endpoint = v.into();
574        self
575    }
576
577    /// Sets the value of [request_id][crate::model::CreateEndpointRequest::request_id].
578    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
579        self.request_id = v.into();
580        self
581    }
582}
583
584impl wkt::message::Message for CreateEndpointRequest {
585    fn typename() -> &'static str {
586        "type.googleapis.com/google.cloud.ids.v1.CreateEndpointRequest"
587    }
588}
589
590#[serde_with::serde_as]
591#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
592#[serde(default, rename_all = "camelCase")]
593#[non_exhaustive]
594pub struct DeleteEndpointRequest {
595    /// Required. The name of the endpoint to delete.
596    #[serde(skip_serializing_if = "std::string::String::is_empty")]
597    pub name: std::string::String,
598
599    /// An optional request ID to identify requests. Specify a unique request ID
600    /// so that if you must retry your request, the server will know to ignore
601    /// the request if it has already been completed. The server will guarantee
602    /// that for at least 60 minutes after the first request.
603    ///
604    /// For example, consider a situation where you make an initial request and t
605    /// he request times out. If you make the request again with the same request
606    /// ID, the server can check if original operation with the same request ID
607    /// was received, and if so, will ignore the second request. This prevents
608    /// clients from accidentally creating duplicate commitments.
609    ///
610    /// The request ID must be a valid UUID with the exception that zero UUID is
611    /// not supported (00000000-0000-0000-0000-000000000000).
612    #[serde(skip_serializing_if = "std::string::String::is_empty")]
613    pub request_id: std::string::String,
614
615    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
616    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
617}
618
619impl DeleteEndpointRequest {
620    pub fn new() -> Self {
621        std::default::Default::default()
622    }
623
624    /// Sets the value of [name][crate::model::DeleteEndpointRequest::name].
625    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
626        self.name = v.into();
627        self
628    }
629
630    /// Sets the value of [request_id][crate::model::DeleteEndpointRequest::request_id].
631    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
632        self.request_id = v.into();
633        self
634    }
635}
636
637impl wkt::message::Message for DeleteEndpointRequest {
638    fn typename() -> &'static str {
639        "type.googleapis.com/google.cloud.ids.v1.DeleteEndpointRequest"
640    }
641}
642
643/// Represents the metadata of the long-running operation.
644#[serde_with::serde_as]
645#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
646#[serde(default, rename_all = "camelCase")]
647#[non_exhaustive]
648pub struct OperationMetadata {
649    /// Output only. The time the operation was created.
650    #[serde(skip_serializing_if = "std::option::Option::is_none")]
651    pub create_time: std::option::Option<wkt::Timestamp>,
652
653    /// Output only. The time the operation finished running.
654    #[serde(skip_serializing_if = "std::option::Option::is_none")]
655    pub end_time: std::option::Option<wkt::Timestamp>,
656
657    /// Output only. Server-defined resource path for the target of the operation.
658    #[serde(skip_serializing_if = "std::string::String::is_empty")]
659    pub target: std::string::String,
660
661    /// Output only. Name of the verb executed by the operation.
662    #[serde(skip_serializing_if = "std::string::String::is_empty")]
663    pub verb: std::string::String,
664
665    /// Output only. Human-readable status of the operation, if any.
666    #[serde(skip_serializing_if = "std::string::String::is_empty")]
667    pub status_message: std::string::String,
668
669    /// Output only. Identifies whether the user has requested cancellation
670    /// of the operation. Operations that have successfully been cancelled
671    /// have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
672    /// corresponding to `Code.CANCELLED`.
673    ///
674    /// [google.rpc.Status.code]: rpc::model::Status::code
675    pub requested_cancellation: bool,
676
677    /// Output only. API version used to start the operation.
678    #[serde(skip_serializing_if = "std::string::String::is_empty")]
679    pub api_version: std::string::String,
680
681    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
682    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
683}
684
685impl OperationMetadata {
686    pub fn new() -> Self {
687        std::default::Default::default()
688    }
689
690    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
691    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
692        mut self,
693        v: T,
694    ) -> Self {
695        self.create_time = v.into();
696        self
697    }
698
699    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
700    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
701        mut self,
702        v: T,
703    ) -> Self {
704        self.end_time = v.into();
705        self
706    }
707
708    /// Sets the value of [target][crate::model::OperationMetadata::target].
709    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
710        self.target = v.into();
711        self
712    }
713
714    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
715    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
716        self.verb = v.into();
717        self
718    }
719
720    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
721    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
722        self.status_message = v.into();
723        self
724    }
725
726    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
727    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
728        self.requested_cancellation = v.into();
729        self
730    }
731
732    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
733    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
734        self.api_version = v.into();
735        self
736    }
737}
738
739impl wkt::message::Message for OperationMetadata {
740    fn typename() -> &'static str {
741        "type.googleapis.com/google.cloud.ids.v1.OperationMetadata"
742    }
743}