Skip to main content

google_cloud_deploy_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_type;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Payload proto for "clouddeploy.googleapis.com/automation"
41/// Platform Log event that describes the Automation related events.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct AutomationEvent {
45    /// Debug message for when there is an update on the AutomationRun.
46    /// Provides further details about the resource creation or state change.
47    pub message: std::string::String,
48
49    /// The name of the `AutomationRun`.
50    pub automation: std::string::String,
51
52    /// Unique identifier of the `DeliveryPipeline`.
53    pub pipeline_uid: std::string::String,
54
55    /// Type of this notification, e.g. for a Pub/Sub failure.
56    pub r#type: crate::model::Type,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl AutomationEvent {
62    /// Creates a new default instance.
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [message][crate::model::AutomationEvent::message].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_deploy_v1::model::AutomationEvent;
72    /// let x = AutomationEvent::new().set_message("example");
73    /// ```
74    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75        self.message = v.into();
76        self
77    }
78
79    /// Sets the value of [automation][crate::model::AutomationEvent::automation].
80    ///
81    /// # Example
82    /// ```ignore,no_run
83    /// # use google_cloud_deploy_v1::model::AutomationEvent;
84    /// let x = AutomationEvent::new().set_automation("example");
85    /// ```
86    pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
87        self.automation = v.into();
88        self
89    }
90
91    /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
92    ///
93    /// # Example
94    /// ```ignore,no_run
95    /// # use google_cloud_deploy_v1::model::AutomationEvent;
96    /// let x = AutomationEvent::new().set_pipeline_uid("example");
97    /// ```
98    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.pipeline_uid = v.into();
100        self
101    }
102
103    /// Sets the value of [r#type][crate::model::AutomationEvent::type].
104    ///
105    /// # Example
106    /// ```ignore,no_run
107    /// # use google_cloud_deploy_v1::model::AutomationEvent;
108    /// use google_cloud_deploy_v1::model::Type;
109    /// let x0 = AutomationEvent::new().set_type(Type::PubsubNotificationFailure);
110    /// let x1 = AutomationEvent::new().set_type(Type::ResourceStateChange);
111    /// let x2 = AutomationEvent::new().set_type(Type::ProcessAborted);
112    /// ```
113    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
114        self.r#type = v.into();
115        self
116    }
117}
118
119impl wkt::message::Message for AutomationEvent {
120    fn typename() -> &'static str {
121        "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
122    }
123}
124
125/// Payload proto for "clouddeploy.googleapis.com/automation_run"
126/// Platform Log event that describes the AutomationRun related events.
127#[derive(Clone, Default, PartialEq)]
128#[non_exhaustive]
129pub struct AutomationRunEvent {
130    /// Debug message for when there is an update on the AutomationRun.
131    /// Provides further details about the resource creation or state change.
132    pub message: std::string::String,
133
134    /// The name of the `AutomationRun`.
135    pub automation_run: std::string::String,
136
137    /// Unique identifier of the `DeliveryPipeline`.
138    pub pipeline_uid: std::string::String,
139
140    /// Identifier of the `Automation`.
141    pub automation_id: std::string::String,
142
143    /// Identifier of the `Automation` rule.
144    pub rule_id: std::string::String,
145
146    /// ID of the `Target` to which the `AutomationRun` is created.
147    pub destination_target_id: std::string::String,
148
149    /// Type of this notification, e.g. for a Pub/Sub failure.
150    pub r#type: crate::model::Type,
151
152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
153}
154
155impl AutomationRunEvent {
156    /// Creates a new default instance.
157    pub fn new() -> Self {
158        std::default::Default::default()
159    }
160
161    /// Sets the value of [message][crate::model::AutomationRunEvent::message].
162    ///
163    /// # Example
164    /// ```ignore,no_run
165    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
166    /// let x = AutomationRunEvent::new().set_message("example");
167    /// ```
168    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169        self.message = v.into();
170        self
171    }
172
173    /// Sets the value of [automation_run][crate::model::AutomationRunEvent::automation_run].
174    ///
175    /// # Example
176    /// ```ignore,no_run
177    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
178    /// let x = AutomationRunEvent::new().set_automation_run("example");
179    /// ```
180    pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
181        self.automation_run = v.into();
182        self
183    }
184
185    /// Sets the value of [pipeline_uid][crate::model::AutomationRunEvent::pipeline_uid].
186    ///
187    /// # Example
188    /// ```ignore,no_run
189    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
190    /// let x = AutomationRunEvent::new().set_pipeline_uid("example");
191    /// ```
192    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
193        self.pipeline_uid = v.into();
194        self
195    }
196
197    /// Sets the value of [automation_id][crate::model::AutomationRunEvent::automation_id].
198    ///
199    /// # Example
200    /// ```ignore,no_run
201    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
202    /// let x = AutomationRunEvent::new().set_automation_id("example");
203    /// ```
204    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205        self.automation_id = v.into();
206        self
207    }
208
209    /// Sets the value of [rule_id][crate::model::AutomationRunEvent::rule_id].
210    ///
211    /// # Example
212    /// ```ignore,no_run
213    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
214    /// let x = AutomationRunEvent::new().set_rule_id("example");
215    /// ```
216    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
217        self.rule_id = v.into();
218        self
219    }
220
221    /// Sets the value of [destination_target_id][crate::model::AutomationRunEvent::destination_target_id].
222    ///
223    /// # Example
224    /// ```ignore,no_run
225    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
226    /// let x = AutomationRunEvent::new().set_destination_target_id("example");
227    /// ```
228    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
229        mut self,
230        v: T,
231    ) -> Self {
232        self.destination_target_id = v.into();
233        self
234    }
235
236    /// Sets the value of [r#type][crate::model::AutomationRunEvent::type].
237    ///
238    /// # Example
239    /// ```ignore,no_run
240    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
241    /// use google_cloud_deploy_v1::model::Type;
242    /// let x0 = AutomationRunEvent::new().set_type(Type::PubsubNotificationFailure);
243    /// let x1 = AutomationRunEvent::new().set_type(Type::ResourceStateChange);
244    /// let x2 = AutomationRunEvent::new().set_type(Type::ProcessAborted);
245    /// ```
246    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
247        self.r#type = v.into();
248        self
249    }
250}
251
252impl wkt::message::Message for AutomationRunEvent {
253    fn typename() -> &'static str {
254        "type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
255    }
256}
257
258/// A `DeliveryPipeline` resource in the Cloud Deploy API.
259///
260/// A `DeliveryPipeline` defines a pipeline through which a Skaffold
261/// configuration can progress.
262#[derive(Clone, Default, PartialEq)]
263#[non_exhaustive]
264pub struct DeliveryPipeline {
265    /// Identifier. Name of the `DeliveryPipeline`. Format is
266    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`.
267    /// The `deliveryPipeline` component must match
268    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
269    pub name: std::string::String,
270
271    /// Output only. Unique identifier of the `DeliveryPipeline`.
272    pub uid: std::string::String,
273
274    /// Optional. Description of the `DeliveryPipeline`. Max length is 255
275    /// characters.
276    pub description: std::string::String,
277
278    /// Optional. User annotations. These attributes can only be set and used by
279    /// the user, and not by Cloud Deploy.
280    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
281
282    /// Labels are attributes that can be set and used by both the
283    /// user and by Cloud Deploy. Labels must meet the following constraints:
284    ///
285    /// * Keys and values can contain only lowercase letters, numeric characters,
286    ///   underscores, and dashes.
287    /// * All characters must use UTF-8 encoding, and international characters are
288    ///   allowed.
289    /// * Keys must start with a lowercase letter or international character.
290    /// * Each resource is limited to a maximum of 64 labels.
291    ///
292    /// Both keys and values are additionally constrained to be <= 128 bytes.
293    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
294
295    /// Output only. Time at which the pipeline was created.
296    pub create_time: std::option::Option<wkt::Timestamp>,
297
298    /// Output only. Most recent time at which the pipeline was updated.
299    pub update_time: std::option::Option<wkt::Timestamp>,
300
301    /// Output only. Information around the state of the Delivery Pipeline.
302    pub condition: std::option::Option<crate::model::PipelineCondition>,
303
304    /// This checksum is computed by the server based on the value of other
305    /// fields, and may be sent on update and delete requests to ensure the
306    /// client has an up-to-date value before proceeding.
307    pub etag: std::string::String,
308
309    /// Optional. When suspended, no new releases or rollouts can be created,
310    /// but in-progress ones will complete.
311    pub suspended: bool,
312
313    /// The ordering configuration of the `DeliveryPipeline`.
314    pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
315
316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
317}
318
319impl DeliveryPipeline {
320    /// Creates a new default instance.
321    pub fn new() -> Self {
322        std::default::Default::default()
323    }
324
325    /// Sets the value of [name][crate::model::DeliveryPipeline::name].
326    ///
327    /// # Example
328    /// ```ignore,no_run
329    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
330    /// let x = DeliveryPipeline::new().set_name("example");
331    /// ```
332    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
333        self.name = v.into();
334        self
335    }
336
337    /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
338    ///
339    /// # Example
340    /// ```ignore,no_run
341    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
342    /// let x = DeliveryPipeline::new().set_uid("example");
343    /// ```
344    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
345        self.uid = v.into();
346        self
347    }
348
349    /// Sets the value of [description][crate::model::DeliveryPipeline::description].
350    ///
351    /// # Example
352    /// ```ignore,no_run
353    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
354    /// let x = DeliveryPipeline::new().set_description("example");
355    /// ```
356    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
357        self.description = v.into();
358        self
359    }
360
361    /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
362    ///
363    /// # Example
364    /// ```ignore,no_run
365    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
366    /// let x = DeliveryPipeline::new().set_annotations([
367    ///     ("key0", "abc"),
368    ///     ("key1", "xyz"),
369    /// ]);
370    /// ```
371    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
372    where
373        T: std::iter::IntoIterator<Item = (K, V)>,
374        K: std::convert::Into<std::string::String>,
375        V: std::convert::Into<std::string::String>,
376    {
377        use std::iter::Iterator;
378        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
379        self
380    }
381
382    /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
383    ///
384    /// # Example
385    /// ```ignore,no_run
386    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
387    /// let x = DeliveryPipeline::new().set_labels([
388    ///     ("key0", "abc"),
389    ///     ("key1", "xyz"),
390    /// ]);
391    /// ```
392    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
393    where
394        T: std::iter::IntoIterator<Item = (K, V)>,
395        K: std::convert::Into<std::string::String>,
396        V: std::convert::Into<std::string::String>,
397    {
398        use std::iter::Iterator;
399        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
400        self
401    }
402
403    /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
404    ///
405    /// # Example
406    /// ```ignore,no_run
407    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
408    /// use wkt::Timestamp;
409    /// let x = DeliveryPipeline::new().set_create_time(Timestamp::default()/* use setters */);
410    /// ```
411    pub fn set_create_time<T>(mut self, v: T) -> Self
412    where
413        T: std::convert::Into<wkt::Timestamp>,
414    {
415        self.create_time = std::option::Option::Some(v.into());
416        self
417    }
418
419    /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
420    ///
421    /// # Example
422    /// ```ignore,no_run
423    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
424    /// use wkt::Timestamp;
425    /// let x = DeliveryPipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
426    /// let x = DeliveryPipeline::new().set_or_clear_create_time(None::<Timestamp>);
427    /// ```
428    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
429    where
430        T: std::convert::Into<wkt::Timestamp>,
431    {
432        self.create_time = v.map(|x| x.into());
433        self
434    }
435
436    /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
437    ///
438    /// # Example
439    /// ```ignore,no_run
440    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
441    /// use wkt::Timestamp;
442    /// let x = DeliveryPipeline::new().set_update_time(Timestamp::default()/* use setters */);
443    /// ```
444    pub fn set_update_time<T>(mut self, v: T) -> Self
445    where
446        T: std::convert::Into<wkt::Timestamp>,
447    {
448        self.update_time = std::option::Option::Some(v.into());
449        self
450    }
451
452    /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
453    ///
454    /// # Example
455    /// ```ignore,no_run
456    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
457    /// use wkt::Timestamp;
458    /// let x = DeliveryPipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
459    /// let x = DeliveryPipeline::new().set_or_clear_update_time(None::<Timestamp>);
460    /// ```
461    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
462    where
463        T: std::convert::Into<wkt::Timestamp>,
464    {
465        self.update_time = v.map(|x| x.into());
466        self
467    }
468
469    /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
470    ///
471    /// # Example
472    /// ```ignore,no_run
473    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
474    /// use google_cloud_deploy_v1::model::PipelineCondition;
475    /// let x = DeliveryPipeline::new().set_condition(PipelineCondition::default()/* use setters */);
476    /// ```
477    pub fn set_condition<T>(mut self, v: T) -> Self
478    where
479        T: std::convert::Into<crate::model::PipelineCondition>,
480    {
481        self.condition = std::option::Option::Some(v.into());
482        self
483    }
484
485    /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
486    ///
487    /// # Example
488    /// ```ignore,no_run
489    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
490    /// use google_cloud_deploy_v1::model::PipelineCondition;
491    /// let x = DeliveryPipeline::new().set_or_clear_condition(Some(PipelineCondition::default()/* use setters */));
492    /// let x = DeliveryPipeline::new().set_or_clear_condition(None::<PipelineCondition>);
493    /// ```
494    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
495    where
496        T: std::convert::Into<crate::model::PipelineCondition>,
497    {
498        self.condition = v.map(|x| x.into());
499        self
500    }
501
502    /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
503    ///
504    /// # Example
505    /// ```ignore,no_run
506    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
507    /// let x = DeliveryPipeline::new().set_etag("example");
508    /// ```
509    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
510        self.etag = v.into();
511        self
512    }
513
514    /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
515    ///
516    /// # Example
517    /// ```ignore,no_run
518    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
519    /// let x = DeliveryPipeline::new().set_suspended(true);
520    /// ```
521    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
522        self.suspended = v.into();
523        self
524    }
525
526    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
527    ///
528    /// Note that all the setters affecting `pipeline` are mutually
529    /// exclusive.
530    ///
531    /// # Example
532    /// ```ignore,no_run
533    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
534    /// use google_cloud_deploy_v1::model::SerialPipeline;
535    /// let x = DeliveryPipeline::new().set_pipeline(Some(
536    ///     google_cloud_deploy_v1::model::delivery_pipeline::Pipeline::SerialPipeline(SerialPipeline::default().into())));
537    /// ```
538    pub fn set_pipeline<
539        T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
540    >(
541        mut self,
542        v: T,
543    ) -> Self {
544        self.pipeline = v.into();
545        self
546    }
547
548    /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
549    /// if it holds a `SerialPipeline`, `None` if the field is not set or
550    /// holds a different branch.
551    pub fn serial_pipeline(
552        &self,
553    ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
554        #[allow(unreachable_patterns)]
555        self.pipeline.as_ref().and_then(|v| match v {
556            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
557                std::option::Option::Some(v)
558            }
559            _ => std::option::Option::None,
560        })
561    }
562
563    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
564    /// to hold a `SerialPipeline`.
565    ///
566    /// Note that all the setters affecting `pipeline` are
567    /// mutually exclusive.
568    ///
569    /// # Example
570    /// ```ignore,no_run
571    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
572    /// use google_cloud_deploy_v1::model::SerialPipeline;
573    /// let x = DeliveryPipeline::new().set_serial_pipeline(SerialPipeline::default()/* use setters */);
574    /// assert!(x.serial_pipeline().is_some());
575    /// ```
576    pub fn set_serial_pipeline<
577        T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
578    >(
579        mut self,
580        v: T,
581    ) -> Self {
582        self.pipeline = std::option::Option::Some(
583            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
584        );
585        self
586    }
587}
588
589impl wkt::message::Message for DeliveryPipeline {
590    fn typename() -> &'static str {
591        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
592    }
593}
594
595/// Defines additional types related to [DeliveryPipeline].
596pub mod delivery_pipeline {
597    #[allow(unused_imports)]
598    use super::*;
599
600    /// The ordering configuration of the `DeliveryPipeline`.
601    #[derive(Clone, Debug, PartialEq)]
602    #[non_exhaustive]
603    pub enum Pipeline {
604        /// Optional. SerialPipeline defines a sequential set of stages for a
605        /// `DeliveryPipeline`.
606        SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
607    }
608}
609
610/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
611#[derive(Clone, Default, PartialEq)]
612#[non_exhaustive]
613pub struct SerialPipeline {
614    /// Optional. Each stage specifies configuration for a `Target`. The ordering
615    /// of this list defines the promotion flow.
616    pub stages: std::vec::Vec<crate::model::Stage>,
617
618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
619}
620
621impl SerialPipeline {
622    /// Creates a new default instance.
623    pub fn new() -> Self {
624        std::default::Default::default()
625    }
626
627    /// Sets the value of [stages][crate::model::SerialPipeline::stages].
628    ///
629    /// # Example
630    /// ```ignore,no_run
631    /// # use google_cloud_deploy_v1::model::SerialPipeline;
632    /// use google_cloud_deploy_v1::model::Stage;
633    /// let x = SerialPipeline::new()
634    ///     .set_stages([
635    ///         Stage::default()/* use setters */,
636    ///         Stage::default()/* use (different) setters */,
637    ///     ]);
638    /// ```
639    pub fn set_stages<T, V>(mut self, v: T) -> Self
640    where
641        T: std::iter::IntoIterator<Item = V>,
642        V: std::convert::Into<crate::model::Stage>,
643    {
644        use std::iter::Iterator;
645        self.stages = v.into_iter().map(|i| i.into()).collect();
646        self
647    }
648}
649
650impl wkt::message::Message for SerialPipeline {
651    fn typename() -> &'static str {
652        "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
653    }
654}
655
656/// Stage specifies a location to which to deploy.
657#[derive(Clone, Default, PartialEq)]
658#[non_exhaustive]
659pub struct Stage {
660    /// Optional. The target_id to which this stage points. This field refers
661    /// exclusively to the last segment of a target name. For example, this field
662    /// would just be `my-target` (rather than
663    /// `projects/project/locations/location/targets/my-target`). The location of
664    /// the `Target` is inferred to be the same as the location of the
665    /// `DeliveryPipeline` that contains this `Stage`.
666    pub target_id: std::string::String,
667
668    /// Optional. Skaffold profiles to use when rendering the manifest for this
669    /// stage's `Target`.
670    pub profiles: std::vec::Vec<std::string::String>,
671
672    /// Optional. The strategy to use for a `Rollout` to this stage.
673    pub strategy: std::option::Option<crate::model::Strategy>,
674
675    /// Optional. The deploy parameters to use for the target in this stage.
676    pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
677
678    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
679}
680
681impl Stage {
682    /// Creates a new default instance.
683    pub fn new() -> Self {
684        std::default::Default::default()
685    }
686
687    /// Sets the value of [target_id][crate::model::Stage::target_id].
688    ///
689    /// # Example
690    /// ```ignore,no_run
691    /// # use google_cloud_deploy_v1::model::Stage;
692    /// let x = Stage::new().set_target_id("example");
693    /// ```
694    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
695        self.target_id = v.into();
696        self
697    }
698
699    /// Sets the value of [profiles][crate::model::Stage::profiles].
700    ///
701    /// # Example
702    /// ```ignore,no_run
703    /// # use google_cloud_deploy_v1::model::Stage;
704    /// let x = Stage::new().set_profiles(["a", "b", "c"]);
705    /// ```
706    pub fn set_profiles<T, V>(mut self, v: T) -> Self
707    where
708        T: std::iter::IntoIterator<Item = V>,
709        V: std::convert::Into<std::string::String>,
710    {
711        use std::iter::Iterator;
712        self.profiles = v.into_iter().map(|i| i.into()).collect();
713        self
714    }
715
716    /// Sets the value of [strategy][crate::model::Stage::strategy].
717    ///
718    /// # Example
719    /// ```ignore,no_run
720    /// # use google_cloud_deploy_v1::model::Stage;
721    /// use google_cloud_deploy_v1::model::Strategy;
722    /// let x = Stage::new().set_strategy(Strategy::default()/* use setters */);
723    /// ```
724    pub fn set_strategy<T>(mut self, v: T) -> Self
725    where
726        T: std::convert::Into<crate::model::Strategy>,
727    {
728        self.strategy = std::option::Option::Some(v.into());
729        self
730    }
731
732    /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
733    ///
734    /// # Example
735    /// ```ignore,no_run
736    /// # use google_cloud_deploy_v1::model::Stage;
737    /// use google_cloud_deploy_v1::model::Strategy;
738    /// let x = Stage::new().set_or_clear_strategy(Some(Strategy::default()/* use setters */));
739    /// let x = Stage::new().set_or_clear_strategy(None::<Strategy>);
740    /// ```
741    pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
742    where
743        T: std::convert::Into<crate::model::Strategy>,
744    {
745        self.strategy = v.map(|x| x.into());
746        self
747    }
748
749    /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
750    ///
751    /// # Example
752    /// ```ignore,no_run
753    /// # use google_cloud_deploy_v1::model::Stage;
754    /// use google_cloud_deploy_v1::model::DeployParameters;
755    /// let x = Stage::new()
756    ///     .set_deploy_parameters([
757    ///         DeployParameters::default()/* use setters */,
758    ///         DeployParameters::default()/* use (different) setters */,
759    ///     ]);
760    /// ```
761    pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
762    where
763        T: std::iter::IntoIterator<Item = V>,
764        V: std::convert::Into<crate::model::DeployParameters>,
765    {
766        use std::iter::Iterator;
767        self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
768        self
769    }
770}
771
772impl wkt::message::Message for Stage {
773    fn typename() -> &'static str {
774        "type.googleapis.com/google.cloud.deploy.v1.Stage"
775    }
776}
777
778/// DeployParameters contains deploy parameters information.
779#[derive(Clone, Default, PartialEq)]
780#[non_exhaustive]
781pub struct DeployParameters {
782    /// Required. Values are deploy parameters in key-value pairs.
783    pub values: std::collections::HashMap<std::string::String, std::string::String>,
784
785    /// Optional. Deploy parameters are applied to targets with match labels.
786    /// If unspecified, deploy parameters are applied to all targets (including
787    /// child targets of a multi-target).
788    pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
789
790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
791}
792
793impl DeployParameters {
794    /// Creates a new default instance.
795    pub fn new() -> Self {
796        std::default::Default::default()
797    }
798
799    /// Sets the value of [values][crate::model::DeployParameters::values].
800    ///
801    /// # Example
802    /// ```ignore,no_run
803    /// # use google_cloud_deploy_v1::model::DeployParameters;
804    /// let x = DeployParameters::new().set_values([
805    ///     ("key0", "abc"),
806    ///     ("key1", "xyz"),
807    /// ]);
808    /// ```
809    pub fn set_values<T, K, V>(mut self, v: T) -> Self
810    where
811        T: std::iter::IntoIterator<Item = (K, V)>,
812        K: std::convert::Into<std::string::String>,
813        V: std::convert::Into<std::string::String>,
814    {
815        use std::iter::Iterator;
816        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
817        self
818    }
819
820    /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
821    ///
822    /// # Example
823    /// ```ignore,no_run
824    /// # use google_cloud_deploy_v1::model::DeployParameters;
825    /// let x = DeployParameters::new().set_match_target_labels([
826    ///     ("key0", "abc"),
827    ///     ("key1", "xyz"),
828    /// ]);
829    /// ```
830    pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
831    where
832        T: std::iter::IntoIterator<Item = (K, V)>,
833        K: std::convert::Into<std::string::String>,
834        V: std::convert::Into<std::string::String>,
835    {
836        use std::iter::Iterator;
837        self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
838        self
839    }
840}
841
842impl wkt::message::Message for DeployParameters {
843    fn typename() -> &'static str {
844        "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
845    }
846}
847
848/// Strategy contains deployment strategy information.
849#[derive(Clone, Default, PartialEq)]
850#[non_exhaustive]
851pub struct Strategy {
852    /// Deployment strategy details.
853    pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
854
855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
856}
857
858impl Strategy {
859    /// Creates a new default instance.
860    pub fn new() -> Self {
861        std::default::Default::default()
862    }
863
864    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
865    ///
866    /// Note that all the setters affecting `deployment_strategy` are mutually
867    /// exclusive.
868    ///
869    /// # Example
870    /// ```ignore,no_run
871    /// # use google_cloud_deploy_v1::model::Strategy;
872    /// use google_cloud_deploy_v1::model::Standard;
873    /// let x = Strategy::new().set_deployment_strategy(Some(
874    ///     google_cloud_deploy_v1::model::strategy::DeploymentStrategy::Standard(Standard::default().into())));
875    /// ```
876    pub fn set_deployment_strategy<
877        T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
878    >(
879        mut self,
880        v: T,
881    ) -> Self {
882        self.deployment_strategy = v.into();
883        self
884    }
885
886    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
887    /// if it holds a `Standard`, `None` if the field is not set or
888    /// holds a different branch.
889    pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
890        #[allow(unreachable_patterns)]
891        self.deployment_strategy.as_ref().and_then(|v| match v {
892            crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
893            _ => std::option::Option::None,
894        })
895    }
896
897    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
898    /// to hold a `Standard`.
899    ///
900    /// Note that all the setters affecting `deployment_strategy` are
901    /// mutually exclusive.
902    ///
903    /// # Example
904    /// ```ignore,no_run
905    /// # use google_cloud_deploy_v1::model::Strategy;
906    /// use google_cloud_deploy_v1::model::Standard;
907    /// let x = Strategy::new().set_standard(Standard::default()/* use setters */);
908    /// assert!(x.standard().is_some());
909    /// assert!(x.canary().is_none());
910    /// ```
911    pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
912        mut self,
913        v: T,
914    ) -> Self {
915        self.deployment_strategy = std::option::Option::Some(
916            crate::model::strategy::DeploymentStrategy::Standard(v.into()),
917        );
918        self
919    }
920
921    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
922    /// if it holds a `Canary`, `None` if the field is not set or
923    /// holds a different branch.
924    pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
925        #[allow(unreachable_patterns)]
926        self.deployment_strategy.as_ref().and_then(|v| match v {
927            crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
928            _ => std::option::Option::None,
929        })
930    }
931
932    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
933    /// to hold a `Canary`.
934    ///
935    /// Note that all the setters affecting `deployment_strategy` are
936    /// mutually exclusive.
937    ///
938    /// # Example
939    /// ```ignore,no_run
940    /// # use google_cloud_deploy_v1::model::Strategy;
941    /// use google_cloud_deploy_v1::model::Canary;
942    /// let x = Strategy::new().set_canary(Canary::default()/* use setters */);
943    /// assert!(x.canary().is_some());
944    /// assert!(x.standard().is_none());
945    /// ```
946    pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
947        mut self,
948        v: T,
949    ) -> Self {
950        self.deployment_strategy =
951            std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
952        self
953    }
954}
955
956impl wkt::message::Message for Strategy {
957    fn typename() -> &'static str {
958        "type.googleapis.com/google.cloud.deploy.v1.Strategy"
959    }
960}
961
962/// Defines additional types related to [Strategy].
963pub mod strategy {
964    #[allow(unused_imports)]
965    use super::*;
966
967    /// Deployment strategy details.
968    #[derive(Clone, Debug, PartialEq)]
969    #[non_exhaustive]
970    pub enum DeploymentStrategy {
971        /// Optional. Standard deployment strategy executes a single deploy and
972        /// allows verifying the deployment.
973        Standard(std::boxed::Box<crate::model::Standard>),
974        /// Optional. Canary deployment strategy provides progressive percentage
975        /// based deployments to a Target.
976        Canary(std::boxed::Box<crate::model::Canary>),
977    }
978}
979
980/// Predeploy contains the predeploy job configuration information.
981#[derive(Clone, Default, PartialEq)]
982#[non_exhaustive]
983pub struct Predeploy {
984    /// Optional. A sequence of Skaffold custom actions to invoke during execution
985    /// of the predeploy job.
986    pub actions: std::vec::Vec<std::string::String>,
987
988    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
989}
990
991impl Predeploy {
992    /// Creates a new default instance.
993    pub fn new() -> Self {
994        std::default::Default::default()
995    }
996
997    /// Sets the value of [actions][crate::model::Predeploy::actions].
998    ///
999    /// # Example
1000    /// ```ignore,no_run
1001    /// # use google_cloud_deploy_v1::model::Predeploy;
1002    /// let x = Predeploy::new().set_actions(["a", "b", "c"]);
1003    /// ```
1004    pub fn set_actions<T, V>(mut self, v: T) -> Self
1005    where
1006        T: std::iter::IntoIterator<Item = V>,
1007        V: std::convert::Into<std::string::String>,
1008    {
1009        use std::iter::Iterator;
1010        self.actions = v.into_iter().map(|i| i.into()).collect();
1011        self
1012    }
1013}
1014
1015impl wkt::message::Message for Predeploy {
1016    fn typename() -> &'static str {
1017        "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
1018    }
1019}
1020
1021/// Postdeploy contains the postdeploy job configuration information.
1022#[derive(Clone, Default, PartialEq)]
1023#[non_exhaustive]
1024pub struct Postdeploy {
1025    /// Optional. A sequence of Skaffold custom actions to invoke during execution
1026    /// of the postdeploy job.
1027    pub actions: std::vec::Vec<std::string::String>,
1028
1029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1030}
1031
1032impl Postdeploy {
1033    /// Creates a new default instance.
1034    pub fn new() -> Self {
1035        std::default::Default::default()
1036    }
1037
1038    /// Sets the value of [actions][crate::model::Postdeploy::actions].
1039    ///
1040    /// # Example
1041    /// ```ignore,no_run
1042    /// # use google_cloud_deploy_v1::model::Postdeploy;
1043    /// let x = Postdeploy::new().set_actions(["a", "b", "c"]);
1044    /// ```
1045    pub fn set_actions<T, V>(mut self, v: T) -> Self
1046    where
1047        T: std::iter::IntoIterator<Item = V>,
1048        V: std::convert::Into<std::string::String>,
1049    {
1050        use std::iter::Iterator;
1051        self.actions = v.into_iter().map(|i| i.into()).collect();
1052        self
1053    }
1054}
1055
1056impl wkt::message::Message for Postdeploy {
1057    fn typename() -> &'static str {
1058        "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
1059    }
1060}
1061
1062/// Standard represents the standard deployment strategy.
1063#[derive(Clone, Default, PartialEq)]
1064#[non_exhaustive]
1065pub struct Standard {
1066    /// Optional. Whether to verify a deployment via `skaffold verify`.
1067    pub verify: bool,
1068
1069    /// Optional. Configuration for the predeploy job. If this is not configured,
1070    /// the predeploy job will not be present.
1071    pub predeploy: std::option::Option<crate::model::Predeploy>,
1072
1073    /// Optional. Configuration for the postdeploy job. If this is not configured,
1074    /// the postdeploy job will not be present.
1075    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1076
1077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1078}
1079
1080impl Standard {
1081    /// Creates a new default instance.
1082    pub fn new() -> Self {
1083        std::default::Default::default()
1084    }
1085
1086    /// Sets the value of [verify][crate::model::Standard::verify].
1087    ///
1088    /// # Example
1089    /// ```ignore,no_run
1090    /// # use google_cloud_deploy_v1::model::Standard;
1091    /// let x = Standard::new().set_verify(true);
1092    /// ```
1093    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1094        self.verify = v.into();
1095        self
1096    }
1097
1098    /// Sets the value of [predeploy][crate::model::Standard::predeploy].
1099    ///
1100    /// # Example
1101    /// ```ignore,no_run
1102    /// # use google_cloud_deploy_v1::model::Standard;
1103    /// use google_cloud_deploy_v1::model::Predeploy;
1104    /// let x = Standard::new().set_predeploy(Predeploy::default()/* use setters */);
1105    /// ```
1106    pub fn set_predeploy<T>(mut self, v: T) -> Self
1107    where
1108        T: std::convert::Into<crate::model::Predeploy>,
1109    {
1110        self.predeploy = std::option::Option::Some(v.into());
1111        self
1112    }
1113
1114    /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
1115    ///
1116    /// # Example
1117    /// ```ignore,no_run
1118    /// # use google_cloud_deploy_v1::model::Standard;
1119    /// use google_cloud_deploy_v1::model::Predeploy;
1120    /// let x = Standard::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1121    /// let x = Standard::new().set_or_clear_predeploy(None::<Predeploy>);
1122    /// ```
1123    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1124    where
1125        T: std::convert::Into<crate::model::Predeploy>,
1126    {
1127        self.predeploy = v.map(|x| x.into());
1128        self
1129    }
1130
1131    /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
1132    ///
1133    /// # Example
1134    /// ```ignore,no_run
1135    /// # use google_cloud_deploy_v1::model::Standard;
1136    /// use google_cloud_deploy_v1::model::Postdeploy;
1137    /// let x = Standard::new().set_postdeploy(Postdeploy::default()/* use setters */);
1138    /// ```
1139    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1140    where
1141        T: std::convert::Into<crate::model::Postdeploy>,
1142    {
1143        self.postdeploy = std::option::Option::Some(v.into());
1144        self
1145    }
1146
1147    /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
1148    ///
1149    /// # Example
1150    /// ```ignore,no_run
1151    /// # use google_cloud_deploy_v1::model::Standard;
1152    /// use google_cloud_deploy_v1::model::Postdeploy;
1153    /// let x = Standard::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1154    /// let x = Standard::new().set_or_clear_postdeploy(None::<Postdeploy>);
1155    /// ```
1156    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1157    where
1158        T: std::convert::Into<crate::model::Postdeploy>,
1159    {
1160        self.postdeploy = v.map(|x| x.into());
1161        self
1162    }
1163}
1164
1165impl wkt::message::Message for Standard {
1166    fn typename() -> &'static str {
1167        "type.googleapis.com/google.cloud.deploy.v1.Standard"
1168    }
1169}
1170
1171/// Canary represents the canary deployment strategy.
1172#[derive(Clone, Default, PartialEq)]
1173#[non_exhaustive]
1174pub struct Canary {
1175    /// Optional. Runtime specific configurations for the deployment strategy. The
1176    /// runtime configuration is used to determine how Cloud Deploy will split
1177    /// traffic to enable a progressive deployment.
1178    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1179
1180    /// The mode to use for the canary deployment strategy.
1181    pub mode: std::option::Option<crate::model::canary::Mode>,
1182
1183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1184}
1185
1186impl Canary {
1187    /// Creates a new default instance.
1188    pub fn new() -> Self {
1189        std::default::Default::default()
1190    }
1191
1192    /// Sets the value of [runtime_config][crate::model::Canary::runtime_config].
1193    ///
1194    /// # Example
1195    /// ```ignore,no_run
1196    /// # use google_cloud_deploy_v1::model::Canary;
1197    /// use google_cloud_deploy_v1::model::RuntimeConfig;
1198    /// let x = Canary::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
1199    /// ```
1200    pub fn set_runtime_config<T>(mut self, v: T) -> Self
1201    where
1202        T: std::convert::Into<crate::model::RuntimeConfig>,
1203    {
1204        self.runtime_config = std::option::Option::Some(v.into());
1205        self
1206    }
1207
1208    /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
1209    ///
1210    /// # Example
1211    /// ```ignore,no_run
1212    /// # use google_cloud_deploy_v1::model::Canary;
1213    /// use google_cloud_deploy_v1::model::RuntimeConfig;
1214    /// let x = Canary::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
1215    /// let x = Canary::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
1216    /// ```
1217    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1218    where
1219        T: std::convert::Into<crate::model::RuntimeConfig>,
1220    {
1221        self.runtime_config = v.map(|x| x.into());
1222        self
1223    }
1224
1225    /// Sets the value of [mode][crate::model::Canary::mode].
1226    ///
1227    /// Note that all the setters affecting `mode` are mutually
1228    /// exclusive.
1229    ///
1230    /// # Example
1231    /// ```ignore,no_run
1232    /// # use google_cloud_deploy_v1::model::Canary;
1233    /// use google_cloud_deploy_v1::model::CanaryDeployment;
1234    /// let x = Canary::new().set_mode(Some(
1235    ///     google_cloud_deploy_v1::model::canary::Mode::CanaryDeployment(CanaryDeployment::default().into())));
1236    /// ```
1237    pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
1238        mut self,
1239        v: T,
1240    ) -> Self {
1241        self.mode = v.into();
1242        self
1243    }
1244
1245    /// The value of [mode][crate::model::Canary::mode]
1246    /// if it holds a `CanaryDeployment`, `None` if the field is not set or
1247    /// holds a different branch.
1248    pub fn canary_deployment(
1249        &self,
1250    ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
1251        #[allow(unreachable_patterns)]
1252        self.mode.as_ref().and_then(|v| match v {
1253            crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
1254            _ => std::option::Option::None,
1255        })
1256    }
1257
1258    /// Sets the value of [mode][crate::model::Canary::mode]
1259    /// to hold a `CanaryDeployment`.
1260    ///
1261    /// Note that all the setters affecting `mode` are
1262    /// mutually exclusive.
1263    ///
1264    /// # Example
1265    /// ```ignore,no_run
1266    /// # use google_cloud_deploy_v1::model::Canary;
1267    /// use google_cloud_deploy_v1::model::CanaryDeployment;
1268    /// let x = Canary::new().set_canary_deployment(CanaryDeployment::default()/* use setters */);
1269    /// assert!(x.canary_deployment().is_some());
1270    /// assert!(x.custom_canary_deployment().is_none());
1271    /// ```
1272    pub fn set_canary_deployment<
1273        T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
1274    >(
1275        mut self,
1276        v: T,
1277    ) -> Self {
1278        self.mode =
1279            std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
1280        self
1281    }
1282
1283    /// The value of [mode][crate::model::Canary::mode]
1284    /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
1285    /// holds a different branch.
1286    pub fn custom_canary_deployment(
1287        &self,
1288    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
1289        #[allow(unreachable_patterns)]
1290        self.mode.as_ref().and_then(|v| match v {
1291            crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
1292            _ => std::option::Option::None,
1293        })
1294    }
1295
1296    /// Sets the value of [mode][crate::model::Canary::mode]
1297    /// to hold a `CustomCanaryDeployment`.
1298    ///
1299    /// Note that all the setters affecting `mode` are
1300    /// mutually exclusive.
1301    ///
1302    /// # Example
1303    /// ```ignore,no_run
1304    /// # use google_cloud_deploy_v1::model::Canary;
1305    /// use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1306    /// let x = Canary::new().set_custom_canary_deployment(CustomCanaryDeployment::default()/* use setters */);
1307    /// assert!(x.custom_canary_deployment().is_some());
1308    /// assert!(x.canary_deployment().is_none());
1309    /// ```
1310    pub fn set_custom_canary_deployment<
1311        T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
1312    >(
1313        mut self,
1314        v: T,
1315    ) -> Self {
1316        self.mode =
1317            std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
1318        self
1319    }
1320}
1321
1322impl wkt::message::Message for Canary {
1323    fn typename() -> &'static str {
1324        "type.googleapis.com/google.cloud.deploy.v1.Canary"
1325    }
1326}
1327
1328/// Defines additional types related to [Canary].
1329pub mod canary {
1330    #[allow(unused_imports)]
1331    use super::*;
1332
1333    /// The mode to use for the canary deployment strategy.
1334    #[derive(Clone, Debug, PartialEq)]
1335    #[non_exhaustive]
1336    pub enum Mode {
1337        /// Optional. Configures the progressive based deployment for a Target.
1338        CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
1339        /// Optional. Configures the progressive based deployment for a Target, but
1340        /// allows customizing at the phase level where a phase represents each of
1341        /// the percentage deployments.
1342        CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
1343    }
1344}
1345
1346/// CanaryDeployment represents the canary deployment configuration
1347#[derive(Clone, Default, PartialEq)]
1348#[non_exhaustive]
1349pub struct CanaryDeployment {
1350    /// Required. The percentage based deployments that will occur as a part of a
1351    /// `Rollout`. List is expected in ascending order and each integer n is
1352    /// 0 <= n < 100.
1353    /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
1354    /// n is 0 <= n <= 100.
1355    pub percentages: std::vec::Vec<i32>,
1356
1357    /// Optional. Whether to run verify tests after each percentage deployment via
1358    /// `skaffold verify`.
1359    pub verify: bool,
1360
1361    /// Optional. Configuration for the predeploy job of the first phase. If this
1362    /// is not configured, there will be no predeploy job for this phase.
1363    pub predeploy: std::option::Option<crate::model::Predeploy>,
1364
1365    /// Optional. Configuration for the postdeploy job of the last phase. If this
1366    /// is not configured, there will be no postdeploy job for this phase.
1367    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1368
1369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1370}
1371
1372impl CanaryDeployment {
1373    /// Creates a new default instance.
1374    pub fn new() -> Self {
1375        std::default::Default::default()
1376    }
1377
1378    /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1379    ///
1380    /// # Example
1381    /// ```ignore,no_run
1382    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1383    /// let x = CanaryDeployment::new().set_percentages([1, 2, 3]);
1384    /// ```
1385    pub fn set_percentages<T, V>(mut self, v: T) -> Self
1386    where
1387        T: std::iter::IntoIterator<Item = V>,
1388        V: std::convert::Into<i32>,
1389    {
1390        use std::iter::Iterator;
1391        self.percentages = v.into_iter().map(|i| i.into()).collect();
1392        self
1393    }
1394
1395    /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1396    ///
1397    /// # Example
1398    /// ```ignore,no_run
1399    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1400    /// let x = CanaryDeployment::new().set_verify(true);
1401    /// ```
1402    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1403        self.verify = v.into();
1404        self
1405    }
1406
1407    /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1408    ///
1409    /// # Example
1410    /// ```ignore,no_run
1411    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1412    /// use google_cloud_deploy_v1::model::Predeploy;
1413    /// let x = CanaryDeployment::new().set_predeploy(Predeploy::default()/* use setters */);
1414    /// ```
1415    pub fn set_predeploy<T>(mut self, v: T) -> Self
1416    where
1417        T: std::convert::Into<crate::model::Predeploy>,
1418    {
1419        self.predeploy = std::option::Option::Some(v.into());
1420        self
1421    }
1422
1423    /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1424    ///
1425    /// # Example
1426    /// ```ignore,no_run
1427    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1428    /// use google_cloud_deploy_v1::model::Predeploy;
1429    /// let x = CanaryDeployment::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1430    /// let x = CanaryDeployment::new().set_or_clear_predeploy(None::<Predeploy>);
1431    /// ```
1432    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1433    where
1434        T: std::convert::Into<crate::model::Predeploy>,
1435    {
1436        self.predeploy = v.map(|x| x.into());
1437        self
1438    }
1439
1440    /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1441    ///
1442    /// # Example
1443    /// ```ignore,no_run
1444    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1445    /// use google_cloud_deploy_v1::model::Postdeploy;
1446    /// let x = CanaryDeployment::new().set_postdeploy(Postdeploy::default()/* use setters */);
1447    /// ```
1448    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1449    where
1450        T: std::convert::Into<crate::model::Postdeploy>,
1451    {
1452        self.postdeploy = std::option::Option::Some(v.into());
1453        self
1454    }
1455
1456    /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1457    ///
1458    /// # Example
1459    /// ```ignore,no_run
1460    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1461    /// use google_cloud_deploy_v1::model::Postdeploy;
1462    /// let x = CanaryDeployment::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1463    /// let x = CanaryDeployment::new().set_or_clear_postdeploy(None::<Postdeploy>);
1464    /// ```
1465    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1466    where
1467        T: std::convert::Into<crate::model::Postdeploy>,
1468    {
1469        self.postdeploy = v.map(|x| x.into());
1470        self
1471    }
1472}
1473
1474impl wkt::message::Message for CanaryDeployment {
1475    fn typename() -> &'static str {
1476        "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1477    }
1478}
1479
1480/// CustomCanaryDeployment represents the custom canary deployment
1481/// configuration.
1482#[derive(Clone, Default, PartialEq)]
1483#[non_exhaustive]
1484pub struct CustomCanaryDeployment {
1485    /// Required. Configuration for each phase in the canary deployment in the
1486    /// order executed.
1487    pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1488
1489    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1490}
1491
1492impl CustomCanaryDeployment {
1493    /// Creates a new default instance.
1494    pub fn new() -> Self {
1495        std::default::Default::default()
1496    }
1497
1498    /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1499    ///
1500    /// # Example
1501    /// ```ignore,no_run
1502    /// # use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1503    /// use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1504    /// let x = CustomCanaryDeployment::new()
1505    ///     .set_phase_configs([
1506    ///         PhaseConfig::default()/* use setters */,
1507    ///         PhaseConfig::default()/* use (different) setters */,
1508    ///     ]);
1509    /// ```
1510    pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1511    where
1512        T: std::iter::IntoIterator<Item = V>,
1513        V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1514    {
1515        use std::iter::Iterator;
1516        self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1517        self
1518    }
1519}
1520
1521impl wkt::message::Message for CustomCanaryDeployment {
1522    fn typename() -> &'static str {
1523        "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1524    }
1525}
1526
1527/// Defines additional types related to [CustomCanaryDeployment].
1528pub mod custom_canary_deployment {
1529    #[allow(unused_imports)]
1530    use super::*;
1531
1532    /// PhaseConfig represents the configuration for a phase in the custom
1533    /// canary deployment.
1534    #[derive(Clone, Default, PartialEq)]
1535    #[non_exhaustive]
1536    pub struct PhaseConfig {
1537        /// Required. The ID to assign to the `Rollout` phase.
1538        /// This value must consist of lower-case letters, numbers, and hyphens,
1539        /// start with a letter and end with a letter or a number, and have a max
1540        /// length of 63 characters. In other words, it must match the following
1541        /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1542        pub phase_id: std::string::String,
1543
1544        /// Required. Percentage deployment for the phase.
1545        pub percentage: i32,
1546
1547        /// Optional. Skaffold profiles to use when rendering the manifest for this
1548        /// phase. These are in addition to the profiles list specified in the
1549        /// `DeliveryPipeline` stage.
1550        pub profiles: std::vec::Vec<std::string::String>,
1551
1552        /// Optional. Whether to run verify tests after the deployment via `skaffold
1553        /// verify`.
1554        pub verify: bool,
1555
1556        /// Optional. Configuration for the predeploy job of this phase. If this is
1557        /// not configured, there will be no predeploy job for this phase.
1558        pub predeploy: std::option::Option<crate::model::Predeploy>,
1559
1560        /// Optional. Configuration for the postdeploy job of this phase. If this is
1561        /// not configured, there will be no postdeploy job for this phase.
1562        pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1563
1564        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1565    }
1566
1567    impl PhaseConfig {
1568        /// Creates a new default instance.
1569        pub fn new() -> Self {
1570            std::default::Default::default()
1571        }
1572
1573        /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1574        ///
1575        /// # Example
1576        /// ```ignore,no_run
1577        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1578        /// let x = PhaseConfig::new().set_phase_id("example");
1579        /// ```
1580        pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1581            self.phase_id = v.into();
1582            self
1583        }
1584
1585        /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1586        ///
1587        /// # Example
1588        /// ```ignore,no_run
1589        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1590        /// let x = PhaseConfig::new().set_percentage(42);
1591        /// ```
1592        pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1593            self.percentage = v.into();
1594            self
1595        }
1596
1597        /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1598        ///
1599        /// # Example
1600        /// ```ignore,no_run
1601        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1602        /// let x = PhaseConfig::new().set_profiles(["a", "b", "c"]);
1603        /// ```
1604        pub fn set_profiles<T, V>(mut self, v: T) -> Self
1605        where
1606            T: std::iter::IntoIterator<Item = V>,
1607            V: std::convert::Into<std::string::String>,
1608        {
1609            use std::iter::Iterator;
1610            self.profiles = v.into_iter().map(|i| i.into()).collect();
1611            self
1612        }
1613
1614        /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1615        ///
1616        /// # Example
1617        /// ```ignore,no_run
1618        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1619        /// let x = PhaseConfig::new().set_verify(true);
1620        /// ```
1621        pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1622            self.verify = v.into();
1623            self
1624        }
1625
1626        /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1627        ///
1628        /// # Example
1629        /// ```ignore,no_run
1630        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1631        /// use google_cloud_deploy_v1::model::Predeploy;
1632        /// let x = PhaseConfig::new().set_predeploy(Predeploy::default()/* use setters */);
1633        /// ```
1634        pub fn set_predeploy<T>(mut self, v: T) -> Self
1635        where
1636            T: std::convert::Into<crate::model::Predeploy>,
1637        {
1638            self.predeploy = std::option::Option::Some(v.into());
1639            self
1640        }
1641
1642        /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1643        ///
1644        /// # Example
1645        /// ```ignore,no_run
1646        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1647        /// use google_cloud_deploy_v1::model::Predeploy;
1648        /// let x = PhaseConfig::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1649        /// let x = PhaseConfig::new().set_or_clear_predeploy(None::<Predeploy>);
1650        /// ```
1651        pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1652        where
1653            T: std::convert::Into<crate::model::Predeploy>,
1654        {
1655            self.predeploy = v.map(|x| x.into());
1656            self
1657        }
1658
1659        /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1660        ///
1661        /// # Example
1662        /// ```ignore,no_run
1663        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1664        /// use google_cloud_deploy_v1::model::Postdeploy;
1665        /// let x = PhaseConfig::new().set_postdeploy(Postdeploy::default()/* use setters */);
1666        /// ```
1667        pub fn set_postdeploy<T>(mut self, v: T) -> Self
1668        where
1669            T: std::convert::Into<crate::model::Postdeploy>,
1670        {
1671            self.postdeploy = std::option::Option::Some(v.into());
1672            self
1673        }
1674
1675        /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1676        ///
1677        /// # Example
1678        /// ```ignore,no_run
1679        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1680        /// use google_cloud_deploy_v1::model::Postdeploy;
1681        /// let x = PhaseConfig::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1682        /// let x = PhaseConfig::new().set_or_clear_postdeploy(None::<Postdeploy>);
1683        /// ```
1684        pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1685        where
1686            T: std::convert::Into<crate::model::Postdeploy>,
1687        {
1688            self.postdeploy = v.map(|x| x.into());
1689            self
1690        }
1691    }
1692
1693    impl wkt::message::Message for PhaseConfig {
1694        fn typename() -> &'static str {
1695            "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1696        }
1697    }
1698}
1699
1700/// KubernetesConfig contains the Kubernetes runtime configuration.
1701#[derive(Clone, Default, PartialEq)]
1702#[non_exhaustive]
1703pub struct KubernetesConfig {
1704    /// The service definition configuration.
1705    pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1706
1707    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1708}
1709
1710impl KubernetesConfig {
1711    /// Creates a new default instance.
1712    pub fn new() -> Self {
1713        std::default::Default::default()
1714    }
1715
1716    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1717    ///
1718    /// Note that all the setters affecting `service_definition` are mutually
1719    /// exclusive.
1720    ///
1721    /// # Example
1722    /// ```ignore,no_run
1723    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1724    /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1725    /// let x = KubernetesConfig::new().set_service_definition(Some(
1726    ///     google_cloud_deploy_v1::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(GatewayServiceMesh::default().into())));
1727    /// ```
1728    pub fn set_service_definition<
1729        T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1730    >(
1731        mut self,
1732        v: T,
1733    ) -> Self {
1734        self.service_definition = v.into();
1735        self
1736    }
1737
1738    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1739    /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1740    /// holds a different branch.
1741    pub fn gateway_service_mesh(
1742        &self,
1743    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1744    {
1745        #[allow(unreachable_patterns)]
1746        self.service_definition.as_ref().and_then(|v| match v {
1747            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1748                std::option::Option::Some(v)
1749            }
1750            _ => std::option::Option::None,
1751        })
1752    }
1753
1754    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1755    /// to hold a `GatewayServiceMesh`.
1756    ///
1757    /// Note that all the setters affecting `service_definition` are
1758    /// mutually exclusive.
1759    ///
1760    /// # Example
1761    /// ```ignore,no_run
1762    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1763    /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1764    /// let x = KubernetesConfig::new().set_gateway_service_mesh(GatewayServiceMesh::default()/* use setters */);
1765    /// assert!(x.gateway_service_mesh().is_some());
1766    /// assert!(x.service_networking().is_none());
1767    /// ```
1768    pub fn set_gateway_service_mesh<
1769        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1770    >(
1771        mut self,
1772        v: T,
1773    ) -> Self {
1774        self.service_definition = std::option::Option::Some(
1775            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1776        );
1777        self
1778    }
1779
1780    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1781    /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1782    /// holds a different branch.
1783    pub fn service_networking(
1784        &self,
1785    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1786    {
1787        #[allow(unreachable_patterns)]
1788        self.service_definition.as_ref().and_then(|v| match v {
1789            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1790                std::option::Option::Some(v)
1791            }
1792            _ => std::option::Option::None,
1793        })
1794    }
1795
1796    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1797    /// to hold a `ServiceNetworking`.
1798    ///
1799    /// Note that all the setters affecting `service_definition` are
1800    /// mutually exclusive.
1801    ///
1802    /// # Example
1803    /// ```ignore,no_run
1804    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1805    /// use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
1806    /// let x = KubernetesConfig::new().set_service_networking(ServiceNetworking::default()/* use setters */);
1807    /// assert!(x.service_networking().is_some());
1808    /// assert!(x.gateway_service_mesh().is_none());
1809    /// ```
1810    pub fn set_service_networking<
1811        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1812    >(
1813        mut self,
1814        v: T,
1815    ) -> Self {
1816        self.service_definition = std::option::Option::Some(
1817            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1818        );
1819        self
1820    }
1821}
1822
1823impl wkt::message::Message for KubernetesConfig {
1824    fn typename() -> &'static str {
1825        "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1826    }
1827}
1828
1829/// Defines additional types related to [KubernetesConfig].
1830pub mod kubernetes_config {
1831    #[allow(unused_imports)]
1832    use super::*;
1833
1834    /// Information about the Kubernetes Gateway API service mesh configuration.
1835    #[derive(Clone, Default, PartialEq)]
1836    #[non_exhaustive]
1837    pub struct GatewayServiceMesh {
1838        /// Required. Name of the Gateway API HTTPRoute.
1839        pub http_route: std::string::String,
1840
1841        /// Required. Name of the Kubernetes Service.
1842        pub service: std::string::String,
1843
1844        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1845        /// the specified HTTPRoute and Service.
1846        pub deployment: std::string::String,
1847
1848        /// Optional. The time to wait for route updates to propagate. The maximum
1849        /// configurable time is 3 hours, in seconds format. If unspecified, there is
1850        /// no wait time.
1851        pub route_update_wait_time: std::option::Option<wkt::Duration>,
1852
1853        /// Optional. The amount of time to migrate traffic back from the canary
1854        /// Service to the original Service during the stable phase deployment. If
1855        /// specified, must be between 15s and 3600s. If unspecified, there is no
1856        /// cutback time.
1857        pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1858
1859        /// Optional. The label to use when selecting Pods for the Deployment and
1860        /// Service resources. This label must already be present in both resources.
1861        pub pod_selector_label: std::string::String,
1862
1863        /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1864        /// to be deployed to additional clusters. This option is available for
1865        /// multi-cluster service mesh set ups that require the route to exist in the
1866        /// clusters that call the service. If unspecified, the HTTPRoute will only
1867        /// be deployed to the Target cluster.
1868        pub route_destinations: std::option::Option<
1869            crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1870        >,
1871
1872        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1873    }
1874
1875    impl GatewayServiceMesh {
1876        /// Creates a new default instance.
1877        pub fn new() -> Self {
1878            std::default::Default::default()
1879        }
1880
1881        /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1882        ///
1883        /// # Example
1884        /// ```ignore,no_run
1885        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1886        /// let x = GatewayServiceMesh::new().set_http_route("example");
1887        /// ```
1888        pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1889            self.http_route = v.into();
1890            self
1891        }
1892
1893        /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1894        ///
1895        /// # Example
1896        /// ```ignore,no_run
1897        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1898        /// let x = GatewayServiceMesh::new().set_service("example");
1899        /// ```
1900        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1901            self.service = v.into();
1902            self
1903        }
1904
1905        /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1906        ///
1907        /// # Example
1908        /// ```ignore,no_run
1909        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1910        /// let x = GatewayServiceMesh::new().set_deployment("example");
1911        /// ```
1912        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1913            self.deployment = v.into();
1914            self
1915        }
1916
1917        /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1918        ///
1919        /// # Example
1920        /// ```ignore,no_run
1921        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1922        /// use wkt::Duration;
1923        /// let x = GatewayServiceMesh::new().set_route_update_wait_time(Duration::default()/* use setters */);
1924        /// ```
1925        pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1926        where
1927            T: std::convert::Into<wkt::Duration>,
1928        {
1929            self.route_update_wait_time = std::option::Option::Some(v.into());
1930            self
1931        }
1932
1933        /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1934        ///
1935        /// # Example
1936        /// ```ignore,no_run
1937        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1938        /// use wkt::Duration;
1939        /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(Some(Duration::default()/* use setters */));
1940        /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(None::<Duration>);
1941        /// ```
1942        pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1943        where
1944            T: std::convert::Into<wkt::Duration>,
1945        {
1946            self.route_update_wait_time = v.map(|x| x.into());
1947            self
1948        }
1949
1950        /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1951        ///
1952        /// # Example
1953        /// ```ignore,no_run
1954        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1955        /// use wkt::Duration;
1956        /// let x = GatewayServiceMesh::new().set_stable_cutback_duration(Duration::default()/* use setters */);
1957        /// ```
1958        pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1959        where
1960            T: std::convert::Into<wkt::Duration>,
1961        {
1962            self.stable_cutback_duration = std::option::Option::Some(v.into());
1963            self
1964        }
1965
1966        /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1967        ///
1968        /// # Example
1969        /// ```ignore,no_run
1970        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1971        /// use wkt::Duration;
1972        /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(Some(Duration::default()/* use setters */));
1973        /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(None::<Duration>);
1974        /// ```
1975        pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1976        where
1977            T: std::convert::Into<wkt::Duration>,
1978        {
1979            self.stable_cutback_duration = v.map(|x| x.into());
1980            self
1981        }
1982
1983        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1984        ///
1985        /// # Example
1986        /// ```ignore,no_run
1987        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1988        /// let x = GatewayServiceMesh::new().set_pod_selector_label("example");
1989        /// ```
1990        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1991            mut self,
1992            v: T,
1993        ) -> Self {
1994            self.pod_selector_label = v.into();
1995            self
1996        }
1997
1998        /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
1999        ///
2000        /// # Example
2001        /// ```ignore,no_run
2002        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2003        /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2004        /// let x = GatewayServiceMesh::new().set_route_destinations(RouteDestinations::default()/* use setters */);
2005        /// ```
2006        pub fn set_route_destinations<T>(mut self, v: T) -> Self
2007        where
2008            T: std::convert::Into<
2009                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2010                >,
2011        {
2012            self.route_destinations = std::option::Option::Some(v.into());
2013            self
2014        }
2015
2016        /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2017        ///
2018        /// # Example
2019        /// ```ignore,no_run
2020        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2021        /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2022        /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(Some(RouteDestinations::default()/* use setters */));
2023        /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(None::<RouteDestinations>);
2024        /// ```
2025        pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
2026        where
2027            T: std::convert::Into<
2028                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2029                >,
2030        {
2031            self.route_destinations = v.map(|x| x.into());
2032            self
2033        }
2034    }
2035
2036    impl wkt::message::Message for GatewayServiceMesh {
2037        fn typename() -> &'static str {
2038            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
2039        }
2040    }
2041
2042    /// Defines additional types related to [GatewayServiceMesh].
2043    pub mod gateway_service_mesh {
2044        #[allow(unused_imports)]
2045        use super::*;
2046
2047        /// Information about route destinations for the Gateway API service mesh.
2048        #[derive(Clone, Default, PartialEq)]
2049        #[non_exhaustive]
2050        pub struct RouteDestinations {
2051            /// Required. The clusters where the Gateway API HTTPRoute resource will be
2052            /// deployed to. Valid entries include the associated entities IDs
2053            /// configured in the Target resource and "@self" to include the Target
2054            /// cluster.
2055            pub destination_ids: std::vec::Vec<std::string::String>,
2056
2057            /// Optional. Whether to propagate the Kubernetes Service to the route
2058            /// destination clusters. The Service will always be deployed to the Target
2059            /// cluster even if the HTTPRoute is not. This option may be used to
2060            /// facilitate successful DNS lookup in the route destination clusters. Can
2061            /// only be set to true if destinations are specified.
2062            pub propagate_service: bool,
2063
2064            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2065        }
2066
2067        impl RouteDestinations {
2068            /// Creates a new default instance.
2069            pub fn new() -> Self {
2070                std::default::Default::default()
2071            }
2072
2073            /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
2074            ///
2075            /// # Example
2076            /// ```ignore,no_run
2077            /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2078            /// let x = RouteDestinations::new().set_destination_ids(["a", "b", "c"]);
2079            /// ```
2080            pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
2081            where
2082                T: std::iter::IntoIterator<Item = V>,
2083                V: std::convert::Into<std::string::String>,
2084            {
2085                use std::iter::Iterator;
2086                self.destination_ids = v.into_iter().map(|i| i.into()).collect();
2087                self
2088            }
2089
2090            /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
2091            ///
2092            /// # Example
2093            /// ```ignore,no_run
2094            /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2095            /// let x = RouteDestinations::new().set_propagate_service(true);
2096            /// ```
2097            pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2098                self.propagate_service = v.into();
2099                self
2100            }
2101        }
2102
2103        impl wkt::message::Message for RouteDestinations {
2104            fn typename() -> &'static str {
2105                "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
2106            }
2107        }
2108    }
2109
2110    /// Information about the Kubernetes Service networking configuration.
2111    #[derive(Clone, Default, PartialEq)]
2112    #[non_exhaustive]
2113    pub struct ServiceNetworking {
2114        /// Required. Name of the Kubernetes Service.
2115        pub service: std::string::String,
2116
2117        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
2118        /// the specified Service.
2119        pub deployment: std::string::String,
2120
2121        /// Optional. Whether to disable Pod overprovisioning. If Pod
2122        /// overprovisioning is disabled then Cloud Deploy will limit the number of
2123        /// total Pods used for the deployment strategy to the number of Pods the
2124        /// Deployment has on the cluster.
2125        pub disable_pod_overprovisioning: bool,
2126
2127        /// Optional. The label to use when selecting Pods for the Deployment
2128        /// resource. This label must already be present in the Deployment.
2129        pub pod_selector_label: std::string::String,
2130
2131        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2132    }
2133
2134    impl ServiceNetworking {
2135        /// Creates a new default instance.
2136        pub fn new() -> Self {
2137            std::default::Default::default()
2138        }
2139
2140        /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
2141        ///
2142        /// # Example
2143        /// ```ignore,no_run
2144        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2145        /// let x = ServiceNetworking::new().set_service("example");
2146        /// ```
2147        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2148            self.service = v.into();
2149            self
2150        }
2151
2152        /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
2153        ///
2154        /// # Example
2155        /// ```ignore,no_run
2156        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2157        /// let x = ServiceNetworking::new().set_deployment("example");
2158        /// ```
2159        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2160            self.deployment = v.into();
2161            self
2162        }
2163
2164        /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
2165        ///
2166        /// # Example
2167        /// ```ignore,no_run
2168        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2169        /// let x = ServiceNetworking::new().set_disable_pod_overprovisioning(true);
2170        /// ```
2171        pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
2172            mut self,
2173            v: T,
2174        ) -> Self {
2175            self.disable_pod_overprovisioning = v.into();
2176            self
2177        }
2178
2179        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
2180        ///
2181        /// # Example
2182        /// ```ignore,no_run
2183        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2184        /// let x = ServiceNetworking::new().set_pod_selector_label("example");
2185        /// ```
2186        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
2187            mut self,
2188            v: T,
2189        ) -> Self {
2190            self.pod_selector_label = v.into();
2191            self
2192        }
2193    }
2194
2195    impl wkt::message::Message for ServiceNetworking {
2196        fn typename() -> &'static str {
2197            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
2198        }
2199    }
2200
2201    /// The service definition configuration.
2202    #[derive(Clone, Debug, PartialEq)]
2203    #[non_exhaustive]
2204    pub enum ServiceDefinition {
2205        /// Optional. Kubernetes Gateway API service mesh configuration.
2206        GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
2207        /// Optional. Kubernetes Service networking configuration.
2208        ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
2209    }
2210}
2211
2212/// CloudRunConfig contains the Cloud Run runtime configuration.
2213#[derive(Clone, Default, PartialEq)]
2214#[non_exhaustive]
2215pub struct CloudRunConfig {
2216    /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
2217    /// Run Service on the user's behalf to facilitate traffic splitting. This is
2218    /// required to be true for CanaryDeployments, but optional for
2219    /// CustomCanaryDeployments.
2220    pub automatic_traffic_control: bool,
2221
2222    /// Optional. A list of tags that are added to the canary revision while the
2223    /// canary phase is in progress.
2224    pub canary_revision_tags: std::vec::Vec<std::string::String>,
2225
2226    /// Optional. A list of tags that are added to the prior revision while the
2227    /// canary phase is in progress.
2228    pub prior_revision_tags: std::vec::Vec<std::string::String>,
2229
2230    /// Optional. A list of tags that are added to the final stable revision when
2231    /// the stable phase is applied.
2232    pub stable_revision_tags: std::vec::Vec<std::string::String>,
2233
2234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2235}
2236
2237impl CloudRunConfig {
2238    /// Creates a new default instance.
2239    pub fn new() -> Self {
2240        std::default::Default::default()
2241    }
2242
2243    /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
2244    ///
2245    /// # Example
2246    /// ```ignore,no_run
2247    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2248    /// let x = CloudRunConfig::new().set_automatic_traffic_control(true);
2249    /// ```
2250    pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2251        self.automatic_traffic_control = v.into();
2252        self
2253    }
2254
2255    /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
2256    ///
2257    /// # Example
2258    /// ```ignore,no_run
2259    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2260    /// let x = CloudRunConfig::new().set_canary_revision_tags(["a", "b", "c"]);
2261    /// ```
2262    pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
2263    where
2264        T: std::iter::IntoIterator<Item = V>,
2265        V: std::convert::Into<std::string::String>,
2266    {
2267        use std::iter::Iterator;
2268        self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
2269        self
2270    }
2271
2272    /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
2273    ///
2274    /// # Example
2275    /// ```ignore,no_run
2276    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2277    /// let x = CloudRunConfig::new().set_prior_revision_tags(["a", "b", "c"]);
2278    /// ```
2279    pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
2280    where
2281        T: std::iter::IntoIterator<Item = V>,
2282        V: std::convert::Into<std::string::String>,
2283    {
2284        use std::iter::Iterator;
2285        self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
2286        self
2287    }
2288
2289    /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
2290    ///
2291    /// # Example
2292    /// ```ignore,no_run
2293    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2294    /// let x = CloudRunConfig::new().set_stable_revision_tags(["a", "b", "c"]);
2295    /// ```
2296    pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
2297    where
2298        T: std::iter::IntoIterator<Item = V>,
2299        V: std::convert::Into<std::string::String>,
2300    {
2301        use std::iter::Iterator;
2302        self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
2303        self
2304    }
2305}
2306
2307impl wkt::message::Message for CloudRunConfig {
2308    fn typename() -> &'static str {
2309        "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
2310    }
2311}
2312
2313/// RuntimeConfig contains the runtime specific configurations for a deployment
2314/// strategy.
2315#[derive(Clone, Default, PartialEq)]
2316#[non_exhaustive]
2317pub struct RuntimeConfig {
2318    /// The runtime configuration details.
2319    pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
2320
2321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl RuntimeConfig {
2325    /// Creates a new default instance.
2326    pub fn new() -> Self {
2327        std::default::Default::default()
2328    }
2329
2330    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
2331    ///
2332    /// Note that all the setters affecting `runtime_config` are mutually
2333    /// exclusive.
2334    ///
2335    /// # Example
2336    /// ```ignore,no_run
2337    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2338    /// use google_cloud_deploy_v1::model::KubernetesConfig;
2339    /// let x = RuntimeConfig::new().set_runtime_config(Some(
2340    ///     google_cloud_deploy_v1::model::runtime_config::RuntimeConfig::Kubernetes(KubernetesConfig::default().into())));
2341    /// ```
2342    pub fn set_runtime_config<
2343        T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
2344    >(
2345        mut self,
2346        v: T,
2347    ) -> Self {
2348        self.runtime_config = v.into();
2349        self
2350    }
2351
2352    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2353    /// if it holds a `Kubernetes`, `None` if the field is not set or
2354    /// holds a different branch.
2355    pub fn kubernetes(
2356        &self,
2357    ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
2358        #[allow(unreachable_patterns)]
2359        self.runtime_config.as_ref().and_then(|v| match v {
2360            crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
2361                std::option::Option::Some(v)
2362            }
2363            _ => std::option::Option::None,
2364        })
2365    }
2366
2367    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2368    /// to hold a `Kubernetes`.
2369    ///
2370    /// Note that all the setters affecting `runtime_config` are
2371    /// mutually exclusive.
2372    ///
2373    /// # Example
2374    /// ```ignore,no_run
2375    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2376    /// use google_cloud_deploy_v1::model::KubernetesConfig;
2377    /// let x = RuntimeConfig::new().set_kubernetes(KubernetesConfig::default()/* use setters */);
2378    /// assert!(x.kubernetes().is_some());
2379    /// assert!(x.cloud_run().is_none());
2380    /// ```
2381    pub fn set_kubernetes<
2382        T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
2383    >(
2384        mut self,
2385        v: T,
2386    ) -> Self {
2387        self.runtime_config = std::option::Option::Some(
2388            crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
2389        );
2390        self
2391    }
2392
2393    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2394    /// if it holds a `CloudRun`, `None` if the field is not set or
2395    /// holds a different branch.
2396    pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
2397        #[allow(unreachable_patterns)]
2398        self.runtime_config.as_ref().and_then(|v| match v {
2399            crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
2400                std::option::Option::Some(v)
2401            }
2402            _ => std::option::Option::None,
2403        })
2404    }
2405
2406    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2407    /// to hold a `CloudRun`.
2408    ///
2409    /// Note that all the setters affecting `runtime_config` are
2410    /// mutually exclusive.
2411    ///
2412    /// # Example
2413    /// ```ignore,no_run
2414    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2415    /// use google_cloud_deploy_v1::model::CloudRunConfig;
2416    /// let x = RuntimeConfig::new().set_cloud_run(CloudRunConfig::default()/* use setters */);
2417    /// assert!(x.cloud_run().is_some());
2418    /// assert!(x.kubernetes().is_none());
2419    /// ```
2420    pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
2421        mut self,
2422        v: T,
2423    ) -> Self {
2424        self.runtime_config = std::option::Option::Some(
2425            crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
2426        );
2427        self
2428    }
2429}
2430
2431impl wkt::message::Message for RuntimeConfig {
2432    fn typename() -> &'static str {
2433        "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
2434    }
2435}
2436
2437/// Defines additional types related to [RuntimeConfig].
2438pub mod runtime_config {
2439    #[allow(unused_imports)]
2440    use super::*;
2441
2442    /// The runtime configuration details.
2443    #[derive(Clone, Debug, PartialEq)]
2444    #[non_exhaustive]
2445    pub enum RuntimeConfig {
2446        /// Optional. Kubernetes runtime configuration.
2447        Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
2448        /// Optional. Cloud Run runtime configuration.
2449        CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
2450    }
2451}
2452
2453/// PipelineReadyCondition contains information around the status of the
2454/// Pipeline.
2455#[derive(Clone, Default, PartialEq)]
2456#[non_exhaustive]
2457pub struct PipelineReadyCondition {
2458    /// True if the Pipeline is in a valid state. Otherwise at least one condition
2459    /// in `PipelineCondition` is in an invalid state. Iterate over those
2460    /// conditions and see which condition(s) has status = false to find out what
2461    /// is wrong with the Pipeline.
2462    pub status: bool,
2463
2464    /// Last time the condition was updated.
2465    pub update_time: std::option::Option<wkt::Timestamp>,
2466
2467    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2468}
2469
2470impl PipelineReadyCondition {
2471    /// Creates a new default instance.
2472    pub fn new() -> Self {
2473        std::default::Default::default()
2474    }
2475
2476    /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
2477    ///
2478    /// # Example
2479    /// ```ignore,no_run
2480    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2481    /// let x = PipelineReadyCondition::new().set_status(true);
2482    /// ```
2483    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2484        self.status = v.into();
2485        self
2486    }
2487
2488    /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2489    ///
2490    /// # Example
2491    /// ```ignore,no_run
2492    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2493    /// use wkt::Timestamp;
2494    /// let x = PipelineReadyCondition::new().set_update_time(Timestamp::default()/* use setters */);
2495    /// ```
2496    pub fn set_update_time<T>(mut self, v: T) -> Self
2497    where
2498        T: std::convert::Into<wkt::Timestamp>,
2499    {
2500        self.update_time = std::option::Option::Some(v.into());
2501        self
2502    }
2503
2504    /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2505    ///
2506    /// # Example
2507    /// ```ignore,no_run
2508    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2509    /// use wkt::Timestamp;
2510    /// let x = PipelineReadyCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2511    /// let x = PipelineReadyCondition::new().set_or_clear_update_time(None::<Timestamp>);
2512    /// ```
2513    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2514    where
2515        T: std::convert::Into<wkt::Timestamp>,
2516    {
2517        self.update_time = v.map(|x| x.into());
2518        self
2519    }
2520}
2521
2522impl wkt::message::Message for PipelineReadyCondition {
2523    fn typename() -> &'static str {
2524        "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
2525    }
2526}
2527
2528/// `TargetsPresentCondition` contains information on any Targets referenced in
2529/// the Delivery Pipeline that do not actually exist.
2530#[derive(Clone, Default, PartialEq)]
2531#[non_exhaustive]
2532pub struct TargetsPresentCondition {
2533    /// True if there aren't any missing Targets.
2534    pub status: bool,
2535
2536    /// The list of Target names that do not exist. For example,
2537    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
2538    pub missing_targets: std::vec::Vec<std::string::String>,
2539
2540    /// Last time the condition was updated.
2541    pub update_time: std::option::Option<wkt::Timestamp>,
2542
2543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2544}
2545
2546impl TargetsPresentCondition {
2547    /// Creates a new default instance.
2548    pub fn new() -> Self {
2549        std::default::Default::default()
2550    }
2551
2552    /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
2553    ///
2554    /// # Example
2555    /// ```ignore,no_run
2556    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2557    /// let x = TargetsPresentCondition::new().set_status(true);
2558    /// ```
2559    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2560        self.status = v.into();
2561        self
2562    }
2563
2564    /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
2565    ///
2566    /// # Example
2567    /// ```ignore,no_run
2568    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2569    /// let x = TargetsPresentCondition::new().set_missing_targets(["a", "b", "c"]);
2570    /// ```
2571    pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
2572    where
2573        T: std::iter::IntoIterator<Item = V>,
2574        V: std::convert::Into<std::string::String>,
2575    {
2576        use std::iter::Iterator;
2577        self.missing_targets = v.into_iter().map(|i| i.into()).collect();
2578        self
2579    }
2580
2581    /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2582    ///
2583    /// # Example
2584    /// ```ignore,no_run
2585    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2586    /// use wkt::Timestamp;
2587    /// let x = TargetsPresentCondition::new().set_update_time(Timestamp::default()/* use setters */);
2588    /// ```
2589    pub fn set_update_time<T>(mut self, v: T) -> Self
2590    where
2591        T: std::convert::Into<wkt::Timestamp>,
2592    {
2593        self.update_time = std::option::Option::Some(v.into());
2594        self
2595    }
2596
2597    /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2598    ///
2599    /// # Example
2600    /// ```ignore,no_run
2601    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2602    /// use wkt::Timestamp;
2603    /// let x = TargetsPresentCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2604    /// let x = TargetsPresentCondition::new().set_or_clear_update_time(None::<Timestamp>);
2605    /// ```
2606    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2607    where
2608        T: std::convert::Into<wkt::Timestamp>,
2609    {
2610        self.update_time = v.map(|x| x.into());
2611        self
2612    }
2613}
2614
2615impl wkt::message::Message for TargetsPresentCondition {
2616    fn typename() -> &'static str {
2617        "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
2618    }
2619}
2620
2621/// TargetsTypeCondition contains information on whether the Targets defined in
2622/// the Delivery Pipeline are of the same type.
2623#[derive(Clone, Default, PartialEq)]
2624#[non_exhaustive]
2625pub struct TargetsTypeCondition {
2626    /// True if the targets are all a comparable type. For example this is true if
2627    /// all targets are GKE clusters. This is false if some targets are Cloud Run
2628    /// targets and others are GKE clusters.
2629    pub status: bool,
2630
2631    /// Human readable error message.
2632    pub error_details: std::string::String,
2633
2634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2635}
2636
2637impl TargetsTypeCondition {
2638    /// Creates a new default instance.
2639    pub fn new() -> Self {
2640        std::default::Default::default()
2641    }
2642
2643    /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
2644    ///
2645    /// # Example
2646    /// ```ignore,no_run
2647    /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2648    /// let x = TargetsTypeCondition::new().set_status(true);
2649    /// ```
2650    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2651        self.status = v.into();
2652        self
2653    }
2654
2655    /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
2656    ///
2657    /// # Example
2658    /// ```ignore,no_run
2659    /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2660    /// let x = TargetsTypeCondition::new().set_error_details("example");
2661    /// ```
2662    pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2663        self.error_details = v.into();
2664        self
2665    }
2666}
2667
2668impl wkt::message::Message for TargetsTypeCondition {
2669    fn typename() -> &'static str {
2670        "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
2671    }
2672}
2673
2674/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
2675#[derive(Clone, Default, PartialEq)]
2676#[non_exhaustive]
2677pub struct PipelineCondition {
2678    /// Details around the Pipeline's overall status.
2679    pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
2680
2681    /// Details around targets enumerated in the pipeline.
2682    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
2683
2684    /// Details on the whether the targets enumerated in the pipeline are of the
2685    /// same type.
2686    pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
2687
2688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2689}
2690
2691impl PipelineCondition {
2692    /// Creates a new default instance.
2693    pub fn new() -> Self {
2694        std::default::Default::default()
2695    }
2696
2697    /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2698    ///
2699    /// # Example
2700    /// ```ignore,no_run
2701    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2702    /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2703    /// let x = PipelineCondition::new().set_pipeline_ready_condition(PipelineReadyCondition::default()/* use setters */);
2704    /// ```
2705    pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
2706    where
2707        T: std::convert::Into<crate::model::PipelineReadyCondition>,
2708    {
2709        self.pipeline_ready_condition = std::option::Option::Some(v.into());
2710        self
2711    }
2712
2713    /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2714    ///
2715    /// # Example
2716    /// ```ignore,no_run
2717    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2718    /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2719    /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(Some(PipelineReadyCondition::default()/* use setters */));
2720    /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(None::<PipelineReadyCondition>);
2721    /// ```
2722    pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
2723    where
2724        T: std::convert::Into<crate::model::PipelineReadyCondition>,
2725    {
2726        self.pipeline_ready_condition = v.map(|x| x.into());
2727        self
2728    }
2729
2730    /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2731    ///
2732    /// # Example
2733    /// ```ignore,no_run
2734    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2735    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2736    /// let x = PipelineCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
2737    /// ```
2738    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
2739    where
2740        T: std::convert::Into<crate::model::TargetsPresentCondition>,
2741    {
2742        self.targets_present_condition = std::option::Option::Some(v.into());
2743        self
2744    }
2745
2746    /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2747    ///
2748    /// # Example
2749    /// ```ignore,no_run
2750    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2751    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2752    /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
2753    /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
2754    /// ```
2755    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
2756    where
2757        T: std::convert::Into<crate::model::TargetsPresentCondition>,
2758    {
2759        self.targets_present_condition = v.map(|x| x.into());
2760        self
2761    }
2762
2763    /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2764    ///
2765    /// # Example
2766    /// ```ignore,no_run
2767    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2768    /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2769    /// let x = PipelineCondition::new().set_targets_type_condition(TargetsTypeCondition::default()/* use setters */);
2770    /// ```
2771    pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2772    where
2773        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2774    {
2775        self.targets_type_condition = std::option::Option::Some(v.into());
2776        self
2777    }
2778
2779    /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2780    ///
2781    /// # Example
2782    /// ```ignore,no_run
2783    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2784    /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2785    /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(Some(TargetsTypeCondition::default()/* use setters */));
2786    /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(None::<TargetsTypeCondition>);
2787    /// ```
2788    pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2789    where
2790        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2791    {
2792        self.targets_type_condition = v.map(|x| x.into());
2793        self
2794    }
2795}
2796
2797impl wkt::message::Message for PipelineCondition {
2798    fn typename() -> &'static str {
2799        "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2800    }
2801}
2802
2803/// The request object for `ListDeliveryPipelines`.
2804#[derive(Clone, Default, PartialEq)]
2805#[non_exhaustive]
2806pub struct ListDeliveryPipelinesRequest {
2807    /// Required. The parent, which owns this collection of pipelines. Format must
2808    /// be `projects/{project_id}/locations/{location_name}`.
2809    pub parent: std::string::String,
2810
2811    /// The maximum number of pipelines to return. The service may return
2812    /// fewer than this value. If unspecified, at most 50 pipelines will
2813    /// be returned. The maximum value is 1000; values above 1000 will be set
2814    /// to 1000.
2815    pub page_size: i32,
2816
2817    /// A page token, received from a previous `ListDeliveryPipelines` call.
2818    /// Provide this to retrieve the subsequent page.
2819    ///
2820    /// When paginating, all other provided parameters match
2821    /// the call that provided the page token.
2822    pub page_token: std::string::String,
2823
2824    /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2825    /// details.
2826    pub filter: std::string::String,
2827
2828    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2829    pub order_by: std::string::String,
2830
2831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2832}
2833
2834impl ListDeliveryPipelinesRequest {
2835    /// Creates a new default instance.
2836    pub fn new() -> Self {
2837        std::default::Default::default()
2838    }
2839
2840    /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2841    ///
2842    /// # Example
2843    /// ```ignore,no_run
2844    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2845    /// let x = ListDeliveryPipelinesRequest::new().set_parent("example");
2846    /// ```
2847    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2848        self.parent = v.into();
2849        self
2850    }
2851
2852    /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2853    ///
2854    /// # Example
2855    /// ```ignore,no_run
2856    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2857    /// let x = ListDeliveryPipelinesRequest::new().set_page_size(42);
2858    /// ```
2859    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2860        self.page_size = v.into();
2861        self
2862    }
2863
2864    /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2865    ///
2866    /// # Example
2867    /// ```ignore,no_run
2868    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2869    /// let x = ListDeliveryPipelinesRequest::new().set_page_token("example");
2870    /// ```
2871    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2872        self.page_token = v.into();
2873        self
2874    }
2875
2876    /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2877    ///
2878    /// # Example
2879    /// ```ignore,no_run
2880    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2881    /// let x = ListDeliveryPipelinesRequest::new().set_filter("example");
2882    /// ```
2883    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2884        self.filter = v.into();
2885        self
2886    }
2887
2888    /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2889    ///
2890    /// # Example
2891    /// ```ignore,no_run
2892    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2893    /// let x = ListDeliveryPipelinesRequest::new().set_order_by("example");
2894    /// ```
2895    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2896        self.order_by = v.into();
2897        self
2898    }
2899}
2900
2901impl wkt::message::Message for ListDeliveryPipelinesRequest {
2902    fn typename() -> &'static str {
2903        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2904    }
2905}
2906
2907/// The response object from `ListDeliveryPipelines`.
2908#[derive(Clone, Default, PartialEq)]
2909#[non_exhaustive]
2910pub struct ListDeliveryPipelinesResponse {
2911    /// The `DeliveryPipeline` objects.
2912    pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2913
2914    /// A token, which can be sent as `page_token` to retrieve the next page.
2915    /// If this field is omitted, there are no subsequent pages.
2916    pub next_page_token: std::string::String,
2917
2918    /// Locations that could not be reached.
2919    pub unreachable: std::vec::Vec<std::string::String>,
2920
2921    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2922}
2923
2924impl ListDeliveryPipelinesResponse {
2925    /// Creates a new default instance.
2926    pub fn new() -> Self {
2927        std::default::Default::default()
2928    }
2929
2930    /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2931    ///
2932    /// # Example
2933    /// ```ignore,no_run
2934    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2935    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
2936    /// let x = ListDeliveryPipelinesResponse::new()
2937    ///     .set_delivery_pipelines([
2938    ///         DeliveryPipeline::default()/* use setters */,
2939    ///         DeliveryPipeline::default()/* use (different) setters */,
2940    ///     ]);
2941    /// ```
2942    pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2943    where
2944        T: std::iter::IntoIterator<Item = V>,
2945        V: std::convert::Into<crate::model::DeliveryPipeline>,
2946    {
2947        use std::iter::Iterator;
2948        self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2949        self
2950    }
2951
2952    /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2953    ///
2954    /// # Example
2955    /// ```ignore,no_run
2956    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2957    /// let x = ListDeliveryPipelinesResponse::new().set_next_page_token("example");
2958    /// ```
2959    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2960        self.next_page_token = v.into();
2961        self
2962    }
2963
2964    /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2965    ///
2966    /// # Example
2967    /// ```ignore,no_run
2968    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2969    /// let x = ListDeliveryPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
2970    /// ```
2971    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2972    where
2973        T: std::iter::IntoIterator<Item = V>,
2974        V: std::convert::Into<std::string::String>,
2975    {
2976        use std::iter::Iterator;
2977        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2978        self
2979    }
2980}
2981
2982impl wkt::message::Message for ListDeliveryPipelinesResponse {
2983    fn typename() -> &'static str {
2984        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2985    }
2986}
2987
2988#[doc(hidden)]
2989impl google_cloud_gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2990    type PageItem = crate::model::DeliveryPipeline;
2991
2992    fn items(self) -> std::vec::Vec<Self::PageItem> {
2993        self.delivery_pipelines
2994    }
2995
2996    fn next_page_token(&self) -> std::string::String {
2997        use std::clone::Clone;
2998        self.next_page_token.clone()
2999    }
3000}
3001
3002/// The request object for `GetDeliveryPipeline`
3003#[derive(Clone, Default, PartialEq)]
3004#[non_exhaustive]
3005pub struct GetDeliveryPipelineRequest {
3006    /// Required. Name of the `DeliveryPipeline`. Format must be
3007    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3008    pub name: std::string::String,
3009
3010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3011}
3012
3013impl GetDeliveryPipelineRequest {
3014    /// Creates a new default instance.
3015    pub fn new() -> Self {
3016        std::default::Default::default()
3017    }
3018
3019    /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
3020    ///
3021    /// # Example
3022    /// ```ignore,no_run
3023    /// # use google_cloud_deploy_v1::model::GetDeliveryPipelineRequest;
3024    /// let x = GetDeliveryPipelineRequest::new().set_name("example");
3025    /// ```
3026    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3027        self.name = v.into();
3028        self
3029    }
3030}
3031
3032impl wkt::message::Message for GetDeliveryPipelineRequest {
3033    fn typename() -> &'static str {
3034        "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
3035    }
3036}
3037
3038/// The request object for `CreateDeliveryPipeline`.
3039#[derive(Clone, Default, PartialEq)]
3040#[non_exhaustive]
3041pub struct CreateDeliveryPipelineRequest {
3042    /// Required. The parent collection in which the `DeliveryPipeline` must be
3043    /// created. The format is `projects/{project_id}/locations/{location_name}`.
3044    pub parent: std::string::String,
3045
3046    /// Required. ID of the `DeliveryPipeline`.
3047    pub delivery_pipeline_id: std::string::String,
3048
3049    /// Required. The `DeliveryPipeline` to create.
3050    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3051
3052    /// Optional. A request ID to identify requests. Specify a unique request ID
3053    /// so that if you must retry your request, the server knows to ignore the
3054    /// request if it has already been completed. The server guarantees that for
3055    /// at least 60 minutes after the first request.
3056    ///
3057    /// For example, consider a situation where you make an initial request and the
3058    /// request times out. If you make the request again with the same request ID,
3059    /// the server can check if original operation with the same request ID was
3060    /// received, and if so, will ignore the second request. This prevents clients
3061    /// from accidentally creating duplicate commitments.
3062    ///
3063    /// The request ID must be a valid UUID with the exception that zero UUID is
3064    /// not supported (00000000-0000-0000-0000-000000000000).
3065    pub request_id: std::string::String,
3066
3067    /// Optional. If set to true, the request is validated and the user is provided
3068    /// with an expected result, but no actual change is made.
3069    pub validate_only: bool,
3070
3071    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3072}
3073
3074impl CreateDeliveryPipelineRequest {
3075    /// Creates a new default instance.
3076    pub fn new() -> Self {
3077        std::default::Default::default()
3078    }
3079
3080    /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
3081    ///
3082    /// # Example
3083    /// ```ignore,no_run
3084    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3085    /// let x = CreateDeliveryPipelineRequest::new().set_parent("example");
3086    /// ```
3087    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3088        self.parent = v.into();
3089        self
3090    }
3091
3092    /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
3093    ///
3094    /// # Example
3095    /// ```ignore,no_run
3096    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3097    /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline_id("example");
3098    /// ```
3099    pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
3100        mut self,
3101        v: T,
3102    ) -> Self {
3103        self.delivery_pipeline_id = v.into();
3104        self
3105    }
3106
3107    /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3108    ///
3109    /// # Example
3110    /// ```ignore,no_run
3111    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3112    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3113    /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3114    /// ```
3115    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3116    where
3117        T: std::convert::Into<crate::model::DeliveryPipeline>,
3118    {
3119        self.delivery_pipeline = std::option::Option::Some(v.into());
3120        self
3121    }
3122
3123    /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3124    ///
3125    /// # Example
3126    /// ```ignore,no_run
3127    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3128    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3129    /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3130    /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3131    /// ```
3132    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3133    where
3134        T: std::convert::Into<crate::model::DeliveryPipeline>,
3135    {
3136        self.delivery_pipeline = v.map(|x| x.into());
3137        self
3138    }
3139
3140    /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
3141    ///
3142    /// # Example
3143    /// ```ignore,no_run
3144    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3145    /// let x = CreateDeliveryPipelineRequest::new().set_request_id("example");
3146    /// ```
3147    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3148        self.request_id = v.into();
3149        self
3150    }
3151
3152    /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
3153    ///
3154    /// # Example
3155    /// ```ignore,no_run
3156    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3157    /// let x = CreateDeliveryPipelineRequest::new().set_validate_only(true);
3158    /// ```
3159    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3160        self.validate_only = v.into();
3161        self
3162    }
3163}
3164
3165impl wkt::message::Message for CreateDeliveryPipelineRequest {
3166    fn typename() -> &'static str {
3167        "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
3168    }
3169}
3170
3171/// The request object for `UpdateDeliveryPipeline`.
3172#[derive(Clone, Default, PartialEq)]
3173#[non_exhaustive]
3174pub struct UpdateDeliveryPipelineRequest {
3175    /// Required. Field mask is used to specify the fields to be overwritten by the
3176    /// update in the `DeliveryPipeline` resource. The fields specified in the
3177    /// update_mask are relative to the resource, not the full request. A field
3178    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
3179    /// then all fields are overwritten.
3180    pub update_mask: std::option::Option<wkt::FieldMask>,
3181
3182    /// Required. The `DeliveryPipeline` to update.
3183    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3184
3185    /// Optional. A request ID to identify requests. Specify a unique request ID
3186    /// so that if you must retry your request, the server knows to ignore the
3187    /// request if it has already been completed. The server guarantees that for
3188    /// at least 60 minutes after the first request.
3189    ///
3190    /// For example, consider a situation where you make an initial request and the
3191    /// request times out. If you make the request again with the same request ID,
3192    /// the server can check if original operation with the same request ID was
3193    /// received, and if so, will ignore the second request. This prevents clients
3194    /// from accidentally creating duplicate commitments.
3195    ///
3196    /// The request ID must be a valid UUID with the exception that zero UUID is
3197    /// not supported (00000000-0000-0000-0000-000000000000).
3198    pub request_id: std::string::String,
3199
3200    /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
3201    /// will result in the creation of a new `DeliveryPipeline`.
3202    pub allow_missing: bool,
3203
3204    /// Optional. If set to true, the request is validated and the user is provided
3205    /// with an expected result, but no actual change is made.
3206    pub validate_only: bool,
3207
3208    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3209}
3210
3211impl UpdateDeliveryPipelineRequest {
3212    /// Creates a new default instance.
3213    pub fn new() -> Self {
3214        std::default::Default::default()
3215    }
3216
3217    /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3218    ///
3219    /// # Example
3220    /// ```ignore,no_run
3221    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3222    /// use wkt::FieldMask;
3223    /// let x = UpdateDeliveryPipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3224    /// ```
3225    pub fn set_update_mask<T>(mut self, v: T) -> Self
3226    where
3227        T: std::convert::Into<wkt::FieldMask>,
3228    {
3229        self.update_mask = std::option::Option::Some(v.into());
3230        self
3231    }
3232
3233    /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3234    ///
3235    /// # Example
3236    /// ```ignore,no_run
3237    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3238    /// use wkt::FieldMask;
3239    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3240    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3241    /// ```
3242    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3243    where
3244        T: std::convert::Into<wkt::FieldMask>,
3245    {
3246        self.update_mask = v.map(|x| x.into());
3247        self
3248    }
3249
3250    /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3251    ///
3252    /// # Example
3253    /// ```ignore,no_run
3254    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3255    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3256    /// let x = UpdateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3257    /// ```
3258    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3259    where
3260        T: std::convert::Into<crate::model::DeliveryPipeline>,
3261    {
3262        self.delivery_pipeline = std::option::Option::Some(v.into());
3263        self
3264    }
3265
3266    /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3267    ///
3268    /// # Example
3269    /// ```ignore,no_run
3270    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3271    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3272    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3273    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3274    /// ```
3275    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3276    where
3277        T: std::convert::Into<crate::model::DeliveryPipeline>,
3278    {
3279        self.delivery_pipeline = v.map(|x| x.into());
3280        self
3281    }
3282
3283    /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
3284    ///
3285    /// # Example
3286    /// ```ignore,no_run
3287    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3288    /// let x = UpdateDeliveryPipelineRequest::new().set_request_id("example");
3289    /// ```
3290    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3291        self.request_id = v.into();
3292        self
3293    }
3294
3295    /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
3296    ///
3297    /// # Example
3298    /// ```ignore,no_run
3299    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3300    /// let x = UpdateDeliveryPipelineRequest::new().set_allow_missing(true);
3301    /// ```
3302    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3303        self.allow_missing = v.into();
3304        self
3305    }
3306
3307    /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
3308    ///
3309    /// # Example
3310    /// ```ignore,no_run
3311    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3312    /// let x = UpdateDeliveryPipelineRequest::new().set_validate_only(true);
3313    /// ```
3314    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3315        self.validate_only = v.into();
3316        self
3317    }
3318}
3319
3320impl wkt::message::Message for UpdateDeliveryPipelineRequest {
3321    fn typename() -> &'static str {
3322        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
3323    }
3324}
3325
3326/// The request object for `DeleteDeliveryPipeline`.
3327#[derive(Clone, Default, PartialEq)]
3328#[non_exhaustive]
3329pub struct DeleteDeliveryPipelineRequest {
3330    /// Required. The name of the `DeliveryPipeline` to delete. The format is
3331    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3332    pub name: std::string::String,
3333
3334    /// Optional. A request ID to identify requests. Specify a unique request ID
3335    /// so that if you must retry your request, the server knows to ignore the
3336    /// request if it has already been completed. The server guarantees that for
3337    /// at least 60 minutes after the first request.
3338    ///
3339    /// For example, consider a situation where you make an initial request and the
3340    /// request times out. If you make the request again with the same request ID,
3341    /// the server can check if original operation with the same request ID was
3342    /// received, and if so, will ignore the second request. This prevents clients
3343    /// from accidentally creating duplicate commitments.
3344    ///
3345    /// The request ID must be a valid UUID with the exception that zero UUID is
3346    /// not supported (00000000-0000-0000-0000-000000000000).
3347    pub request_id: std::string::String,
3348
3349    /// Optional. If set to true, then deleting an already deleted or non-existing
3350    /// `DeliveryPipeline` will succeed.
3351    pub allow_missing: bool,
3352
3353    /// Optional. If set, validate the request and preview the review, but do not
3354    /// actually post it.
3355    pub validate_only: bool,
3356
3357    /// Optional. If set to true, all child resources under this pipeline will also
3358    /// be deleted. Otherwise, the request will only work if the pipeline has no
3359    /// child resources.
3360    pub force: bool,
3361
3362    /// Optional. This checksum is computed by the server based on the value of
3363    /// other fields, and may be sent on update and delete requests to ensure the
3364    /// client has an up-to-date value before proceeding.
3365    pub etag: std::string::String,
3366
3367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3368}
3369
3370impl DeleteDeliveryPipelineRequest {
3371    /// Creates a new default instance.
3372    pub fn new() -> Self {
3373        std::default::Default::default()
3374    }
3375
3376    /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
3377    ///
3378    /// # Example
3379    /// ```ignore,no_run
3380    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3381    /// let x = DeleteDeliveryPipelineRequest::new().set_name("example");
3382    /// ```
3383    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3384        self.name = v.into();
3385        self
3386    }
3387
3388    /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
3389    ///
3390    /// # Example
3391    /// ```ignore,no_run
3392    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3393    /// let x = DeleteDeliveryPipelineRequest::new().set_request_id("example");
3394    /// ```
3395    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3396        self.request_id = v.into();
3397        self
3398    }
3399
3400    /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
3401    ///
3402    /// # Example
3403    /// ```ignore,no_run
3404    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3405    /// let x = DeleteDeliveryPipelineRequest::new().set_allow_missing(true);
3406    /// ```
3407    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3408        self.allow_missing = v.into();
3409        self
3410    }
3411
3412    /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
3413    ///
3414    /// # Example
3415    /// ```ignore,no_run
3416    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3417    /// let x = DeleteDeliveryPipelineRequest::new().set_validate_only(true);
3418    /// ```
3419    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3420        self.validate_only = v.into();
3421        self
3422    }
3423
3424    /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
3425    ///
3426    /// # Example
3427    /// ```ignore,no_run
3428    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3429    /// let x = DeleteDeliveryPipelineRequest::new().set_force(true);
3430    /// ```
3431    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3432        self.force = v.into();
3433        self
3434    }
3435
3436    /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
3437    ///
3438    /// # Example
3439    /// ```ignore,no_run
3440    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3441    /// let x = DeleteDeliveryPipelineRequest::new().set_etag("example");
3442    /// ```
3443    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3444        self.etag = v.into();
3445        self
3446    }
3447}
3448
3449impl wkt::message::Message for DeleteDeliveryPipelineRequest {
3450    fn typename() -> &'static str {
3451        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
3452    }
3453}
3454
3455/// Configs for the Rollback rollout.
3456#[derive(Clone, Default, PartialEq)]
3457#[non_exhaustive]
3458pub struct RollbackTargetConfig {
3459    /// Optional. The rollback `Rollout` to create.
3460    pub rollout: std::option::Option<crate::model::Rollout>,
3461
3462    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
3463    /// `Rollout` will start in the stable phase.
3464    pub starting_phase_id: std::string::String,
3465
3466    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3467}
3468
3469impl RollbackTargetConfig {
3470    /// Creates a new default instance.
3471    pub fn new() -> Self {
3472        std::default::Default::default()
3473    }
3474
3475    /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3476    ///
3477    /// # Example
3478    /// ```ignore,no_run
3479    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3480    /// use google_cloud_deploy_v1::model::Rollout;
3481    /// let x = RollbackTargetConfig::new().set_rollout(Rollout::default()/* use setters */);
3482    /// ```
3483    pub fn set_rollout<T>(mut self, v: T) -> Self
3484    where
3485        T: std::convert::Into<crate::model::Rollout>,
3486    {
3487        self.rollout = std::option::Option::Some(v.into());
3488        self
3489    }
3490
3491    /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3492    ///
3493    /// # Example
3494    /// ```ignore,no_run
3495    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3496    /// use google_cloud_deploy_v1::model::Rollout;
3497    /// let x = RollbackTargetConfig::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
3498    /// let x = RollbackTargetConfig::new().set_or_clear_rollout(None::<Rollout>);
3499    /// ```
3500    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3501    where
3502        T: std::convert::Into<crate::model::Rollout>,
3503    {
3504        self.rollout = v.map(|x| x.into());
3505        self
3506    }
3507
3508    /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
3509    ///
3510    /// # Example
3511    /// ```ignore,no_run
3512    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3513    /// let x = RollbackTargetConfig::new().set_starting_phase_id("example");
3514    /// ```
3515    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
3516        mut self,
3517        v: T,
3518    ) -> Self {
3519        self.starting_phase_id = v.into();
3520        self
3521    }
3522}
3523
3524impl wkt::message::Message for RollbackTargetConfig {
3525    fn typename() -> &'static str {
3526        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
3527    }
3528}
3529
3530/// The request object for `RollbackTarget`.
3531#[derive(Clone, Default, PartialEq)]
3532#[non_exhaustive]
3533pub struct RollbackTargetRequest {
3534    /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
3535    /// created. The format is
3536    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3537    pub name: std::string::String,
3538
3539    /// Required. ID of the `Target` that is being rolled back.
3540    pub target_id: std::string::String,
3541
3542    /// Required. ID of the rollback `Rollout` to create.
3543    pub rollout_id: std::string::String,
3544
3545    /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
3546    /// previous successful `Rollout` to the specified target will be used to
3547    /// determine the `Release`.
3548    pub release_id: std::string::String,
3549
3550    /// Optional. If provided, this must be the latest `Rollout` that is on the
3551    /// `Target`.
3552    pub rollout_to_roll_back: std::string::String,
3553
3554    /// Optional. Configs for the rollback `Rollout`.
3555    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3556
3557    /// Optional. If set to true, the request is validated and the user is provided
3558    /// with a `RollbackTargetResponse`.
3559    pub validate_only: bool,
3560
3561    /// Optional. Deploy policies to override. Format is
3562    /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
3563    pub override_deploy_policy: std::vec::Vec<std::string::String>,
3564
3565    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3566}
3567
3568impl RollbackTargetRequest {
3569    /// Creates a new default instance.
3570    pub fn new() -> Self {
3571        std::default::Default::default()
3572    }
3573
3574    /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
3575    ///
3576    /// # Example
3577    /// ```ignore,no_run
3578    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3579    /// let x = RollbackTargetRequest::new().set_name("example");
3580    /// ```
3581    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3582        self.name = v.into();
3583        self
3584    }
3585
3586    /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
3587    ///
3588    /// # Example
3589    /// ```ignore,no_run
3590    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3591    /// let x = RollbackTargetRequest::new().set_target_id("example");
3592    /// ```
3593    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3594        self.target_id = v.into();
3595        self
3596    }
3597
3598    /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
3599    ///
3600    /// # Example
3601    /// ```ignore,no_run
3602    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3603    /// let x = RollbackTargetRequest::new().set_rollout_id("example");
3604    /// ```
3605    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3606        self.rollout_id = v.into();
3607        self
3608    }
3609
3610    /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
3611    ///
3612    /// # Example
3613    /// ```ignore,no_run
3614    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3615    /// let x = RollbackTargetRequest::new().set_release_id("example");
3616    /// ```
3617    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3618        self.release_id = v.into();
3619        self
3620    }
3621
3622    /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
3623    ///
3624    /// # Example
3625    /// ```ignore,no_run
3626    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3627    /// let x = RollbackTargetRequest::new().set_rollout_to_roll_back("example");
3628    /// ```
3629    pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
3630        mut self,
3631        v: T,
3632    ) -> Self {
3633        self.rollout_to_roll_back = v.into();
3634        self
3635    }
3636
3637    /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3638    ///
3639    /// # Example
3640    /// ```ignore,no_run
3641    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3642    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3643    /// let x = RollbackTargetRequest::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3644    /// ```
3645    pub fn set_rollback_config<T>(mut self, v: T) -> Self
3646    where
3647        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3648    {
3649        self.rollback_config = std::option::Option::Some(v.into());
3650        self
3651    }
3652
3653    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3654    ///
3655    /// # Example
3656    /// ```ignore,no_run
3657    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3658    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3659    /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3660    /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3661    /// ```
3662    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3663    where
3664        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3665    {
3666        self.rollback_config = v.map(|x| x.into());
3667        self
3668    }
3669
3670    /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
3671    ///
3672    /// # Example
3673    /// ```ignore,no_run
3674    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3675    /// let x = RollbackTargetRequest::new().set_validate_only(true);
3676    /// ```
3677    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3678        self.validate_only = v.into();
3679        self
3680    }
3681
3682    /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
3683    ///
3684    /// # Example
3685    /// ```ignore,no_run
3686    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3687    /// let x = RollbackTargetRequest::new().set_override_deploy_policy(["a", "b", "c"]);
3688    /// ```
3689    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3690    where
3691        T: std::iter::IntoIterator<Item = V>,
3692        V: std::convert::Into<std::string::String>,
3693    {
3694        use std::iter::Iterator;
3695        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3696        self
3697    }
3698}
3699
3700impl wkt::message::Message for RollbackTargetRequest {
3701    fn typename() -> &'static str {
3702        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
3703    }
3704}
3705
3706/// The response object from `RollbackTarget`.
3707#[derive(Clone, Default, PartialEq)]
3708#[non_exhaustive]
3709pub struct RollbackTargetResponse {
3710    /// The config of the rollback `Rollout` created or will be created.
3711    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3712
3713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3714}
3715
3716impl RollbackTargetResponse {
3717    /// Creates a new default instance.
3718    pub fn new() -> Self {
3719        std::default::Default::default()
3720    }
3721
3722    /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3723    ///
3724    /// # Example
3725    /// ```ignore,no_run
3726    /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3727    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3728    /// let x = RollbackTargetResponse::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3729    /// ```
3730    pub fn set_rollback_config<T>(mut self, v: T) -> Self
3731    where
3732        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3733    {
3734        self.rollback_config = std::option::Option::Some(v.into());
3735        self
3736    }
3737
3738    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3739    ///
3740    /// # Example
3741    /// ```ignore,no_run
3742    /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3743    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3744    /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3745    /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3746    /// ```
3747    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3748    where
3749        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3750    {
3751        self.rollback_config = v.map(|x| x.into());
3752        self
3753    }
3754}
3755
3756impl wkt::message::Message for RollbackTargetResponse {
3757    fn typename() -> &'static str {
3758        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
3759    }
3760}
3761
3762/// A `Target` resource in the Cloud Deploy API.
3763///
3764/// A `Target` defines a location to which a Skaffold configuration
3765/// can be deployed.
3766#[derive(Clone, Default, PartialEq)]
3767#[non_exhaustive]
3768pub struct Target {
3769    /// Identifier. Name of the `Target`. Format is
3770    /// `projects/{project}/locations/{location}/targets/{target}`.
3771    /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
3772    pub name: std::string::String,
3773
3774    /// Output only. Resource id of the `Target`.
3775    pub target_id: std::string::String,
3776
3777    /// Output only. Unique identifier of the `Target`.
3778    pub uid: std::string::String,
3779
3780    /// Optional. Description of the `Target`. Max length is 255 characters.
3781    pub description: std::string::String,
3782
3783    /// Optional. User annotations. These attributes can only be set and used by
3784    /// the user, and not by Cloud Deploy. See
3785    /// <https://google.aip.dev/128#annotations> for more details such as format and
3786    /// size limitations.
3787    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3788
3789    /// Optional. Labels are attributes that can be set and used by both the
3790    /// user and by Cloud Deploy. Labels must meet the following constraints:
3791    ///
3792    /// * Keys and values can contain only lowercase letters, numeric characters,
3793    ///   underscores, and dashes.
3794    /// * All characters must use UTF-8 encoding, and international characters are
3795    ///   allowed.
3796    /// * Keys must start with a lowercase letter or international character.
3797    /// * Each resource is limited to a maximum of 64 labels.
3798    ///
3799    /// Both keys and values are additionally constrained to be <= 128 bytes.
3800    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3801
3802    /// Optional. Whether or not the `Target` requires approval.
3803    pub require_approval: bool,
3804
3805    /// Output only. Time at which the `Target` was created.
3806    pub create_time: std::option::Option<wkt::Timestamp>,
3807
3808    /// Output only. Most recent time at which the `Target` was updated.
3809    pub update_time: std::option::Option<wkt::Timestamp>,
3810
3811    /// Optional. Map of entity IDs to their associated entities. Associated
3812    /// entities allows specifying places other than the deployment target for
3813    /// specific features. For example, the Gateway API canary can be configured to
3814    /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
3815    /// using associated entities. An entity ID must consist of lower-case letters,
3816    /// numbers, and hyphens, start with a letter and end with a letter or a
3817    /// number, and have a max length of 63 characters. In other words, it must
3818    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3819    pub associated_entities:
3820        std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
3821
3822    /// Optional. This checksum is computed by the server based on the value of
3823    /// other fields, and may be sent on update and delete requests to ensure the
3824    /// client has an up-to-date value before proceeding.
3825    pub etag: std::string::String,
3826
3827    /// Optional. Configurations for all execution that relates to this `Target`.
3828    /// Each `ExecutionEnvironmentUsage` value may only be used in a single
3829    /// configuration; using the same value multiple times is an error.
3830    /// When one or more configurations are specified, they must include the
3831    /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
3832    /// When no configurations are specified, execution will use the default
3833    /// specified in `DefaultPool`.
3834    pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
3835
3836    /// Optional. The deploy parameters to use for this target.
3837    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
3838
3839    /// Destination to which the Skaffold configuration is applied during a
3840    /// rollout.
3841    pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
3842
3843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3844}
3845
3846impl Target {
3847    /// Creates a new default instance.
3848    pub fn new() -> Self {
3849        std::default::Default::default()
3850    }
3851
3852    /// Sets the value of [name][crate::model::Target::name].
3853    ///
3854    /// # Example
3855    /// ```ignore,no_run
3856    /// # use google_cloud_deploy_v1::model::Target;
3857    /// let x = Target::new().set_name("example");
3858    /// ```
3859    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3860        self.name = v.into();
3861        self
3862    }
3863
3864    /// Sets the value of [target_id][crate::model::Target::target_id].
3865    ///
3866    /// # Example
3867    /// ```ignore,no_run
3868    /// # use google_cloud_deploy_v1::model::Target;
3869    /// let x = Target::new().set_target_id("example");
3870    /// ```
3871    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3872        self.target_id = v.into();
3873        self
3874    }
3875
3876    /// Sets the value of [uid][crate::model::Target::uid].
3877    ///
3878    /// # Example
3879    /// ```ignore,no_run
3880    /// # use google_cloud_deploy_v1::model::Target;
3881    /// let x = Target::new().set_uid("example");
3882    /// ```
3883    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3884        self.uid = v.into();
3885        self
3886    }
3887
3888    /// Sets the value of [description][crate::model::Target::description].
3889    ///
3890    /// # Example
3891    /// ```ignore,no_run
3892    /// # use google_cloud_deploy_v1::model::Target;
3893    /// let x = Target::new().set_description("example");
3894    /// ```
3895    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3896        self.description = v.into();
3897        self
3898    }
3899
3900    /// Sets the value of [annotations][crate::model::Target::annotations].
3901    ///
3902    /// # Example
3903    /// ```ignore,no_run
3904    /// # use google_cloud_deploy_v1::model::Target;
3905    /// let x = Target::new().set_annotations([
3906    ///     ("key0", "abc"),
3907    ///     ("key1", "xyz"),
3908    /// ]);
3909    /// ```
3910    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3911    where
3912        T: std::iter::IntoIterator<Item = (K, V)>,
3913        K: std::convert::Into<std::string::String>,
3914        V: std::convert::Into<std::string::String>,
3915    {
3916        use std::iter::Iterator;
3917        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3918        self
3919    }
3920
3921    /// Sets the value of [labels][crate::model::Target::labels].
3922    ///
3923    /// # Example
3924    /// ```ignore,no_run
3925    /// # use google_cloud_deploy_v1::model::Target;
3926    /// let x = Target::new().set_labels([
3927    ///     ("key0", "abc"),
3928    ///     ("key1", "xyz"),
3929    /// ]);
3930    /// ```
3931    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3932    where
3933        T: std::iter::IntoIterator<Item = (K, V)>,
3934        K: std::convert::Into<std::string::String>,
3935        V: std::convert::Into<std::string::String>,
3936    {
3937        use std::iter::Iterator;
3938        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3939        self
3940    }
3941
3942    /// Sets the value of [require_approval][crate::model::Target::require_approval].
3943    ///
3944    /// # Example
3945    /// ```ignore,no_run
3946    /// # use google_cloud_deploy_v1::model::Target;
3947    /// let x = Target::new().set_require_approval(true);
3948    /// ```
3949    pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3950        self.require_approval = v.into();
3951        self
3952    }
3953
3954    /// Sets the value of [create_time][crate::model::Target::create_time].
3955    ///
3956    /// # Example
3957    /// ```ignore,no_run
3958    /// # use google_cloud_deploy_v1::model::Target;
3959    /// use wkt::Timestamp;
3960    /// let x = Target::new().set_create_time(Timestamp::default()/* use setters */);
3961    /// ```
3962    pub fn set_create_time<T>(mut self, v: T) -> Self
3963    where
3964        T: std::convert::Into<wkt::Timestamp>,
3965    {
3966        self.create_time = std::option::Option::Some(v.into());
3967        self
3968    }
3969
3970    /// Sets or clears the value of [create_time][crate::model::Target::create_time].
3971    ///
3972    /// # Example
3973    /// ```ignore,no_run
3974    /// # use google_cloud_deploy_v1::model::Target;
3975    /// use wkt::Timestamp;
3976    /// let x = Target::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3977    /// let x = Target::new().set_or_clear_create_time(None::<Timestamp>);
3978    /// ```
3979    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3980    where
3981        T: std::convert::Into<wkt::Timestamp>,
3982    {
3983        self.create_time = v.map(|x| x.into());
3984        self
3985    }
3986
3987    /// Sets the value of [update_time][crate::model::Target::update_time].
3988    ///
3989    /// # Example
3990    /// ```ignore,no_run
3991    /// # use google_cloud_deploy_v1::model::Target;
3992    /// use wkt::Timestamp;
3993    /// let x = Target::new().set_update_time(Timestamp::default()/* use setters */);
3994    /// ```
3995    pub fn set_update_time<T>(mut self, v: T) -> Self
3996    where
3997        T: std::convert::Into<wkt::Timestamp>,
3998    {
3999        self.update_time = std::option::Option::Some(v.into());
4000        self
4001    }
4002
4003    /// Sets or clears the value of [update_time][crate::model::Target::update_time].
4004    ///
4005    /// # Example
4006    /// ```ignore,no_run
4007    /// # use google_cloud_deploy_v1::model::Target;
4008    /// use wkt::Timestamp;
4009    /// let x = Target::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4010    /// let x = Target::new().set_or_clear_update_time(None::<Timestamp>);
4011    /// ```
4012    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4013    where
4014        T: std::convert::Into<wkt::Timestamp>,
4015    {
4016        self.update_time = v.map(|x| x.into());
4017        self
4018    }
4019
4020    /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
4021    ///
4022    /// # Example
4023    /// ```ignore,no_run
4024    /// # use google_cloud_deploy_v1::model::Target;
4025    /// use google_cloud_deploy_v1::model::AssociatedEntities;
4026    /// let x = Target::new().set_associated_entities([
4027    ///     ("key0", AssociatedEntities::default()/* use setters */),
4028    ///     ("key1", AssociatedEntities::default()/* use (different) setters */),
4029    /// ]);
4030    /// ```
4031    pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
4032    where
4033        T: std::iter::IntoIterator<Item = (K, V)>,
4034        K: std::convert::Into<std::string::String>,
4035        V: std::convert::Into<crate::model::AssociatedEntities>,
4036    {
4037        use std::iter::Iterator;
4038        self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4039        self
4040    }
4041
4042    /// Sets the value of [etag][crate::model::Target::etag].
4043    ///
4044    /// # Example
4045    /// ```ignore,no_run
4046    /// # use google_cloud_deploy_v1::model::Target;
4047    /// let x = Target::new().set_etag("example");
4048    /// ```
4049    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4050        self.etag = v.into();
4051        self
4052    }
4053
4054    /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
4055    ///
4056    /// # Example
4057    /// ```ignore,no_run
4058    /// # use google_cloud_deploy_v1::model::Target;
4059    /// use google_cloud_deploy_v1::model::ExecutionConfig;
4060    /// let x = Target::new()
4061    ///     .set_execution_configs([
4062    ///         ExecutionConfig::default()/* use setters */,
4063    ///         ExecutionConfig::default()/* use (different) setters */,
4064    ///     ]);
4065    /// ```
4066    pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
4067    where
4068        T: std::iter::IntoIterator<Item = V>,
4069        V: std::convert::Into<crate::model::ExecutionConfig>,
4070    {
4071        use std::iter::Iterator;
4072        self.execution_configs = v.into_iter().map(|i| i.into()).collect();
4073        self
4074    }
4075
4076    /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
4077    ///
4078    /// # Example
4079    /// ```ignore,no_run
4080    /// # use google_cloud_deploy_v1::model::Target;
4081    /// let x = Target::new().set_deploy_parameters([
4082    ///     ("key0", "abc"),
4083    ///     ("key1", "xyz"),
4084    /// ]);
4085    /// ```
4086    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
4087    where
4088        T: std::iter::IntoIterator<Item = (K, V)>,
4089        K: std::convert::Into<std::string::String>,
4090        V: std::convert::Into<std::string::String>,
4091    {
4092        use std::iter::Iterator;
4093        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4094        self
4095    }
4096
4097    /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
4098    ///
4099    /// Note that all the setters affecting `deployment_target` are mutually
4100    /// exclusive.
4101    ///
4102    /// # Example
4103    /// ```ignore,no_run
4104    /// # use google_cloud_deploy_v1::model::Target;
4105    /// use google_cloud_deploy_v1::model::GkeCluster;
4106    /// let x = Target::new().set_deployment_target(Some(
4107    ///     google_cloud_deploy_v1::model::target::DeploymentTarget::Gke(GkeCluster::default().into())));
4108    /// ```
4109    pub fn set_deployment_target<
4110        T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
4111    >(
4112        mut self,
4113        v: T,
4114    ) -> Self {
4115        self.deployment_target = v.into();
4116        self
4117    }
4118
4119    /// The value of [deployment_target][crate::model::Target::deployment_target]
4120    /// if it holds a `Gke`, `None` if the field is not set or
4121    /// holds a different branch.
4122    pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
4123        #[allow(unreachable_patterns)]
4124        self.deployment_target.as_ref().and_then(|v| match v {
4125            crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
4126            _ => std::option::Option::None,
4127        })
4128    }
4129
4130    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4131    /// to hold a `Gke`.
4132    ///
4133    /// Note that all the setters affecting `deployment_target` are
4134    /// mutually exclusive.
4135    ///
4136    /// # Example
4137    /// ```ignore,no_run
4138    /// # use google_cloud_deploy_v1::model::Target;
4139    /// use google_cloud_deploy_v1::model::GkeCluster;
4140    /// let x = Target::new().set_gke(GkeCluster::default()/* use setters */);
4141    /// assert!(x.gke().is_some());
4142    /// assert!(x.anthos_cluster().is_none());
4143    /// assert!(x.run().is_none());
4144    /// assert!(x.multi_target().is_none());
4145    /// assert!(x.custom_target().is_none());
4146    /// ```
4147    pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
4148        mut self,
4149        v: T,
4150    ) -> Self {
4151        self.deployment_target =
4152            std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
4153        self
4154    }
4155
4156    /// The value of [deployment_target][crate::model::Target::deployment_target]
4157    /// if it holds a `AnthosCluster`, `None` if the field is not set or
4158    /// holds a different branch.
4159    pub fn anthos_cluster(
4160        &self,
4161    ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
4162        #[allow(unreachable_patterns)]
4163        self.deployment_target.as_ref().and_then(|v| match v {
4164            crate::model::target::DeploymentTarget::AnthosCluster(v) => {
4165                std::option::Option::Some(v)
4166            }
4167            _ => std::option::Option::None,
4168        })
4169    }
4170
4171    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4172    /// to hold a `AnthosCluster`.
4173    ///
4174    /// Note that all the setters affecting `deployment_target` are
4175    /// mutually exclusive.
4176    ///
4177    /// # Example
4178    /// ```ignore,no_run
4179    /// # use google_cloud_deploy_v1::model::Target;
4180    /// use google_cloud_deploy_v1::model::AnthosCluster;
4181    /// let x = Target::new().set_anthos_cluster(AnthosCluster::default()/* use setters */);
4182    /// assert!(x.anthos_cluster().is_some());
4183    /// assert!(x.gke().is_none());
4184    /// assert!(x.run().is_none());
4185    /// assert!(x.multi_target().is_none());
4186    /// assert!(x.custom_target().is_none());
4187    /// ```
4188    pub fn set_anthos_cluster<
4189        T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
4190    >(
4191        mut self,
4192        v: T,
4193    ) -> Self {
4194        self.deployment_target = std::option::Option::Some(
4195            crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
4196        );
4197        self
4198    }
4199
4200    /// The value of [deployment_target][crate::model::Target::deployment_target]
4201    /// if it holds a `Run`, `None` if the field is not set or
4202    /// holds a different branch.
4203    pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
4204        #[allow(unreachable_patterns)]
4205        self.deployment_target.as_ref().and_then(|v| match v {
4206            crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
4207            _ => std::option::Option::None,
4208        })
4209    }
4210
4211    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4212    /// to hold a `Run`.
4213    ///
4214    /// Note that all the setters affecting `deployment_target` are
4215    /// mutually exclusive.
4216    ///
4217    /// # Example
4218    /// ```ignore,no_run
4219    /// # use google_cloud_deploy_v1::model::Target;
4220    /// use google_cloud_deploy_v1::model::CloudRunLocation;
4221    /// let x = Target::new().set_run(CloudRunLocation::default()/* use setters */);
4222    /// assert!(x.run().is_some());
4223    /// assert!(x.gke().is_none());
4224    /// assert!(x.anthos_cluster().is_none());
4225    /// assert!(x.multi_target().is_none());
4226    /// assert!(x.custom_target().is_none());
4227    /// ```
4228    pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
4229        mut self,
4230        v: T,
4231    ) -> Self {
4232        self.deployment_target =
4233            std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
4234        self
4235    }
4236
4237    /// The value of [deployment_target][crate::model::Target::deployment_target]
4238    /// if it holds a `MultiTarget`, `None` if the field is not set or
4239    /// holds a different branch.
4240    pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
4241        #[allow(unreachable_patterns)]
4242        self.deployment_target.as_ref().and_then(|v| match v {
4243            crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
4244            _ => std::option::Option::None,
4245        })
4246    }
4247
4248    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4249    /// to hold a `MultiTarget`.
4250    ///
4251    /// Note that all the setters affecting `deployment_target` are
4252    /// mutually exclusive.
4253    ///
4254    /// # Example
4255    /// ```ignore,no_run
4256    /// # use google_cloud_deploy_v1::model::Target;
4257    /// use google_cloud_deploy_v1::model::MultiTarget;
4258    /// let x = Target::new().set_multi_target(MultiTarget::default()/* use setters */);
4259    /// assert!(x.multi_target().is_some());
4260    /// assert!(x.gke().is_none());
4261    /// assert!(x.anthos_cluster().is_none());
4262    /// assert!(x.run().is_none());
4263    /// assert!(x.custom_target().is_none());
4264    /// ```
4265    pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
4266        mut self,
4267        v: T,
4268    ) -> Self {
4269        self.deployment_target = std::option::Option::Some(
4270            crate::model::target::DeploymentTarget::MultiTarget(v.into()),
4271        );
4272        self
4273    }
4274
4275    /// The value of [deployment_target][crate::model::Target::deployment_target]
4276    /// if it holds a `CustomTarget`, `None` if the field is not set or
4277    /// holds a different branch.
4278    pub fn custom_target(
4279        &self,
4280    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
4281        #[allow(unreachable_patterns)]
4282        self.deployment_target.as_ref().and_then(|v| match v {
4283            crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
4284            _ => std::option::Option::None,
4285        })
4286    }
4287
4288    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4289    /// to hold a `CustomTarget`.
4290    ///
4291    /// Note that all the setters affecting `deployment_target` are
4292    /// mutually exclusive.
4293    ///
4294    /// # Example
4295    /// ```ignore,no_run
4296    /// # use google_cloud_deploy_v1::model::Target;
4297    /// use google_cloud_deploy_v1::model::CustomTarget;
4298    /// let x = Target::new().set_custom_target(CustomTarget::default()/* use setters */);
4299    /// assert!(x.custom_target().is_some());
4300    /// assert!(x.gke().is_none());
4301    /// assert!(x.anthos_cluster().is_none());
4302    /// assert!(x.run().is_none());
4303    /// assert!(x.multi_target().is_none());
4304    /// ```
4305    pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
4306        mut self,
4307        v: T,
4308    ) -> Self {
4309        self.deployment_target = std::option::Option::Some(
4310            crate::model::target::DeploymentTarget::CustomTarget(v.into()),
4311        );
4312        self
4313    }
4314}
4315
4316impl wkt::message::Message for Target {
4317    fn typename() -> &'static str {
4318        "type.googleapis.com/google.cloud.deploy.v1.Target"
4319    }
4320}
4321
4322/// Defines additional types related to [Target].
4323pub mod target {
4324    #[allow(unused_imports)]
4325    use super::*;
4326
4327    /// Destination to which the Skaffold configuration is applied during a
4328    /// rollout.
4329    #[derive(Clone, Debug, PartialEq)]
4330    #[non_exhaustive]
4331    pub enum DeploymentTarget {
4332        /// Optional. Information specifying a GKE Cluster.
4333        Gke(std::boxed::Box<crate::model::GkeCluster>),
4334        /// Optional. Information specifying an Anthos Cluster.
4335        AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
4336        /// Optional. Information specifying a Cloud Run deployment target.
4337        Run(std::boxed::Box<crate::model::CloudRunLocation>),
4338        /// Optional. Information specifying a multiTarget.
4339        MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
4340        /// Optional. Information specifying a Custom Target.
4341        CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
4342    }
4343}
4344
4345/// Configuration of the environment to use when calling Skaffold.
4346#[derive(Clone, Default, PartialEq)]
4347#[non_exhaustive]
4348pub struct ExecutionConfig {
4349    /// Required. Usages when this configuration should be applied.
4350    pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
4351
4352    /// Optional. The resource name of the `WorkerPool`, with the format
4353    /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
4354    /// If this optional field is unspecified, the default Cloud Build pool will be
4355    /// used.
4356    pub worker_pool: std::string::String,
4357
4358    /// Optional. Google service account to use for execution. If unspecified,
4359    /// the project execution service account
4360    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
4361    pub service_account: std::string::String,
4362
4363    /// Optional. Cloud Storage location in which to store execution outputs. This
4364    /// can either be a bucket ("gs://my-bucket") or a path within a bucket
4365    /// ("gs://my-bucket/my-dir").
4366    /// If unspecified, a default bucket located in the same region will be used.
4367    pub artifact_storage: std::string::String,
4368
4369    /// Optional. Execution timeout for a Cloud Build Execution. This must be
4370    /// between 10m and 24h in seconds format. If unspecified, a default timeout of
4371    /// 1h is used.
4372    pub execution_timeout: std::option::Option<wkt::Duration>,
4373
4374    /// Optional. If true, additional logging will be enabled when running builds
4375    /// in this execution environment.
4376    pub verbose: bool,
4377
4378    /// Details of the environment.
4379    pub execution_environment:
4380        std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4381
4382    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4383}
4384
4385impl ExecutionConfig {
4386    /// Creates a new default instance.
4387    pub fn new() -> Self {
4388        std::default::Default::default()
4389    }
4390
4391    /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
4392    ///
4393    /// # Example
4394    /// ```ignore,no_run
4395    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4396    /// use google_cloud_deploy_v1::model::execution_config::ExecutionEnvironmentUsage;
4397    /// let x = ExecutionConfig::new().set_usages([
4398    ///     ExecutionEnvironmentUsage::Render,
4399    ///     ExecutionEnvironmentUsage::Deploy,
4400    ///     ExecutionEnvironmentUsage::Verify,
4401    /// ]);
4402    /// ```
4403    pub fn set_usages<T, V>(mut self, v: T) -> Self
4404    where
4405        T: std::iter::IntoIterator<Item = V>,
4406        V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
4407    {
4408        use std::iter::Iterator;
4409        self.usages = v.into_iter().map(|i| i.into()).collect();
4410        self
4411    }
4412
4413    /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
4414    ///
4415    /// # Example
4416    /// ```ignore,no_run
4417    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4418    /// let x = ExecutionConfig::new().set_worker_pool("example");
4419    /// ```
4420    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4421        self.worker_pool = v.into();
4422        self
4423    }
4424
4425    /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
4426    ///
4427    /// # Example
4428    /// ```ignore,no_run
4429    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4430    /// let x = ExecutionConfig::new().set_service_account("example");
4431    /// ```
4432    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4433        self.service_account = v.into();
4434        self
4435    }
4436
4437    /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
4438    ///
4439    /// # Example
4440    /// ```ignore,no_run
4441    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4442    /// let x = ExecutionConfig::new().set_artifact_storage("example");
4443    /// ```
4444    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4445        mut self,
4446        v: T,
4447    ) -> Self {
4448        self.artifact_storage = v.into();
4449        self
4450    }
4451
4452    /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4453    ///
4454    /// # Example
4455    /// ```ignore,no_run
4456    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4457    /// use wkt::Duration;
4458    /// let x = ExecutionConfig::new().set_execution_timeout(Duration::default()/* use setters */);
4459    /// ```
4460    pub fn set_execution_timeout<T>(mut self, v: T) -> Self
4461    where
4462        T: std::convert::Into<wkt::Duration>,
4463    {
4464        self.execution_timeout = std::option::Option::Some(v.into());
4465        self
4466    }
4467
4468    /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4469    ///
4470    /// # Example
4471    /// ```ignore,no_run
4472    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4473    /// use wkt::Duration;
4474    /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(Some(Duration::default()/* use setters */));
4475    /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(None::<Duration>);
4476    /// ```
4477    pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4478    where
4479        T: std::convert::Into<wkt::Duration>,
4480    {
4481        self.execution_timeout = v.map(|x| x.into());
4482        self
4483    }
4484
4485    /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
4486    ///
4487    /// # Example
4488    /// ```ignore,no_run
4489    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4490    /// let x = ExecutionConfig::new().set_verbose(true);
4491    /// ```
4492    pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4493        self.verbose = v.into();
4494        self
4495    }
4496
4497    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
4498    ///
4499    /// Note that all the setters affecting `execution_environment` are mutually
4500    /// exclusive.
4501    ///
4502    /// # Example
4503    /// ```ignore,no_run
4504    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4505    /// use google_cloud_deploy_v1::model::DefaultPool;
4506    /// let x = ExecutionConfig::new().set_execution_environment(Some(
4507    ///     google_cloud_deploy_v1::model::execution_config::ExecutionEnvironment::DefaultPool(DefaultPool::default().into())));
4508    /// ```
4509    pub fn set_execution_environment<
4510        T: std::convert::Into<
4511                std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4512            >,
4513    >(
4514        mut self,
4515        v: T,
4516    ) -> Self {
4517        self.execution_environment = v.into();
4518        self
4519    }
4520
4521    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4522    /// if it holds a `DefaultPool`, `None` if the field is not set or
4523    /// holds a different branch.
4524    pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
4525        #[allow(unreachable_patterns)]
4526        self.execution_environment.as_ref().and_then(|v| match v {
4527            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
4528                std::option::Option::Some(v)
4529            }
4530            _ => std::option::Option::None,
4531        })
4532    }
4533
4534    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4535    /// to hold a `DefaultPool`.
4536    ///
4537    /// Note that all the setters affecting `execution_environment` are
4538    /// mutually exclusive.
4539    ///
4540    /// # Example
4541    /// ```ignore,no_run
4542    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4543    /// use google_cloud_deploy_v1::model::DefaultPool;
4544    /// let x = ExecutionConfig::new().set_default_pool(DefaultPool::default()/* use setters */);
4545    /// assert!(x.default_pool().is_some());
4546    /// assert!(x.private_pool().is_none());
4547    /// ```
4548    pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
4549        mut self,
4550        v: T,
4551    ) -> Self {
4552        self.execution_environment = std::option::Option::Some(
4553            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
4554        );
4555        self
4556    }
4557
4558    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4559    /// if it holds a `PrivatePool`, `None` if the field is not set or
4560    /// holds a different branch.
4561    pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
4562        #[allow(unreachable_patterns)]
4563        self.execution_environment.as_ref().and_then(|v| match v {
4564            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
4565                std::option::Option::Some(v)
4566            }
4567            _ => std::option::Option::None,
4568        })
4569    }
4570
4571    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4572    /// to hold a `PrivatePool`.
4573    ///
4574    /// Note that all the setters affecting `execution_environment` are
4575    /// mutually exclusive.
4576    ///
4577    /// # Example
4578    /// ```ignore,no_run
4579    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4580    /// use google_cloud_deploy_v1::model::PrivatePool;
4581    /// let x = ExecutionConfig::new().set_private_pool(PrivatePool::default()/* use setters */);
4582    /// assert!(x.private_pool().is_some());
4583    /// assert!(x.default_pool().is_none());
4584    /// ```
4585    pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
4586        mut self,
4587        v: T,
4588    ) -> Self {
4589        self.execution_environment = std::option::Option::Some(
4590            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
4591        );
4592        self
4593    }
4594}
4595
4596impl wkt::message::Message for ExecutionConfig {
4597    fn typename() -> &'static str {
4598        "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
4599    }
4600}
4601
4602/// Defines additional types related to [ExecutionConfig].
4603pub mod execution_config {
4604    #[allow(unused_imports)]
4605    use super::*;
4606
4607    /// Possible usages of this configuration.
4608    ///
4609    /// # Working with unknown values
4610    ///
4611    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4612    /// additional enum variants at any time. Adding new variants is not considered
4613    /// a breaking change. Applications should write their code in anticipation of:
4614    ///
4615    /// - New values appearing in future releases of the client library, **and**
4616    /// - New values received dynamically, without application changes.
4617    ///
4618    /// Please consult the [Working with enums] section in the user guide for some
4619    /// guidelines.
4620    ///
4621    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4622    #[derive(Clone, Debug, PartialEq)]
4623    #[non_exhaustive]
4624    pub enum ExecutionEnvironmentUsage {
4625        /// Default value. This value is unused.
4626        Unspecified,
4627        /// Use for rendering.
4628        Render,
4629        /// Use for deploying and deployment hooks.
4630        Deploy,
4631        /// Use for deployment verification.
4632        Verify,
4633        /// Use for predeploy job execution.
4634        Predeploy,
4635        /// Use for postdeploy job execution.
4636        Postdeploy,
4637        /// If set, the enum was initialized with an unknown value.
4638        ///
4639        /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
4640        /// [ExecutionEnvironmentUsage::name].
4641        UnknownValue(execution_environment_usage::UnknownValue),
4642    }
4643
4644    #[doc(hidden)]
4645    pub mod execution_environment_usage {
4646        #[allow(unused_imports)]
4647        use super::*;
4648        #[derive(Clone, Debug, PartialEq)]
4649        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4650    }
4651
4652    impl ExecutionEnvironmentUsage {
4653        /// Gets the enum value.
4654        ///
4655        /// Returns `None` if the enum contains an unknown value deserialized from
4656        /// the string representation of enums.
4657        pub fn value(&self) -> std::option::Option<i32> {
4658            match self {
4659                Self::Unspecified => std::option::Option::Some(0),
4660                Self::Render => std::option::Option::Some(1),
4661                Self::Deploy => std::option::Option::Some(2),
4662                Self::Verify => std::option::Option::Some(3),
4663                Self::Predeploy => std::option::Option::Some(4),
4664                Self::Postdeploy => std::option::Option::Some(5),
4665                Self::UnknownValue(u) => u.0.value(),
4666            }
4667        }
4668
4669        /// Gets the enum value as a string.
4670        ///
4671        /// Returns `None` if the enum contains an unknown value deserialized from
4672        /// the integer representation of enums.
4673        pub fn name(&self) -> std::option::Option<&str> {
4674            match self {
4675                Self::Unspecified => {
4676                    std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
4677                }
4678                Self::Render => std::option::Option::Some("RENDER"),
4679                Self::Deploy => std::option::Option::Some("DEPLOY"),
4680                Self::Verify => std::option::Option::Some("VERIFY"),
4681                Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
4682                Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
4683                Self::UnknownValue(u) => u.0.name(),
4684            }
4685        }
4686    }
4687
4688    impl std::default::Default for ExecutionEnvironmentUsage {
4689        fn default() -> Self {
4690            use std::convert::From;
4691            Self::from(0)
4692        }
4693    }
4694
4695    impl std::fmt::Display for ExecutionEnvironmentUsage {
4696        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4697            wkt::internal::display_enum(f, self.name(), self.value())
4698        }
4699    }
4700
4701    impl std::convert::From<i32> for ExecutionEnvironmentUsage {
4702        fn from(value: i32) -> Self {
4703            match value {
4704                0 => Self::Unspecified,
4705                1 => Self::Render,
4706                2 => Self::Deploy,
4707                3 => Self::Verify,
4708                4 => Self::Predeploy,
4709                5 => Self::Postdeploy,
4710                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4711                    wkt::internal::UnknownEnumValue::Integer(value),
4712                )),
4713            }
4714        }
4715    }
4716
4717    impl std::convert::From<&str> for ExecutionEnvironmentUsage {
4718        fn from(value: &str) -> Self {
4719            use std::string::ToString;
4720            match value {
4721                "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
4722                "RENDER" => Self::Render,
4723                "DEPLOY" => Self::Deploy,
4724                "VERIFY" => Self::Verify,
4725                "PREDEPLOY" => Self::Predeploy,
4726                "POSTDEPLOY" => Self::Postdeploy,
4727                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4728                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4729                )),
4730            }
4731        }
4732    }
4733
4734    impl serde::ser::Serialize for ExecutionEnvironmentUsage {
4735        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4736        where
4737            S: serde::Serializer,
4738        {
4739            match self {
4740                Self::Unspecified => serializer.serialize_i32(0),
4741                Self::Render => serializer.serialize_i32(1),
4742                Self::Deploy => serializer.serialize_i32(2),
4743                Self::Verify => serializer.serialize_i32(3),
4744                Self::Predeploy => serializer.serialize_i32(4),
4745                Self::Postdeploy => serializer.serialize_i32(5),
4746                Self::UnknownValue(u) => u.0.serialize(serializer),
4747            }
4748        }
4749    }
4750
4751    impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
4752        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4753        where
4754            D: serde::Deserializer<'de>,
4755        {
4756            deserializer.deserialize_any(
4757                wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
4758                    ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
4759                ),
4760            )
4761        }
4762    }
4763
4764    /// Details of the environment.
4765    #[derive(Clone, Debug, PartialEq)]
4766    #[non_exhaustive]
4767    pub enum ExecutionEnvironment {
4768        /// Optional. Use default Cloud Build pool.
4769        DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
4770        /// Optional. Use private Cloud Build pool.
4771        PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
4772    }
4773}
4774
4775/// Execution using the default Cloud Build pool.
4776#[derive(Clone, Default, PartialEq)]
4777#[non_exhaustive]
4778pub struct DefaultPool {
4779    /// Optional. Google service account to use for execution. If unspecified,
4780    /// the project execution service account
4781    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4782    pub service_account: std::string::String,
4783
4784    /// Optional. Cloud Storage location where execution outputs should be stored.
4785    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4786    /// ("gs://my-bucket/my-dir").
4787    /// If unspecified, a default bucket located in the same region will be used.
4788    pub artifact_storage: std::string::String,
4789
4790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4791}
4792
4793impl DefaultPool {
4794    /// Creates a new default instance.
4795    pub fn new() -> Self {
4796        std::default::Default::default()
4797    }
4798
4799    /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
4800    ///
4801    /// # Example
4802    /// ```ignore,no_run
4803    /// # use google_cloud_deploy_v1::model::DefaultPool;
4804    /// let x = DefaultPool::new().set_service_account("example");
4805    /// ```
4806    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4807        self.service_account = v.into();
4808        self
4809    }
4810
4811    /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
4812    ///
4813    /// # Example
4814    /// ```ignore,no_run
4815    /// # use google_cloud_deploy_v1::model::DefaultPool;
4816    /// let x = DefaultPool::new().set_artifact_storage("example");
4817    /// ```
4818    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4819        mut self,
4820        v: T,
4821    ) -> Self {
4822        self.artifact_storage = v.into();
4823        self
4824    }
4825}
4826
4827impl wkt::message::Message for DefaultPool {
4828    fn typename() -> &'static str {
4829        "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
4830    }
4831}
4832
4833/// Execution using a private Cloud Build pool.
4834#[derive(Clone, Default, PartialEq)]
4835#[non_exhaustive]
4836pub struct PrivatePool {
4837    /// Required. Resource name of the Cloud Build worker pool to use. The format
4838    /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
4839    pub worker_pool: std::string::String,
4840
4841    /// Optional. Google service account to use for execution. If unspecified,
4842    /// the project execution service account
4843    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4844    pub service_account: std::string::String,
4845
4846    /// Optional. Cloud Storage location where execution outputs should be stored.
4847    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4848    /// ("gs://my-bucket/my-dir").
4849    /// If unspecified, a default bucket located in the same region will be used.
4850    pub artifact_storage: std::string::String,
4851
4852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4853}
4854
4855impl PrivatePool {
4856    /// Creates a new default instance.
4857    pub fn new() -> Self {
4858        std::default::Default::default()
4859    }
4860
4861    /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
4862    ///
4863    /// # Example
4864    /// ```ignore,no_run
4865    /// # use google_cloud_deploy_v1::model::PrivatePool;
4866    /// let x = PrivatePool::new().set_worker_pool("example");
4867    /// ```
4868    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4869        self.worker_pool = v.into();
4870        self
4871    }
4872
4873    /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
4874    ///
4875    /// # Example
4876    /// ```ignore,no_run
4877    /// # use google_cloud_deploy_v1::model::PrivatePool;
4878    /// let x = PrivatePool::new().set_service_account("example");
4879    /// ```
4880    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4881        self.service_account = v.into();
4882        self
4883    }
4884
4885    /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
4886    ///
4887    /// # Example
4888    /// ```ignore,no_run
4889    /// # use google_cloud_deploy_v1::model::PrivatePool;
4890    /// let x = PrivatePool::new().set_artifact_storage("example");
4891    /// ```
4892    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4893        mut self,
4894        v: T,
4895    ) -> Self {
4896        self.artifact_storage = v.into();
4897        self
4898    }
4899}
4900
4901impl wkt::message::Message for PrivatePool {
4902    fn typename() -> &'static str {
4903        "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
4904    }
4905}
4906
4907/// Information specifying a GKE Cluster.
4908#[derive(Clone, Default, PartialEq)]
4909#[non_exhaustive]
4910pub struct GkeCluster {
4911    /// Optional. Information specifying a GKE Cluster. Format is
4912    /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
4913    pub cluster: std::string::String,
4914
4915    /// Optional. If true, `cluster` is accessed using the private IP address of
4916    /// the control plane endpoint. Otherwise, the default IP address of the
4917    /// control plane endpoint is used. The default IP address is the private IP
4918    /// address for clusters with private control-plane endpoints and the public IP
4919    /// address otherwise.
4920    ///
4921    /// Only specify this option when `cluster` is a [private GKE
4922    /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
4923    /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
4924    pub internal_ip: bool,
4925
4926    /// Optional. If set, used to configure a
4927    /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
4928    /// to the Kubernetes server.
4929    pub proxy_url: std::string::String,
4930
4931    /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
4932    /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
4933    pub dns_endpoint: bool,
4934
4935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4936}
4937
4938impl GkeCluster {
4939    /// Creates a new default instance.
4940    pub fn new() -> Self {
4941        std::default::Default::default()
4942    }
4943
4944    /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
4945    ///
4946    /// # Example
4947    /// ```ignore,no_run
4948    /// # use google_cloud_deploy_v1::model::GkeCluster;
4949    /// let x = GkeCluster::new().set_cluster("example");
4950    /// ```
4951    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4952        self.cluster = v.into();
4953        self
4954    }
4955
4956    /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
4957    ///
4958    /// # Example
4959    /// ```ignore,no_run
4960    /// # use google_cloud_deploy_v1::model::GkeCluster;
4961    /// let x = GkeCluster::new().set_internal_ip(true);
4962    /// ```
4963    pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4964        self.internal_ip = v.into();
4965        self
4966    }
4967
4968    /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
4969    ///
4970    /// # Example
4971    /// ```ignore,no_run
4972    /// # use google_cloud_deploy_v1::model::GkeCluster;
4973    /// let x = GkeCluster::new().set_proxy_url("example");
4974    /// ```
4975    pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4976        self.proxy_url = v.into();
4977        self
4978    }
4979
4980    /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
4981    ///
4982    /// # Example
4983    /// ```ignore,no_run
4984    /// # use google_cloud_deploy_v1::model::GkeCluster;
4985    /// let x = GkeCluster::new().set_dns_endpoint(true);
4986    /// ```
4987    pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4988        self.dns_endpoint = v.into();
4989        self
4990    }
4991}
4992
4993impl wkt::message::Message for GkeCluster {
4994    fn typename() -> &'static str {
4995        "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
4996    }
4997}
4998
4999/// Information specifying an Anthos Cluster.
5000#[derive(Clone, Default, PartialEq)]
5001#[non_exhaustive]
5002pub struct AnthosCluster {
5003    /// Optional. Membership of the GKE Hub-registered cluster to which to apply
5004    /// the Skaffold configuration. Format is
5005    /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
5006    pub membership: std::string::String,
5007
5008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5009}
5010
5011impl AnthosCluster {
5012    /// Creates a new default instance.
5013    pub fn new() -> Self {
5014        std::default::Default::default()
5015    }
5016
5017    /// Sets the value of [membership][crate::model::AnthosCluster::membership].
5018    ///
5019    /// # Example
5020    /// ```ignore,no_run
5021    /// # use google_cloud_deploy_v1::model::AnthosCluster;
5022    /// let x = AnthosCluster::new().set_membership("example");
5023    /// ```
5024    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5025        self.membership = v.into();
5026        self
5027    }
5028}
5029
5030impl wkt::message::Message for AnthosCluster {
5031    fn typename() -> &'static str {
5032        "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
5033    }
5034}
5035
5036/// Information specifying where to deploy a Cloud Run Service.
5037#[derive(Clone, Default, PartialEq)]
5038#[non_exhaustive]
5039pub struct CloudRunLocation {
5040    /// Required. The location for the Cloud Run Service. Format must be
5041    /// `projects/{project}/locations/{location}`.
5042    pub location: std::string::String,
5043
5044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5045}
5046
5047impl CloudRunLocation {
5048    /// Creates a new default instance.
5049    pub fn new() -> Self {
5050        std::default::Default::default()
5051    }
5052
5053    /// Sets the value of [location][crate::model::CloudRunLocation::location].
5054    ///
5055    /// # Example
5056    /// ```ignore,no_run
5057    /// # use google_cloud_deploy_v1::model::CloudRunLocation;
5058    /// let x = CloudRunLocation::new().set_location("example");
5059    /// ```
5060    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5061        self.location = v.into();
5062        self
5063    }
5064}
5065
5066impl wkt::message::Message for CloudRunLocation {
5067    fn typename() -> &'static str {
5068        "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
5069    }
5070}
5071
5072/// Information specifying a multiTarget.
5073#[derive(Clone, Default, PartialEq)]
5074#[non_exhaustive]
5075pub struct MultiTarget {
5076    /// Required. The target_ids of this multiTarget.
5077    pub target_ids: std::vec::Vec<std::string::String>,
5078
5079    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5080}
5081
5082impl MultiTarget {
5083    /// Creates a new default instance.
5084    pub fn new() -> Self {
5085        std::default::Default::default()
5086    }
5087
5088    /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
5089    ///
5090    /// # Example
5091    /// ```ignore,no_run
5092    /// # use google_cloud_deploy_v1::model::MultiTarget;
5093    /// let x = MultiTarget::new().set_target_ids(["a", "b", "c"]);
5094    /// ```
5095    pub fn set_target_ids<T, V>(mut self, v: T) -> Self
5096    where
5097        T: std::iter::IntoIterator<Item = V>,
5098        V: std::convert::Into<std::string::String>,
5099    {
5100        use std::iter::Iterator;
5101        self.target_ids = v.into_iter().map(|i| i.into()).collect();
5102        self
5103    }
5104}
5105
5106impl wkt::message::Message for MultiTarget {
5107    fn typename() -> &'static str {
5108        "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
5109    }
5110}
5111
5112/// Information specifying a Custom Target.
5113#[derive(Clone, Default, PartialEq)]
5114#[non_exhaustive]
5115pub struct CustomTarget {
5116    /// Required. The name of the CustomTargetType. Format must be
5117    /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
5118    pub custom_target_type: std::string::String,
5119
5120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5121}
5122
5123impl CustomTarget {
5124    /// Creates a new default instance.
5125    pub fn new() -> Self {
5126        std::default::Default::default()
5127    }
5128
5129    /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
5130    ///
5131    /// # Example
5132    /// ```ignore,no_run
5133    /// # use google_cloud_deploy_v1::model::CustomTarget;
5134    /// let x = CustomTarget::new().set_custom_target_type("example");
5135    /// ```
5136    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
5137        mut self,
5138        v: T,
5139    ) -> Self {
5140        self.custom_target_type = v.into();
5141        self
5142    }
5143}
5144
5145impl wkt::message::Message for CustomTarget {
5146    fn typename() -> &'static str {
5147        "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
5148    }
5149}
5150
5151/// Information about entities associated with a `Target`.
5152#[derive(Clone, Default, PartialEq)]
5153#[non_exhaustive]
5154pub struct AssociatedEntities {
5155    /// Optional. Information specifying GKE clusters as associated entities.
5156    pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
5157
5158    /// Optional. Information specifying Anthos clusters as associated entities.
5159    pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
5160
5161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5162}
5163
5164impl AssociatedEntities {
5165    /// Creates a new default instance.
5166    pub fn new() -> Self {
5167        std::default::Default::default()
5168    }
5169
5170    /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
5171    ///
5172    /// # Example
5173    /// ```ignore,no_run
5174    /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5175    /// use google_cloud_deploy_v1::model::GkeCluster;
5176    /// let x = AssociatedEntities::new()
5177    ///     .set_gke_clusters([
5178    ///         GkeCluster::default()/* use setters */,
5179    ///         GkeCluster::default()/* use (different) setters */,
5180    ///     ]);
5181    /// ```
5182    pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
5183    where
5184        T: std::iter::IntoIterator<Item = V>,
5185        V: std::convert::Into<crate::model::GkeCluster>,
5186    {
5187        use std::iter::Iterator;
5188        self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
5189        self
5190    }
5191
5192    /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
5193    ///
5194    /// # Example
5195    /// ```ignore,no_run
5196    /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5197    /// use google_cloud_deploy_v1::model::AnthosCluster;
5198    /// let x = AssociatedEntities::new()
5199    ///     .set_anthos_clusters([
5200    ///         AnthosCluster::default()/* use setters */,
5201    ///         AnthosCluster::default()/* use (different) setters */,
5202    ///     ]);
5203    /// ```
5204    pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
5205    where
5206        T: std::iter::IntoIterator<Item = V>,
5207        V: std::convert::Into<crate::model::AnthosCluster>,
5208    {
5209        use std::iter::Iterator;
5210        self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
5211        self
5212    }
5213}
5214
5215impl wkt::message::Message for AssociatedEntities {
5216    fn typename() -> &'static str {
5217        "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
5218    }
5219}
5220
5221/// The request object for `ListTargets`.
5222#[derive(Clone, Default, PartialEq)]
5223#[non_exhaustive]
5224pub struct ListTargetsRequest {
5225    /// Required. The parent, which owns this collection of targets. Format must be
5226    /// `projects/{project_id}/locations/{location_name}`.
5227    pub parent: std::string::String,
5228
5229    /// Optional. The maximum number of `Target` objects to return. The service may
5230    /// return fewer than this value. If unspecified, at most 50 `Target` objects
5231    /// will be returned. The maximum value is 1000; values above 1000 will be set
5232    /// to 1000.
5233    pub page_size: i32,
5234
5235    /// Optional. A page token, received from a previous `ListTargets` call.
5236    /// Provide this to retrieve the subsequent page.
5237    ///
5238    /// When paginating, all other provided parameters match
5239    /// the call that provided the page token.
5240    pub page_token: std::string::String,
5241
5242    /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
5243    /// more details.
5244    pub filter: std::string::String,
5245
5246    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
5247    /// more details.
5248    pub order_by: std::string::String,
5249
5250    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5251}
5252
5253impl ListTargetsRequest {
5254    /// Creates a new default instance.
5255    pub fn new() -> Self {
5256        std::default::Default::default()
5257    }
5258
5259    /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
5260    ///
5261    /// # Example
5262    /// ```ignore,no_run
5263    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5264    /// let x = ListTargetsRequest::new().set_parent("example");
5265    /// ```
5266    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5267        self.parent = v.into();
5268        self
5269    }
5270
5271    /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
5272    ///
5273    /// # Example
5274    /// ```ignore,no_run
5275    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5276    /// let x = ListTargetsRequest::new().set_page_size(42);
5277    /// ```
5278    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5279        self.page_size = v.into();
5280        self
5281    }
5282
5283    /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
5284    ///
5285    /// # Example
5286    /// ```ignore,no_run
5287    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5288    /// let x = ListTargetsRequest::new().set_page_token("example");
5289    /// ```
5290    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5291        self.page_token = v.into();
5292        self
5293    }
5294
5295    /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
5296    ///
5297    /// # Example
5298    /// ```ignore,no_run
5299    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5300    /// let x = ListTargetsRequest::new().set_filter("example");
5301    /// ```
5302    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5303        self.filter = v.into();
5304        self
5305    }
5306
5307    /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
5308    ///
5309    /// # Example
5310    /// ```ignore,no_run
5311    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5312    /// let x = ListTargetsRequest::new().set_order_by("example");
5313    /// ```
5314    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5315        self.order_by = v.into();
5316        self
5317    }
5318}
5319
5320impl wkt::message::Message for ListTargetsRequest {
5321    fn typename() -> &'static str {
5322        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
5323    }
5324}
5325
5326/// The response object from `ListTargets`.
5327#[derive(Clone, Default, PartialEq)]
5328#[non_exhaustive]
5329pub struct ListTargetsResponse {
5330    /// The `Target` objects.
5331    pub targets: std::vec::Vec<crate::model::Target>,
5332
5333    /// A token, which can be sent as `page_token` to retrieve the next page.
5334    /// If this field is omitted, there are no subsequent pages.
5335    pub next_page_token: std::string::String,
5336
5337    /// Locations that could not be reached.
5338    pub unreachable: std::vec::Vec<std::string::String>,
5339
5340    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5341}
5342
5343impl ListTargetsResponse {
5344    /// Creates a new default instance.
5345    pub fn new() -> Self {
5346        std::default::Default::default()
5347    }
5348
5349    /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
5350    ///
5351    /// # Example
5352    /// ```ignore,no_run
5353    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5354    /// use google_cloud_deploy_v1::model::Target;
5355    /// let x = ListTargetsResponse::new()
5356    ///     .set_targets([
5357    ///         Target::default()/* use setters */,
5358    ///         Target::default()/* use (different) setters */,
5359    ///     ]);
5360    /// ```
5361    pub fn set_targets<T, V>(mut self, v: T) -> Self
5362    where
5363        T: std::iter::IntoIterator<Item = V>,
5364        V: std::convert::Into<crate::model::Target>,
5365    {
5366        use std::iter::Iterator;
5367        self.targets = v.into_iter().map(|i| i.into()).collect();
5368        self
5369    }
5370
5371    /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
5372    ///
5373    /// # Example
5374    /// ```ignore,no_run
5375    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5376    /// let x = ListTargetsResponse::new().set_next_page_token("example");
5377    /// ```
5378    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5379        self.next_page_token = v.into();
5380        self
5381    }
5382
5383    /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
5384    ///
5385    /// # Example
5386    /// ```ignore,no_run
5387    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5388    /// let x = ListTargetsResponse::new().set_unreachable(["a", "b", "c"]);
5389    /// ```
5390    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5391    where
5392        T: std::iter::IntoIterator<Item = V>,
5393        V: std::convert::Into<std::string::String>,
5394    {
5395        use std::iter::Iterator;
5396        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5397        self
5398    }
5399}
5400
5401impl wkt::message::Message for ListTargetsResponse {
5402    fn typename() -> &'static str {
5403        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
5404    }
5405}
5406
5407#[doc(hidden)]
5408impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetsResponse {
5409    type PageItem = crate::model::Target;
5410
5411    fn items(self) -> std::vec::Vec<Self::PageItem> {
5412        self.targets
5413    }
5414
5415    fn next_page_token(&self) -> std::string::String {
5416        use std::clone::Clone;
5417        self.next_page_token.clone()
5418    }
5419}
5420
5421/// The request object for `GetTarget`.
5422#[derive(Clone, Default, PartialEq)]
5423#[non_exhaustive]
5424pub struct GetTargetRequest {
5425    /// Required. Name of the `Target`. Format must be
5426    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5427    pub name: std::string::String,
5428
5429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5430}
5431
5432impl GetTargetRequest {
5433    /// Creates a new default instance.
5434    pub fn new() -> Self {
5435        std::default::Default::default()
5436    }
5437
5438    /// Sets the value of [name][crate::model::GetTargetRequest::name].
5439    ///
5440    /// # Example
5441    /// ```ignore,no_run
5442    /// # use google_cloud_deploy_v1::model::GetTargetRequest;
5443    /// let x = GetTargetRequest::new().set_name("example");
5444    /// ```
5445    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5446        self.name = v.into();
5447        self
5448    }
5449}
5450
5451impl wkt::message::Message for GetTargetRequest {
5452    fn typename() -> &'static str {
5453        "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
5454    }
5455}
5456
5457/// The request object for `CreateTarget`.
5458#[derive(Clone, Default, PartialEq)]
5459#[non_exhaustive]
5460pub struct CreateTargetRequest {
5461    /// Required. The parent collection in which the `Target` must be created.
5462    /// The format is
5463    /// `projects/{project_id}/locations/{location_name}`.
5464    pub parent: std::string::String,
5465
5466    /// Required. ID of the `Target`.
5467    pub target_id: std::string::String,
5468
5469    /// Required. The `Target` to create.
5470    pub target: std::option::Option<crate::model::Target>,
5471
5472    /// Optional. A request ID to identify requests. Specify a unique request ID
5473    /// so that if you must retry your request, the server knows to ignore the
5474    /// request if it has already been completed. The server guarantees that for
5475    /// at least 60 minutes after the first request.
5476    ///
5477    /// For example, consider a situation where you make an initial request and the
5478    /// request times out. If you make the request again with the same request ID,
5479    /// the server can check if original operation with the same request ID was
5480    /// received, and if so, will ignore the second request. This prevents clients
5481    /// from accidentally creating duplicate commitments.
5482    ///
5483    /// The request ID must be a valid UUID with the exception that zero UUID is
5484    /// not supported (00000000-0000-0000-0000-000000000000).
5485    pub request_id: std::string::String,
5486
5487    /// Optional. If set to true, the request is validated and the user is provided
5488    /// with an expected result, but no actual change is made.
5489    pub validate_only: bool,
5490
5491    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5492}
5493
5494impl CreateTargetRequest {
5495    /// Creates a new default instance.
5496    pub fn new() -> Self {
5497        std::default::Default::default()
5498    }
5499
5500    /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
5501    ///
5502    /// # Example
5503    /// ```ignore,no_run
5504    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5505    /// let x = CreateTargetRequest::new().set_parent("example");
5506    /// ```
5507    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5508        self.parent = v.into();
5509        self
5510    }
5511
5512    /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
5513    ///
5514    /// # Example
5515    /// ```ignore,no_run
5516    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5517    /// let x = CreateTargetRequest::new().set_target_id("example");
5518    /// ```
5519    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5520        self.target_id = v.into();
5521        self
5522    }
5523
5524    /// Sets the value of [target][crate::model::CreateTargetRequest::target].
5525    ///
5526    /// # Example
5527    /// ```ignore,no_run
5528    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5529    /// use google_cloud_deploy_v1::model::Target;
5530    /// let x = CreateTargetRequest::new().set_target(Target::default()/* use setters */);
5531    /// ```
5532    pub fn set_target<T>(mut self, v: T) -> Self
5533    where
5534        T: std::convert::Into<crate::model::Target>,
5535    {
5536        self.target = std::option::Option::Some(v.into());
5537        self
5538    }
5539
5540    /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
5541    ///
5542    /// # Example
5543    /// ```ignore,no_run
5544    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5545    /// use google_cloud_deploy_v1::model::Target;
5546    /// let x = CreateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5547    /// let x = CreateTargetRequest::new().set_or_clear_target(None::<Target>);
5548    /// ```
5549    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5550    where
5551        T: std::convert::Into<crate::model::Target>,
5552    {
5553        self.target = v.map(|x| x.into());
5554        self
5555    }
5556
5557    /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
5558    ///
5559    /// # Example
5560    /// ```ignore,no_run
5561    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5562    /// let x = CreateTargetRequest::new().set_request_id("example");
5563    /// ```
5564    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5565        self.request_id = v.into();
5566        self
5567    }
5568
5569    /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
5570    ///
5571    /// # Example
5572    /// ```ignore,no_run
5573    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5574    /// let x = CreateTargetRequest::new().set_validate_only(true);
5575    /// ```
5576    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5577        self.validate_only = v.into();
5578        self
5579    }
5580}
5581
5582impl wkt::message::Message for CreateTargetRequest {
5583    fn typename() -> &'static str {
5584        "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
5585    }
5586}
5587
5588/// The request object for `UpdateTarget`.
5589#[derive(Clone, Default, PartialEq)]
5590#[non_exhaustive]
5591pub struct UpdateTargetRequest {
5592    /// Required. Field mask is used to specify the fields to be overwritten by the
5593    /// update in the `Target` resource. The fields specified in the update_mask
5594    /// are relative to the resource, not the full request. A field will be
5595    /// overwritten if it's in the mask. If the user doesn't provide a mask then
5596    /// all fields are overwritten.
5597    pub update_mask: std::option::Option<wkt::FieldMask>,
5598
5599    /// Required. The `Target` to update.
5600    pub target: std::option::Option<crate::model::Target>,
5601
5602    /// Optional. A request ID to identify requests. Specify a unique request ID
5603    /// so that if you must retry your request, the server knows to ignore the
5604    /// request if it has already been completed. The server guarantees that for
5605    /// at least 60 minutes after the first request.
5606    ///
5607    /// For example, consider a situation where you make an initial request and the
5608    /// request times out. If you make the request again with the same request ID,
5609    /// the server can check if original operation with the same request ID was
5610    /// received, and if so, will ignore the second request. This prevents clients
5611    /// from accidentally creating duplicate commitments.
5612    ///
5613    /// The request ID must be a valid UUID with the exception that zero UUID is
5614    /// not supported (00000000-0000-0000-0000-000000000000).
5615    pub request_id: std::string::String,
5616
5617    /// Optional. If set to true, updating a `Target` that does not exist will
5618    /// result in the creation of a new `Target`.
5619    pub allow_missing: bool,
5620
5621    /// Optional. If set to true, the request is validated and the user is provided
5622    /// with an expected result, but no actual change is made.
5623    pub validate_only: bool,
5624
5625    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5626}
5627
5628impl UpdateTargetRequest {
5629    /// Creates a new default instance.
5630    pub fn new() -> Self {
5631        std::default::Default::default()
5632    }
5633
5634    /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5635    ///
5636    /// # Example
5637    /// ```ignore,no_run
5638    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5639    /// use wkt::FieldMask;
5640    /// let x = UpdateTargetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5641    /// ```
5642    pub fn set_update_mask<T>(mut self, v: T) -> Self
5643    where
5644        T: std::convert::Into<wkt::FieldMask>,
5645    {
5646        self.update_mask = std::option::Option::Some(v.into());
5647        self
5648    }
5649
5650    /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5651    ///
5652    /// # Example
5653    /// ```ignore,no_run
5654    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5655    /// use wkt::FieldMask;
5656    /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5657    /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5658    /// ```
5659    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5660    where
5661        T: std::convert::Into<wkt::FieldMask>,
5662    {
5663        self.update_mask = v.map(|x| x.into());
5664        self
5665    }
5666
5667    /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
5668    ///
5669    /// # Example
5670    /// ```ignore,no_run
5671    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5672    /// use google_cloud_deploy_v1::model::Target;
5673    /// let x = UpdateTargetRequest::new().set_target(Target::default()/* use setters */);
5674    /// ```
5675    pub fn set_target<T>(mut self, v: T) -> Self
5676    where
5677        T: std::convert::Into<crate::model::Target>,
5678    {
5679        self.target = std::option::Option::Some(v.into());
5680        self
5681    }
5682
5683    /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
5684    ///
5685    /// # Example
5686    /// ```ignore,no_run
5687    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5688    /// use google_cloud_deploy_v1::model::Target;
5689    /// let x = UpdateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5690    /// let x = UpdateTargetRequest::new().set_or_clear_target(None::<Target>);
5691    /// ```
5692    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5693    where
5694        T: std::convert::Into<crate::model::Target>,
5695    {
5696        self.target = v.map(|x| x.into());
5697        self
5698    }
5699
5700    /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
5701    ///
5702    /// # Example
5703    /// ```ignore,no_run
5704    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5705    /// let x = UpdateTargetRequest::new().set_request_id("example");
5706    /// ```
5707    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5708        self.request_id = v.into();
5709        self
5710    }
5711
5712    /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
5713    ///
5714    /// # Example
5715    /// ```ignore,no_run
5716    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5717    /// let x = UpdateTargetRequest::new().set_allow_missing(true);
5718    /// ```
5719    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5720        self.allow_missing = v.into();
5721        self
5722    }
5723
5724    /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
5725    ///
5726    /// # Example
5727    /// ```ignore,no_run
5728    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5729    /// let x = UpdateTargetRequest::new().set_validate_only(true);
5730    /// ```
5731    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5732        self.validate_only = v.into();
5733        self
5734    }
5735}
5736
5737impl wkt::message::Message for UpdateTargetRequest {
5738    fn typename() -> &'static str {
5739        "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
5740    }
5741}
5742
5743/// The request object for `DeleteTarget`.
5744#[derive(Clone, Default, PartialEq)]
5745#[non_exhaustive]
5746pub struct DeleteTargetRequest {
5747    /// Required. The name of the `Target` to delete. The format is
5748    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5749    pub name: std::string::String,
5750
5751    /// Optional. A request ID to identify requests. Specify a unique request ID
5752    /// so that if you must retry your request, the server knows to ignore the
5753    /// request if it has already been completed. The server guarantees that for
5754    /// at least 60 minutes after the first request.
5755    ///
5756    /// For example, consider a situation where you make an initial request and the
5757    /// request times out. If you make the request again with the same request ID,
5758    /// the server can check if original operation with the same request ID was
5759    /// received, and if so, will ignore the second request. This prevents clients
5760    /// from accidentally creating duplicate commitments.
5761    ///
5762    /// The request ID must be a valid UUID with the exception that zero UUID is
5763    /// not supported (00000000-0000-0000-0000-000000000000).
5764    pub request_id: std::string::String,
5765
5766    /// Optional. If set to true, then deleting an already deleted or non-existing
5767    /// `Target` will succeed.
5768    pub allow_missing: bool,
5769
5770    /// Optional. If set, validate the request and preview the review, but do not
5771    /// actually post it.
5772    pub validate_only: bool,
5773
5774    /// Optional. This checksum is computed by the server based on the value of
5775    /// other fields, and may be sent on update and delete requests to ensure the
5776    /// client has an up-to-date value before proceeding.
5777    pub etag: std::string::String,
5778
5779    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5780}
5781
5782impl DeleteTargetRequest {
5783    /// Creates a new default instance.
5784    pub fn new() -> Self {
5785        std::default::Default::default()
5786    }
5787
5788    /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
5789    ///
5790    /// # Example
5791    /// ```ignore,no_run
5792    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5793    /// let x = DeleteTargetRequest::new().set_name("example");
5794    /// ```
5795    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5796        self.name = v.into();
5797        self
5798    }
5799
5800    /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
5801    ///
5802    /// # Example
5803    /// ```ignore,no_run
5804    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5805    /// let x = DeleteTargetRequest::new().set_request_id("example");
5806    /// ```
5807    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5808        self.request_id = v.into();
5809        self
5810    }
5811
5812    /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
5813    ///
5814    /// # Example
5815    /// ```ignore,no_run
5816    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5817    /// let x = DeleteTargetRequest::new().set_allow_missing(true);
5818    /// ```
5819    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5820        self.allow_missing = v.into();
5821        self
5822    }
5823
5824    /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
5825    ///
5826    /// # Example
5827    /// ```ignore,no_run
5828    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5829    /// let x = DeleteTargetRequest::new().set_validate_only(true);
5830    /// ```
5831    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5832        self.validate_only = v.into();
5833        self
5834    }
5835
5836    /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
5837    ///
5838    /// # Example
5839    /// ```ignore,no_run
5840    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5841    /// let x = DeleteTargetRequest::new().set_etag("example");
5842    /// ```
5843    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5844        self.etag = v.into();
5845        self
5846    }
5847}
5848
5849impl wkt::message::Message for DeleteTargetRequest {
5850    fn typename() -> &'static str {
5851        "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
5852    }
5853}
5854
5855/// A `CustomTargetType` resource in the Cloud Deploy API.
5856///
5857/// A `CustomTargetType` defines a type of custom target that can be referenced
5858/// in a `Target` in order to facilitate deploying to other systems besides the
5859/// supported runtimes.
5860#[derive(Clone, Default, PartialEq)]
5861#[non_exhaustive]
5862pub struct CustomTargetType {
5863    /// Identifier. Name of the `CustomTargetType`. Format is
5864    /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
5865    /// The `customTargetType` component must match
5866    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5867    pub name: std::string::String,
5868
5869    /// Output only. Resource id of the `CustomTargetType`.
5870    pub custom_target_type_id: std::string::String,
5871
5872    /// Output only. Unique identifier of the `CustomTargetType`.
5873    pub uid: std::string::String,
5874
5875    /// Optional. Description of the `CustomTargetType`. Max length is 255
5876    /// characters.
5877    pub description: std::string::String,
5878
5879    /// Optional. User annotations. These attributes can only be set and used by
5880    /// the user, and not by Cloud Deploy. See
5881    /// <https://google.aip.dev/128#annotations> for more details such as format and
5882    /// size limitations.
5883    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5884
5885    /// Optional. Labels are attributes that can be set and used by both the
5886    /// user and by Cloud Deploy. Labels must meet the following constraints:
5887    ///
5888    /// * Keys and values can contain only lowercase letters, numeric characters,
5889    ///   underscores, and dashes.
5890    /// * All characters must use UTF-8 encoding, and international characters are
5891    ///   allowed.
5892    /// * Keys must start with a lowercase letter or international character.
5893    /// * Each resource is limited to a maximum of 64 labels.
5894    ///
5895    /// Both keys and values are additionally constrained to be <= 128 bytes.
5896    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5897
5898    /// Output only. Time at which the `CustomTargetType` was created.
5899    pub create_time: std::option::Option<wkt::Timestamp>,
5900
5901    /// Output only. Most recent time at which the `CustomTargetType` was updated.
5902    pub update_time: std::option::Option<wkt::Timestamp>,
5903
5904    /// Optional. This checksum is computed by the server based on the value of
5905    /// other fields, and may be sent on update and delete requests to ensure the
5906    /// client has an up-to-date value before proceeding.
5907    pub etag: std::string::String,
5908
5909    /// Defines the `CustomTargetType` renderer and deployer.
5910    pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
5911
5912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5913}
5914
5915impl CustomTargetType {
5916    /// Creates a new default instance.
5917    pub fn new() -> Self {
5918        std::default::Default::default()
5919    }
5920
5921    /// Sets the value of [name][crate::model::CustomTargetType::name].
5922    ///
5923    /// # Example
5924    /// ```ignore,no_run
5925    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5926    /// let x = CustomTargetType::new().set_name("example");
5927    /// ```
5928    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5929        self.name = v.into();
5930        self
5931    }
5932
5933    /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
5934    ///
5935    /// # Example
5936    /// ```ignore,no_run
5937    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5938    /// let x = CustomTargetType::new().set_custom_target_type_id("example");
5939    /// ```
5940    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5941        mut self,
5942        v: T,
5943    ) -> Self {
5944        self.custom_target_type_id = v.into();
5945        self
5946    }
5947
5948    /// Sets the value of [uid][crate::model::CustomTargetType::uid].
5949    ///
5950    /// # Example
5951    /// ```ignore,no_run
5952    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5953    /// let x = CustomTargetType::new().set_uid("example");
5954    /// ```
5955    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5956        self.uid = v.into();
5957        self
5958    }
5959
5960    /// Sets the value of [description][crate::model::CustomTargetType::description].
5961    ///
5962    /// # Example
5963    /// ```ignore,no_run
5964    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5965    /// let x = CustomTargetType::new().set_description("example");
5966    /// ```
5967    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5968        self.description = v.into();
5969        self
5970    }
5971
5972    /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
5973    ///
5974    /// # Example
5975    /// ```ignore,no_run
5976    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5977    /// let x = CustomTargetType::new().set_annotations([
5978    ///     ("key0", "abc"),
5979    ///     ("key1", "xyz"),
5980    /// ]);
5981    /// ```
5982    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5983    where
5984        T: std::iter::IntoIterator<Item = (K, V)>,
5985        K: std::convert::Into<std::string::String>,
5986        V: std::convert::Into<std::string::String>,
5987    {
5988        use std::iter::Iterator;
5989        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5990        self
5991    }
5992
5993    /// Sets the value of [labels][crate::model::CustomTargetType::labels].
5994    ///
5995    /// # Example
5996    /// ```ignore,no_run
5997    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5998    /// let x = CustomTargetType::new().set_labels([
5999    ///     ("key0", "abc"),
6000    ///     ("key1", "xyz"),
6001    /// ]);
6002    /// ```
6003    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6004    where
6005        T: std::iter::IntoIterator<Item = (K, V)>,
6006        K: std::convert::Into<std::string::String>,
6007        V: std::convert::Into<std::string::String>,
6008    {
6009        use std::iter::Iterator;
6010        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6011        self
6012    }
6013
6014    /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
6015    ///
6016    /// # Example
6017    /// ```ignore,no_run
6018    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6019    /// use wkt::Timestamp;
6020    /// let x = CustomTargetType::new().set_create_time(Timestamp::default()/* use setters */);
6021    /// ```
6022    pub fn set_create_time<T>(mut self, v: T) -> Self
6023    where
6024        T: std::convert::Into<wkt::Timestamp>,
6025    {
6026        self.create_time = std::option::Option::Some(v.into());
6027        self
6028    }
6029
6030    /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
6031    ///
6032    /// # Example
6033    /// ```ignore,no_run
6034    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6035    /// use wkt::Timestamp;
6036    /// let x = CustomTargetType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6037    /// let x = CustomTargetType::new().set_or_clear_create_time(None::<Timestamp>);
6038    /// ```
6039    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6040    where
6041        T: std::convert::Into<wkt::Timestamp>,
6042    {
6043        self.create_time = v.map(|x| x.into());
6044        self
6045    }
6046
6047    /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
6048    ///
6049    /// # Example
6050    /// ```ignore,no_run
6051    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6052    /// use wkt::Timestamp;
6053    /// let x = CustomTargetType::new().set_update_time(Timestamp::default()/* use setters */);
6054    /// ```
6055    pub fn set_update_time<T>(mut self, v: T) -> Self
6056    where
6057        T: std::convert::Into<wkt::Timestamp>,
6058    {
6059        self.update_time = std::option::Option::Some(v.into());
6060        self
6061    }
6062
6063    /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
6064    ///
6065    /// # Example
6066    /// ```ignore,no_run
6067    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6068    /// use wkt::Timestamp;
6069    /// let x = CustomTargetType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6070    /// let x = CustomTargetType::new().set_or_clear_update_time(None::<Timestamp>);
6071    /// ```
6072    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6073    where
6074        T: std::convert::Into<wkt::Timestamp>,
6075    {
6076        self.update_time = v.map(|x| x.into());
6077        self
6078    }
6079
6080    /// Sets the value of [etag][crate::model::CustomTargetType::etag].
6081    ///
6082    /// # Example
6083    /// ```ignore,no_run
6084    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6085    /// let x = CustomTargetType::new().set_etag("example");
6086    /// ```
6087    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6088        self.etag = v.into();
6089        self
6090    }
6091
6092    /// Sets the value of [definition][crate::model::CustomTargetType::definition].
6093    ///
6094    /// Note that all the setters affecting `definition` are mutually
6095    /// exclusive.
6096    ///
6097    /// # Example
6098    /// ```ignore,no_run
6099    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6100    /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6101    /// let x = CustomTargetType::new().set_definition(Some(
6102    ///     google_cloud_deploy_v1::model::custom_target_type::Definition::CustomActions(CustomTargetSkaffoldActions::default().into())));
6103    /// ```
6104    pub fn set_definition<
6105        T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
6106    >(
6107        mut self,
6108        v: T,
6109    ) -> Self {
6110        self.definition = v.into();
6111        self
6112    }
6113
6114    /// The value of [definition][crate::model::CustomTargetType::definition]
6115    /// if it holds a `CustomActions`, `None` if the field is not set or
6116    /// holds a different branch.
6117    pub fn custom_actions(
6118        &self,
6119    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
6120        #[allow(unreachable_patterns)]
6121        self.definition.as_ref().and_then(|v| match v {
6122            crate::model::custom_target_type::Definition::CustomActions(v) => {
6123                std::option::Option::Some(v)
6124            }
6125            _ => std::option::Option::None,
6126        })
6127    }
6128
6129    /// Sets the value of [definition][crate::model::CustomTargetType::definition]
6130    /// to hold a `CustomActions`.
6131    ///
6132    /// Note that all the setters affecting `definition` are
6133    /// mutually exclusive.
6134    ///
6135    /// # Example
6136    /// ```ignore,no_run
6137    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6138    /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6139    /// let x = CustomTargetType::new().set_custom_actions(CustomTargetSkaffoldActions::default()/* use setters */);
6140    /// assert!(x.custom_actions().is_some());
6141    /// ```
6142    pub fn set_custom_actions<
6143        T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
6144    >(
6145        mut self,
6146        v: T,
6147    ) -> Self {
6148        self.definition = std::option::Option::Some(
6149            crate::model::custom_target_type::Definition::CustomActions(v.into()),
6150        );
6151        self
6152    }
6153}
6154
6155impl wkt::message::Message for CustomTargetType {
6156    fn typename() -> &'static str {
6157        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
6158    }
6159}
6160
6161/// Defines additional types related to [CustomTargetType].
6162pub mod custom_target_type {
6163    #[allow(unused_imports)]
6164    use super::*;
6165
6166    /// Defines the `CustomTargetType` renderer and deployer.
6167    #[derive(Clone, Debug, PartialEq)]
6168    #[non_exhaustive]
6169    pub enum Definition {
6170        /// Optional. Configures render and deploy for the `CustomTargetType` using
6171        /// Skaffold custom actions.
6172        CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
6173    }
6174}
6175
6176/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
6177/// using Skaffold custom actions.
6178#[derive(Clone, Default, PartialEq)]
6179#[non_exhaustive]
6180pub struct CustomTargetSkaffoldActions {
6181    /// Optional. The Skaffold custom action responsible for render operations. If
6182    /// not provided then Cloud Deploy will perform the render operations via
6183    /// `skaffold render`.
6184    pub render_action: std::string::String,
6185
6186    /// Required. The Skaffold custom action responsible for deploy operations.
6187    pub deploy_action: std::string::String,
6188
6189    /// Optional. List of Skaffold modules Cloud Deploy will include in the
6190    /// Skaffold Config as required before performing diagnose.
6191    pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
6192
6193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6194}
6195
6196impl CustomTargetSkaffoldActions {
6197    /// Creates a new default instance.
6198    pub fn new() -> Self {
6199        std::default::Default::default()
6200    }
6201
6202    /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
6203    ///
6204    /// # Example
6205    /// ```ignore,no_run
6206    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6207    /// let x = CustomTargetSkaffoldActions::new().set_render_action("example");
6208    /// ```
6209    pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6210        self.render_action = v.into();
6211        self
6212    }
6213
6214    /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
6215    ///
6216    /// # Example
6217    /// ```ignore,no_run
6218    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6219    /// let x = CustomTargetSkaffoldActions::new().set_deploy_action("example");
6220    /// ```
6221    pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6222        self.deploy_action = v.into();
6223        self
6224    }
6225
6226    /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
6227    ///
6228    /// # Example
6229    /// ```ignore,no_run
6230    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6231    /// use google_cloud_deploy_v1::model::SkaffoldModules;
6232    /// let x = CustomTargetSkaffoldActions::new()
6233    ///     .set_include_skaffold_modules([
6234    ///         SkaffoldModules::default()/* use setters */,
6235    ///         SkaffoldModules::default()/* use (different) setters */,
6236    ///     ]);
6237    /// ```
6238    pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
6239    where
6240        T: std::iter::IntoIterator<Item = V>,
6241        V: std::convert::Into<crate::model::SkaffoldModules>,
6242    {
6243        use std::iter::Iterator;
6244        self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
6245        self
6246    }
6247}
6248
6249impl wkt::message::Message for CustomTargetSkaffoldActions {
6250    fn typename() -> &'static str {
6251        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
6252    }
6253}
6254
6255/// Skaffold Config modules and their remote source.
6256#[derive(Clone, Default, PartialEq)]
6257#[non_exhaustive]
6258pub struct SkaffoldModules {
6259    /// Optional. The Skaffold Config modules to use from the specified source.
6260    pub configs: std::vec::Vec<std::string::String>,
6261
6262    /// The source that contains the Skaffold Config modules.
6263    pub source: std::option::Option<crate::model::skaffold_modules::Source>,
6264
6265    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6266}
6267
6268impl SkaffoldModules {
6269    /// Creates a new default instance.
6270    pub fn new() -> Self {
6271        std::default::Default::default()
6272    }
6273
6274    /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
6275    ///
6276    /// # Example
6277    /// ```ignore,no_run
6278    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6279    /// let x = SkaffoldModules::new().set_configs(["a", "b", "c"]);
6280    /// ```
6281    pub fn set_configs<T, V>(mut self, v: T) -> Self
6282    where
6283        T: std::iter::IntoIterator<Item = V>,
6284        V: std::convert::Into<std::string::String>,
6285    {
6286        use std::iter::Iterator;
6287        self.configs = v.into_iter().map(|i| i.into()).collect();
6288        self
6289    }
6290
6291    /// Sets the value of [source][crate::model::SkaffoldModules::source].
6292    ///
6293    /// Note that all the setters affecting `source` are mutually
6294    /// exclusive.
6295    ///
6296    /// # Example
6297    /// ```ignore,no_run
6298    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6299    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6300    /// let x = SkaffoldModules::new().set_source(Some(
6301    ///     google_cloud_deploy_v1::model::skaffold_modules::Source::Git(SkaffoldGitSource::default().into())));
6302    /// ```
6303    pub fn set_source<
6304        T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
6305    >(
6306        mut self,
6307        v: T,
6308    ) -> Self {
6309        self.source = v.into();
6310        self
6311    }
6312
6313    /// The value of [source][crate::model::SkaffoldModules::source]
6314    /// if it holds a `Git`, `None` if the field is not set or
6315    /// holds a different branch.
6316    pub fn git(
6317        &self,
6318    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
6319    {
6320        #[allow(unreachable_patterns)]
6321        self.source.as_ref().and_then(|v| match v {
6322            crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
6323            _ => std::option::Option::None,
6324        })
6325    }
6326
6327    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6328    /// to hold a `Git`.
6329    ///
6330    /// Note that all the setters affecting `source` are
6331    /// mutually exclusive.
6332    ///
6333    /// # Example
6334    /// ```ignore,no_run
6335    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6336    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6337    /// let x = SkaffoldModules::new().set_git(SkaffoldGitSource::default()/* use setters */);
6338    /// assert!(x.git().is_some());
6339    /// assert!(x.google_cloud_storage().is_none());
6340    /// assert!(x.google_cloud_build_repo().is_none());
6341    /// ```
6342    pub fn set_git<
6343        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
6344    >(
6345        mut self,
6346        v: T,
6347    ) -> Self {
6348        self.source =
6349            std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
6350        self
6351    }
6352
6353    /// The value of [source][crate::model::SkaffoldModules::source]
6354    /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
6355    /// holds a different branch.
6356    pub fn google_cloud_storage(
6357        &self,
6358    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
6359    {
6360        #[allow(unreachable_patterns)]
6361        self.source.as_ref().and_then(|v| match v {
6362            crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
6363                std::option::Option::Some(v)
6364            }
6365            _ => std::option::Option::None,
6366        })
6367    }
6368
6369    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6370    /// to hold a `GoogleCloudStorage`.
6371    ///
6372    /// Note that all the setters affecting `source` are
6373    /// mutually exclusive.
6374    ///
6375    /// # Example
6376    /// ```ignore,no_run
6377    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6378    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6379    /// let x = SkaffoldModules::new().set_google_cloud_storage(SkaffoldGCSSource::default()/* use setters */);
6380    /// assert!(x.google_cloud_storage().is_some());
6381    /// assert!(x.git().is_none());
6382    /// assert!(x.google_cloud_build_repo().is_none());
6383    /// ```
6384    pub fn set_google_cloud_storage<
6385        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
6386    >(
6387        mut self,
6388        v: T,
6389    ) -> Self {
6390        self.source = std::option::Option::Some(
6391            crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
6392        );
6393        self
6394    }
6395
6396    /// The value of [source][crate::model::SkaffoldModules::source]
6397    /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
6398    /// holds a different branch.
6399    pub fn google_cloud_build_repo(
6400        &self,
6401    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
6402    {
6403        #[allow(unreachable_patterns)]
6404        self.source.as_ref().and_then(|v| match v {
6405            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
6406                std::option::Option::Some(v)
6407            }
6408            _ => std::option::Option::None,
6409        })
6410    }
6411
6412    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6413    /// to hold a `GoogleCloudBuildRepo`.
6414    ///
6415    /// Note that all the setters affecting `source` are
6416    /// mutually exclusive.
6417    ///
6418    /// # Example
6419    /// ```ignore,no_run
6420    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6421    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6422    /// let x = SkaffoldModules::new().set_google_cloud_build_repo(SkaffoldGCBRepoSource::default()/* use setters */);
6423    /// assert!(x.google_cloud_build_repo().is_some());
6424    /// assert!(x.git().is_none());
6425    /// assert!(x.google_cloud_storage().is_none());
6426    /// ```
6427    pub fn set_google_cloud_build_repo<
6428        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
6429    >(
6430        mut self,
6431        v: T,
6432    ) -> Self {
6433        self.source = std::option::Option::Some(
6434            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
6435        );
6436        self
6437    }
6438}
6439
6440impl wkt::message::Message for SkaffoldModules {
6441    fn typename() -> &'static str {
6442        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
6443    }
6444}
6445
6446/// Defines additional types related to [SkaffoldModules].
6447pub mod skaffold_modules {
6448    #[allow(unused_imports)]
6449    use super::*;
6450
6451    /// Git repository containing Skaffold Config modules.
6452    #[derive(Clone, Default, PartialEq)]
6453    #[non_exhaustive]
6454    pub struct SkaffoldGitSource {
6455        /// Required. Git repository the package should be cloned from.
6456        pub repo: std::string::String,
6457
6458        /// Optional. Relative path from the repository root to the Skaffold file.
6459        pub path: std::string::String,
6460
6461        /// Optional. Git branch or tag to use when cloning the repository.
6462        pub r#ref: std::string::String,
6463
6464        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6465    }
6466
6467    impl SkaffoldGitSource {
6468        /// Creates a new default instance.
6469        pub fn new() -> Self {
6470            std::default::Default::default()
6471        }
6472
6473        /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
6474        ///
6475        /// # Example
6476        /// ```ignore,no_run
6477        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6478        /// let x = SkaffoldGitSource::new().set_repo("example");
6479        /// ```
6480        pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6481            self.repo = v.into();
6482            self
6483        }
6484
6485        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
6486        ///
6487        /// # Example
6488        /// ```ignore,no_run
6489        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6490        /// let x = SkaffoldGitSource::new().set_path("example");
6491        /// ```
6492        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6493            self.path = v.into();
6494            self
6495        }
6496
6497        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
6498        ///
6499        /// # Example
6500        /// ```ignore,no_run
6501        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6502        /// let x = SkaffoldGitSource::new().set_ref("example");
6503        /// ```
6504        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6505            self.r#ref = v.into();
6506            self
6507        }
6508    }
6509
6510    impl wkt::message::Message for SkaffoldGitSource {
6511        fn typename() -> &'static str {
6512            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
6513        }
6514    }
6515
6516    /// Cloud Storage bucket containing Skaffold Config modules.
6517    #[derive(Clone, Default, PartialEq)]
6518    #[non_exhaustive]
6519    pub struct SkaffoldGCSSource {
6520        /// Required. Cloud Storage source paths to copy recursively. For example,
6521        /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
6522        /// all files within the "dir/configs" directory in the bucket "my-bucket".
6523        pub source: std::string::String,
6524
6525        /// Optional. Relative path from the source to the Skaffold file.
6526        pub path: std::string::String,
6527
6528        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6529    }
6530
6531    impl SkaffoldGCSSource {
6532        /// Creates a new default instance.
6533        pub fn new() -> Self {
6534            std::default::Default::default()
6535        }
6536
6537        /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
6538        ///
6539        /// # Example
6540        /// ```ignore,no_run
6541        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6542        /// let x = SkaffoldGCSSource::new().set_source("example");
6543        /// ```
6544        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6545            self.source = v.into();
6546            self
6547        }
6548
6549        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
6550        ///
6551        /// # Example
6552        /// ```ignore,no_run
6553        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6554        /// let x = SkaffoldGCSSource::new().set_path("example");
6555        /// ```
6556        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6557            self.path = v.into();
6558            self
6559        }
6560    }
6561
6562    impl wkt::message::Message for SkaffoldGCSSource {
6563        fn typename() -> &'static str {
6564            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
6565        }
6566    }
6567
6568    /// Cloud Build V2 Repository containing Skaffold Configs.
6569    #[derive(Clone, Default, PartialEq)]
6570    #[non_exhaustive]
6571    pub struct SkaffoldGCBRepoSource {
6572        /// Required. Name of the Cloud Build V2 Repository.
6573        /// Format is
6574        /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
6575        pub repository: std::string::String,
6576
6577        /// Optional. Relative path from the repository root to the Skaffold Config
6578        /// file.
6579        pub path: std::string::String,
6580
6581        /// Optional. Branch or tag to use when cloning the repository.
6582        pub r#ref: std::string::String,
6583
6584        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6585    }
6586
6587    impl SkaffoldGCBRepoSource {
6588        /// Creates a new default instance.
6589        pub fn new() -> Self {
6590            std::default::Default::default()
6591        }
6592
6593        /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
6594        ///
6595        /// # Example
6596        /// ```ignore,no_run
6597        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6598        /// let x = SkaffoldGCBRepoSource::new().set_repository("example");
6599        /// ```
6600        pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6601            self.repository = v.into();
6602            self
6603        }
6604
6605        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
6606        ///
6607        /// # Example
6608        /// ```ignore,no_run
6609        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6610        /// let x = SkaffoldGCBRepoSource::new().set_path("example");
6611        /// ```
6612        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6613            self.path = v.into();
6614            self
6615        }
6616
6617        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
6618        ///
6619        /// # Example
6620        /// ```ignore,no_run
6621        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6622        /// let x = SkaffoldGCBRepoSource::new().set_ref("example");
6623        /// ```
6624        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6625            self.r#ref = v.into();
6626            self
6627        }
6628    }
6629
6630    impl wkt::message::Message for SkaffoldGCBRepoSource {
6631        fn typename() -> &'static str {
6632            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
6633        }
6634    }
6635
6636    /// The source that contains the Skaffold Config modules.
6637    #[derive(Clone, Debug, PartialEq)]
6638    #[non_exhaustive]
6639    pub enum Source {
6640        /// Optional. Remote git repository containing the Skaffold Config modules.
6641        Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
6642        /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
6643        GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
6644        /// Optional. Cloud Build V2 repository containing the Skaffold Config
6645        /// modules.
6646        GoogleCloudBuildRepo(
6647            std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
6648        ),
6649    }
6650}
6651
6652/// The request object for `ListCustomTargetTypes`.
6653#[derive(Clone, Default, PartialEq)]
6654#[non_exhaustive]
6655pub struct ListCustomTargetTypesRequest {
6656    /// Required. The parent that owns this collection of custom target types.
6657    /// Format must be `projects/{project_id}/locations/{location_name}`.
6658    pub parent: std::string::String,
6659
6660    /// Optional. The maximum number of `CustomTargetType` objects to return. The
6661    /// service may return fewer than this value. If unspecified, at most 50
6662    /// `CustomTargetType` objects will be returned. The maximum value is 1000;
6663    /// values above 1000 will be set to 1000.
6664    pub page_size: i32,
6665
6666    /// Optional. A page token, received from a previous `ListCustomTargetTypes`
6667    /// call. Provide this to retrieve the subsequent page.
6668    ///
6669    /// When paginating, all other provided parameters match
6670    /// the call that provided the page token.
6671    pub page_token: std::string::String,
6672
6673    /// Optional. Filter custom target types to be returned. See
6674    /// <https://google.aip.dev/160> for more details.
6675    pub filter: std::string::String,
6676
6677    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
6678    /// more details.
6679    pub order_by: std::string::String,
6680
6681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6682}
6683
6684impl ListCustomTargetTypesRequest {
6685    /// Creates a new default instance.
6686    pub fn new() -> Self {
6687        std::default::Default::default()
6688    }
6689
6690    /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
6691    ///
6692    /// # Example
6693    /// ```ignore,no_run
6694    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6695    /// let x = ListCustomTargetTypesRequest::new().set_parent("example");
6696    /// ```
6697    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6698        self.parent = v.into();
6699        self
6700    }
6701
6702    /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
6703    ///
6704    /// # Example
6705    /// ```ignore,no_run
6706    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6707    /// let x = ListCustomTargetTypesRequest::new().set_page_size(42);
6708    /// ```
6709    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6710        self.page_size = v.into();
6711        self
6712    }
6713
6714    /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
6715    ///
6716    /// # Example
6717    /// ```ignore,no_run
6718    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6719    /// let x = ListCustomTargetTypesRequest::new().set_page_token("example");
6720    /// ```
6721    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6722        self.page_token = v.into();
6723        self
6724    }
6725
6726    /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
6727    ///
6728    /// # Example
6729    /// ```ignore,no_run
6730    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6731    /// let x = ListCustomTargetTypesRequest::new().set_filter("example");
6732    /// ```
6733    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6734        self.filter = v.into();
6735        self
6736    }
6737
6738    /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
6739    ///
6740    /// # Example
6741    /// ```ignore,no_run
6742    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6743    /// let x = ListCustomTargetTypesRequest::new().set_order_by("example");
6744    /// ```
6745    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6746        self.order_by = v.into();
6747        self
6748    }
6749}
6750
6751impl wkt::message::Message for ListCustomTargetTypesRequest {
6752    fn typename() -> &'static str {
6753        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
6754    }
6755}
6756
6757/// The response object from `ListCustomTargetTypes.`
6758#[derive(Clone, Default, PartialEq)]
6759#[non_exhaustive]
6760pub struct ListCustomTargetTypesResponse {
6761    /// The `CustomTargetType` objects.
6762    pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
6763
6764    /// A token, which can be sent as `page_token` to retrieve the next page.
6765    /// If this field is omitted, there are no subsequent pages.
6766    pub next_page_token: std::string::String,
6767
6768    /// Locations that could not be reached.
6769    pub unreachable: std::vec::Vec<std::string::String>,
6770
6771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6772}
6773
6774impl ListCustomTargetTypesResponse {
6775    /// Creates a new default instance.
6776    pub fn new() -> Self {
6777        std::default::Default::default()
6778    }
6779
6780    /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
6781    ///
6782    /// # Example
6783    /// ```ignore,no_run
6784    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6785    /// use google_cloud_deploy_v1::model::CustomTargetType;
6786    /// let x = ListCustomTargetTypesResponse::new()
6787    ///     .set_custom_target_types([
6788    ///         CustomTargetType::default()/* use setters */,
6789    ///         CustomTargetType::default()/* use (different) setters */,
6790    ///     ]);
6791    /// ```
6792    pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
6793    where
6794        T: std::iter::IntoIterator<Item = V>,
6795        V: std::convert::Into<crate::model::CustomTargetType>,
6796    {
6797        use std::iter::Iterator;
6798        self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
6799        self
6800    }
6801
6802    /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
6803    ///
6804    /// # Example
6805    /// ```ignore,no_run
6806    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6807    /// let x = ListCustomTargetTypesResponse::new().set_next_page_token("example");
6808    /// ```
6809    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6810        self.next_page_token = v.into();
6811        self
6812    }
6813
6814    /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
6815    ///
6816    /// # Example
6817    /// ```ignore,no_run
6818    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6819    /// let x = ListCustomTargetTypesResponse::new().set_unreachable(["a", "b", "c"]);
6820    /// ```
6821    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6822    where
6823        T: std::iter::IntoIterator<Item = V>,
6824        V: std::convert::Into<std::string::String>,
6825    {
6826        use std::iter::Iterator;
6827        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6828        self
6829    }
6830}
6831
6832impl wkt::message::Message for ListCustomTargetTypesResponse {
6833    fn typename() -> &'static str {
6834        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
6835    }
6836}
6837
6838#[doc(hidden)]
6839impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
6840    type PageItem = crate::model::CustomTargetType;
6841
6842    fn items(self) -> std::vec::Vec<Self::PageItem> {
6843        self.custom_target_types
6844    }
6845
6846    fn next_page_token(&self) -> std::string::String {
6847        use std::clone::Clone;
6848        self.next_page_token.clone()
6849    }
6850}
6851
6852/// The request object for `GetCustomTargetType`.
6853#[derive(Clone, Default, PartialEq)]
6854#[non_exhaustive]
6855pub struct GetCustomTargetTypeRequest {
6856    /// Required. Name of the `CustomTargetType`. Format must be
6857    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
6858    pub name: std::string::String,
6859
6860    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6861}
6862
6863impl GetCustomTargetTypeRequest {
6864    /// Creates a new default instance.
6865    pub fn new() -> Self {
6866        std::default::Default::default()
6867    }
6868
6869    /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
6870    ///
6871    /// # Example
6872    /// ```ignore,no_run
6873    /// # use google_cloud_deploy_v1::model::GetCustomTargetTypeRequest;
6874    /// let x = GetCustomTargetTypeRequest::new().set_name("example");
6875    /// ```
6876    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6877        self.name = v.into();
6878        self
6879    }
6880}
6881
6882impl wkt::message::Message for GetCustomTargetTypeRequest {
6883    fn typename() -> &'static str {
6884        "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
6885    }
6886}
6887
6888/// The request object for `CreateCustomTargetType`.
6889#[derive(Clone, Default, PartialEq)]
6890#[non_exhaustive]
6891pub struct CreateCustomTargetTypeRequest {
6892    /// Required. The parent collection in which the `CustomTargetType` must be
6893    /// created. The format is `projects/{project_id}/locations/{location_name}`.
6894    pub parent: std::string::String,
6895
6896    /// Required. ID of the `CustomTargetType`.
6897    pub custom_target_type_id: std::string::String,
6898
6899    /// Required. The `CustomTargetType` to create.
6900    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6901
6902    /// Optional. A request ID to identify requests. Specify a unique request ID
6903    /// so that if you must retry your request, the server knows to ignore the
6904    /// request if it has already been completed. The server guarantees that for
6905    /// at least 60 minutes after the first request.
6906    ///
6907    /// For example, consider a situation where you make an initial request and the
6908    /// request times out. If you make the request again with the same request ID,
6909    /// the server can check if original operation with the same request ID was
6910    /// received, and if so, will ignore the second request. This prevents clients
6911    /// from accidentally creating duplicate commitments.
6912    ///
6913    /// The request ID must be a valid UUID with the exception that zero UUID is
6914    /// not supported (00000000-0000-0000-0000-000000000000).
6915    pub request_id: std::string::String,
6916
6917    /// Optional. If set to true, the request is validated and the user is provided
6918    /// with an expected result, but no actual change is made.
6919    pub validate_only: bool,
6920
6921    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6922}
6923
6924impl CreateCustomTargetTypeRequest {
6925    /// Creates a new default instance.
6926    pub fn new() -> Self {
6927        std::default::Default::default()
6928    }
6929
6930    /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
6931    ///
6932    /// # Example
6933    /// ```ignore,no_run
6934    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6935    /// let x = CreateCustomTargetTypeRequest::new().set_parent("example");
6936    /// ```
6937    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6938        self.parent = v.into();
6939        self
6940    }
6941
6942    /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
6943    ///
6944    /// # Example
6945    /// ```ignore,no_run
6946    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6947    /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type_id("example");
6948    /// ```
6949    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
6950        mut self,
6951        v: T,
6952    ) -> Self {
6953        self.custom_target_type_id = v.into();
6954        self
6955    }
6956
6957    /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6958    ///
6959    /// # Example
6960    /// ```ignore,no_run
6961    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6962    /// use google_cloud_deploy_v1::model::CustomTargetType;
6963    /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
6964    /// ```
6965    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
6966    where
6967        T: std::convert::Into<crate::model::CustomTargetType>,
6968    {
6969        self.custom_target_type = std::option::Option::Some(v.into());
6970        self
6971    }
6972
6973    /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6974    ///
6975    /// # Example
6976    /// ```ignore,no_run
6977    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6978    /// use google_cloud_deploy_v1::model::CustomTargetType;
6979    /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
6980    /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
6981    /// ```
6982    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
6983    where
6984        T: std::convert::Into<crate::model::CustomTargetType>,
6985    {
6986        self.custom_target_type = v.map(|x| x.into());
6987        self
6988    }
6989
6990    /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
6991    ///
6992    /// # Example
6993    /// ```ignore,no_run
6994    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6995    /// let x = CreateCustomTargetTypeRequest::new().set_request_id("example");
6996    /// ```
6997    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6998        self.request_id = v.into();
6999        self
7000    }
7001
7002    /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
7003    ///
7004    /// # Example
7005    /// ```ignore,no_run
7006    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7007    /// let x = CreateCustomTargetTypeRequest::new().set_validate_only(true);
7008    /// ```
7009    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7010        self.validate_only = v.into();
7011        self
7012    }
7013}
7014
7015impl wkt::message::Message for CreateCustomTargetTypeRequest {
7016    fn typename() -> &'static str {
7017        "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
7018    }
7019}
7020
7021/// The request object for `UpdateCustomTargetType`.
7022#[derive(Clone, Default, PartialEq)]
7023#[non_exhaustive]
7024pub struct UpdateCustomTargetTypeRequest {
7025    /// Required. Field mask is used to specify the fields to be overwritten by the
7026    /// update in the `CustomTargetType` resource. The fields specified in the
7027    /// update_mask are relative to the resource, not the full request. A field
7028    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
7029    /// then all fields are overwritten.
7030    pub update_mask: std::option::Option<wkt::FieldMask>,
7031
7032    /// Required. The `CustomTargetType` to update.
7033    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
7034
7035    /// Optional. A request ID to identify requests. Specify a unique request ID
7036    /// so that if you must retry your request, the server knows to ignore the
7037    /// request if it has already been completed. The server guarantees that for
7038    /// at least 60 minutes after the first request.
7039    ///
7040    /// For example, consider a situation where you make an initial request and the
7041    /// request times out. If you make the request again with the same request ID,
7042    /// the server can check if original operation with the same request ID was
7043    /// received, and if so, will ignore the second request. This prevents clients
7044    /// from accidentally creating duplicate commitments.
7045    ///
7046    /// The request ID must be a valid UUID with the exception that zero UUID is
7047    /// not supported (00000000-0000-0000-0000-000000000000).
7048    pub request_id: std::string::String,
7049
7050    /// Optional. If set to true, updating a `CustomTargetType` that does not exist
7051    /// will result in the creation of a new `CustomTargetType`.
7052    pub allow_missing: bool,
7053
7054    /// Optional. If set to true, the request is validated and the user is provided
7055    /// with an expected result, but no actual change is made.
7056    pub validate_only: bool,
7057
7058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7059}
7060
7061impl UpdateCustomTargetTypeRequest {
7062    /// Creates a new default instance.
7063    pub fn new() -> Self {
7064        std::default::Default::default()
7065    }
7066
7067    /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7068    ///
7069    /// # Example
7070    /// ```ignore,no_run
7071    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7072    /// use wkt::FieldMask;
7073    /// let x = UpdateCustomTargetTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7074    /// ```
7075    pub fn set_update_mask<T>(mut self, v: T) -> Self
7076    where
7077        T: std::convert::Into<wkt::FieldMask>,
7078    {
7079        self.update_mask = std::option::Option::Some(v.into());
7080        self
7081    }
7082
7083    /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7084    ///
7085    /// # Example
7086    /// ```ignore,no_run
7087    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7088    /// use wkt::FieldMask;
7089    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7090    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7091    /// ```
7092    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7093    where
7094        T: std::convert::Into<wkt::FieldMask>,
7095    {
7096        self.update_mask = v.map(|x| x.into());
7097        self
7098    }
7099
7100    /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7101    ///
7102    /// # Example
7103    /// ```ignore,no_run
7104    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7105    /// use google_cloud_deploy_v1::model::CustomTargetType;
7106    /// let x = UpdateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7107    /// ```
7108    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7109    where
7110        T: std::convert::Into<crate::model::CustomTargetType>,
7111    {
7112        self.custom_target_type = std::option::Option::Some(v.into());
7113        self
7114    }
7115
7116    /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7117    ///
7118    /// # Example
7119    /// ```ignore,no_run
7120    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7121    /// use google_cloud_deploy_v1::model::CustomTargetType;
7122    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7123    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7124    /// ```
7125    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7126    where
7127        T: std::convert::Into<crate::model::CustomTargetType>,
7128    {
7129        self.custom_target_type = v.map(|x| x.into());
7130        self
7131    }
7132
7133    /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
7134    ///
7135    /// # Example
7136    /// ```ignore,no_run
7137    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7138    /// let x = UpdateCustomTargetTypeRequest::new().set_request_id("example");
7139    /// ```
7140    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7141        self.request_id = v.into();
7142        self
7143    }
7144
7145    /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
7146    ///
7147    /// # Example
7148    /// ```ignore,no_run
7149    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7150    /// let x = UpdateCustomTargetTypeRequest::new().set_allow_missing(true);
7151    /// ```
7152    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7153        self.allow_missing = v.into();
7154        self
7155    }
7156
7157    /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
7158    ///
7159    /// # Example
7160    /// ```ignore,no_run
7161    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7162    /// let x = UpdateCustomTargetTypeRequest::new().set_validate_only(true);
7163    /// ```
7164    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7165        self.validate_only = v.into();
7166        self
7167    }
7168}
7169
7170impl wkt::message::Message for UpdateCustomTargetTypeRequest {
7171    fn typename() -> &'static str {
7172        "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
7173    }
7174}
7175
7176/// The request object for `DeleteCustomTargetType`.
7177#[derive(Clone, Default, PartialEq)]
7178#[non_exhaustive]
7179pub struct DeleteCustomTargetTypeRequest {
7180    /// Required. The name of the `CustomTargetType` to delete. Format must be
7181    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
7182    pub name: std::string::String,
7183
7184    /// Optional. A request ID to identify requests. Specify a unique request ID
7185    /// so that if you must retry your request, the server knows to ignore the
7186    /// request if it has already been completed. The server guarantees that for
7187    /// at least 60 minutes after the first request.
7188    ///
7189    /// For example, consider a situation where you make an initial request and the
7190    /// request times out. If you make the request again with the same request ID,
7191    /// the server can check if original operation with the same request ID was
7192    /// received, and if so, will ignore the second request. This prevents clients
7193    /// from accidentally creating duplicate commitments.
7194    ///
7195    /// The request ID must be a valid UUID with the exception that zero UUID is
7196    /// not supported (00000000-0000-0000-0000-000000000000).
7197    pub request_id: std::string::String,
7198
7199    /// Optional. If set to true, then deleting an already deleted or non-existing
7200    /// `CustomTargetType` will succeed.
7201    pub allow_missing: bool,
7202
7203    /// Optional. If set to true, the request is validated but no actual change is
7204    /// made.
7205    pub validate_only: bool,
7206
7207    /// Optional. This checksum is computed by the server based on the value of
7208    /// other fields, and may be sent on update and delete requests to ensure the
7209    /// client has an up-to-date value before proceeding.
7210    pub etag: std::string::String,
7211
7212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7213}
7214
7215impl DeleteCustomTargetTypeRequest {
7216    /// Creates a new default instance.
7217    pub fn new() -> Self {
7218        std::default::Default::default()
7219    }
7220
7221    /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
7222    ///
7223    /// # Example
7224    /// ```ignore,no_run
7225    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7226    /// let x = DeleteCustomTargetTypeRequest::new().set_name("example");
7227    /// ```
7228    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7229        self.name = v.into();
7230        self
7231    }
7232
7233    /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
7234    ///
7235    /// # Example
7236    /// ```ignore,no_run
7237    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7238    /// let x = DeleteCustomTargetTypeRequest::new().set_request_id("example");
7239    /// ```
7240    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7241        self.request_id = v.into();
7242        self
7243    }
7244
7245    /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
7246    ///
7247    /// # Example
7248    /// ```ignore,no_run
7249    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7250    /// let x = DeleteCustomTargetTypeRequest::new().set_allow_missing(true);
7251    /// ```
7252    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7253        self.allow_missing = v.into();
7254        self
7255    }
7256
7257    /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
7258    ///
7259    /// # Example
7260    /// ```ignore,no_run
7261    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7262    /// let x = DeleteCustomTargetTypeRequest::new().set_validate_only(true);
7263    /// ```
7264    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7265        self.validate_only = v.into();
7266        self
7267    }
7268
7269    /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
7270    ///
7271    /// # Example
7272    /// ```ignore,no_run
7273    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7274    /// let x = DeleteCustomTargetTypeRequest::new().set_etag("example");
7275    /// ```
7276    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7277        self.etag = v.into();
7278        self
7279    }
7280}
7281
7282impl wkt::message::Message for DeleteCustomTargetTypeRequest {
7283    fn typename() -> &'static str {
7284        "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
7285    }
7286}
7287
7288/// A `DeployPolicy` resource in the Cloud Deploy API.
7289///
7290/// A `DeployPolicy` inhibits manual or automation-driven actions within a
7291/// Delivery Pipeline or Target.
7292#[derive(Clone, Default, PartialEq)]
7293#[non_exhaustive]
7294pub struct DeployPolicy {
7295    /// Output only. Name of the `DeployPolicy`. Format is
7296    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
7297    /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
7298    pub name: std::string::String,
7299
7300    /// Output only. Unique identifier of the `DeployPolicy`.
7301    pub uid: std::string::String,
7302
7303    /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
7304    pub description: std::string::String,
7305
7306    /// Optional. User annotations. These attributes can only be set and used by
7307    /// the user, and not by Cloud Deploy. Annotations must meet the following
7308    /// constraints:
7309    ///
7310    /// * Annotations are key/value pairs.
7311    /// * Valid annotation keys have two segments: an optional prefix and name,
7312    ///   separated by a slash (`/`).
7313    /// * The name segment is required and must be 63 characters or less,
7314    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
7315    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
7316    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
7317    ///   a series of DNS labels separated by dots(`.`), not longer than 253
7318    ///   characters in total, followed by a slash (`/`).
7319    ///
7320    /// See
7321    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
7322    /// for more details.
7323    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7324
7325    /// Labels are attributes that can be set and used by both the
7326    /// user and by Cloud Deploy. Labels must meet the following constraints:
7327    ///
7328    /// * Keys and values can contain only lowercase letters, numeric characters,
7329    ///   underscores, and dashes.
7330    /// * All characters must use UTF-8 encoding, and international characters are
7331    ///   allowed.
7332    /// * Keys must start with a lowercase letter or international character.
7333    /// * Each resource is limited to a maximum of 64 labels.
7334    ///
7335    /// Both keys and values are additionally constrained to be <= 128 bytes.
7336    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7337
7338    /// Output only. Time at which the deploy policy was created.
7339    pub create_time: std::option::Option<wkt::Timestamp>,
7340
7341    /// Output only. Most recent time at which the deploy policy was updated.
7342    pub update_time: std::option::Option<wkt::Timestamp>,
7343
7344    /// Optional. When suspended, the policy will not prevent actions from
7345    /// occurring, even if the action violates the policy.
7346    pub suspended: bool,
7347
7348    /// Required. Selected resources to which the policy will be applied. At least
7349    /// one selector is required. If one selector matches the resource the policy
7350    /// applies. For example, if there are two selectors and the action being
7351    /// attempted matches one of them, the policy will apply to that action.
7352    pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
7353
7354    /// Required. Rules to apply. At least one rule must be present.
7355    pub rules: std::vec::Vec<crate::model::PolicyRule>,
7356
7357    /// The weak etag of the `DeployPolicy` resource.
7358    /// This checksum is computed by the server based on the value of other
7359    /// fields, and may be sent on update and delete requests to ensure the
7360    /// client has an up-to-date value before proceeding.
7361    pub etag: std::string::String,
7362
7363    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7364}
7365
7366impl DeployPolicy {
7367    /// Creates a new default instance.
7368    pub fn new() -> Self {
7369        std::default::Default::default()
7370    }
7371
7372    /// Sets the value of [name][crate::model::DeployPolicy::name].
7373    ///
7374    /// # Example
7375    /// ```ignore,no_run
7376    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7377    /// let x = DeployPolicy::new().set_name("example");
7378    /// ```
7379    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7380        self.name = v.into();
7381        self
7382    }
7383
7384    /// Sets the value of [uid][crate::model::DeployPolicy::uid].
7385    ///
7386    /// # Example
7387    /// ```ignore,no_run
7388    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7389    /// let x = DeployPolicy::new().set_uid("example");
7390    /// ```
7391    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7392        self.uid = v.into();
7393        self
7394    }
7395
7396    /// Sets the value of [description][crate::model::DeployPolicy::description].
7397    ///
7398    /// # Example
7399    /// ```ignore,no_run
7400    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7401    /// let x = DeployPolicy::new().set_description("example");
7402    /// ```
7403    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7404        self.description = v.into();
7405        self
7406    }
7407
7408    /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
7409    ///
7410    /// # Example
7411    /// ```ignore,no_run
7412    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7413    /// let x = DeployPolicy::new().set_annotations([
7414    ///     ("key0", "abc"),
7415    ///     ("key1", "xyz"),
7416    /// ]);
7417    /// ```
7418    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7419    where
7420        T: std::iter::IntoIterator<Item = (K, V)>,
7421        K: std::convert::Into<std::string::String>,
7422        V: std::convert::Into<std::string::String>,
7423    {
7424        use std::iter::Iterator;
7425        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7426        self
7427    }
7428
7429    /// Sets the value of [labels][crate::model::DeployPolicy::labels].
7430    ///
7431    /// # Example
7432    /// ```ignore,no_run
7433    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7434    /// let x = DeployPolicy::new().set_labels([
7435    ///     ("key0", "abc"),
7436    ///     ("key1", "xyz"),
7437    /// ]);
7438    /// ```
7439    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7440    where
7441        T: std::iter::IntoIterator<Item = (K, V)>,
7442        K: std::convert::Into<std::string::String>,
7443        V: std::convert::Into<std::string::String>,
7444    {
7445        use std::iter::Iterator;
7446        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7447        self
7448    }
7449
7450    /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
7451    ///
7452    /// # Example
7453    /// ```ignore,no_run
7454    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7455    /// use wkt::Timestamp;
7456    /// let x = DeployPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7457    /// ```
7458    pub fn set_create_time<T>(mut self, v: T) -> Self
7459    where
7460        T: std::convert::Into<wkt::Timestamp>,
7461    {
7462        self.create_time = std::option::Option::Some(v.into());
7463        self
7464    }
7465
7466    /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
7467    ///
7468    /// # Example
7469    /// ```ignore,no_run
7470    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7471    /// use wkt::Timestamp;
7472    /// let x = DeployPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7473    /// let x = DeployPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7474    /// ```
7475    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7476    where
7477        T: std::convert::Into<wkt::Timestamp>,
7478    {
7479        self.create_time = v.map(|x| x.into());
7480        self
7481    }
7482
7483    /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
7484    ///
7485    /// # Example
7486    /// ```ignore,no_run
7487    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7488    /// use wkt::Timestamp;
7489    /// let x = DeployPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7490    /// ```
7491    pub fn set_update_time<T>(mut self, v: T) -> Self
7492    where
7493        T: std::convert::Into<wkt::Timestamp>,
7494    {
7495        self.update_time = std::option::Option::Some(v.into());
7496        self
7497    }
7498
7499    /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
7500    ///
7501    /// # Example
7502    /// ```ignore,no_run
7503    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7504    /// use wkt::Timestamp;
7505    /// let x = DeployPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7506    /// let x = DeployPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7507    /// ```
7508    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7509    where
7510        T: std::convert::Into<wkt::Timestamp>,
7511    {
7512        self.update_time = v.map(|x| x.into());
7513        self
7514    }
7515
7516    /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
7517    ///
7518    /// # Example
7519    /// ```ignore,no_run
7520    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7521    /// let x = DeployPolicy::new().set_suspended(true);
7522    /// ```
7523    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7524        self.suspended = v.into();
7525        self
7526    }
7527
7528    /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
7529    ///
7530    /// # Example
7531    /// ```ignore,no_run
7532    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7533    /// use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7534    /// let x = DeployPolicy::new()
7535    ///     .set_selectors([
7536    ///         DeployPolicyResourceSelector::default()/* use setters */,
7537    ///         DeployPolicyResourceSelector::default()/* use (different) setters */,
7538    ///     ]);
7539    /// ```
7540    pub fn set_selectors<T, V>(mut self, v: T) -> Self
7541    where
7542        T: std::iter::IntoIterator<Item = V>,
7543        V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
7544    {
7545        use std::iter::Iterator;
7546        self.selectors = v.into_iter().map(|i| i.into()).collect();
7547        self
7548    }
7549
7550    /// Sets the value of [rules][crate::model::DeployPolicy::rules].
7551    ///
7552    /// # Example
7553    /// ```ignore,no_run
7554    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7555    /// use google_cloud_deploy_v1::model::PolicyRule;
7556    /// let x = DeployPolicy::new()
7557    ///     .set_rules([
7558    ///         PolicyRule::default()/* use setters */,
7559    ///         PolicyRule::default()/* use (different) setters */,
7560    ///     ]);
7561    /// ```
7562    pub fn set_rules<T, V>(mut self, v: T) -> Self
7563    where
7564        T: std::iter::IntoIterator<Item = V>,
7565        V: std::convert::Into<crate::model::PolicyRule>,
7566    {
7567        use std::iter::Iterator;
7568        self.rules = v.into_iter().map(|i| i.into()).collect();
7569        self
7570    }
7571
7572    /// Sets the value of [etag][crate::model::DeployPolicy::etag].
7573    ///
7574    /// # Example
7575    /// ```ignore,no_run
7576    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7577    /// let x = DeployPolicy::new().set_etag("example");
7578    /// ```
7579    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7580        self.etag = v.into();
7581        self
7582    }
7583}
7584
7585impl wkt::message::Message for DeployPolicy {
7586    fn typename() -> &'static str {
7587        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
7588    }
7589}
7590
7591/// Defines additional types related to [DeployPolicy].
7592pub mod deploy_policy {
7593    #[allow(unused_imports)]
7594    use super::*;
7595
7596    /// What invoked the action. Filters enforcing the policy depending on what
7597    /// invoked the action.
7598    ///
7599    /// # Working with unknown values
7600    ///
7601    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7602    /// additional enum variants at any time. Adding new variants is not considered
7603    /// a breaking change. Applications should write their code in anticipation of:
7604    ///
7605    /// - New values appearing in future releases of the client library, **and**
7606    /// - New values received dynamically, without application changes.
7607    ///
7608    /// Please consult the [Working with enums] section in the user guide for some
7609    /// guidelines.
7610    ///
7611    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7612    #[derive(Clone, Debug, PartialEq)]
7613    #[non_exhaustive]
7614    pub enum Invoker {
7615        /// Unspecified.
7616        Unspecified,
7617        /// The action is user-driven. For example, creating a rollout manually via a
7618        /// gcloud create command.
7619        User,
7620        /// Automated action by Cloud Deploy.
7621        DeployAutomation,
7622        /// If set, the enum was initialized with an unknown value.
7623        ///
7624        /// Applications can examine the value using [Invoker::value] or
7625        /// [Invoker::name].
7626        UnknownValue(invoker::UnknownValue),
7627    }
7628
7629    #[doc(hidden)]
7630    pub mod invoker {
7631        #[allow(unused_imports)]
7632        use super::*;
7633        #[derive(Clone, Debug, PartialEq)]
7634        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7635    }
7636
7637    impl Invoker {
7638        /// Gets the enum value.
7639        ///
7640        /// Returns `None` if the enum contains an unknown value deserialized from
7641        /// the string representation of enums.
7642        pub fn value(&self) -> std::option::Option<i32> {
7643            match self {
7644                Self::Unspecified => std::option::Option::Some(0),
7645                Self::User => std::option::Option::Some(1),
7646                Self::DeployAutomation => std::option::Option::Some(2),
7647                Self::UnknownValue(u) => u.0.value(),
7648            }
7649        }
7650
7651        /// Gets the enum value as a string.
7652        ///
7653        /// Returns `None` if the enum contains an unknown value deserialized from
7654        /// the integer representation of enums.
7655        pub fn name(&self) -> std::option::Option<&str> {
7656            match self {
7657                Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
7658                Self::User => std::option::Option::Some("USER"),
7659                Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
7660                Self::UnknownValue(u) => u.0.name(),
7661            }
7662        }
7663    }
7664
7665    impl std::default::Default for Invoker {
7666        fn default() -> Self {
7667            use std::convert::From;
7668            Self::from(0)
7669        }
7670    }
7671
7672    impl std::fmt::Display for Invoker {
7673        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7674            wkt::internal::display_enum(f, self.name(), self.value())
7675        }
7676    }
7677
7678    impl std::convert::From<i32> for Invoker {
7679        fn from(value: i32) -> Self {
7680            match value {
7681                0 => Self::Unspecified,
7682                1 => Self::User,
7683                2 => Self::DeployAutomation,
7684                _ => Self::UnknownValue(invoker::UnknownValue(
7685                    wkt::internal::UnknownEnumValue::Integer(value),
7686                )),
7687            }
7688        }
7689    }
7690
7691    impl std::convert::From<&str> for Invoker {
7692        fn from(value: &str) -> Self {
7693            use std::string::ToString;
7694            match value {
7695                "INVOKER_UNSPECIFIED" => Self::Unspecified,
7696                "USER" => Self::User,
7697                "DEPLOY_AUTOMATION" => Self::DeployAutomation,
7698                _ => Self::UnknownValue(invoker::UnknownValue(
7699                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7700                )),
7701            }
7702        }
7703    }
7704
7705    impl serde::ser::Serialize for Invoker {
7706        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7707        where
7708            S: serde::Serializer,
7709        {
7710            match self {
7711                Self::Unspecified => serializer.serialize_i32(0),
7712                Self::User => serializer.serialize_i32(1),
7713                Self::DeployAutomation => serializer.serialize_i32(2),
7714                Self::UnknownValue(u) => u.0.serialize(serializer),
7715            }
7716        }
7717    }
7718
7719    impl<'de> serde::de::Deserialize<'de> for Invoker {
7720        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7721        where
7722            D: serde::Deserializer<'de>,
7723        {
7724            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
7725                ".google.cloud.deploy.v1.DeployPolicy.Invoker",
7726            ))
7727        }
7728    }
7729}
7730
7731/// Contains information on the resources to select for a deploy policy.
7732/// Attributes provided must all match the resource in order for policy
7733/// restrictions to apply. For example, if delivery pipelines attributes given
7734/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
7735/// match both that id and have that label in order to be subject to the policy.
7736#[derive(Clone, Default, PartialEq)]
7737#[non_exhaustive]
7738pub struct DeployPolicyResourceSelector {
7739    /// Optional. Contains attributes about a delivery pipeline.
7740    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
7741
7742    /// Optional. Contains attributes about a target.
7743    pub target: std::option::Option<crate::model::TargetAttribute>,
7744
7745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7746}
7747
7748impl DeployPolicyResourceSelector {
7749    /// Creates a new default instance.
7750    pub fn new() -> Self {
7751        std::default::Default::default()
7752    }
7753
7754    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7755    ///
7756    /// # Example
7757    /// ```ignore,no_run
7758    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7759    /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7760    /// let x = DeployPolicyResourceSelector::new().set_delivery_pipeline(DeliveryPipelineAttribute::default()/* use setters */);
7761    /// ```
7762    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
7763    where
7764        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7765    {
7766        self.delivery_pipeline = std::option::Option::Some(v.into());
7767        self
7768    }
7769
7770    /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7771    ///
7772    /// # Example
7773    /// ```ignore,no_run
7774    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7775    /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7776    /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(Some(DeliveryPipelineAttribute::default()/* use setters */));
7777    /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(None::<DeliveryPipelineAttribute>);
7778    /// ```
7779    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
7780    where
7781        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7782    {
7783        self.delivery_pipeline = v.map(|x| x.into());
7784        self
7785    }
7786
7787    /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
7788    ///
7789    /// # Example
7790    /// ```ignore,no_run
7791    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7792    /// use google_cloud_deploy_v1::model::TargetAttribute;
7793    /// let x = DeployPolicyResourceSelector::new().set_target(TargetAttribute::default()/* use setters */);
7794    /// ```
7795    pub fn set_target<T>(mut self, v: T) -> Self
7796    where
7797        T: std::convert::Into<crate::model::TargetAttribute>,
7798    {
7799        self.target = std::option::Option::Some(v.into());
7800        self
7801    }
7802
7803    /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
7804    ///
7805    /// # Example
7806    /// ```ignore,no_run
7807    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7808    /// use google_cloud_deploy_v1::model::TargetAttribute;
7809    /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(Some(TargetAttribute::default()/* use setters */));
7810    /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(None::<TargetAttribute>);
7811    /// ```
7812    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7813    where
7814        T: std::convert::Into<crate::model::TargetAttribute>,
7815    {
7816        self.target = v.map(|x| x.into());
7817        self
7818    }
7819}
7820
7821impl wkt::message::Message for DeployPolicyResourceSelector {
7822    fn typename() -> &'static str {
7823        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
7824    }
7825}
7826
7827/// Contains criteria for selecting DeliveryPipelines.
7828#[derive(Clone, Default, PartialEq)]
7829#[non_exhaustive]
7830pub struct DeliveryPipelineAttribute {
7831    /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
7832    /// one of the following:
7833    ///
7834    /// * The last segment of a pipeline name
7835    /// * "*", all delivery pipelines in a location
7836    pub id: std::string::String,
7837
7838    /// DeliveryPipeline labels.
7839    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7840
7841    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7842}
7843
7844impl DeliveryPipelineAttribute {
7845    /// Creates a new default instance.
7846    pub fn new() -> Self {
7847        std::default::Default::default()
7848    }
7849
7850    /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
7851    ///
7852    /// # Example
7853    /// ```ignore,no_run
7854    /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7855    /// let x = DeliveryPipelineAttribute::new().set_id("example");
7856    /// ```
7857    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7858        self.id = v.into();
7859        self
7860    }
7861
7862    /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
7863    ///
7864    /// # Example
7865    /// ```ignore,no_run
7866    /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7867    /// let x = DeliveryPipelineAttribute::new().set_labels([
7868    ///     ("key0", "abc"),
7869    ///     ("key1", "xyz"),
7870    /// ]);
7871    /// ```
7872    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7873    where
7874        T: std::iter::IntoIterator<Item = (K, V)>,
7875        K: std::convert::Into<std::string::String>,
7876        V: std::convert::Into<std::string::String>,
7877    {
7878        use std::iter::Iterator;
7879        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7880        self
7881    }
7882}
7883
7884impl wkt::message::Message for DeliveryPipelineAttribute {
7885    fn typename() -> &'static str {
7886        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
7887    }
7888}
7889
7890/// Contains criteria for selecting Targets. This could be used to select targets
7891/// for a Deploy Policy or for an Automation.
7892#[derive(Clone, Default, PartialEq)]
7893#[non_exhaustive]
7894pub struct TargetAttribute {
7895    /// Optional. ID of the `Target`. The value of this field could be one of the
7896    /// following:
7897    ///
7898    /// * The last segment of a target name
7899    /// * "*", all targets in a location
7900    pub id: std::string::String,
7901
7902    /// Target labels.
7903    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7904
7905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7906}
7907
7908impl TargetAttribute {
7909    /// Creates a new default instance.
7910    pub fn new() -> Self {
7911        std::default::Default::default()
7912    }
7913
7914    /// Sets the value of [id][crate::model::TargetAttribute::id].
7915    ///
7916    /// # Example
7917    /// ```ignore,no_run
7918    /// # use google_cloud_deploy_v1::model::TargetAttribute;
7919    /// let x = TargetAttribute::new().set_id("example");
7920    /// ```
7921    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7922        self.id = v.into();
7923        self
7924    }
7925
7926    /// Sets the value of [labels][crate::model::TargetAttribute::labels].
7927    ///
7928    /// # Example
7929    /// ```ignore,no_run
7930    /// # use google_cloud_deploy_v1::model::TargetAttribute;
7931    /// let x = TargetAttribute::new().set_labels([
7932    ///     ("key0", "abc"),
7933    ///     ("key1", "xyz"),
7934    /// ]);
7935    /// ```
7936    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7937    where
7938        T: std::iter::IntoIterator<Item = (K, V)>,
7939        K: std::convert::Into<std::string::String>,
7940        V: std::convert::Into<std::string::String>,
7941    {
7942        use std::iter::Iterator;
7943        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7944        self
7945    }
7946}
7947
7948impl wkt::message::Message for TargetAttribute {
7949    fn typename() -> &'static str {
7950        "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
7951    }
7952}
7953
7954/// Deploy Policy rule.
7955#[derive(Clone, Default, PartialEq)]
7956#[non_exhaustive]
7957pub struct PolicyRule {
7958    #[allow(missing_docs)]
7959    pub rule: std::option::Option<crate::model::policy_rule::Rule>,
7960
7961    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7962}
7963
7964impl PolicyRule {
7965    /// Creates a new default instance.
7966    pub fn new() -> Self {
7967        std::default::Default::default()
7968    }
7969
7970    /// Sets the value of [rule][crate::model::PolicyRule::rule].
7971    ///
7972    /// Note that all the setters affecting `rule` are mutually
7973    /// exclusive.
7974    ///
7975    /// # Example
7976    /// ```ignore,no_run
7977    /// # use google_cloud_deploy_v1::model::PolicyRule;
7978    /// use google_cloud_deploy_v1::model::RolloutRestriction;
7979    /// let x = PolicyRule::new().set_rule(Some(
7980    ///     google_cloud_deploy_v1::model::policy_rule::Rule::RolloutRestriction(RolloutRestriction::default().into())));
7981    /// ```
7982    pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
7983        mut self,
7984        v: T,
7985    ) -> Self {
7986        self.rule = v.into();
7987        self
7988    }
7989
7990    /// The value of [rule][crate::model::PolicyRule::rule]
7991    /// if it holds a `RolloutRestriction`, `None` if the field is not set or
7992    /// holds a different branch.
7993    pub fn rollout_restriction(
7994        &self,
7995    ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
7996        #[allow(unreachable_patterns)]
7997        self.rule.as_ref().and_then(|v| match v {
7998            crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
7999            _ => std::option::Option::None,
8000        })
8001    }
8002
8003    /// Sets the value of [rule][crate::model::PolicyRule::rule]
8004    /// to hold a `RolloutRestriction`.
8005    ///
8006    /// Note that all the setters affecting `rule` are
8007    /// mutually exclusive.
8008    ///
8009    /// # Example
8010    /// ```ignore,no_run
8011    /// # use google_cloud_deploy_v1::model::PolicyRule;
8012    /// use google_cloud_deploy_v1::model::RolloutRestriction;
8013    /// let x = PolicyRule::new().set_rollout_restriction(RolloutRestriction::default()/* use setters */);
8014    /// assert!(x.rollout_restriction().is_some());
8015    /// ```
8016    pub fn set_rollout_restriction<
8017        T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
8018    >(
8019        mut self,
8020        v: T,
8021    ) -> Self {
8022        self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
8023            v.into(),
8024        ));
8025        self
8026    }
8027}
8028
8029impl wkt::message::Message for PolicyRule {
8030    fn typename() -> &'static str {
8031        "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
8032    }
8033}
8034
8035/// Defines additional types related to [PolicyRule].
8036pub mod policy_rule {
8037    #[allow(unused_imports)]
8038    use super::*;
8039
8040    #[allow(missing_docs)]
8041    #[derive(Clone, Debug, PartialEq)]
8042    #[non_exhaustive]
8043    pub enum Rule {
8044        /// Optional. Rollout restrictions.
8045        RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
8046    }
8047}
8048
8049/// Rollout restrictions.
8050#[derive(Clone, Default, PartialEq)]
8051#[non_exhaustive]
8052pub struct RolloutRestriction {
8053    /// Required. Restriction rule ID. Required and must be unique within a
8054    /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
8055    pub id: std::string::String,
8056
8057    /// Optional. What invoked the action. If left empty, all invoker types will be
8058    /// restricted.
8059    pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
8060
8061    /// Optional. Rollout actions to be restricted as part of the policy. If left
8062    /// empty, all actions will be restricted.
8063    pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
8064
8065    /// Required. Time window within which actions are restricted.
8066    pub time_windows: std::option::Option<crate::model::TimeWindows>,
8067
8068    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8069}
8070
8071impl RolloutRestriction {
8072    /// Creates a new default instance.
8073    pub fn new() -> Self {
8074        std::default::Default::default()
8075    }
8076
8077    /// Sets the value of [id][crate::model::RolloutRestriction::id].
8078    ///
8079    /// # Example
8080    /// ```ignore,no_run
8081    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8082    /// let x = RolloutRestriction::new().set_id("example");
8083    /// ```
8084    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8085        self.id = v.into();
8086        self
8087    }
8088
8089    /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
8090    ///
8091    /// # Example
8092    /// ```ignore,no_run
8093    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8094    /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
8095    /// let x = RolloutRestriction::new().set_invokers([
8096    ///     Invoker::User,
8097    ///     Invoker::DeployAutomation,
8098    /// ]);
8099    /// ```
8100    pub fn set_invokers<T, V>(mut self, v: T) -> Self
8101    where
8102        T: std::iter::IntoIterator<Item = V>,
8103        V: std::convert::Into<crate::model::deploy_policy::Invoker>,
8104    {
8105        use std::iter::Iterator;
8106        self.invokers = v.into_iter().map(|i| i.into()).collect();
8107        self
8108    }
8109
8110    /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
8111    ///
8112    /// # Example
8113    /// ```ignore,no_run
8114    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8115    /// use google_cloud_deploy_v1::model::rollout_restriction::RolloutActions;
8116    /// let x = RolloutRestriction::new().set_actions([
8117    ///     RolloutActions::Advance,
8118    ///     RolloutActions::Approve,
8119    ///     RolloutActions::Cancel,
8120    /// ]);
8121    /// ```
8122    pub fn set_actions<T, V>(mut self, v: T) -> Self
8123    where
8124        T: std::iter::IntoIterator<Item = V>,
8125        V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
8126    {
8127        use std::iter::Iterator;
8128        self.actions = v.into_iter().map(|i| i.into()).collect();
8129        self
8130    }
8131
8132    /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8133    ///
8134    /// # Example
8135    /// ```ignore,no_run
8136    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8137    /// use google_cloud_deploy_v1::model::TimeWindows;
8138    /// let x = RolloutRestriction::new().set_time_windows(TimeWindows::default()/* use setters */);
8139    /// ```
8140    pub fn set_time_windows<T>(mut self, v: T) -> Self
8141    where
8142        T: std::convert::Into<crate::model::TimeWindows>,
8143    {
8144        self.time_windows = std::option::Option::Some(v.into());
8145        self
8146    }
8147
8148    /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8149    ///
8150    /// # Example
8151    /// ```ignore,no_run
8152    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8153    /// use google_cloud_deploy_v1::model::TimeWindows;
8154    /// let x = RolloutRestriction::new().set_or_clear_time_windows(Some(TimeWindows::default()/* use setters */));
8155    /// let x = RolloutRestriction::new().set_or_clear_time_windows(None::<TimeWindows>);
8156    /// ```
8157    pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
8158    where
8159        T: std::convert::Into<crate::model::TimeWindows>,
8160    {
8161        self.time_windows = v.map(|x| x.into());
8162        self
8163    }
8164}
8165
8166impl wkt::message::Message for RolloutRestriction {
8167    fn typename() -> &'static str {
8168        "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
8169    }
8170}
8171
8172/// Defines additional types related to [RolloutRestriction].
8173pub mod rollout_restriction {
8174    #[allow(unused_imports)]
8175    use super::*;
8176
8177    /// Rollout actions to be restricted as part of the policy.
8178    ///
8179    /// # Working with unknown values
8180    ///
8181    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8182    /// additional enum variants at any time. Adding new variants is not considered
8183    /// a breaking change. Applications should write their code in anticipation of:
8184    ///
8185    /// - New values appearing in future releases of the client library, **and**
8186    /// - New values received dynamically, without application changes.
8187    ///
8188    /// Please consult the [Working with enums] section in the user guide for some
8189    /// guidelines.
8190    ///
8191    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8192    #[derive(Clone, Debug, PartialEq)]
8193    #[non_exhaustive]
8194    pub enum RolloutActions {
8195        /// Unspecified.
8196        Unspecified,
8197        /// Advance the rollout to the next phase.
8198        Advance,
8199        /// Approve the rollout.
8200        Approve,
8201        /// Cancel the rollout.
8202        Cancel,
8203        /// Create a rollout.
8204        Create,
8205        /// Ignore a job result on the rollout.
8206        IgnoreJob,
8207        /// Retry a job for a rollout.
8208        RetryJob,
8209        /// Rollback a rollout.
8210        Rollback,
8211        /// Terminate a jobrun.
8212        TerminateJobrun,
8213        /// If set, the enum was initialized with an unknown value.
8214        ///
8215        /// Applications can examine the value using [RolloutActions::value] or
8216        /// [RolloutActions::name].
8217        UnknownValue(rollout_actions::UnknownValue),
8218    }
8219
8220    #[doc(hidden)]
8221    pub mod rollout_actions {
8222        #[allow(unused_imports)]
8223        use super::*;
8224        #[derive(Clone, Debug, PartialEq)]
8225        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8226    }
8227
8228    impl RolloutActions {
8229        /// Gets the enum value.
8230        ///
8231        /// Returns `None` if the enum contains an unknown value deserialized from
8232        /// the string representation of enums.
8233        pub fn value(&self) -> std::option::Option<i32> {
8234            match self {
8235                Self::Unspecified => std::option::Option::Some(0),
8236                Self::Advance => std::option::Option::Some(1),
8237                Self::Approve => std::option::Option::Some(2),
8238                Self::Cancel => std::option::Option::Some(3),
8239                Self::Create => std::option::Option::Some(4),
8240                Self::IgnoreJob => std::option::Option::Some(5),
8241                Self::RetryJob => std::option::Option::Some(6),
8242                Self::Rollback => std::option::Option::Some(7),
8243                Self::TerminateJobrun => std::option::Option::Some(8),
8244                Self::UnknownValue(u) => u.0.value(),
8245            }
8246        }
8247
8248        /// Gets the enum value as a string.
8249        ///
8250        /// Returns `None` if the enum contains an unknown value deserialized from
8251        /// the integer representation of enums.
8252        pub fn name(&self) -> std::option::Option<&str> {
8253            match self {
8254                Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
8255                Self::Advance => std::option::Option::Some("ADVANCE"),
8256                Self::Approve => std::option::Option::Some("APPROVE"),
8257                Self::Cancel => std::option::Option::Some("CANCEL"),
8258                Self::Create => std::option::Option::Some("CREATE"),
8259                Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
8260                Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
8261                Self::Rollback => std::option::Option::Some("ROLLBACK"),
8262                Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
8263                Self::UnknownValue(u) => u.0.name(),
8264            }
8265        }
8266    }
8267
8268    impl std::default::Default for RolloutActions {
8269        fn default() -> Self {
8270            use std::convert::From;
8271            Self::from(0)
8272        }
8273    }
8274
8275    impl std::fmt::Display for RolloutActions {
8276        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8277            wkt::internal::display_enum(f, self.name(), self.value())
8278        }
8279    }
8280
8281    impl std::convert::From<i32> for RolloutActions {
8282        fn from(value: i32) -> Self {
8283            match value {
8284                0 => Self::Unspecified,
8285                1 => Self::Advance,
8286                2 => Self::Approve,
8287                3 => Self::Cancel,
8288                4 => Self::Create,
8289                5 => Self::IgnoreJob,
8290                6 => Self::RetryJob,
8291                7 => Self::Rollback,
8292                8 => Self::TerminateJobrun,
8293                _ => Self::UnknownValue(rollout_actions::UnknownValue(
8294                    wkt::internal::UnknownEnumValue::Integer(value),
8295                )),
8296            }
8297        }
8298    }
8299
8300    impl std::convert::From<&str> for RolloutActions {
8301        fn from(value: &str) -> Self {
8302            use std::string::ToString;
8303            match value {
8304                "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
8305                "ADVANCE" => Self::Advance,
8306                "APPROVE" => Self::Approve,
8307                "CANCEL" => Self::Cancel,
8308                "CREATE" => Self::Create,
8309                "IGNORE_JOB" => Self::IgnoreJob,
8310                "RETRY_JOB" => Self::RetryJob,
8311                "ROLLBACK" => Self::Rollback,
8312                "TERMINATE_JOBRUN" => Self::TerminateJobrun,
8313                _ => Self::UnknownValue(rollout_actions::UnknownValue(
8314                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8315                )),
8316            }
8317        }
8318    }
8319
8320    impl serde::ser::Serialize for RolloutActions {
8321        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8322        where
8323            S: serde::Serializer,
8324        {
8325            match self {
8326                Self::Unspecified => serializer.serialize_i32(0),
8327                Self::Advance => serializer.serialize_i32(1),
8328                Self::Approve => serializer.serialize_i32(2),
8329                Self::Cancel => serializer.serialize_i32(3),
8330                Self::Create => serializer.serialize_i32(4),
8331                Self::IgnoreJob => serializer.serialize_i32(5),
8332                Self::RetryJob => serializer.serialize_i32(6),
8333                Self::Rollback => serializer.serialize_i32(7),
8334                Self::TerminateJobrun => serializer.serialize_i32(8),
8335                Self::UnknownValue(u) => u.0.serialize(serializer),
8336            }
8337        }
8338    }
8339
8340    impl<'de> serde::de::Deserialize<'de> for RolloutActions {
8341        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8342        where
8343            D: serde::Deserializer<'de>,
8344        {
8345            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
8346                ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
8347            ))
8348        }
8349    }
8350}
8351
8352/// Time windows within which actions are restricted. See the
8353/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
8354/// for more information on how to configure dates/times.
8355#[derive(Clone, Default, PartialEq)]
8356#[non_exhaustive]
8357pub struct TimeWindows {
8358    /// Required. The time zone in IANA format [IANA Time Zone
8359    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
8360    pub time_zone: std::string::String,
8361
8362    /// Optional. One-time windows within which actions are restricted.
8363    pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
8364
8365    /// Optional. Recurring weekly windows within which actions are restricted.
8366    pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
8367
8368    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8369}
8370
8371impl TimeWindows {
8372    /// Creates a new default instance.
8373    pub fn new() -> Self {
8374        std::default::Default::default()
8375    }
8376
8377    /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
8378    ///
8379    /// # Example
8380    /// ```ignore,no_run
8381    /// # use google_cloud_deploy_v1::model::TimeWindows;
8382    /// let x = TimeWindows::new().set_time_zone("example");
8383    /// ```
8384    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8385        self.time_zone = v.into();
8386        self
8387    }
8388
8389    /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
8390    ///
8391    /// # Example
8392    /// ```ignore,no_run
8393    /// # use google_cloud_deploy_v1::model::TimeWindows;
8394    /// use google_cloud_deploy_v1::model::OneTimeWindow;
8395    /// let x = TimeWindows::new()
8396    ///     .set_one_time_windows([
8397    ///         OneTimeWindow::default()/* use setters */,
8398    ///         OneTimeWindow::default()/* use (different) setters */,
8399    ///     ]);
8400    /// ```
8401    pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
8402    where
8403        T: std::iter::IntoIterator<Item = V>,
8404        V: std::convert::Into<crate::model::OneTimeWindow>,
8405    {
8406        use std::iter::Iterator;
8407        self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
8408        self
8409    }
8410
8411    /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
8412    ///
8413    /// # Example
8414    /// ```ignore,no_run
8415    /// # use google_cloud_deploy_v1::model::TimeWindows;
8416    /// use google_cloud_deploy_v1::model::WeeklyWindow;
8417    /// let x = TimeWindows::new()
8418    ///     .set_weekly_windows([
8419    ///         WeeklyWindow::default()/* use setters */,
8420    ///         WeeklyWindow::default()/* use (different) setters */,
8421    ///     ]);
8422    /// ```
8423    pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
8424    where
8425        T: std::iter::IntoIterator<Item = V>,
8426        V: std::convert::Into<crate::model::WeeklyWindow>,
8427    {
8428        use std::iter::Iterator;
8429        self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
8430        self
8431    }
8432}
8433
8434impl wkt::message::Message for TimeWindows {
8435    fn typename() -> &'static str {
8436        "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
8437    }
8438}
8439
8440/// One-time window within which actions are restricted. For example, blocking
8441/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
8442#[derive(Clone, Default, PartialEq)]
8443#[non_exhaustive]
8444pub struct OneTimeWindow {
8445    /// Required. Start date.
8446    pub start_date: std::option::Option<google_cloud_type::model::Date>,
8447
8448    /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
8449    pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8450
8451    /// Required. End date.
8452    pub end_date: std::option::Option<google_cloud_type::model::Date>,
8453
8454    /// Required. End time (exclusive). You may use 24:00 for the end of the day.
8455    pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8456
8457    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8458}
8459
8460impl OneTimeWindow {
8461    /// Creates a new default instance.
8462    pub fn new() -> Self {
8463        std::default::Default::default()
8464    }
8465
8466    /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
8467    ///
8468    /// # Example
8469    /// ```ignore,no_run
8470    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8471    /// use google_cloud_type::model::Date;
8472    /// let x = OneTimeWindow::new().set_start_date(Date::default()/* use setters */);
8473    /// ```
8474    pub fn set_start_date<T>(mut self, v: T) -> Self
8475    where
8476        T: std::convert::Into<google_cloud_type::model::Date>,
8477    {
8478        self.start_date = std::option::Option::Some(v.into());
8479        self
8480    }
8481
8482    /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
8483    ///
8484    /// # Example
8485    /// ```ignore,no_run
8486    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8487    /// use google_cloud_type::model::Date;
8488    /// let x = OneTimeWindow::new().set_or_clear_start_date(Some(Date::default()/* use setters */));
8489    /// let x = OneTimeWindow::new().set_or_clear_start_date(None::<Date>);
8490    /// ```
8491    pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
8492    where
8493        T: std::convert::Into<google_cloud_type::model::Date>,
8494    {
8495        self.start_date = v.map(|x| x.into());
8496        self
8497    }
8498
8499    /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
8500    ///
8501    /// # Example
8502    /// ```ignore,no_run
8503    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8504    /// use google_cloud_type::model::TimeOfDay;
8505    /// let x = OneTimeWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8506    /// ```
8507    pub fn set_start_time<T>(mut self, v: T) -> Self
8508    where
8509        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8510    {
8511        self.start_time = std::option::Option::Some(v.into());
8512        self
8513    }
8514
8515    /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
8516    ///
8517    /// # Example
8518    /// ```ignore,no_run
8519    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8520    /// use google_cloud_type::model::TimeOfDay;
8521    /// let x = OneTimeWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8522    /// let x = OneTimeWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8523    /// ```
8524    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8525    where
8526        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8527    {
8528        self.start_time = v.map(|x| x.into());
8529        self
8530    }
8531
8532    /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
8533    ///
8534    /// # Example
8535    /// ```ignore,no_run
8536    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8537    /// use google_cloud_type::model::Date;
8538    /// let x = OneTimeWindow::new().set_end_date(Date::default()/* use setters */);
8539    /// ```
8540    pub fn set_end_date<T>(mut self, v: T) -> Self
8541    where
8542        T: std::convert::Into<google_cloud_type::model::Date>,
8543    {
8544        self.end_date = std::option::Option::Some(v.into());
8545        self
8546    }
8547
8548    /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
8549    ///
8550    /// # Example
8551    /// ```ignore,no_run
8552    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8553    /// use google_cloud_type::model::Date;
8554    /// let x = OneTimeWindow::new().set_or_clear_end_date(Some(Date::default()/* use setters */));
8555    /// let x = OneTimeWindow::new().set_or_clear_end_date(None::<Date>);
8556    /// ```
8557    pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
8558    where
8559        T: std::convert::Into<google_cloud_type::model::Date>,
8560    {
8561        self.end_date = v.map(|x| x.into());
8562        self
8563    }
8564
8565    /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
8566    ///
8567    /// # Example
8568    /// ```ignore,no_run
8569    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8570    /// use google_cloud_type::model::TimeOfDay;
8571    /// let x = OneTimeWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8572    /// ```
8573    pub fn set_end_time<T>(mut self, v: T) -> Self
8574    where
8575        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8576    {
8577        self.end_time = std::option::Option::Some(v.into());
8578        self
8579    }
8580
8581    /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
8582    ///
8583    /// # Example
8584    /// ```ignore,no_run
8585    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8586    /// use google_cloud_type::model::TimeOfDay;
8587    /// let x = OneTimeWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8588    /// let x = OneTimeWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8589    /// ```
8590    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8591    where
8592        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8593    {
8594        self.end_time = v.map(|x| x.into());
8595        self
8596    }
8597}
8598
8599impl wkt::message::Message for OneTimeWindow {
8600    fn typename() -> &'static str {
8601        "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
8602    }
8603}
8604
8605/// Weekly windows. For example, blocking actions every Saturday and Sunday.
8606/// Another example would be blocking actions every weekday from 5pm to midnight.
8607#[derive(Clone, Default, PartialEq)]
8608#[non_exhaustive]
8609pub struct WeeklyWindow {
8610    /// Optional. Days of week. If left empty, all days of the week will be
8611    /// included.
8612    pub days_of_week: std::vec::Vec<google_cloud_type::model::DayOfWeek>,
8613
8614    /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
8615    /// If you specify start_time you must also specify end_time. If left empty,
8616    /// this will block for the entire day for the days specified in days_of_week.
8617    pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8618
8619    /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
8620    /// specify end_time you must also specify start_time. If left empty, this will
8621    /// block for the entire day for the days specified in days_of_week.
8622    pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8623
8624    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8625}
8626
8627impl WeeklyWindow {
8628    /// Creates a new default instance.
8629    pub fn new() -> Self {
8630        std::default::Default::default()
8631    }
8632
8633    /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
8634    ///
8635    /// # Example
8636    /// ```ignore,no_run
8637    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8638    /// use google_cloud_type::model::DayOfWeek;
8639    /// let x = WeeklyWindow::new().set_days_of_week([
8640    ///     DayOfWeek::Monday,
8641    ///     DayOfWeek::Tuesday,
8642    ///     DayOfWeek::Wednesday,
8643    /// ]);
8644    /// ```
8645    pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
8646    where
8647        T: std::iter::IntoIterator<Item = V>,
8648        V: std::convert::Into<google_cloud_type::model::DayOfWeek>,
8649    {
8650        use std::iter::Iterator;
8651        self.days_of_week = v.into_iter().map(|i| i.into()).collect();
8652        self
8653    }
8654
8655    /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
8656    ///
8657    /// # Example
8658    /// ```ignore,no_run
8659    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8660    /// use google_cloud_type::model::TimeOfDay;
8661    /// let x = WeeklyWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8662    /// ```
8663    pub fn set_start_time<T>(mut self, v: T) -> Self
8664    where
8665        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8666    {
8667        self.start_time = std::option::Option::Some(v.into());
8668        self
8669    }
8670
8671    /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
8672    ///
8673    /// # Example
8674    /// ```ignore,no_run
8675    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8676    /// use google_cloud_type::model::TimeOfDay;
8677    /// let x = WeeklyWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8678    /// let x = WeeklyWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8679    /// ```
8680    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8681    where
8682        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8683    {
8684        self.start_time = v.map(|x| x.into());
8685        self
8686    }
8687
8688    /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
8689    ///
8690    /// # Example
8691    /// ```ignore,no_run
8692    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8693    /// use google_cloud_type::model::TimeOfDay;
8694    /// let x = WeeklyWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8695    /// ```
8696    pub fn set_end_time<T>(mut self, v: T) -> Self
8697    where
8698        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8699    {
8700        self.end_time = std::option::Option::Some(v.into());
8701        self
8702    }
8703
8704    /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
8705    ///
8706    /// # Example
8707    /// ```ignore,no_run
8708    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8709    /// use google_cloud_type::model::TimeOfDay;
8710    /// let x = WeeklyWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8711    /// let x = WeeklyWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8712    /// ```
8713    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8714    where
8715        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8716    {
8717        self.end_time = v.map(|x| x.into());
8718        self
8719    }
8720}
8721
8722impl wkt::message::Message for WeeklyWindow {
8723    fn typename() -> &'static str {
8724        "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
8725    }
8726}
8727
8728/// Returned from an action if one or more policies were
8729/// violated, and therefore the action was prevented. Contains information about
8730/// what policies were violated and why.
8731#[derive(Clone, Default, PartialEq)]
8732#[non_exhaustive]
8733pub struct PolicyViolation {
8734    /// Policy violation details.
8735    pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
8736
8737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8738}
8739
8740impl PolicyViolation {
8741    /// Creates a new default instance.
8742    pub fn new() -> Self {
8743        std::default::Default::default()
8744    }
8745
8746    /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
8747    ///
8748    /// # Example
8749    /// ```ignore,no_run
8750    /// # use google_cloud_deploy_v1::model::PolicyViolation;
8751    /// use google_cloud_deploy_v1::model::PolicyViolationDetails;
8752    /// let x = PolicyViolation::new()
8753    ///     .set_policy_violation_details([
8754    ///         PolicyViolationDetails::default()/* use setters */,
8755    ///         PolicyViolationDetails::default()/* use (different) setters */,
8756    ///     ]);
8757    /// ```
8758    pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
8759    where
8760        T: std::iter::IntoIterator<Item = V>,
8761        V: std::convert::Into<crate::model::PolicyViolationDetails>,
8762    {
8763        use std::iter::Iterator;
8764        self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
8765        self
8766    }
8767}
8768
8769impl wkt::message::Message for PolicyViolation {
8770    fn typename() -> &'static str {
8771        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
8772    }
8773}
8774
8775/// Policy violation details.
8776#[derive(Clone, Default, PartialEq)]
8777#[non_exhaustive]
8778pub struct PolicyViolationDetails {
8779    /// Name of the policy that was violated.
8780    /// Policy resource will be in the format of
8781    /// `projects/{project}/locations/{location}/policies/{policy}`.
8782    pub policy: std::string::String,
8783
8784    /// Id of the rule that triggered the policy violation.
8785    pub rule_id: std::string::String,
8786
8787    /// User readable message about why the request violated a policy. This is not
8788    /// intended for machine parsing.
8789    pub failure_message: std::string::String,
8790
8791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8792}
8793
8794impl PolicyViolationDetails {
8795    /// Creates a new default instance.
8796    pub fn new() -> Self {
8797        std::default::Default::default()
8798    }
8799
8800    /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
8801    ///
8802    /// # Example
8803    /// ```ignore,no_run
8804    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8805    /// let x = PolicyViolationDetails::new().set_policy("example");
8806    /// ```
8807    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8808        self.policy = v.into();
8809        self
8810    }
8811
8812    /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
8813    ///
8814    /// # Example
8815    /// ```ignore,no_run
8816    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8817    /// let x = PolicyViolationDetails::new().set_rule_id("example");
8818    /// ```
8819    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8820        self.rule_id = v.into();
8821        self
8822    }
8823
8824    /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
8825    ///
8826    /// # Example
8827    /// ```ignore,no_run
8828    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8829    /// let x = PolicyViolationDetails::new().set_failure_message("example");
8830    /// ```
8831    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8832        self.failure_message = v.into();
8833        self
8834    }
8835}
8836
8837impl wkt::message::Message for PolicyViolationDetails {
8838    fn typename() -> &'static str {
8839        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
8840    }
8841}
8842
8843/// A `Release` resource in the Cloud Deploy API.
8844///
8845/// A `Release` defines a specific Skaffold configuration instance
8846/// that can be deployed.
8847#[derive(Clone, Default, PartialEq)]
8848#[non_exhaustive]
8849pub struct Release {
8850    /// Identifier. Name of the `Release`. Format is
8851    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
8852    /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8853    pub name: std::string::String,
8854
8855    /// Output only. Unique identifier of the `Release`.
8856    pub uid: std::string::String,
8857
8858    /// Optional. Description of the `Release`. Max length is 255 characters.
8859    pub description: std::string::String,
8860
8861    /// Optional. User annotations. These attributes can only be set and used by
8862    /// the user, and not by Cloud Deploy. See
8863    /// <https://google.aip.dev/128#annotations> for more details such as format and
8864    /// size limitations.
8865    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8866
8867    /// Labels are attributes that can be set and used by both the
8868    /// user and by Cloud Deploy. Labels must meet the following constraints:
8869    ///
8870    /// * Keys and values can contain only lowercase letters, numeric characters,
8871    ///   underscores, and dashes.
8872    /// * All characters must use UTF-8 encoding, and international characters are
8873    ///   allowed.
8874    /// * Keys must start with a lowercase letter or international character.
8875    /// * Each resource is limited to a maximum of 64 labels.
8876    ///
8877    /// Both keys and values are additionally constrained to be <= 128 bytes.
8878    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8879
8880    /// Output only. Indicates whether this is an abandoned release.
8881    pub abandoned: bool,
8882
8883    /// Output only. Time at which the `Release` was created.
8884    pub create_time: std::option::Option<wkt::Timestamp>,
8885
8886    /// Output only. Time at which the render began.
8887    pub render_start_time: std::option::Option<wkt::Timestamp>,
8888
8889    /// Output only. Time at which the render completed.
8890    pub render_end_time: std::option::Option<wkt::Timestamp>,
8891
8892    /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
8893    /// configuration.
8894    pub skaffold_config_uri: std::string::String,
8895
8896    /// Optional. Filepath of the Skaffold config inside of the config URI.
8897    pub skaffold_config_path: std::string::String,
8898
8899    /// Optional. List of artifacts to pass through to Skaffold command.
8900    pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
8901
8902    /// Output only. Snapshot of the parent pipeline taken at release creation
8903    /// time.
8904    pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
8905
8906    /// Output only. Snapshot of the targets taken at release creation time.
8907    pub target_snapshots: std::vec::Vec<crate::model::Target>,
8908
8909    /// Output only. Snapshot of the custom target types referenced by the targets
8910    /// taken at release creation time.
8911    pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
8912
8913    /// Output only. Current state of the render operation.
8914    pub render_state: crate::model::release::RenderState,
8915
8916    /// This checksum is computed by the server based on the value of other
8917    /// fields, and may be sent on update and delete requests to ensure the
8918    /// client has an up-to-date value before proceeding.
8919    pub etag: std::string::String,
8920
8921    /// Optional. The Skaffold version to use when operating on this release, such
8922    /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
8923    /// set of versions.
8924    ///
8925    /// If unset, the most recent supported Skaffold version will be used.
8926    pub skaffold_version: std::string::String,
8927
8928    /// Output only. Map from target ID to the target artifacts created
8929    /// during the render operation.
8930    pub target_artifacts:
8931        std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
8932
8933    /// Output only. Map from target ID to details of the render operation for that
8934    /// target.
8935    pub target_renders:
8936        std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
8937
8938    /// Output only. Information around the state of the Release.
8939    pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
8940
8941    /// Optional. The deploy parameters to use for all targets in this release.
8942    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
8943
8944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8945}
8946
8947impl Release {
8948    /// Creates a new default instance.
8949    pub fn new() -> Self {
8950        std::default::Default::default()
8951    }
8952
8953    /// Sets the value of [name][crate::model::Release::name].
8954    ///
8955    /// # Example
8956    /// ```ignore,no_run
8957    /// # use google_cloud_deploy_v1::model::Release;
8958    /// let x = Release::new().set_name("example");
8959    /// ```
8960    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8961        self.name = v.into();
8962        self
8963    }
8964
8965    /// Sets the value of [uid][crate::model::Release::uid].
8966    ///
8967    /// # Example
8968    /// ```ignore,no_run
8969    /// # use google_cloud_deploy_v1::model::Release;
8970    /// let x = Release::new().set_uid("example");
8971    /// ```
8972    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8973        self.uid = v.into();
8974        self
8975    }
8976
8977    /// Sets the value of [description][crate::model::Release::description].
8978    ///
8979    /// # Example
8980    /// ```ignore,no_run
8981    /// # use google_cloud_deploy_v1::model::Release;
8982    /// let x = Release::new().set_description("example");
8983    /// ```
8984    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8985        self.description = v.into();
8986        self
8987    }
8988
8989    /// Sets the value of [annotations][crate::model::Release::annotations].
8990    ///
8991    /// # Example
8992    /// ```ignore,no_run
8993    /// # use google_cloud_deploy_v1::model::Release;
8994    /// let x = Release::new().set_annotations([
8995    ///     ("key0", "abc"),
8996    ///     ("key1", "xyz"),
8997    /// ]);
8998    /// ```
8999    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
9000    where
9001        T: std::iter::IntoIterator<Item = (K, V)>,
9002        K: std::convert::Into<std::string::String>,
9003        V: std::convert::Into<std::string::String>,
9004    {
9005        use std::iter::Iterator;
9006        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9007        self
9008    }
9009
9010    /// Sets the value of [labels][crate::model::Release::labels].
9011    ///
9012    /// # Example
9013    /// ```ignore,no_run
9014    /// # use google_cloud_deploy_v1::model::Release;
9015    /// let x = Release::new().set_labels([
9016    ///     ("key0", "abc"),
9017    ///     ("key1", "xyz"),
9018    /// ]);
9019    /// ```
9020    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9021    where
9022        T: std::iter::IntoIterator<Item = (K, V)>,
9023        K: std::convert::Into<std::string::String>,
9024        V: std::convert::Into<std::string::String>,
9025    {
9026        use std::iter::Iterator;
9027        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9028        self
9029    }
9030
9031    /// Sets the value of [abandoned][crate::model::Release::abandoned].
9032    ///
9033    /// # Example
9034    /// ```ignore,no_run
9035    /// # use google_cloud_deploy_v1::model::Release;
9036    /// let x = Release::new().set_abandoned(true);
9037    /// ```
9038    pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9039        self.abandoned = v.into();
9040        self
9041    }
9042
9043    /// Sets the value of [create_time][crate::model::Release::create_time].
9044    ///
9045    /// # Example
9046    /// ```ignore,no_run
9047    /// # use google_cloud_deploy_v1::model::Release;
9048    /// use wkt::Timestamp;
9049    /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
9050    /// ```
9051    pub fn set_create_time<T>(mut self, v: T) -> Self
9052    where
9053        T: std::convert::Into<wkt::Timestamp>,
9054    {
9055        self.create_time = std::option::Option::Some(v.into());
9056        self
9057    }
9058
9059    /// Sets or clears the value of [create_time][crate::model::Release::create_time].
9060    ///
9061    /// # Example
9062    /// ```ignore,no_run
9063    /// # use google_cloud_deploy_v1::model::Release;
9064    /// use wkt::Timestamp;
9065    /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9066    /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
9067    /// ```
9068    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9069    where
9070        T: std::convert::Into<wkt::Timestamp>,
9071    {
9072        self.create_time = v.map(|x| x.into());
9073        self
9074    }
9075
9076    /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
9077    ///
9078    /// # Example
9079    /// ```ignore,no_run
9080    /// # use google_cloud_deploy_v1::model::Release;
9081    /// use wkt::Timestamp;
9082    /// let x = Release::new().set_render_start_time(Timestamp::default()/* use setters */);
9083    /// ```
9084    pub fn set_render_start_time<T>(mut self, v: T) -> Self
9085    where
9086        T: std::convert::Into<wkt::Timestamp>,
9087    {
9088        self.render_start_time = std::option::Option::Some(v.into());
9089        self
9090    }
9091
9092    /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
9093    ///
9094    /// # Example
9095    /// ```ignore,no_run
9096    /// # use google_cloud_deploy_v1::model::Release;
9097    /// use wkt::Timestamp;
9098    /// let x = Release::new().set_or_clear_render_start_time(Some(Timestamp::default()/* use setters */));
9099    /// let x = Release::new().set_or_clear_render_start_time(None::<Timestamp>);
9100    /// ```
9101    pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9102    where
9103        T: std::convert::Into<wkt::Timestamp>,
9104    {
9105        self.render_start_time = v.map(|x| x.into());
9106        self
9107    }
9108
9109    /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
9110    ///
9111    /// # Example
9112    /// ```ignore,no_run
9113    /// # use google_cloud_deploy_v1::model::Release;
9114    /// use wkt::Timestamp;
9115    /// let x = Release::new().set_render_end_time(Timestamp::default()/* use setters */);
9116    /// ```
9117    pub fn set_render_end_time<T>(mut self, v: T) -> Self
9118    where
9119        T: std::convert::Into<wkt::Timestamp>,
9120    {
9121        self.render_end_time = std::option::Option::Some(v.into());
9122        self
9123    }
9124
9125    /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
9126    ///
9127    /// # Example
9128    /// ```ignore,no_run
9129    /// # use google_cloud_deploy_v1::model::Release;
9130    /// use wkt::Timestamp;
9131    /// let x = Release::new().set_or_clear_render_end_time(Some(Timestamp::default()/* use setters */));
9132    /// let x = Release::new().set_or_clear_render_end_time(None::<Timestamp>);
9133    /// ```
9134    pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9135    where
9136        T: std::convert::Into<wkt::Timestamp>,
9137    {
9138        self.render_end_time = v.map(|x| x.into());
9139        self
9140    }
9141
9142    /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
9143    ///
9144    /// # Example
9145    /// ```ignore,no_run
9146    /// # use google_cloud_deploy_v1::model::Release;
9147    /// let x = Release::new().set_skaffold_config_uri("example");
9148    /// ```
9149    pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
9150        mut self,
9151        v: T,
9152    ) -> Self {
9153        self.skaffold_config_uri = v.into();
9154        self
9155    }
9156
9157    /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
9158    ///
9159    /// # Example
9160    /// ```ignore,no_run
9161    /// # use google_cloud_deploy_v1::model::Release;
9162    /// let x = Release::new().set_skaffold_config_path("example");
9163    /// ```
9164    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
9165        mut self,
9166        v: T,
9167    ) -> Self {
9168        self.skaffold_config_path = v.into();
9169        self
9170    }
9171
9172    /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
9173    ///
9174    /// # Example
9175    /// ```ignore,no_run
9176    /// # use google_cloud_deploy_v1::model::Release;
9177    /// use google_cloud_deploy_v1::model::BuildArtifact;
9178    /// let x = Release::new()
9179    ///     .set_build_artifacts([
9180    ///         BuildArtifact::default()/* use setters */,
9181    ///         BuildArtifact::default()/* use (different) setters */,
9182    ///     ]);
9183    /// ```
9184    pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
9185    where
9186        T: std::iter::IntoIterator<Item = V>,
9187        V: std::convert::Into<crate::model::BuildArtifact>,
9188    {
9189        use std::iter::Iterator;
9190        self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
9191        self
9192    }
9193
9194    /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9195    ///
9196    /// # Example
9197    /// ```ignore,no_run
9198    /// # use google_cloud_deploy_v1::model::Release;
9199    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9200    /// let x = Release::new().set_delivery_pipeline_snapshot(DeliveryPipeline::default()/* use setters */);
9201    /// ```
9202    pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
9203    where
9204        T: std::convert::Into<crate::model::DeliveryPipeline>,
9205    {
9206        self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
9207        self
9208    }
9209
9210    /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9211    ///
9212    /// # Example
9213    /// ```ignore,no_run
9214    /// # use google_cloud_deploy_v1::model::Release;
9215    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9216    /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(Some(DeliveryPipeline::default()/* use setters */));
9217    /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(None::<DeliveryPipeline>);
9218    /// ```
9219    pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9220    where
9221        T: std::convert::Into<crate::model::DeliveryPipeline>,
9222    {
9223        self.delivery_pipeline_snapshot = v.map(|x| x.into());
9224        self
9225    }
9226
9227    /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
9228    ///
9229    /// # Example
9230    /// ```ignore,no_run
9231    /// # use google_cloud_deploy_v1::model::Release;
9232    /// use google_cloud_deploy_v1::model::Target;
9233    /// let x = Release::new()
9234    ///     .set_target_snapshots([
9235    ///         Target::default()/* use setters */,
9236    ///         Target::default()/* use (different) setters */,
9237    ///     ]);
9238    /// ```
9239    pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
9240    where
9241        T: std::iter::IntoIterator<Item = V>,
9242        V: std::convert::Into<crate::model::Target>,
9243    {
9244        use std::iter::Iterator;
9245        self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
9246        self
9247    }
9248
9249    /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
9250    ///
9251    /// # Example
9252    /// ```ignore,no_run
9253    /// # use google_cloud_deploy_v1::model::Release;
9254    /// use google_cloud_deploy_v1::model::CustomTargetType;
9255    /// let x = Release::new()
9256    ///     .set_custom_target_type_snapshots([
9257    ///         CustomTargetType::default()/* use setters */,
9258    ///         CustomTargetType::default()/* use (different) setters */,
9259    ///     ]);
9260    /// ```
9261    pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
9262    where
9263        T: std::iter::IntoIterator<Item = V>,
9264        V: std::convert::Into<crate::model::CustomTargetType>,
9265    {
9266        use std::iter::Iterator;
9267        self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
9268        self
9269    }
9270
9271    /// Sets the value of [render_state][crate::model::Release::render_state].
9272    ///
9273    /// # Example
9274    /// ```ignore,no_run
9275    /// # use google_cloud_deploy_v1::model::Release;
9276    /// use google_cloud_deploy_v1::model::release::RenderState;
9277    /// let x0 = Release::new().set_render_state(RenderState::Succeeded);
9278    /// let x1 = Release::new().set_render_state(RenderState::Failed);
9279    /// let x2 = Release::new().set_render_state(RenderState::InProgress);
9280    /// ```
9281    pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
9282        mut self,
9283        v: T,
9284    ) -> Self {
9285        self.render_state = v.into();
9286        self
9287    }
9288
9289    /// Sets the value of [etag][crate::model::Release::etag].
9290    ///
9291    /// # Example
9292    /// ```ignore,no_run
9293    /// # use google_cloud_deploy_v1::model::Release;
9294    /// let x = Release::new().set_etag("example");
9295    /// ```
9296    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9297        self.etag = v.into();
9298        self
9299    }
9300
9301    /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
9302    ///
9303    /// # Example
9304    /// ```ignore,no_run
9305    /// # use google_cloud_deploy_v1::model::Release;
9306    /// let x = Release::new().set_skaffold_version("example");
9307    /// ```
9308    pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
9309        mut self,
9310        v: T,
9311    ) -> Self {
9312        self.skaffold_version = v.into();
9313        self
9314    }
9315
9316    /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
9317    ///
9318    /// # Example
9319    /// ```ignore,no_run
9320    /// # use google_cloud_deploy_v1::model::Release;
9321    /// use google_cloud_deploy_v1::model::TargetArtifact;
9322    /// let x = Release::new().set_target_artifacts([
9323    ///     ("key0", TargetArtifact::default()/* use setters */),
9324    ///     ("key1", TargetArtifact::default()/* use (different) setters */),
9325    /// ]);
9326    /// ```
9327    pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
9328    where
9329        T: std::iter::IntoIterator<Item = (K, V)>,
9330        K: std::convert::Into<std::string::String>,
9331        V: std::convert::Into<crate::model::TargetArtifact>,
9332    {
9333        use std::iter::Iterator;
9334        self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9335        self
9336    }
9337
9338    /// Sets the value of [target_renders][crate::model::Release::target_renders].
9339    ///
9340    /// # Example
9341    /// ```ignore,no_run
9342    /// # use google_cloud_deploy_v1::model::Release;
9343    /// use google_cloud_deploy_v1::model::release::TargetRender;
9344    /// let x = Release::new().set_target_renders([
9345    ///     ("key0", TargetRender::default()/* use setters */),
9346    ///     ("key1", TargetRender::default()/* use (different) setters */),
9347    /// ]);
9348    /// ```
9349    pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
9350    where
9351        T: std::iter::IntoIterator<Item = (K, V)>,
9352        K: std::convert::Into<std::string::String>,
9353        V: std::convert::Into<crate::model::release::TargetRender>,
9354    {
9355        use std::iter::Iterator;
9356        self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9357        self
9358    }
9359
9360    /// Sets the value of [condition][crate::model::Release::condition].
9361    ///
9362    /// # Example
9363    /// ```ignore,no_run
9364    /// # use google_cloud_deploy_v1::model::Release;
9365    /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9366    /// let x = Release::new().set_condition(ReleaseCondition::default()/* use setters */);
9367    /// ```
9368    pub fn set_condition<T>(mut self, v: T) -> Self
9369    where
9370        T: std::convert::Into<crate::model::release::ReleaseCondition>,
9371    {
9372        self.condition = std::option::Option::Some(v.into());
9373        self
9374    }
9375
9376    /// Sets or clears the value of [condition][crate::model::Release::condition].
9377    ///
9378    /// # Example
9379    /// ```ignore,no_run
9380    /// # use google_cloud_deploy_v1::model::Release;
9381    /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9382    /// let x = Release::new().set_or_clear_condition(Some(ReleaseCondition::default()/* use setters */));
9383    /// let x = Release::new().set_or_clear_condition(None::<ReleaseCondition>);
9384    /// ```
9385    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
9386    where
9387        T: std::convert::Into<crate::model::release::ReleaseCondition>,
9388    {
9389        self.condition = v.map(|x| x.into());
9390        self
9391    }
9392
9393    /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
9394    ///
9395    /// # Example
9396    /// ```ignore,no_run
9397    /// # use google_cloud_deploy_v1::model::Release;
9398    /// let x = Release::new().set_deploy_parameters([
9399    ///     ("key0", "abc"),
9400    ///     ("key1", "xyz"),
9401    /// ]);
9402    /// ```
9403    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
9404    where
9405        T: std::iter::IntoIterator<Item = (K, V)>,
9406        K: std::convert::Into<std::string::String>,
9407        V: std::convert::Into<std::string::String>,
9408    {
9409        use std::iter::Iterator;
9410        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9411        self
9412    }
9413}
9414
9415impl wkt::message::Message for Release {
9416    fn typename() -> &'static str {
9417        "type.googleapis.com/google.cloud.deploy.v1.Release"
9418    }
9419}
9420
9421/// Defines additional types related to [Release].
9422pub mod release {
9423    #[allow(unused_imports)]
9424    use super::*;
9425
9426    /// Details of rendering for a single target.
9427    #[derive(Clone, Default, PartialEq)]
9428    #[non_exhaustive]
9429    pub struct TargetRender {
9430        /// Output only. The resource name of the Cloud Build `Build` object that is
9431        /// used to render the manifest for this target. Format is
9432        /// `projects/{project}/locations/{location}/builds/{build}`.
9433        pub rendering_build: std::string::String,
9434
9435        /// Output only. Current state of the render operation for this Target.
9436        pub rendering_state: crate::model::release::target_render::TargetRenderState,
9437
9438        /// Output only. Metadata related to the `Release` render for this Target.
9439        pub metadata: std::option::Option<crate::model::RenderMetadata>,
9440
9441        /// Output only. Reason this render failed. This will always be unspecified
9442        /// while the render in progress.
9443        pub failure_cause: crate::model::release::target_render::FailureCause,
9444
9445        /// Output only. Additional information about the render failure, if
9446        /// available.
9447        pub failure_message: std::string::String,
9448
9449        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9450    }
9451
9452    impl TargetRender {
9453        /// Creates a new default instance.
9454        pub fn new() -> Self {
9455            std::default::Default::default()
9456        }
9457
9458        /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
9459        ///
9460        /// # Example
9461        /// ```ignore,no_run
9462        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9463        /// let x = TargetRender::new().set_rendering_build("example");
9464        /// ```
9465        pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
9466            mut self,
9467            v: T,
9468        ) -> Self {
9469            self.rendering_build = v.into();
9470            self
9471        }
9472
9473        /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
9474        ///
9475        /// # Example
9476        /// ```ignore,no_run
9477        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9478        /// use google_cloud_deploy_v1::model::release::target_render::TargetRenderState;
9479        /// let x0 = TargetRender::new().set_rendering_state(TargetRenderState::Succeeded);
9480        /// let x1 = TargetRender::new().set_rendering_state(TargetRenderState::Failed);
9481        /// let x2 = TargetRender::new().set_rendering_state(TargetRenderState::InProgress);
9482        /// ```
9483        pub fn set_rendering_state<
9484            T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
9485        >(
9486            mut self,
9487            v: T,
9488        ) -> Self {
9489            self.rendering_state = v.into();
9490            self
9491        }
9492
9493        /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
9494        ///
9495        /// # Example
9496        /// ```ignore,no_run
9497        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9498        /// use google_cloud_deploy_v1::model::RenderMetadata;
9499        /// let x = TargetRender::new().set_metadata(RenderMetadata::default()/* use setters */);
9500        /// ```
9501        pub fn set_metadata<T>(mut self, v: T) -> Self
9502        where
9503            T: std::convert::Into<crate::model::RenderMetadata>,
9504        {
9505            self.metadata = std::option::Option::Some(v.into());
9506            self
9507        }
9508
9509        /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
9510        ///
9511        /// # Example
9512        /// ```ignore,no_run
9513        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9514        /// use google_cloud_deploy_v1::model::RenderMetadata;
9515        /// let x = TargetRender::new().set_or_clear_metadata(Some(RenderMetadata::default()/* use setters */));
9516        /// let x = TargetRender::new().set_or_clear_metadata(None::<RenderMetadata>);
9517        /// ```
9518        pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9519        where
9520            T: std::convert::Into<crate::model::RenderMetadata>,
9521        {
9522            self.metadata = v.map(|x| x.into());
9523            self
9524        }
9525
9526        /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
9527        ///
9528        /// # Example
9529        /// ```ignore,no_run
9530        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9531        /// use google_cloud_deploy_v1::model::release::target_render::FailureCause;
9532        /// let x0 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
9533        /// let x1 = TargetRender::new().set_failure_cause(FailureCause::ExecutionFailed);
9534        /// let x2 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildRequestFailed);
9535        /// ```
9536        pub fn set_failure_cause<
9537            T: std::convert::Into<crate::model::release::target_render::FailureCause>,
9538        >(
9539            mut self,
9540            v: T,
9541        ) -> Self {
9542            self.failure_cause = v.into();
9543            self
9544        }
9545
9546        /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
9547        ///
9548        /// # Example
9549        /// ```ignore,no_run
9550        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9551        /// let x = TargetRender::new().set_failure_message("example");
9552        /// ```
9553        pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
9554            mut self,
9555            v: T,
9556        ) -> Self {
9557            self.failure_message = v.into();
9558            self
9559        }
9560    }
9561
9562    impl wkt::message::Message for TargetRender {
9563        fn typename() -> &'static str {
9564            "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
9565        }
9566    }
9567
9568    /// Defines additional types related to [TargetRender].
9569    pub mod target_render {
9570        #[allow(unused_imports)]
9571        use super::*;
9572
9573        /// Valid states of the render operation.
9574        ///
9575        /// # Working with unknown values
9576        ///
9577        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9578        /// additional enum variants at any time. Adding new variants is not considered
9579        /// a breaking change. Applications should write their code in anticipation of:
9580        ///
9581        /// - New values appearing in future releases of the client library, **and**
9582        /// - New values received dynamically, without application changes.
9583        ///
9584        /// Please consult the [Working with enums] section in the user guide for some
9585        /// guidelines.
9586        ///
9587        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9588        #[derive(Clone, Debug, PartialEq)]
9589        #[non_exhaustive]
9590        pub enum TargetRenderState {
9591            /// The render operation state is unspecified.
9592            Unspecified,
9593            /// The render operation has completed successfully.
9594            Succeeded,
9595            /// The render operation has failed.
9596            Failed,
9597            /// The render operation is in progress.
9598            InProgress,
9599            /// If set, the enum was initialized with an unknown value.
9600            ///
9601            /// Applications can examine the value using [TargetRenderState::value] or
9602            /// [TargetRenderState::name].
9603            UnknownValue(target_render_state::UnknownValue),
9604        }
9605
9606        #[doc(hidden)]
9607        pub mod target_render_state {
9608            #[allow(unused_imports)]
9609            use super::*;
9610            #[derive(Clone, Debug, PartialEq)]
9611            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9612        }
9613
9614        impl TargetRenderState {
9615            /// Gets the enum value.
9616            ///
9617            /// Returns `None` if the enum contains an unknown value deserialized from
9618            /// the string representation of enums.
9619            pub fn value(&self) -> std::option::Option<i32> {
9620                match self {
9621                    Self::Unspecified => std::option::Option::Some(0),
9622                    Self::Succeeded => std::option::Option::Some(1),
9623                    Self::Failed => std::option::Option::Some(2),
9624                    Self::InProgress => std::option::Option::Some(3),
9625                    Self::UnknownValue(u) => u.0.value(),
9626                }
9627            }
9628
9629            /// Gets the enum value as a string.
9630            ///
9631            /// Returns `None` if the enum contains an unknown value deserialized from
9632            /// the integer representation of enums.
9633            pub fn name(&self) -> std::option::Option<&str> {
9634                match self {
9635                    Self::Unspecified => {
9636                        std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
9637                    }
9638                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9639                    Self::Failed => std::option::Option::Some("FAILED"),
9640                    Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9641                    Self::UnknownValue(u) => u.0.name(),
9642                }
9643            }
9644        }
9645
9646        impl std::default::Default for TargetRenderState {
9647            fn default() -> Self {
9648                use std::convert::From;
9649                Self::from(0)
9650            }
9651        }
9652
9653        impl std::fmt::Display for TargetRenderState {
9654            fn fmt(
9655                &self,
9656                f: &mut std::fmt::Formatter<'_>,
9657            ) -> std::result::Result<(), std::fmt::Error> {
9658                wkt::internal::display_enum(f, self.name(), self.value())
9659            }
9660        }
9661
9662        impl std::convert::From<i32> for TargetRenderState {
9663            fn from(value: i32) -> Self {
9664                match value {
9665                    0 => Self::Unspecified,
9666                    1 => Self::Succeeded,
9667                    2 => Self::Failed,
9668                    3 => Self::InProgress,
9669                    _ => Self::UnknownValue(target_render_state::UnknownValue(
9670                        wkt::internal::UnknownEnumValue::Integer(value),
9671                    )),
9672                }
9673            }
9674        }
9675
9676        impl std::convert::From<&str> for TargetRenderState {
9677            fn from(value: &str) -> Self {
9678                use std::string::ToString;
9679                match value {
9680                    "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
9681                    "SUCCEEDED" => Self::Succeeded,
9682                    "FAILED" => Self::Failed,
9683                    "IN_PROGRESS" => Self::InProgress,
9684                    _ => Self::UnknownValue(target_render_state::UnknownValue(
9685                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9686                    )),
9687                }
9688            }
9689        }
9690
9691        impl serde::ser::Serialize for TargetRenderState {
9692            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9693            where
9694                S: serde::Serializer,
9695            {
9696                match self {
9697                    Self::Unspecified => serializer.serialize_i32(0),
9698                    Self::Succeeded => serializer.serialize_i32(1),
9699                    Self::Failed => serializer.serialize_i32(2),
9700                    Self::InProgress => serializer.serialize_i32(3),
9701                    Self::UnknownValue(u) => u.0.serialize(serializer),
9702                }
9703            }
9704        }
9705
9706        impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
9707            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9708            where
9709                D: serde::Deserializer<'de>,
9710            {
9711                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
9712                    ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
9713                ))
9714            }
9715        }
9716
9717        /// Well-known rendering failures.
9718        ///
9719        /// # Working with unknown values
9720        ///
9721        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9722        /// additional enum variants at any time. Adding new variants is not considered
9723        /// a breaking change. Applications should write their code in anticipation of:
9724        ///
9725        /// - New values appearing in future releases of the client library, **and**
9726        /// - New values received dynamically, without application changes.
9727        ///
9728        /// Please consult the [Working with enums] section in the user guide for some
9729        /// guidelines.
9730        ///
9731        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9732        #[derive(Clone, Debug, PartialEq)]
9733        #[non_exhaustive]
9734        pub enum FailureCause {
9735            /// No reason for failure is specified.
9736            Unspecified,
9737            /// Cloud Build is not available, either because it is not enabled or
9738            /// because Cloud Deploy has insufficient permissions. See [required
9739            /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9740            CloudBuildUnavailable,
9741            /// The render operation did not complete successfully; check Cloud Build
9742            /// logs.
9743            ExecutionFailed,
9744            /// Cloud Build failed to fulfill Cloud Deploy's request. See
9745            /// failure_message for additional details.
9746            CloudBuildRequestFailed,
9747            /// The render operation did not complete successfully because the
9748            /// verification stanza required for verify was not found on the Skaffold
9749            /// configuration.
9750            VerificationConfigNotFound,
9751            /// The render operation did not complete successfully because the custom
9752            /// action(s) required for Rollout jobs were not found in the Skaffold
9753            /// configuration. See failure_message for additional details.
9754            CustomActionNotFound,
9755            /// Release failed during rendering because the release configuration is
9756            /// not supported with the specified deployment strategy.
9757            DeploymentStrategyNotSupported,
9758            /// The render operation had a feature configured that is not supported.
9759            RenderFeatureNotSupported,
9760            /// If set, the enum was initialized with an unknown value.
9761            ///
9762            /// Applications can examine the value using [FailureCause::value] or
9763            /// [FailureCause::name].
9764            UnknownValue(failure_cause::UnknownValue),
9765        }
9766
9767        #[doc(hidden)]
9768        pub mod failure_cause {
9769            #[allow(unused_imports)]
9770            use super::*;
9771            #[derive(Clone, Debug, PartialEq)]
9772            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9773        }
9774
9775        impl FailureCause {
9776            /// Gets the enum value.
9777            ///
9778            /// Returns `None` if the enum contains an unknown value deserialized from
9779            /// the string representation of enums.
9780            pub fn value(&self) -> std::option::Option<i32> {
9781                match self {
9782                    Self::Unspecified => std::option::Option::Some(0),
9783                    Self::CloudBuildUnavailable => std::option::Option::Some(1),
9784                    Self::ExecutionFailed => std::option::Option::Some(2),
9785                    Self::CloudBuildRequestFailed => std::option::Option::Some(3),
9786                    Self::VerificationConfigNotFound => std::option::Option::Some(4),
9787                    Self::CustomActionNotFound => std::option::Option::Some(5),
9788                    Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
9789                    Self::RenderFeatureNotSupported => std::option::Option::Some(7),
9790                    Self::UnknownValue(u) => u.0.value(),
9791                }
9792            }
9793
9794            /// Gets the enum value as a string.
9795            ///
9796            /// Returns `None` if the enum contains an unknown value deserialized from
9797            /// the integer representation of enums.
9798            pub fn name(&self) -> std::option::Option<&str> {
9799                match self {
9800                    Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9801                    Self::CloudBuildUnavailable => {
9802                        std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
9803                    }
9804                    Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9805                    Self::CloudBuildRequestFailed => {
9806                        std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9807                    }
9808                    Self::VerificationConfigNotFound => {
9809                        std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9810                    }
9811                    Self::CustomActionNotFound => {
9812                        std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
9813                    }
9814                    Self::DeploymentStrategyNotSupported => {
9815                        std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
9816                    }
9817                    Self::RenderFeatureNotSupported => {
9818                        std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
9819                    }
9820                    Self::UnknownValue(u) => u.0.name(),
9821                }
9822            }
9823        }
9824
9825        impl std::default::Default for FailureCause {
9826            fn default() -> Self {
9827                use std::convert::From;
9828                Self::from(0)
9829            }
9830        }
9831
9832        impl std::fmt::Display for FailureCause {
9833            fn fmt(
9834                &self,
9835                f: &mut std::fmt::Formatter<'_>,
9836            ) -> std::result::Result<(), std::fmt::Error> {
9837                wkt::internal::display_enum(f, self.name(), self.value())
9838            }
9839        }
9840
9841        impl std::convert::From<i32> for FailureCause {
9842            fn from(value: i32) -> Self {
9843                match value {
9844                    0 => Self::Unspecified,
9845                    1 => Self::CloudBuildUnavailable,
9846                    2 => Self::ExecutionFailed,
9847                    3 => Self::CloudBuildRequestFailed,
9848                    4 => Self::VerificationConfigNotFound,
9849                    5 => Self::CustomActionNotFound,
9850                    6 => Self::DeploymentStrategyNotSupported,
9851                    7 => Self::RenderFeatureNotSupported,
9852                    _ => Self::UnknownValue(failure_cause::UnknownValue(
9853                        wkt::internal::UnknownEnumValue::Integer(value),
9854                    )),
9855                }
9856            }
9857        }
9858
9859        impl std::convert::From<&str> for FailureCause {
9860            fn from(value: &str) -> Self {
9861                use std::string::ToString;
9862                match value {
9863                    "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9864                    "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9865                    "EXECUTION_FAILED" => Self::ExecutionFailed,
9866                    "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9867                    "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9868                    "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
9869                    "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
9870                    "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
9871                    _ => Self::UnknownValue(failure_cause::UnknownValue(
9872                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9873                    )),
9874                }
9875            }
9876        }
9877
9878        impl serde::ser::Serialize for FailureCause {
9879            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9880            where
9881                S: serde::Serializer,
9882            {
9883                match self {
9884                    Self::Unspecified => serializer.serialize_i32(0),
9885                    Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9886                    Self::ExecutionFailed => serializer.serialize_i32(2),
9887                    Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
9888                    Self::VerificationConfigNotFound => serializer.serialize_i32(4),
9889                    Self::CustomActionNotFound => serializer.serialize_i32(5),
9890                    Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
9891                    Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
9892                    Self::UnknownValue(u) => u.0.serialize(serializer),
9893                }
9894            }
9895        }
9896
9897        impl<'de> serde::de::Deserialize<'de> for FailureCause {
9898            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9899            where
9900                D: serde::Deserializer<'de>,
9901            {
9902                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9903                    ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
9904                ))
9905            }
9906        }
9907    }
9908
9909    /// ReleaseReadyCondition contains information around the status of the
9910    /// Release. If a release is not ready, you cannot create a rollout with the
9911    /// release.
9912    #[derive(Clone, Default, PartialEq)]
9913    #[non_exhaustive]
9914    pub struct ReleaseReadyCondition {
9915        /// True if the Release is in a valid state. Otherwise at least one condition
9916        /// in `ReleaseCondition` is in an invalid state. Iterate over those
9917        /// conditions and see which condition(s) has status = false to find out what
9918        /// is wrong with the Release.
9919        pub status: bool,
9920
9921        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9922    }
9923
9924    impl ReleaseReadyCondition {
9925        /// Creates a new default instance.
9926        pub fn new() -> Self {
9927            std::default::Default::default()
9928        }
9929
9930        /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
9931        ///
9932        /// # Example
9933        /// ```ignore,no_run
9934        /// # use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
9935        /// let x = ReleaseReadyCondition::new().set_status(true);
9936        /// ```
9937        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9938            self.status = v.into();
9939            self
9940        }
9941    }
9942
9943    impl wkt::message::Message for ReleaseReadyCondition {
9944        fn typename() -> &'static str {
9945            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
9946        }
9947    }
9948
9949    /// SkaffoldSupportedCondition contains information about when support for the
9950    /// release's version of Skaffold ends.
9951    #[derive(Clone, Default, PartialEq)]
9952    #[non_exhaustive]
9953    pub struct SkaffoldSupportedCondition {
9954        /// True if the version of Skaffold used by this release is supported.
9955        pub status: bool,
9956
9957        /// The Skaffold support state for this release's version of Skaffold.
9958        pub skaffold_support_state: crate::model::SkaffoldSupportState,
9959
9960        /// The time at which this release's version of Skaffold will enter
9961        /// maintenance mode.
9962        pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
9963
9964        /// The time at which this release's version of Skaffold will no longer be
9965        /// supported.
9966        pub support_expiration_time: std::option::Option<wkt::Timestamp>,
9967
9968        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9969    }
9970
9971    impl SkaffoldSupportedCondition {
9972        /// Creates a new default instance.
9973        pub fn new() -> Self {
9974            std::default::Default::default()
9975        }
9976
9977        /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
9978        ///
9979        /// # Example
9980        /// ```ignore,no_run
9981        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9982        /// let x = SkaffoldSupportedCondition::new().set_status(true);
9983        /// ```
9984        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9985            self.status = v.into();
9986            self
9987        }
9988
9989        /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
9990        ///
9991        /// # Example
9992        /// ```ignore,no_run
9993        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9994        /// use google_cloud_deploy_v1::model::SkaffoldSupportState;
9995        /// let x0 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Supported);
9996        /// let x1 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::MaintenanceMode);
9997        /// let x2 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Unsupported);
9998        /// ```
9999        pub fn set_skaffold_support_state<
10000            T: std::convert::Into<crate::model::SkaffoldSupportState>,
10001        >(
10002            mut self,
10003            v: T,
10004        ) -> Self {
10005            self.skaffold_support_state = v.into();
10006            self
10007        }
10008
10009        /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
10010        ///
10011        /// # Example
10012        /// ```ignore,no_run
10013        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10014        /// use wkt::Timestamp;
10015        /// let x = SkaffoldSupportedCondition::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
10016        /// ```
10017        pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
10018        where
10019            T: std::convert::Into<wkt::Timestamp>,
10020        {
10021            self.maintenance_mode_time = std::option::Option::Some(v.into());
10022            self
10023        }
10024
10025        /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
10026        ///
10027        /// # Example
10028        /// ```ignore,no_run
10029        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10030        /// use wkt::Timestamp;
10031        /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
10032        /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
10033        /// ```
10034        pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
10035        where
10036            T: std::convert::Into<wkt::Timestamp>,
10037        {
10038            self.maintenance_mode_time = v.map(|x| x.into());
10039            self
10040        }
10041
10042        /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
10043        ///
10044        /// # Example
10045        /// ```ignore,no_run
10046        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10047        /// use wkt::Timestamp;
10048        /// let x = SkaffoldSupportedCondition::new().set_support_expiration_time(Timestamp::default()/* use setters */);
10049        /// ```
10050        pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
10051        where
10052            T: std::convert::Into<wkt::Timestamp>,
10053        {
10054            self.support_expiration_time = std::option::Option::Some(v.into());
10055            self
10056        }
10057
10058        /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
10059        ///
10060        /// # Example
10061        /// ```ignore,no_run
10062        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10063        /// use wkt::Timestamp;
10064        /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
10065        /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(None::<Timestamp>);
10066        /// ```
10067        pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
10068        where
10069            T: std::convert::Into<wkt::Timestamp>,
10070        {
10071            self.support_expiration_time = v.map(|x| x.into());
10072            self
10073        }
10074    }
10075
10076    impl wkt::message::Message for SkaffoldSupportedCondition {
10077        fn typename() -> &'static str {
10078            "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
10079        }
10080    }
10081
10082    /// ReleaseCondition contains all conditions relevant to a Release.
10083    #[derive(Clone, Default, PartialEq)]
10084    #[non_exhaustive]
10085    pub struct ReleaseCondition {
10086        /// Details around the Releases's overall status.
10087        pub release_ready_condition:
10088            std::option::Option<crate::model::release::ReleaseReadyCondition>,
10089
10090        /// Details around the support state of the release's Skaffold
10091        /// version.
10092        pub skaffold_supported_condition:
10093            std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
10094
10095        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10096    }
10097
10098    impl ReleaseCondition {
10099        /// Creates a new default instance.
10100        pub fn new() -> Self {
10101            std::default::Default::default()
10102        }
10103
10104        /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10105        ///
10106        /// # Example
10107        /// ```ignore,no_run
10108        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10109        /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10110        /// let x = ReleaseCondition::new().set_release_ready_condition(ReleaseReadyCondition::default()/* use setters */);
10111        /// ```
10112        pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
10113        where
10114            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10115        {
10116            self.release_ready_condition = std::option::Option::Some(v.into());
10117            self
10118        }
10119
10120        /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10121        ///
10122        /// # Example
10123        /// ```ignore,no_run
10124        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10125        /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10126        /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(Some(ReleaseReadyCondition::default()/* use setters */));
10127        /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(None::<ReleaseReadyCondition>);
10128        /// ```
10129        pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
10130        where
10131            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10132        {
10133            self.release_ready_condition = v.map(|x| x.into());
10134            self
10135        }
10136
10137        /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10138        ///
10139        /// # Example
10140        /// ```ignore,no_run
10141        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10142        /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10143        /// let x = ReleaseCondition::new().set_skaffold_supported_condition(SkaffoldSupportedCondition::default()/* use setters */);
10144        /// ```
10145        pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
10146        where
10147            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10148        {
10149            self.skaffold_supported_condition = std::option::Option::Some(v.into());
10150            self
10151        }
10152
10153        /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10154        ///
10155        /// # Example
10156        /// ```ignore,no_run
10157        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10158        /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10159        /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(Some(SkaffoldSupportedCondition::default()/* use setters */));
10160        /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(None::<SkaffoldSupportedCondition>);
10161        /// ```
10162        pub fn set_or_clear_skaffold_supported_condition<T>(
10163            mut self,
10164            v: std::option::Option<T>,
10165        ) -> Self
10166        where
10167            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10168        {
10169            self.skaffold_supported_condition = v.map(|x| x.into());
10170            self
10171        }
10172    }
10173
10174    impl wkt::message::Message for ReleaseCondition {
10175        fn typename() -> &'static str {
10176            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
10177        }
10178    }
10179
10180    /// Valid states of the render operation.
10181    ///
10182    /// # Working with unknown values
10183    ///
10184    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10185    /// additional enum variants at any time. Adding new variants is not considered
10186    /// a breaking change. Applications should write their code in anticipation of:
10187    ///
10188    /// - New values appearing in future releases of the client library, **and**
10189    /// - New values received dynamically, without application changes.
10190    ///
10191    /// Please consult the [Working with enums] section in the user guide for some
10192    /// guidelines.
10193    ///
10194    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10195    #[derive(Clone, Debug, PartialEq)]
10196    #[non_exhaustive]
10197    pub enum RenderState {
10198        /// The render state is unspecified.
10199        Unspecified,
10200        /// All rendering operations have completed successfully.
10201        Succeeded,
10202        /// All rendering operations have completed, and one or more have failed.
10203        Failed,
10204        /// Rendering has started and is not complete.
10205        InProgress,
10206        /// If set, the enum was initialized with an unknown value.
10207        ///
10208        /// Applications can examine the value using [RenderState::value] or
10209        /// [RenderState::name].
10210        UnknownValue(render_state::UnknownValue),
10211    }
10212
10213    #[doc(hidden)]
10214    pub mod render_state {
10215        #[allow(unused_imports)]
10216        use super::*;
10217        #[derive(Clone, Debug, PartialEq)]
10218        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10219    }
10220
10221    impl RenderState {
10222        /// Gets the enum value.
10223        ///
10224        /// Returns `None` if the enum contains an unknown value deserialized from
10225        /// the string representation of enums.
10226        pub fn value(&self) -> std::option::Option<i32> {
10227            match self {
10228                Self::Unspecified => std::option::Option::Some(0),
10229                Self::Succeeded => std::option::Option::Some(1),
10230                Self::Failed => std::option::Option::Some(2),
10231                Self::InProgress => std::option::Option::Some(3),
10232                Self::UnknownValue(u) => u.0.value(),
10233            }
10234        }
10235
10236        /// Gets the enum value as a string.
10237        ///
10238        /// Returns `None` if the enum contains an unknown value deserialized from
10239        /// the integer representation of enums.
10240        pub fn name(&self) -> std::option::Option<&str> {
10241            match self {
10242                Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
10243                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10244                Self::Failed => std::option::Option::Some("FAILED"),
10245                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10246                Self::UnknownValue(u) => u.0.name(),
10247            }
10248        }
10249    }
10250
10251    impl std::default::Default for RenderState {
10252        fn default() -> Self {
10253            use std::convert::From;
10254            Self::from(0)
10255        }
10256    }
10257
10258    impl std::fmt::Display for RenderState {
10259        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10260            wkt::internal::display_enum(f, self.name(), self.value())
10261        }
10262    }
10263
10264    impl std::convert::From<i32> for RenderState {
10265        fn from(value: i32) -> Self {
10266            match value {
10267                0 => Self::Unspecified,
10268                1 => Self::Succeeded,
10269                2 => Self::Failed,
10270                3 => Self::InProgress,
10271                _ => Self::UnknownValue(render_state::UnknownValue(
10272                    wkt::internal::UnknownEnumValue::Integer(value),
10273                )),
10274            }
10275        }
10276    }
10277
10278    impl std::convert::From<&str> for RenderState {
10279        fn from(value: &str) -> Self {
10280            use std::string::ToString;
10281            match value {
10282                "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
10283                "SUCCEEDED" => Self::Succeeded,
10284                "FAILED" => Self::Failed,
10285                "IN_PROGRESS" => Self::InProgress,
10286                _ => Self::UnknownValue(render_state::UnknownValue(
10287                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10288                )),
10289            }
10290        }
10291    }
10292
10293    impl serde::ser::Serialize for RenderState {
10294        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10295        where
10296            S: serde::Serializer,
10297        {
10298            match self {
10299                Self::Unspecified => serializer.serialize_i32(0),
10300                Self::Succeeded => serializer.serialize_i32(1),
10301                Self::Failed => serializer.serialize_i32(2),
10302                Self::InProgress => serializer.serialize_i32(3),
10303                Self::UnknownValue(u) => u.0.serialize(serializer),
10304            }
10305        }
10306    }
10307
10308    impl<'de> serde::de::Deserialize<'de> for RenderState {
10309        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10310        where
10311            D: serde::Deserializer<'de>,
10312        {
10313            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
10314                ".google.cloud.deploy.v1.Release.RenderState",
10315            ))
10316        }
10317    }
10318}
10319
10320/// The request object for `CreateDeployPolicy`.
10321#[derive(Clone, Default, PartialEq)]
10322#[non_exhaustive]
10323pub struct CreateDeployPolicyRequest {
10324    /// Required. The parent collection in which the `DeployPolicy` must be
10325    /// created. The format is `projects/{project_id}/locations/{location_name}`.
10326    pub parent: std::string::String,
10327
10328    /// Required. ID of the `DeployPolicy`.
10329    pub deploy_policy_id: std::string::String,
10330
10331    /// Required. The `DeployPolicy` to create.
10332    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10333
10334    /// Optional. A request ID to identify requests. Specify a unique request ID
10335    /// so that if you must retry your request, the server knows to ignore the
10336    /// request if it has already been completed. The server guarantees that for
10337    /// at least 60 minutes after the first request.
10338    ///
10339    /// For example, consider a situation where you make an initial request and the
10340    /// request times out. If you make the request again with the same request ID,
10341    /// the server can check if original operation with the same request ID was
10342    /// received, and if so, will ignore the second request. This prevents clients
10343    /// from accidentally creating duplicate commitments.
10344    ///
10345    /// The request ID must be a valid UUID with the exception that zero UUID is
10346    /// not supported (00000000-0000-0000-0000-000000000000).
10347    pub request_id: std::string::String,
10348
10349    /// Optional. If set to true, the request is validated and the user is provided
10350    /// with an expected result, but no actual change is made.
10351    pub validate_only: bool,
10352
10353    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10354}
10355
10356impl CreateDeployPolicyRequest {
10357    /// Creates a new default instance.
10358    pub fn new() -> Self {
10359        std::default::Default::default()
10360    }
10361
10362    /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
10363    ///
10364    /// # Example
10365    /// ```ignore,no_run
10366    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10367    /// let x = CreateDeployPolicyRequest::new().set_parent("example");
10368    /// ```
10369    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10370        self.parent = v.into();
10371        self
10372    }
10373
10374    /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
10375    ///
10376    /// # Example
10377    /// ```ignore,no_run
10378    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10379    /// let x = CreateDeployPolicyRequest::new().set_deploy_policy_id("example");
10380    /// ```
10381    pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
10382        mut self,
10383        v: T,
10384    ) -> Self {
10385        self.deploy_policy_id = v.into();
10386        self
10387    }
10388
10389    /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10390    ///
10391    /// # Example
10392    /// ```ignore,no_run
10393    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10394    /// use google_cloud_deploy_v1::model::DeployPolicy;
10395    /// let x = CreateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10396    /// ```
10397    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10398    where
10399        T: std::convert::Into<crate::model::DeployPolicy>,
10400    {
10401        self.deploy_policy = std::option::Option::Some(v.into());
10402        self
10403    }
10404
10405    /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10406    ///
10407    /// # Example
10408    /// ```ignore,no_run
10409    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10410    /// use google_cloud_deploy_v1::model::DeployPolicy;
10411    /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10412    /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10413    /// ```
10414    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10415    where
10416        T: std::convert::Into<crate::model::DeployPolicy>,
10417    {
10418        self.deploy_policy = v.map(|x| x.into());
10419        self
10420    }
10421
10422    /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
10423    ///
10424    /// # Example
10425    /// ```ignore,no_run
10426    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10427    /// let x = CreateDeployPolicyRequest::new().set_request_id("example");
10428    /// ```
10429    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10430        self.request_id = v.into();
10431        self
10432    }
10433
10434    /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
10435    ///
10436    /// # Example
10437    /// ```ignore,no_run
10438    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10439    /// let x = CreateDeployPolicyRequest::new().set_validate_only(true);
10440    /// ```
10441    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10442        self.validate_only = v.into();
10443        self
10444    }
10445}
10446
10447impl wkt::message::Message for CreateDeployPolicyRequest {
10448    fn typename() -> &'static str {
10449        "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
10450    }
10451}
10452
10453/// The request object for `UpdateDeployPolicy`.
10454#[derive(Clone, Default, PartialEq)]
10455#[non_exhaustive]
10456pub struct UpdateDeployPolicyRequest {
10457    /// Required. Field mask is used to specify the fields to be overwritten by the
10458    /// update in the `DeployPolicy` resource. The fields specified in the
10459    /// update_mask are relative to the resource, not the full request. A field
10460    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
10461    /// then all fields are overwritten.
10462    pub update_mask: std::option::Option<wkt::FieldMask>,
10463
10464    /// Required. The `DeployPolicy` to update.
10465    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10466
10467    /// Optional. A request ID to identify requests. Specify a unique request ID
10468    /// so that if you must retry your request, the server knows to ignore the
10469    /// request if it has already been completed. The server guarantees that for
10470    /// at least 60 minutes after the first request.
10471    ///
10472    /// For example, consider a situation where you make an initial request and the
10473    /// request times out. If you make the request again with the same request ID,
10474    /// the server can check if original operation with the same request ID was
10475    /// received, and if so, will ignore the second request. This prevents clients
10476    /// from accidentally creating duplicate commitments.
10477    ///
10478    /// The request ID must be a valid UUID with the exception that zero UUID is
10479    /// not supported (00000000-0000-0000-0000-000000000000).
10480    pub request_id: std::string::String,
10481
10482    /// Optional. If set to true, updating a `DeployPolicy` that does not exist
10483    /// will result in the creation of a new `DeployPolicy`.
10484    pub allow_missing: bool,
10485
10486    /// Optional. If set to true, the request is validated and the user is provided
10487    /// with an expected result, but no actual change is made.
10488    pub validate_only: bool,
10489
10490    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10491}
10492
10493impl UpdateDeployPolicyRequest {
10494    /// Creates a new default instance.
10495    pub fn new() -> Self {
10496        std::default::Default::default()
10497    }
10498
10499    /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10500    ///
10501    /// # Example
10502    /// ```ignore,no_run
10503    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10504    /// use wkt::FieldMask;
10505    /// let x = UpdateDeployPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10506    /// ```
10507    pub fn set_update_mask<T>(mut self, v: T) -> Self
10508    where
10509        T: std::convert::Into<wkt::FieldMask>,
10510    {
10511        self.update_mask = std::option::Option::Some(v.into());
10512        self
10513    }
10514
10515    /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10516    ///
10517    /// # Example
10518    /// ```ignore,no_run
10519    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10520    /// use wkt::FieldMask;
10521    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10522    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10523    /// ```
10524    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10525    where
10526        T: std::convert::Into<wkt::FieldMask>,
10527    {
10528        self.update_mask = v.map(|x| x.into());
10529        self
10530    }
10531
10532    /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10533    ///
10534    /// # Example
10535    /// ```ignore,no_run
10536    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10537    /// use google_cloud_deploy_v1::model::DeployPolicy;
10538    /// let x = UpdateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10539    /// ```
10540    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10541    where
10542        T: std::convert::Into<crate::model::DeployPolicy>,
10543    {
10544        self.deploy_policy = std::option::Option::Some(v.into());
10545        self
10546    }
10547
10548    /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10549    ///
10550    /// # Example
10551    /// ```ignore,no_run
10552    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10553    /// use google_cloud_deploy_v1::model::DeployPolicy;
10554    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10555    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10556    /// ```
10557    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10558    where
10559        T: std::convert::Into<crate::model::DeployPolicy>,
10560    {
10561        self.deploy_policy = v.map(|x| x.into());
10562        self
10563    }
10564
10565    /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
10566    ///
10567    /// # Example
10568    /// ```ignore,no_run
10569    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10570    /// let x = UpdateDeployPolicyRequest::new().set_request_id("example");
10571    /// ```
10572    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10573        self.request_id = v.into();
10574        self
10575    }
10576
10577    /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
10578    ///
10579    /// # Example
10580    /// ```ignore,no_run
10581    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10582    /// let x = UpdateDeployPolicyRequest::new().set_allow_missing(true);
10583    /// ```
10584    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10585        self.allow_missing = v.into();
10586        self
10587    }
10588
10589    /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
10590    ///
10591    /// # Example
10592    /// ```ignore,no_run
10593    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10594    /// let x = UpdateDeployPolicyRequest::new().set_validate_only(true);
10595    /// ```
10596    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10597        self.validate_only = v.into();
10598        self
10599    }
10600}
10601
10602impl wkt::message::Message for UpdateDeployPolicyRequest {
10603    fn typename() -> &'static str {
10604        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
10605    }
10606}
10607
10608/// The request object for `DeleteDeployPolicy`.
10609#[derive(Clone, Default, PartialEq)]
10610#[non_exhaustive]
10611pub struct DeleteDeployPolicyRequest {
10612    /// Required. The name of the `DeployPolicy` to delete. The format is
10613    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10614    pub name: std::string::String,
10615
10616    /// Optional. A request ID to identify requests. Specify a unique request ID
10617    /// so that if you must retry your request, the server knows to ignore the
10618    /// request if it has already been completed. The server guarantees that for
10619    /// at least 60 minutes after the first request.
10620    ///
10621    /// For example, consider a situation where you make an initial request and the
10622    /// request times out. If you make the request again with the same request ID,
10623    /// the server can check if original operation with the same request ID was
10624    /// received, and if so, will ignore the second request. This prevents clients
10625    /// from accidentally creating duplicate commitments.
10626    ///
10627    /// The request ID must be a valid UUID with the exception that zero UUID is
10628    /// not supported (00000000-0000-0000-0000-000000000000).
10629    pub request_id: std::string::String,
10630
10631    /// Optional. If set to true, then deleting an already deleted or non-existing
10632    /// `DeployPolicy` will succeed.
10633    pub allow_missing: bool,
10634
10635    /// Optional. If set, validate the request and preview the review, but do not
10636    /// actually post it.
10637    pub validate_only: bool,
10638
10639    /// Optional. This checksum is computed by the server based on the value of
10640    /// other fields, and may be sent on update and delete requests to ensure the
10641    /// client has an up-to-date value before proceeding.
10642    pub etag: std::string::String,
10643
10644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10645}
10646
10647impl DeleteDeployPolicyRequest {
10648    /// Creates a new default instance.
10649    pub fn new() -> Self {
10650        std::default::Default::default()
10651    }
10652
10653    /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
10654    ///
10655    /// # Example
10656    /// ```ignore,no_run
10657    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10658    /// let x = DeleteDeployPolicyRequest::new().set_name("example");
10659    /// ```
10660    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10661        self.name = v.into();
10662        self
10663    }
10664
10665    /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
10666    ///
10667    /// # Example
10668    /// ```ignore,no_run
10669    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10670    /// let x = DeleteDeployPolicyRequest::new().set_request_id("example");
10671    /// ```
10672    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10673        self.request_id = v.into();
10674        self
10675    }
10676
10677    /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
10678    ///
10679    /// # Example
10680    /// ```ignore,no_run
10681    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10682    /// let x = DeleteDeployPolicyRequest::new().set_allow_missing(true);
10683    /// ```
10684    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10685        self.allow_missing = v.into();
10686        self
10687    }
10688
10689    /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
10690    ///
10691    /// # Example
10692    /// ```ignore,no_run
10693    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10694    /// let x = DeleteDeployPolicyRequest::new().set_validate_only(true);
10695    /// ```
10696    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10697        self.validate_only = v.into();
10698        self
10699    }
10700
10701    /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
10702    ///
10703    /// # Example
10704    /// ```ignore,no_run
10705    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10706    /// let x = DeleteDeployPolicyRequest::new().set_etag("example");
10707    /// ```
10708    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10709        self.etag = v.into();
10710        self
10711    }
10712}
10713
10714impl wkt::message::Message for DeleteDeployPolicyRequest {
10715    fn typename() -> &'static str {
10716        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
10717    }
10718}
10719
10720/// The request object for `ListDeployPolicies`.
10721#[derive(Clone, Default, PartialEq)]
10722#[non_exhaustive]
10723pub struct ListDeployPoliciesRequest {
10724    /// Required. The parent, which owns this collection of deploy policies. Format
10725    /// must be `projects/{project_id}/locations/{location_name}`.
10726    pub parent: std::string::String,
10727
10728    /// The maximum number of deploy policies to return. The service may return
10729    /// fewer than this value. If unspecified, at most 50 deploy policies will
10730    /// be returned. The maximum value is 1000; values above 1000 will be set
10731    /// to 1000.
10732    pub page_size: i32,
10733
10734    /// A page token, received from a previous `ListDeployPolicies` call.
10735    /// Provide this to retrieve the subsequent page.
10736    ///
10737    /// When paginating, all other provided parameters match
10738    /// the call that provided the page token.
10739    pub page_token: std::string::String,
10740
10741    /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
10742    /// more details. All fields can be used in the filter.
10743    pub filter: std::string::String,
10744
10745    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
10746    pub order_by: std::string::String,
10747
10748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10749}
10750
10751impl ListDeployPoliciesRequest {
10752    /// Creates a new default instance.
10753    pub fn new() -> Self {
10754        std::default::Default::default()
10755    }
10756
10757    /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
10758    ///
10759    /// # Example
10760    /// ```ignore,no_run
10761    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10762    /// let x = ListDeployPoliciesRequest::new().set_parent("example");
10763    /// ```
10764    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10765        self.parent = v.into();
10766        self
10767    }
10768
10769    /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
10770    ///
10771    /// # Example
10772    /// ```ignore,no_run
10773    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10774    /// let x = ListDeployPoliciesRequest::new().set_page_size(42);
10775    /// ```
10776    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10777        self.page_size = v.into();
10778        self
10779    }
10780
10781    /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
10782    ///
10783    /// # Example
10784    /// ```ignore,no_run
10785    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10786    /// let x = ListDeployPoliciesRequest::new().set_page_token("example");
10787    /// ```
10788    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10789        self.page_token = v.into();
10790        self
10791    }
10792
10793    /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
10794    ///
10795    /// # Example
10796    /// ```ignore,no_run
10797    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10798    /// let x = ListDeployPoliciesRequest::new().set_filter("example");
10799    /// ```
10800    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10801        self.filter = v.into();
10802        self
10803    }
10804
10805    /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
10806    ///
10807    /// # Example
10808    /// ```ignore,no_run
10809    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10810    /// let x = ListDeployPoliciesRequest::new().set_order_by("example");
10811    /// ```
10812    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10813        self.order_by = v.into();
10814        self
10815    }
10816}
10817
10818impl wkt::message::Message for ListDeployPoliciesRequest {
10819    fn typename() -> &'static str {
10820        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
10821    }
10822}
10823
10824/// The response object from `ListDeployPolicies`.
10825#[derive(Clone, Default, PartialEq)]
10826#[non_exhaustive]
10827pub struct ListDeployPoliciesResponse {
10828    /// The `DeployPolicy` objects.
10829    pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
10830
10831    /// A token, which can be sent as `page_token` to retrieve the next page.
10832    /// If this field is omitted, there are no subsequent pages.
10833    pub next_page_token: std::string::String,
10834
10835    /// Locations that could not be reached.
10836    pub unreachable: std::vec::Vec<std::string::String>,
10837
10838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10839}
10840
10841impl ListDeployPoliciesResponse {
10842    /// Creates a new default instance.
10843    pub fn new() -> Self {
10844        std::default::Default::default()
10845    }
10846
10847    /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
10848    ///
10849    /// # Example
10850    /// ```ignore,no_run
10851    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10852    /// use google_cloud_deploy_v1::model::DeployPolicy;
10853    /// let x = ListDeployPoliciesResponse::new()
10854    ///     .set_deploy_policies([
10855    ///         DeployPolicy::default()/* use setters */,
10856    ///         DeployPolicy::default()/* use (different) setters */,
10857    ///     ]);
10858    /// ```
10859    pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
10860    where
10861        T: std::iter::IntoIterator<Item = V>,
10862        V: std::convert::Into<crate::model::DeployPolicy>,
10863    {
10864        use std::iter::Iterator;
10865        self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
10866        self
10867    }
10868
10869    /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
10870    ///
10871    /// # Example
10872    /// ```ignore,no_run
10873    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10874    /// let x = ListDeployPoliciesResponse::new().set_next_page_token("example");
10875    /// ```
10876    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10877        self.next_page_token = v.into();
10878        self
10879    }
10880
10881    /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
10882    ///
10883    /// # Example
10884    /// ```ignore,no_run
10885    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10886    /// let x = ListDeployPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10887    /// ```
10888    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10889    where
10890        T: std::iter::IntoIterator<Item = V>,
10891        V: std::convert::Into<std::string::String>,
10892    {
10893        use std::iter::Iterator;
10894        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10895        self
10896    }
10897}
10898
10899impl wkt::message::Message for ListDeployPoliciesResponse {
10900    fn typename() -> &'static str {
10901        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
10902    }
10903}
10904
10905#[doc(hidden)]
10906impl google_cloud_gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
10907    type PageItem = crate::model::DeployPolicy;
10908
10909    fn items(self) -> std::vec::Vec<Self::PageItem> {
10910        self.deploy_policies
10911    }
10912
10913    fn next_page_token(&self) -> std::string::String {
10914        use std::clone::Clone;
10915        self.next_page_token.clone()
10916    }
10917}
10918
10919/// The request object for `GetDeployPolicy`
10920#[derive(Clone, Default, PartialEq)]
10921#[non_exhaustive]
10922pub struct GetDeployPolicyRequest {
10923    /// Required. Name of the `DeployPolicy`. Format must be
10924    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10925    pub name: std::string::String,
10926
10927    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10928}
10929
10930impl GetDeployPolicyRequest {
10931    /// Creates a new default instance.
10932    pub fn new() -> Self {
10933        std::default::Default::default()
10934    }
10935
10936    /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
10937    ///
10938    /// # Example
10939    /// ```ignore,no_run
10940    /// # use google_cloud_deploy_v1::model::GetDeployPolicyRequest;
10941    /// let x = GetDeployPolicyRequest::new().set_name("example");
10942    /// ```
10943    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10944        self.name = v.into();
10945        self
10946    }
10947}
10948
10949impl wkt::message::Message for GetDeployPolicyRequest {
10950    fn typename() -> &'static str {
10951        "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
10952    }
10953}
10954
10955/// Description of an a image to use during Skaffold rendering.
10956#[derive(Clone, Default, PartialEq)]
10957#[non_exhaustive]
10958pub struct BuildArtifact {
10959    /// Optional. Image name in Skaffold configuration.
10960    pub image: std::string::String,
10961
10962    /// Optional. Image tag to use. This will generally be the full path to an
10963    /// image, such as "gcr.io/my-project/busybox:1.2.3" or
10964    /// "gcr.io/my-project/busybox@sha256:abc123".
10965    pub tag: std::string::String,
10966
10967    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10968}
10969
10970impl BuildArtifact {
10971    /// Creates a new default instance.
10972    pub fn new() -> Self {
10973        std::default::Default::default()
10974    }
10975
10976    /// Sets the value of [image][crate::model::BuildArtifact::image].
10977    ///
10978    /// # Example
10979    /// ```ignore,no_run
10980    /// # use google_cloud_deploy_v1::model::BuildArtifact;
10981    /// let x = BuildArtifact::new().set_image("example");
10982    /// ```
10983    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10984        self.image = v.into();
10985        self
10986    }
10987
10988    /// Sets the value of [tag][crate::model::BuildArtifact::tag].
10989    ///
10990    /// # Example
10991    /// ```ignore,no_run
10992    /// # use google_cloud_deploy_v1::model::BuildArtifact;
10993    /// let x = BuildArtifact::new().set_tag("example");
10994    /// ```
10995    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10996        self.tag = v.into();
10997        self
10998    }
10999}
11000
11001impl wkt::message::Message for BuildArtifact {
11002    fn typename() -> &'static str {
11003        "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
11004    }
11005}
11006
11007/// The artifacts produced by a target render operation.
11008#[derive(Clone, Default, PartialEq)]
11009#[non_exhaustive]
11010pub struct TargetArtifact {
11011    /// Output only. File path of the resolved Skaffold configuration for the
11012    /// stable phase, relative to the URI.
11013    pub skaffold_config_path: std::string::String,
11014
11015    /// Output only. File path of the rendered manifest relative to the URI for the
11016    /// stable phase.
11017    pub manifest_path: std::string::String,
11018
11019    /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
11020    pub phase_artifacts: std::collections::HashMap<
11021        std::string::String,
11022        crate::model::target_artifact::PhaseArtifact,
11023    >,
11024
11025    #[allow(missing_docs)]
11026    pub uri: std::option::Option<crate::model::target_artifact::Uri>,
11027
11028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11029}
11030
11031impl TargetArtifact {
11032    /// Creates a new default instance.
11033    pub fn new() -> Self {
11034        std::default::Default::default()
11035    }
11036
11037    /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
11038    ///
11039    /// # Example
11040    /// ```ignore,no_run
11041    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11042    /// let x = TargetArtifact::new().set_skaffold_config_path("example");
11043    /// ```
11044    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11045        mut self,
11046        v: T,
11047    ) -> Self {
11048        self.skaffold_config_path = v.into();
11049        self
11050    }
11051
11052    /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
11053    ///
11054    /// # Example
11055    /// ```ignore,no_run
11056    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11057    /// let x = TargetArtifact::new().set_manifest_path("example");
11058    /// ```
11059    pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11060        self.manifest_path = v.into();
11061        self
11062    }
11063
11064    /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
11065    ///
11066    /// # Example
11067    /// ```ignore,no_run
11068    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11069    /// use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11070    /// let x = TargetArtifact::new().set_phase_artifacts([
11071    ///     ("key0", PhaseArtifact::default()/* use setters */),
11072    ///     ("key1", PhaseArtifact::default()/* use (different) setters */),
11073    /// ]);
11074    /// ```
11075    pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
11076    where
11077        T: std::iter::IntoIterator<Item = (K, V)>,
11078        K: std::convert::Into<std::string::String>,
11079        V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
11080    {
11081        use std::iter::Iterator;
11082        self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11083        self
11084    }
11085
11086    /// Sets the value of [uri][crate::model::TargetArtifact::uri].
11087    ///
11088    /// Note that all the setters affecting `uri` are mutually
11089    /// exclusive.
11090    ///
11091    /// # Example
11092    /// ```ignore,no_run
11093    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11094    /// use google_cloud_deploy_v1::model::target_artifact::Uri;
11095    /// let x = TargetArtifact::new().set_uri(Some(Uri::ArtifactUri("example".to_string())));
11096    /// ```
11097    pub fn set_uri<
11098        T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
11099    >(
11100        mut self,
11101        v: T,
11102    ) -> Self {
11103        self.uri = v.into();
11104        self
11105    }
11106
11107    /// The value of [uri][crate::model::TargetArtifact::uri]
11108    /// if it holds a `ArtifactUri`, `None` if the field is not set or
11109    /// holds a different branch.
11110    pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
11111        #[allow(unreachable_patterns)]
11112        self.uri.as_ref().and_then(|v| match v {
11113            crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
11114            _ => std::option::Option::None,
11115        })
11116    }
11117
11118    /// Sets the value of [uri][crate::model::TargetArtifact::uri]
11119    /// to hold a `ArtifactUri`.
11120    ///
11121    /// Note that all the setters affecting `uri` are
11122    /// mutually exclusive.
11123    ///
11124    /// # Example
11125    /// ```ignore,no_run
11126    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11127    /// let x = TargetArtifact::new().set_artifact_uri("example");
11128    /// assert!(x.artifact_uri().is_some());
11129    /// ```
11130    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11131        self.uri =
11132            std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
11133        self
11134    }
11135}
11136
11137impl wkt::message::Message for TargetArtifact {
11138    fn typename() -> &'static str {
11139        "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
11140    }
11141}
11142
11143/// Defines additional types related to [TargetArtifact].
11144pub mod target_artifact {
11145    #[allow(unused_imports)]
11146    use super::*;
11147
11148    /// Contains the paths to the artifacts, relative to the URI, for a phase.
11149    #[derive(Clone, Default, PartialEq)]
11150    #[non_exhaustive]
11151    pub struct PhaseArtifact {
11152        /// Output only. File path of the resolved Skaffold configuration relative to
11153        /// the URI.
11154        pub skaffold_config_path: std::string::String,
11155
11156        /// Output only. File path of the rendered manifest relative to the URI.
11157        pub manifest_path: std::string::String,
11158
11159        /// Output only. File path of the directory of rendered job manifests
11160        /// relative to the URI. This is only set if it is applicable.
11161        pub job_manifests_path: std::string::String,
11162
11163        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11164    }
11165
11166    impl PhaseArtifact {
11167        /// Creates a new default instance.
11168        pub fn new() -> Self {
11169            std::default::Default::default()
11170        }
11171
11172        /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
11173        ///
11174        /// # Example
11175        /// ```ignore,no_run
11176        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11177        /// let x = PhaseArtifact::new().set_skaffold_config_path("example");
11178        /// ```
11179        pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11180            mut self,
11181            v: T,
11182        ) -> Self {
11183            self.skaffold_config_path = v.into();
11184            self
11185        }
11186
11187        /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
11188        ///
11189        /// # Example
11190        /// ```ignore,no_run
11191        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11192        /// let x = PhaseArtifact::new().set_manifest_path("example");
11193        /// ```
11194        pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
11195            mut self,
11196            v: T,
11197        ) -> Self {
11198            self.manifest_path = v.into();
11199            self
11200        }
11201
11202        /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
11203        ///
11204        /// # Example
11205        /// ```ignore,no_run
11206        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11207        /// let x = PhaseArtifact::new().set_job_manifests_path("example");
11208        /// ```
11209        pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
11210            mut self,
11211            v: T,
11212        ) -> Self {
11213            self.job_manifests_path = v.into();
11214            self
11215        }
11216    }
11217
11218    impl wkt::message::Message for PhaseArtifact {
11219        fn typename() -> &'static str {
11220            "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
11221        }
11222    }
11223
11224    #[allow(missing_docs)]
11225    #[derive(Clone, Debug, PartialEq)]
11226    #[non_exhaustive]
11227    pub enum Uri {
11228        /// Output only. URI of a directory containing the artifacts. This contains
11229        /// deployment configuration used by Skaffold during a rollout, and all
11230        /// paths are relative to this location.
11231        ArtifactUri(std::string::String),
11232    }
11233}
11234
11235/// The artifacts produced by a deploy operation.
11236#[derive(Clone, Default, PartialEq)]
11237#[non_exhaustive]
11238pub struct DeployArtifact {
11239    /// Output only. URI of a directory containing the artifacts. All paths are
11240    /// relative to this location.
11241    pub artifact_uri: std::string::String,
11242
11243    /// Output only. File paths of the manifests applied during the deploy
11244    /// operation relative to the URI.
11245    pub manifest_paths: std::vec::Vec<std::string::String>,
11246
11247    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11248}
11249
11250impl DeployArtifact {
11251    /// Creates a new default instance.
11252    pub fn new() -> Self {
11253        std::default::Default::default()
11254    }
11255
11256    /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
11257    ///
11258    /// # Example
11259    /// ```ignore,no_run
11260    /// # use google_cloud_deploy_v1::model::DeployArtifact;
11261    /// let x = DeployArtifact::new().set_artifact_uri("example");
11262    /// ```
11263    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11264        self.artifact_uri = v.into();
11265        self
11266    }
11267
11268    /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
11269    ///
11270    /// # Example
11271    /// ```ignore,no_run
11272    /// # use google_cloud_deploy_v1::model::DeployArtifact;
11273    /// let x = DeployArtifact::new().set_manifest_paths(["a", "b", "c"]);
11274    /// ```
11275    pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
11276    where
11277        T: std::iter::IntoIterator<Item = V>,
11278        V: std::convert::Into<std::string::String>,
11279    {
11280        use std::iter::Iterator;
11281        self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
11282        self
11283    }
11284}
11285
11286impl wkt::message::Message for DeployArtifact {
11287    fn typename() -> &'static str {
11288        "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
11289    }
11290}
11291
11292/// CloudRunRenderMetadata contains Cloud Run information associated with a
11293/// `Release` render.
11294#[derive(Clone, Default, PartialEq)]
11295#[non_exhaustive]
11296pub struct CloudRunRenderMetadata {
11297    /// Output only. The name of the Cloud Run Service in the rendered manifest.
11298    /// Format is `projects/{project}/locations/{location}/services/{service}`.
11299    pub service: std::string::String,
11300
11301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11302}
11303
11304impl CloudRunRenderMetadata {
11305    /// Creates a new default instance.
11306    pub fn new() -> Self {
11307        std::default::Default::default()
11308    }
11309
11310    /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
11311    ///
11312    /// # Example
11313    /// ```ignore,no_run
11314    /// # use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11315    /// let x = CloudRunRenderMetadata::new().set_service("example");
11316    /// ```
11317    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11318        self.service = v.into();
11319        self
11320    }
11321}
11322
11323impl wkt::message::Message for CloudRunRenderMetadata {
11324    fn typename() -> &'static str {
11325        "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
11326    }
11327}
11328
11329/// RenderMetadata includes information associated with a `Release` render.
11330#[derive(Clone, Default, PartialEq)]
11331#[non_exhaustive]
11332pub struct RenderMetadata {
11333    /// Output only. Metadata associated with rendering for Cloud Run.
11334    pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
11335
11336    /// Output only. Custom metadata provided by user-defined render operation.
11337    pub custom: std::option::Option<crate::model::CustomMetadata>,
11338
11339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11340}
11341
11342impl RenderMetadata {
11343    /// Creates a new default instance.
11344    pub fn new() -> Self {
11345        std::default::Default::default()
11346    }
11347
11348    /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11349    ///
11350    /// # Example
11351    /// ```ignore,no_run
11352    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11353    /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11354    /// let x = RenderMetadata::new().set_cloud_run(CloudRunRenderMetadata::default()/* use setters */);
11355    /// ```
11356    pub fn set_cloud_run<T>(mut self, v: T) -> Self
11357    where
11358        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11359    {
11360        self.cloud_run = std::option::Option::Some(v.into());
11361        self
11362    }
11363
11364    /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11365    ///
11366    /// # Example
11367    /// ```ignore,no_run
11368    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11369    /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11370    /// let x = RenderMetadata::new().set_or_clear_cloud_run(Some(CloudRunRenderMetadata::default()/* use setters */));
11371    /// let x = RenderMetadata::new().set_or_clear_cloud_run(None::<CloudRunRenderMetadata>);
11372    /// ```
11373    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
11374    where
11375        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11376    {
11377        self.cloud_run = v.map(|x| x.into());
11378        self
11379    }
11380
11381    /// Sets the value of [custom][crate::model::RenderMetadata::custom].
11382    ///
11383    /// # Example
11384    /// ```ignore,no_run
11385    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11386    /// use google_cloud_deploy_v1::model::CustomMetadata;
11387    /// let x = RenderMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
11388    /// ```
11389    pub fn set_custom<T>(mut self, v: T) -> Self
11390    where
11391        T: std::convert::Into<crate::model::CustomMetadata>,
11392    {
11393        self.custom = std::option::Option::Some(v.into());
11394        self
11395    }
11396
11397    /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
11398    ///
11399    /// # Example
11400    /// ```ignore,no_run
11401    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11402    /// use google_cloud_deploy_v1::model::CustomMetadata;
11403    /// let x = RenderMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
11404    /// let x = RenderMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
11405    /// ```
11406    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
11407    where
11408        T: std::convert::Into<crate::model::CustomMetadata>,
11409    {
11410        self.custom = v.map(|x| x.into());
11411        self
11412    }
11413}
11414
11415impl wkt::message::Message for RenderMetadata {
11416    fn typename() -> &'static str {
11417        "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
11418    }
11419}
11420
11421/// The request object for `ListReleases`.
11422#[derive(Clone, Default, PartialEq)]
11423#[non_exhaustive]
11424pub struct ListReleasesRequest {
11425    /// Required. The `DeliveryPipeline` which owns this collection of `Release`
11426    /// objects.
11427    pub parent: std::string::String,
11428
11429    /// Optional. The maximum number of `Release` objects to return. The service
11430    /// may return fewer than this value. If unspecified, at most 50 `Release`
11431    /// objects will be returned. The maximum value is 1000; values above 1000 will
11432    /// be set to 1000.
11433    pub page_size: i32,
11434
11435    /// Optional. A page token, received from a previous `ListReleases` call.
11436    /// Provide this to retrieve the subsequent page.
11437    ///
11438    /// When paginating, all other provided parameters match
11439    /// the call that provided the page token.
11440    pub page_token: std::string::String,
11441
11442    /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
11443    /// for more details.
11444    pub filter: std::string::String,
11445
11446    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
11447    /// more details.
11448    pub order_by: std::string::String,
11449
11450    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11451}
11452
11453impl ListReleasesRequest {
11454    /// Creates a new default instance.
11455    pub fn new() -> Self {
11456        std::default::Default::default()
11457    }
11458
11459    /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
11460    ///
11461    /// # Example
11462    /// ```ignore,no_run
11463    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11464    /// let x = ListReleasesRequest::new().set_parent("example");
11465    /// ```
11466    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11467        self.parent = v.into();
11468        self
11469    }
11470
11471    /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
11472    ///
11473    /// # Example
11474    /// ```ignore,no_run
11475    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11476    /// let x = ListReleasesRequest::new().set_page_size(42);
11477    /// ```
11478    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11479        self.page_size = v.into();
11480        self
11481    }
11482
11483    /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
11484    ///
11485    /// # Example
11486    /// ```ignore,no_run
11487    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11488    /// let x = ListReleasesRequest::new().set_page_token("example");
11489    /// ```
11490    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11491        self.page_token = v.into();
11492        self
11493    }
11494
11495    /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
11496    ///
11497    /// # Example
11498    /// ```ignore,no_run
11499    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11500    /// let x = ListReleasesRequest::new().set_filter("example");
11501    /// ```
11502    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11503        self.filter = v.into();
11504        self
11505    }
11506
11507    /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
11508    ///
11509    /// # Example
11510    /// ```ignore,no_run
11511    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11512    /// let x = ListReleasesRequest::new().set_order_by("example");
11513    /// ```
11514    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11515        self.order_by = v.into();
11516        self
11517    }
11518}
11519
11520impl wkt::message::Message for ListReleasesRequest {
11521    fn typename() -> &'static str {
11522        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
11523    }
11524}
11525
11526/// The response object from `ListReleases`.
11527#[derive(Clone, Default, PartialEq)]
11528#[non_exhaustive]
11529pub struct ListReleasesResponse {
11530    /// The `Release` objects.
11531    pub releases: std::vec::Vec<crate::model::Release>,
11532
11533    /// A token, which can be sent as `page_token` to retrieve the next page.
11534    /// If this field is omitted, there are no subsequent pages.
11535    pub next_page_token: std::string::String,
11536
11537    /// Locations that could not be reached.
11538    pub unreachable: std::vec::Vec<std::string::String>,
11539
11540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11541}
11542
11543impl ListReleasesResponse {
11544    /// Creates a new default instance.
11545    pub fn new() -> Self {
11546        std::default::Default::default()
11547    }
11548
11549    /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
11550    ///
11551    /// # Example
11552    /// ```ignore,no_run
11553    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11554    /// use google_cloud_deploy_v1::model::Release;
11555    /// let x = ListReleasesResponse::new()
11556    ///     .set_releases([
11557    ///         Release::default()/* use setters */,
11558    ///         Release::default()/* use (different) setters */,
11559    ///     ]);
11560    /// ```
11561    pub fn set_releases<T, V>(mut self, v: T) -> Self
11562    where
11563        T: std::iter::IntoIterator<Item = V>,
11564        V: std::convert::Into<crate::model::Release>,
11565    {
11566        use std::iter::Iterator;
11567        self.releases = v.into_iter().map(|i| i.into()).collect();
11568        self
11569    }
11570
11571    /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
11572    ///
11573    /// # Example
11574    /// ```ignore,no_run
11575    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11576    /// let x = ListReleasesResponse::new().set_next_page_token("example");
11577    /// ```
11578    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11579        self.next_page_token = v.into();
11580        self
11581    }
11582
11583    /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
11584    ///
11585    /// # Example
11586    /// ```ignore,no_run
11587    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11588    /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
11589    /// ```
11590    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11591    where
11592        T: std::iter::IntoIterator<Item = V>,
11593        V: std::convert::Into<std::string::String>,
11594    {
11595        use std::iter::Iterator;
11596        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11597        self
11598    }
11599}
11600
11601impl wkt::message::Message for ListReleasesResponse {
11602    fn typename() -> &'static str {
11603        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
11604    }
11605}
11606
11607#[doc(hidden)]
11608impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
11609    type PageItem = crate::model::Release;
11610
11611    fn items(self) -> std::vec::Vec<Self::PageItem> {
11612        self.releases
11613    }
11614
11615    fn next_page_token(&self) -> std::string::String {
11616        use std::clone::Clone;
11617        self.next_page_token.clone()
11618    }
11619}
11620
11621/// The request object for `GetRelease`.
11622#[derive(Clone, Default, PartialEq)]
11623#[non_exhaustive]
11624pub struct GetReleaseRequest {
11625    /// Required. Name of the `Release`. Format must be
11626    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11627    pub name: std::string::String,
11628
11629    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11630}
11631
11632impl GetReleaseRequest {
11633    /// Creates a new default instance.
11634    pub fn new() -> Self {
11635        std::default::Default::default()
11636    }
11637
11638    /// Sets the value of [name][crate::model::GetReleaseRequest::name].
11639    ///
11640    /// # Example
11641    /// ```ignore,no_run
11642    /// # use google_cloud_deploy_v1::model::GetReleaseRequest;
11643    /// let x = GetReleaseRequest::new().set_name("example");
11644    /// ```
11645    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11646        self.name = v.into();
11647        self
11648    }
11649}
11650
11651impl wkt::message::Message for GetReleaseRequest {
11652    fn typename() -> &'static str {
11653        "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
11654    }
11655}
11656
11657/// The request object for `CreateRelease`,
11658#[derive(Clone, Default, PartialEq)]
11659#[non_exhaustive]
11660pub struct CreateReleaseRequest {
11661    /// Required. The parent collection in which the `Release` is created.
11662    /// The format is
11663    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
11664    pub parent: std::string::String,
11665
11666    /// Required. ID of the `Release`.
11667    pub release_id: std::string::String,
11668
11669    /// Required. The `Release` to create.
11670    pub release: std::option::Option<crate::model::Release>,
11671
11672    /// Optional. A request ID to identify requests. Specify a unique request ID
11673    /// so that if you must retry your request, the server knows to ignore the
11674    /// request if it has already been completed. The server guarantees that for
11675    /// at least 60 minutes after the first request.
11676    ///
11677    /// For example, consider a situation where you make an initial request and the
11678    /// request times out. If you make the request again with the same request ID,
11679    /// the server can check if original operation with the same request ID was
11680    /// received, and if so, will ignore the second request. This prevents clients
11681    /// from accidentally creating duplicate commitments.
11682    ///
11683    /// The request ID must be a valid UUID with the exception that zero UUID is
11684    /// not supported (00000000-0000-0000-0000-000000000000).
11685    pub request_id: std::string::String,
11686
11687    /// Optional. If set to true, the request is validated and the user is provided
11688    /// with an expected result, but no actual change is made.
11689    pub validate_only: bool,
11690
11691    /// Optional. Deploy policies to override. Format is
11692    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11693    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11694
11695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11696}
11697
11698impl CreateReleaseRequest {
11699    /// Creates a new default instance.
11700    pub fn new() -> Self {
11701        std::default::Default::default()
11702    }
11703
11704    /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
11705    ///
11706    /// # Example
11707    /// ```ignore,no_run
11708    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11709    /// let x = CreateReleaseRequest::new().set_parent("example");
11710    /// ```
11711    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11712        self.parent = v.into();
11713        self
11714    }
11715
11716    /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
11717    ///
11718    /// # Example
11719    /// ```ignore,no_run
11720    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11721    /// let x = CreateReleaseRequest::new().set_release_id("example");
11722    /// ```
11723    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11724        self.release_id = v.into();
11725        self
11726    }
11727
11728    /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
11729    ///
11730    /// # Example
11731    /// ```ignore,no_run
11732    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11733    /// use google_cloud_deploy_v1::model::Release;
11734    /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
11735    /// ```
11736    pub fn set_release<T>(mut self, v: T) -> Self
11737    where
11738        T: std::convert::Into<crate::model::Release>,
11739    {
11740        self.release = std::option::Option::Some(v.into());
11741        self
11742    }
11743
11744    /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
11745    ///
11746    /// # Example
11747    /// ```ignore,no_run
11748    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11749    /// use google_cloud_deploy_v1::model::Release;
11750    /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
11751    /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
11752    /// ```
11753    pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
11754    where
11755        T: std::convert::Into<crate::model::Release>,
11756    {
11757        self.release = v.map(|x| x.into());
11758        self
11759    }
11760
11761    /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
11762    ///
11763    /// # Example
11764    /// ```ignore,no_run
11765    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11766    /// let x = CreateReleaseRequest::new().set_request_id("example");
11767    /// ```
11768    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11769        self.request_id = v.into();
11770        self
11771    }
11772
11773    /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
11774    ///
11775    /// # Example
11776    /// ```ignore,no_run
11777    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11778    /// let x = CreateReleaseRequest::new().set_validate_only(true);
11779    /// ```
11780    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11781        self.validate_only = v.into();
11782        self
11783    }
11784
11785    /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
11786    ///
11787    /// # Example
11788    /// ```ignore,no_run
11789    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11790    /// let x = CreateReleaseRequest::new().set_override_deploy_policy(["a", "b", "c"]);
11791    /// ```
11792    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11793    where
11794        T: std::iter::IntoIterator<Item = V>,
11795        V: std::convert::Into<std::string::String>,
11796    {
11797        use std::iter::Iterator;
11798        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11799        self
11800    }
11801}
11802
11803impl wkt::message::Message for CreateReleaseRequest {
11804    fn typename() -> &'static str {
11805        "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
11806    }
11807}
11808
11809/// A `Rollout` resource in the Cloud Deploy API.
11810///
11811/// A `Rollout` contains information around a specific deployment to a `Target`.
11812#[derive(Clone, Default, PartialEq)]
11813#[non_exhaustive]
11814pub struct Rollout {
11815    /// Identifier. Name of the `Rollout`. Format is
11816    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11817    /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
11818    pub name: std::string::String,
11819
11820    /// Output only. Unique identifier of the `Rollout`.
11821    pub uid: std::string::String,
11822
11823    /// Optional. Description of the `Rollout` for user purposes. Max length is 255
11824    /// characters.
11825    pub description: std::string::String,
11826
11827    /// Optional. User annotations. These attributes can only be set and used by
11828    /// the user, and not by Cloud Deploy. See
11829    /// <https://google.aip.dev/128#annotations> for more details such as format and
11830    /// size limitations.
11831    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11832
11833    /// Labels are attributes that can be set and used by both the
11834    /// user and by Cloud Deploy. Labels must meet the following constraints:
11835    ///
11836    /// * Keys and values can contain only lowercase letters, numeric characters,
11837    ///   underscores, and dashes.
11838    /// * All characters must use UTF-8 encoding, and international characters are
11839    ///   allowed.
11840    /// * Keys must start with a lowercase letter or international character.
11841    /// * Each resource is limited to a maximum of 64 labels.
11842    ///
11843    /// Both keys and values are additionally constrained to be <= 128 bytes.
11844    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11845
11846    /// Output only. Time at which the `Rollout` was created.
11847    pub create_time: std::option::Option<wkt::Timestamp>,
11848
11849    /// Output only. Time at which the `Rollout` was approved.
11850    pub approve_time: std::option::Option<wkt::Timestamp>,
11851
11852    /// Output only. Time at which the `Rollout` was enqueued.
11853    pub enqueue_time: std::option::Option<wkt::Timestamp>,
11854
11855    /// Output only. Time at which the `Rollout` started deploying.
11856    pub deploy_start_time: std::option::Option<wkt::Timestamp>,
11857
11858    /// Output only. Time at which the `Rollout` finished deploying.
11859    pub deploy_end_time: std::option::Option<wkt::Timestamp>,
11860
11861    /// Required. The ID of Target to which this `Rollout` is deploying.
11862    pub target_id: std::string::String,
11863
11864    /// Output only. Approval state of the `Rollout`.
11865    pub approval_state: crate::model::rollout::ApprovalState,
11866
11867    /// Output only. Current state of the `Rollout`.
11868    pub state: crate::model::rollout::State,
11869
11870    /// Output only. Additional information about the rollout failure, if
11871    /// available.
11872    pub failure_reason: std::string::String,
11873
11874    /// Output only. The resource name of the Cloud Build `Build` object that is
11875    /// used to deploy the Rollout. Format is
11876    /// `projects/{project}/locations/{location}/builds/{build}`.
11877    pub deploying_build: std::string::String,
11878
11879    /// This checksum is computed by the server based on the value of other
11880    /// fields, and may be sent on update and delete requests to ensure the
11881    /// client has an up-to-date value before proceeding.
11882    pub etag: std::string::String,
11883
11884    /// Output only. The reason this rollout failed. This will always be
11885    /// unspecified while the rollout is in progress.
11886    pub deploy_failure_cause: crate::model::rollout::FailureCause,
11887
11888    /// Output only. The phases that represent the workflows of this `Rollout`.
11889    pub phases: std::vec::Vec<crate::model::Phase>,
11890
11891    /// Output only. Metadata contains information about the rollout.
11892    pub metadata: std::option::Option<crate::model::Metadata>,
11893
11894    /// Output only. Name of the `ControllerRollout`. Format is
11895    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11896    pub controller_rollout: std::string::String,
11897
11898    /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
11899    /// Empty if this `Rollout` wasn't created as a rollback.
11900    pub rollback_of_rollout: std::string::String,
11901
11902    /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
11903    pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
11904
11905    /// Output only. The AutomationRun actively repairing the rollout.
11906    pub active_repair_automation_run: std::string::String,
11907
11908    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11909}
11910
11911impl Rollout {
11912    /// Creates a new default instance.
11913    pub fn new() -> Self {
11914        std::default::Default::default()
11915    }
11916
11917    /// Sets the value of [name][crate::model::Rollout::name].
11918    ///
11919    /// # Example
11920    /// ```ignore,no_run
11921    /// # use google_cloud_deploy_v1::model::Rollout;
11922    /// let x = Rollout::new().set_name("example");
11923    /// ```
11924    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11925        self.name = v.into();
11926        self
11927    }
11928
11929    /// Sets the value of [uid][crate::model::Rollout::uid].
11930    ///
11931    /// # Example
11932    /// ```ignore,no_run
11933    /// # use google_cloud_deploy_v1::model::Rollout;
11934    /// let x = Rollout::new().set_uid("example");
11935    /// ```
11936    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11937        self.uid = v.into();
11938        self
11939    }
11940
11941    /// Sets the value of [description][crate::model::Rollout::description].
11942    ///
11943    /// # Example
11944    /// ```ignore,no_run
11945    /// # use google_cloud_deploy_v1::model::Rollout;
11946    /// let x = Rollout::new().set_description("example");
11947    /// ```
11948    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11949        self.description = v.into();
11950        self
11951    }
11952
11953    /// Sets the value of [annotations][crate::model::Rollout::annotations].
11954    ///
11955    /// # Example
11956    /// ```ignore,no_run
11957    /// # use google_cloud_deploy_v1::model::Rollout;
11958    /// let x = Rollout::new().set_annotations([
11959    ///     ("key0", "abc"),
11960    ///     ("key1", "xyz"),
11961    /// ]);
11962    /// ```
11963    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11964    where
11965        T: std::iter::IntoIterator<Item = (K, V)>,
11966        K: std::convert::Into<std::string::String>,
11967        V: std::convert::Into<std::string::String>,
11968    {
11969        use std::iter::Iterator;
11970        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11971        self
11972    }
11973
11974    /// Sets the value of [labels][crate::model::Rollout::labels].
11975    ///
11976    /// # Example
11977    /// ```ignore,no_run
11978    /// # use google_cloud_deploy_v1::model::Rollout;
11979    /// let x = Rollout::new().set_labels([
11980    ///     ("key0", "abc"),
11981    ///     ("key1", "xyz"),
11982    /// ]);
11983    /// ```
11984    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11985    where
11986        T: std::iter::IntoIterator<Item = (K, V)>,
11987        K: std::convert::Into<std::string::String>,
11988        V: std::convert::Into<std::string::String>,
11989    {
11990        use std::iter::Iterator;
11991        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11992        self
11993    }
11994
11995    /// Sets the value of [create_time][crate::model::Rollout::create_time].
11996    ///
11997    /// # Example
11998    /// ```ignore,no_run
11999    /// # use google_cloud_deploy_v1::model::Rollout;
12000    /// use wkt::Timestamp;
12001    /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
12002    /// ```
12003    pub fn set_create_time<T>(mut self, v: T) -> Self
12004    where
12005        T: std::convert::Into<wkt::Timestamp>,
12006    {
12007        self.create_time = std::option::Option::Some(v.into());
12008        self
12009    }
12010
12011    /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
12012    ///
12013    /// # Example
12014    /// ```ignore,no_run
12015    /// # use google_cloud_deploy_v1::model::Rollout;
12016    /// use wkt::Timestamp;
12017    /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12018    /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
12019    /// ```
12020    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12021    where
12022        T: std::convert::Into<wkt::Timestamp>,
12023    {
12024        self.create_time = v.map(|x| x.into());
12025        self
12026    }
12027
12028    /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
12029    ///
12030    /// # Example
12031    /// ```ignore,no_run
12032    /// # use google_cloud_deploy_v1::model::Rollout;
12033    /// use wkt::Timestamp;
12034    /// let x = Rollout::new().set_approve_time(Timestamp::default()/* use setters */);
12035    /// ```
12036    pub fn set_approve_time<T>(mut self, v: T) -> Self
12037    where
12038        T: std::convert::Into<wkt::Timestamp>,
12039    {
12040        self.approve_time = std::option::Option::Some(v.into());
12041        self
12042    }
12043
12044    /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
12045    ///
12046    /// # Example
12047    /// ```ignore,no_run
12048    /// # use google_cloud_deploy_v1::model::Rollout;
12049    /// use wkt::Timestamp;
12050    /// let x = Rollout::new().set_or_clear_approve_time(Some(Timestamp::default()/* use setters */));
12051    /// let x = Rollout::new().set_or_clear_approve_time(None::<Timestamp>);
12052    /// ```
12053    pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
12054    where
12055        T: std::convert::Into<wkt::Timestamp>,
12056    {
12057        self.approve_time = v.map(|x| x.into());
12058        self
12059    }
12060
12061    /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
12062    ///
12063    /// # Example
12064    /// ```ignore,no_run
12065    /// # use google_cloud_deploy_v1::model::Rollout;
12066    /// use wkt::Timestamp;
12067    /// let x = Rollout::new().set_enqueue_time(Timestamp::default()/* use setters */);
12068    /// ```
12069    pub fn set_enqueue_time<T>(mut self, v: T) -> Self
12070    where
12071        T: std::convert::Into<wkt::Timestamp>,
12072    {
12073        self.enqueue_time = std::option::Option::Some(v.into());
12074        self
12075    }
12076
12077    /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
12078    ///
12079    /// # Example
12080    /// ```ignore,no_run
12081    /// # use google_cloud_deploy_v1::model::Rollout;
12082    /// use wkt::Timestamp;
12083    /// let x = Rollout::new().set_or_clear_enqueue_time(Some(Timestamp::default()/* use setters */));
12084    /// let x = Rollout::new().set_or_clear_enqueue_time(None::<Timestamp>);
12085    /// ```
12086    pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
12087    where
12088        T: std::convert::Into<wkt::Timestamp>,
12089    {
12090        self.enqueue_time = v.map(|x| x.into());
12091        self
12092    }
12093
12094    /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12095    ///
12096    /// # Example
12097    /// ```ignore,no_run
12098    /// # use google_cloud_deploy_v1::model::Rollout;
12099    /// use wkt::Timestamp;
12100    /// let x = Rollout::new().set_deploy_start_time(Timestamp::default()/* use setters */);
12101    /// ```
12102    pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
12103    where
12104        T: std::convert::Into<wkt::Timestamp>,
12105    {
12106        self.deploy_start_time = std::option::Option::Some(v.into());
12107        self
12108    }
12109
12110    /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12111    ///
12112    /// # Example
12113    /// ```ignore,no_run
12114    /// # use google_cloud_deploy_v1::model::Rollout;
12115    /// use wkt::Timestamp;
12116    /// let x = Rollout::new().set_or_clear_deploy_start_time(Some(Timestamp::default()/* use setters */));
12117    /// let x = Rollout::new().set_or_clear_deploy_start_time(None::<Timestamp>);
12118    /// ```
12119    pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12120    where
12121        T: std::convert::Into<wkt::Timestamp>,
12122    {
12123        self.deploy_start_time = v.map(|x| x.into());
12124        self
12125    }
12126
12127    /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12128    ///
12129    /// # Example
12130    /// ```ignore,no_run
12131    /// # use google_cloud_deploy_v1::model::Rollout;
12132    /// use wkt::Timestamp;
12133    /// let x = Rollout::new().set_deploy_end_time(Timestamp::default()/* use setters */);
12134    /// ```
12135    pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
12136    where
12137        T: std::convert::Into<wkt::Timestamp>,
12138    {
12139        self.deploy_end_time = std::option::Option::Some(v.into());
12140        self
12141    }
12142
12143    /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12144    ///
12145    /// # Example
12146    /// ```ignore,no_run
12147    /// # use google_cloud_deploy_v1::model::Rollout;
12148    /// use wkt::Timestamp;
12149    /// let x = Rollout::new().set_or_clear_deploy_end_time(Some(Timestamp::default()/* use setters */));
12150    /// let x = Rollout::new().set_or_clear_deploy_end_time(None::<Timestamp>);
12151    /// ```
12152    pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12153    where
12154        T: std::convert::Into<wkt::Timestamp>,
12155    {
12156        self.deploy_end_time = v.map(|x| x.into());
12157        self
12158    }
12159
12160    /// Sets the value of [target_id][crate::model::Rollout::target_id].
12161    ///
12162    /// # Example
12163    /// ```ignore,no_run
12164    /// # use google_cloud_deploy_v1::model::Rollout;
12165    /// let x = Rollout::new().set_target_id("example");
12166    /// ```
12167    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12168        self.target_id = v.into();
12169        self
12170    }
12171
12172    /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
12173    ///
12174    /// # Example
12175    /// ```ignore,no_run
12176    /// # use google_cloud_deploy_v1::model::Rollout;
12177    /// use google_cloud_deploy_v1::model::rollout::ApprovalState;
12178    /// let x0 = Rollout::new().set_approval_state(ApprovalState::NeedsApproval);
12179    /// let x1 = Rollout::new().set_approval_state(ApprovalState::DoesNotNeedApproval);
12180    /// let x2 = Rollout::new().set_approval_state(ApprovalState::Approved);
12181    /// ```
12182    pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
12183        mut self,
12184        v: T,
12185    ) -> Self {
12186        self.approval_state = v.into();
12187        self
12188    }
12189
12190    /// Sets the value of [state][crate::model::Rollout::state].
12191    ///
12192    /// # Example
12193    /// ```ignore,no_run
12194    /// # use google_cloud_deploy_v1::model::Rollout;
12195    /// use google_cloud_deploy_v1::model::rollout::State;
12196    /// let x0 = Rollout::new().set_state(State::Succeeded);
12197    /// let x1 = Rollout::new().set_state(State::Failed);
12198    /// let x2 = Rollout::new().set_state(State::InProgress);
12199    /// ```
12200    pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
12201        self.state = v.into();
12202        self
12203    }
12204
12205    /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
12206    ///
12207    /// # Example
12208    /// ```ignore,no_run
12209    /// # use google_cloud_deploy_v1::model::Rollout;
12210    /// let x = Rollout::new().set_failure_reason("example");
12211    /// ```
12212    pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12213        self.failure_reason = v.into();
12214        self
12215    }
12216
12217    /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
12218    ///
12219    /// # Example
12220    /// ```ignore,no_run
12221    /// # use google_cloud_deploy_v1::model::Rollout;
12222    /// let x = Rollout::new().set_deploying_build("example");
12223    /// ```
12224    pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12225        self.deploying_build = v.into();
12226        self
12227    }
12228
12229    /// Sets the value of [etag][crate::model::Rollout::etag].
12230    ///
12231    /// # Example
12232    /// ```ignore,no_run
12233    /// # use google_cloud_deploy_v1::model::Rollout;
12234    /// let x = Rollout::new().set_etag("example");
12235    /// ```
12236    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12237        self.etag = v.into();
12238        self
12239    }
12240
12241    /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
12242    ///
12243    /// # Example
12244    /// ```ignore,no_run
12245    /// # use google_cloud_deploy_v1::model::Rollout;
12246    /// use google_cloud_deploy_v1::model::rollout::FailureCause;
12247    /// let x0 = Rollout::new().set_deploy_failure_cause(FailureCause::CloudBuildUnavailable);
12248    /// let x1 = Rollout::new().set_deploy_failure_cause(FailureCause::ExecutionFailed);
12249    /// let x2 = Rollout::new().set_deploy_failure_cause(FailureCause::DeadlineExceeded);
12250    /// ```
12251    pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
12252        mut self,
12253        v: T,
12254    ) -> Self {
12255        self.deploy_failure_cause = v.into();
12256        self
12257    }
12258
12259    /// Sets the value of [phases][crate::model::Rollout::phases].
12260    ///
12261    /// # Example
12262    /// ```ignore,no_run
12263    /// # use google_cloud_deploy_v1::model::Rollout;
12264    /// use google_cloud_deploy_v1::model::Phase;
12265    /// let x = Rollout::new()
12266    ///     .set_phases([
12267    ///         Phase::default()/* use setters */,
12268    ///         Phase::default()/* use (different) setters */,
12269    ///     ]);
12270    /// ```
12271    pub fn set_phases<T, V>(mut self, v: T) -> Self
12272    where
12273        T: std::iter::IntoIterator<Item = V>,
12274        V: std::convert::Into<crate::model::Phase>,
12275    {
12276        use std::iter::Iterator;
12277        self.phases = v.into_iter().map(|i| i.into()).collect();
12278        self
12279    }
12280
12281    /// Sets the value of [metadata][crate::model::Rollout::metadata].
12282    ///
12283    /// # Example
12284    /// ```ignore,no_run
12285    /// # use google_cloud_deploy_v1::model::Rollout;
12286    /// use google_cloud_deploy_v1::model::Metadata;
12287    /// let x = Rollout::new().set_metadata(Metadata::default()/* use setters */);
12288    /// ```
12289    pub fn set_metadata<T>(mut self, v: T) -> Self
12290    where
12291        T: std::convert::Into<crate::model::Metadata>,
12292    {
12293        self.metadata = std::option::Option::Some(v.into());
12294        self
12295    }
12296
12297    /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
12298    ///
12299    /// # Example
12300    /// ```ignore,no_run
12301    /// # use google_cloud_deploy_v1::model::Rollout;
12302    /// use google_cloud_deploy_v1::model::Metadata;
12303    /// let x = Rollout::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
12304    /// let x = Rollout::new().set_or_clear_metadata(None::<Metadata>);
12305    /// ```
12306    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12307    where
12308        T: std::convert::Into<crate::model::Metadata>,
12309    {
12310        self.metadata = v.map(|x| x.into());
12311        self
12312    }
12313
12314    /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
12315    ///
12316    /// # Example
12317    /// ```ignore,no_run
12318    /// # use google_cloud_deploy_v1::model::Rollout;
12319    /// let x = Rollout::new().set_controller_rollout("example");
12320    /// ```
12321    pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
12322        mut self,
12323        v: T,
12324    ) -> Self {
12325        self.controller_rollout = v.into();
12326        self
12327    }
12328
12329    /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
12330    ///
12331    /// # Example
12332    /// ```ignore,no_run
12333    /// # use google_cloud_deploy_v1::model::Rollout;
12334    /// let x = Rollout::new().set_rollback_of_rollout("example");
12335    /// ```
12336    pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
12337        mut self,
12338        v: T,
12339    ) -> Self {
12340        self.rollback_of_rollout = v.into();
12341        self
12342    }
12343
12344    /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
12345    ///
12346    /// # Example
12347    /// ```ignore,no_run
12348    /// # use google_cloud_deploy_v1::model::Rollout;
12349    /// let x = Rollout::new().set_rolled_back_by_rollouts(["a", "b", "c"]);
12350    /// ```
12351    pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
12352    where
12353        T: std::iter::IntoIterator<Item = V>,
12354        V: std::convert::Into<std::string::String>,
12355    {
12356        use std::iter::Iterator;
12357        self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
12358        self
12359    }
12360
12361    /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
12362    ///
12363    /// # Example
12364    /// ```ignore,no_run
12365    /// # use google_cloud_deploy_v1::model::Rollout;
12366    /// let x = Rollout::new().set_active_repair_automation_run("example");
12367    /// ```
12368    pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
12369        mut self,
12370        v: T,
12371    ) -> Self {
12372        self.active_repair_automation_run = v.into();
12373        self
12374    }
12375}
12376
12377impl wkt::message::Message for Rollout {
12378    fn typename() -> &'static str {
12379        "type.googleapis.com/google.cloud.deploy.v1.Rollout"
12380    }
12381}
12382
12383/// Defines additional types related to [Rollout].
12384pub mod rollout {
12385    #[allow(unused_imports)]
12386    use super::*;
12387
12388    /// Valid approval states of a `Rollout`.
12389    ///
12390    /// # Working with unknown values
12391    ///
12392    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12393    /// additional enum variants at any time. Adding new variants is not considered
12394    /// a breaking change. Applications should write their code in anticipation of:
12395    ///
12396    /// - New values appearing in future releases of the client library, **and**
12397    /// - New values received dynamically, without application changes.
12398    ///
12399    /// Please consult the [Working with enums] section in the user guide for some
12400    /// guidelines.
12401    ///
12402    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12403    #[derive(Clone, Debug, PartialEq)]
12404    #[non_exhaustive]
12405    pub enum ApprovalState {
12406        /// The `Rollout` has an unspecified approval state.
12407        Unspecified,
12408        /// The `Rollout` requires approval.
12409        NeedsApproval,
12410        /// The `Rollout` does not require approval.
12411        DoesNotNeedApproval,
12412        /// The `Rollout` has been approved.
12413        Approved,
12414        /// The `Rollout` has been rejected.
12415        Rejected,
12416        /// If set, the enum was initialized with an unknown value.
12417        ///
12418        /// Applications can examine the value using [ApprovalState::value] or
12419        /// [ApprovalState::name].
12420        UnknownValue(approval_state::UnknownValue),
12421    }
12422
12423    #[doc(hidden)]
12424    pub mod approval_state {
12425        #[allow(unused_imports)]
12426        use super::*;
12427        #[derive(Clone, Debug, PartialEq)]
12428        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12429    }
12430
12431    impl ApprovalState {
12432        /// Gets the enum value.
12433        ///
12434        /// Returns `None` if the enum contains an unknown value deserialized from
12435        /// the string representation of enums.
12436        pub fn value(&self) -> std::option::Option<i32> {
12437            match self {
12438                Self::Unspecified => std::option::Option::Some(0),
12439                Self::NeedsApproval => std::option::Option::Some(1),
12440                Self::DoesNotNeedApproval => std::option::Option::Some(2),
12441                Self::Approved => std::option::Option::Some(3),
12442                Self::Rejected => std::option::Option::Some(4),
12443                Self::UnknownValue(u) => u.0.value(),
12444            }
12445        }
12446
12447        /// Gets the enum value as a string.
12448        ///
12449        /// Returns `None` if the enum contains an unknown value deserialized from
12450        /// the integer representation of enums.
12451        pub fn name(&self) -> std::option::Option<&str> {
12452            match self {
12453                Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
12454                Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
12455                Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
12456                Self::Approved => std::option::Option::Some("APPROVED"),
12457                Self::Rejected => std::option::Option::Some("REJECTED"),
12458                Self::UnknownValue(u) => u.0.name(),
12459            }
12460        }
12461    }
12462
12463    impl std::default::Default for ApprovalState {
12464        fn default() -> Self {
12465            use std::convert::From;
12466            Self::from(0)
12467        }
12468    }
12469
12470    impl std::fmt::Display for ApprovalState {
12471        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12472            wkt::internal::display_enum(f, self.name(), self.value())
12473        }
12474    }
12475
12476    impl std::convert::From<i32> for ApprovalState {
12477        fn from(value: i32) -> Self {
12478            match value {
12479                0 => Self::Unspecified,
12480                1 => Self::NeedsApproval,
12481                2 => Self::DoesNotNeedApproval,
12482                3 => Self::Approved,
12483                4 => Self::Rejected,
12484                _ => Self::UnknownValue(approval_state::UnknownValue(
12485                    wkt::internal::UnknownEnumValue::Integer(value),
12486                )),
12487            }
12488        }
12489    }
12490
12491    impl std::convert::From<&str> for ApprovalState {
12492        fn from(value: &str) -> Self {
12493            use std::string::ToString;
12494            match value {
12495                "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
12496                "NEEDS_APPROVAL" => Self::NeedsApproval,
12497                "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
12498                "APPROVED" => Self::Approved,
12499                "REJECTED" => Self::Rejected,
12500                _ => Self::UnknownValue(approval_state::UnknownValue(
12501                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12502                )),
12503            }
12504        }
12505    }
12506
12507    impl serde::ser::Serialize for ApprovalState {
12508        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12509        where
12510            S: serde::Serializer,
12511        {
12512            match self {
12513                Self::Unspecified => serializer.serialize_i32(0),
12514                Self::NeedsApproval => serializer.serialize_i32(1),
12515                Self::DoesNotNeedApproval => serializer.serialize_i32(2),
12516                Self::Approved => serializer.serialize_i32(3),
12517                Self::Rejected => serializer.serialize_i32(4),
12518                Self::UnknownValue(u) => u.0.serialize(serializer),
12519            }
12520        }
12521    }
12522
12523    impl<'de> serde::de::Deserialize<'de> for ApprovalState {
12524        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12525        where
12526            D: serde::Deserializer<'de>,
12527        {
12528            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
12529                ".google.cloud.deploy.v1.Rollout.ApprovalState",
12530            ))
12531        }
12532    }
12533
12534    /// Valid states of a `Rollout`.
12535    ///
12536    /// # Working with unknown values
12537    ///
12538    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12539    /// additional enum variants at any time. Adding new variants is not considered
12540    /// a breaking change. Applications should write their code in anticipation of:
12541    ///
12542    /// - New values appearing in future releases of the client library, **and**
12543    /// - New values received dynamically, without application changes.
12544    ///
12545    /// Please consult the [Working with enums] section in the user guide for some
12546    /// guidelines.
12547    ///
12548    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12549    #[derive(Clone, Debug, PartialEq)]
12550    #[non_exhaustive]
12551    pub enum State {
12552        /// The `Rollout` has an unspecified state.
12553        Unspecified,
12554        /// The `Rollout` has completed successfully.
12555        Succeeded,
12556        /// The `Rollout` has failed.
12557        Failed,
12558        /// The `Rollout` is being deployed.
12559        InProgress,
12560        /// The `Rollout` needs approval.
12561        PendingApproval,
12562        /// An approver rejected the `Rollout`.
12563        ApprovalRejected,
12564        /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
12565        /// `Target`.
12566        Pending,
12567        /// The `Rollout` is waiting for the `Release` to be fully rendered.
12568        PendingRelease,
12569        /// The `Rollout` is in the process of being cancelled.
12570        Cancelling,
12571        /// The `Rollout` has been cancelled.
12572        Cancelled,
12573        /// The `Rollout` is halted.
12574        Halted,
12575        /// If set, the enum was initialized with an unknown value.
12576        ///
12577        /// Applications can examine the value using [State::value] or
12578        /// [State::name].
12579        UnknownValue(state::UnknownValue),
12580    }
12581
12582    #[doc(hidden)]
12583    pub mod state {
12584        #[allow(unused_imports)]
12585        use super::*;
12586        #[derive(Clone, Debug, PartialEq)]
12587        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12588    }
12589
12590    impl State {
12591        /// Gets the enum value.
12592        ///
12593        /// Returns `None` if the enum contains an unknown value deserialized from
12594        /// the string representation of enums.
12595        pub fn value(&self) -> std::option::Option<i32> {
12596            match self {
12597                Self::Unspecified => std::option::Option::Some(0),
12598                Self::Succeeded => std::option::Option::Some(1),
12599                Self::Failed => std::option::Option::Some(2),
12600                Self::InProgress => std::option::Option::Some(3),
12601                Self::PendingApproval => std::option::Option::Some(4),
12602                Self::ApprovalRejected => std::option::Option::Some(5),
12603                Self::Pending => std::option::Option::Some(6),
12604                Self::PendingRelease => std::option::Option::Some(7),
12605                Self::Cancelling => std::option::Option::Some(8),
12606                Self::Cancelled => std::option::Option::Some(9),
12607                Self::Halted => std::option::Option::Some(10),
12608                Self::UnknownValue(u) => u.0.value(),
12609            }
12610        }
12611
12612        /// Gets the enum value as a string.
12613        ///
12614        /// Returns `None` if the enum contains an unknown value deserialized from
12615        /// the integer representation of enums.
12616        pub fn name(&self) -> std::option::Option<&str> {
12617            match self {
12618                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12619                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12620                Self::Failed => std::option::Option::Some("FAILED"),
12621                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12622                Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
12623                Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
12624                Self::Pending => std::option::Option::Some("PENDING"),
12625                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
12626                Self::Cancelling => std::option::Option::Some("CANCELLING"),
12627                Self::Cancelled => std::option::Option::Some("CANCELLED"),
12628                Self::Halted => std::option::Option::Some("HALTED"),
12629                Self::UnknownValue(u) => u.0.name(),
12630            }
12631        }
12632    }
12633
12634    impl std::default::Default for State {
12635        fn default() -> Self {
12636            use std::convert::From;
12637            Self::from(0)
12638        }
12639    }
12640
12641    impl std::fmt::Display for State {
12642        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12643            wkt::internal::display_enum(f, self.name(), self.value())
12644        }
12645    }
12646
12647    impl std::convert::From<i32> for State {
12648        fn from(value: i32) -> Self {
12649            match value {
12650                0 => Self::Unspecified,
12651                1 => Self::Succeeded,
12652                2 => Self::Failed,
12653                3 => Self::InProgress,
12654                4 => Self::PendingApproval,
12655                5 => Self::ApprovalRejected,
12656                6 => Self::Pending,
12657                7 => Self::PendingRelease,
12658                8 => Self::Cancelling,
12659                9 => Self::Cancelled,
12660                10 => Self::Halted,
12661                _ => Self::UnknownValue(state::UnknownValue(
12662                    wkt::internal::UnknownEnumValue::Integer(value),
12663                )),
12664            }
12665        }
12666    }
12667
12668    impl std::convert::From<&str> for State {
12669        fn from(value: &str) -> Self {
12670            use std::string::ToString;
12671            match value {
12672                "STATE_UNSPECIFIED" => Self::Unspecified,
12673                "SUCCEEDED" => Self::Succeeded,
12674                "FAILED" => Self::Failed,
12675                "IN_PROGRESS" => Self::InProgress,
12676                "PENDING_APPROVAL" => Self::PendingApproval,
12677                "APPROVAL_REJECTED" => Self::ApprovalRejected,
12678                "PENDING" => Self::Pending,
12679                "PENDING_RELEASE" => Self::PendingRelease,
12680                "CANCELLING" => Self::Cancelling,
12681                "CANCELLED" => Self::Cancelled,
12682                "HALTED" => Self::Halted,
12683                _ => Self::UnknownValue(state::UnknownValue(
12684                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12685                )),
12686            }
12687        }
12688    }
12689
12690    impl serde::ser::Serialize for State {
12691        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12692        where
12693            S: serde::Serializer,
12694        {
12695            match self {
12696                Self::Unspecified => serializer.serialize_i32(0),
12697                Self::Succeeded => serializer.serialize_i32(1),
12698                Self::Failed => serializer.serialize_i32(2),
12699                Self::InProgress => serializer.serialize_i32(3),
12700                Self::PendingApproval => serializer.serialize_i32(4),
12701                Self::ApprovalRejected => serializer.serialize_i32(5),
12702                Self::Pending => serializer.serialize_i32(6),
12703                Self::PendingRelease => serializer.serialize_i32(7),
12704                Self::Cancelling => serializer.serialize_i32(8),
12705                Self::Cancelled => serializer.serialize_i32(9),
12706                Self::Halted => serializer.serialize_i32(10),
12707                Self::UnknownValue(u) => u.0.serialize(serializer),
12708            }
12709        }
12710    }
12711
12712    impl<'de> serde::de::Deserialize<'de> for State {
12713        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12714        where
12715            D: serde::Deserializer<'de>,
12716        {
12717            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12718                ".google.cloud.deploy.v1.Rollout.State",
12719            ))
12720        }
12721    }
12722
12723    /// Well-known rollout failures.
12724    ///
12725    /// # Working with unknown values
12726    ///
12727    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12728    /// additional enum variants at any time. Adding new variants is not considered
12729    /// a breaking change. Applications should write their code in anticipation of:
12730    ///
12731    /// - New values appearing in future releases of the client library, **and**
12732    /// - New values received dynamically, without application changes.
12733    ///
12734    /// Please consult the [Working with enums] section in the user guide for some
12735    /// guidelines.
12736    ///
12737    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12738    #[derive(Clone, Debug, PartialEq)]
12739    #[non_exhaustive]
12740    pub enum FailureCause {
12741        /// No reason for failure is specified.
12742        Unspecified,
12743        /// Cloud Build is not available, either because it is not enabled or because
12744        /// Cloud Deploy has insufficient permissions. See [required
12745        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12746        CloudBuildUnavailable,
12747        /// The deploy operation did not complete successfully; check Cloud Build
12748        /// logs.
12749        ExecutionFailed,
12750        /// Deployment did not complete within the allotted time.
12751        DeadlineExceeded,
12752        /// Release is in a failed state.
12753        ReleaseFailed,
12754        /// Release is abandoned.
12755        ReleaseAbandoned,
12756        /// No Skaffold verify configuration was found.
12757        VerificationConfigNotFound,
12758        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12759        /// for additional details.
12760        CloudBuildRequestFailed,
12761        /// A Rollout operation had a feature configured that is not supported.
12762        OperationFeatureNotSupported,
12763        /// If set, the enum was initialized with an unknown value.
12764        ///
12765        /// Applications can examine the value using [FailureCause::value] or
12766        /// [FailureCause::name].
12767        UnknownValue(failure_cause::UnknownValue),
12768    }
12769
12770    #[doc(hidden)]
12771    pub mod failure_cause {
12772        #[allow(unused_imports)]
12773        use super::*;
12774        #[derive(Clone, Debug, PartialEq)]
12775        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12776    }
12777
12778    impl FailureCause {
12779        /// Gets the enum value.
12780        ///
12781        /// Returns `None` if the enum contains an unknown value deserialized from
12782        /// the string representation of enums.
12783        pub fn value(&self) -> std::option::Option<i32> {
12784            match self {
12785                Self::Unspecified => std::option::Option::Some(0),
12786                Self::CloudBuildUnavailable => std::option::Option::Some(1),
12787                Self::ExecutionFailed => std::option::Option::Some(2),
12788                Self::DeadlineExceeded => std::option::Option::Some(3),
12789                Self::ReleaseFailed => std::option::Option::Some(4),
12790                Self::ReleaseAbandoned => std::option::Option::Some(5),
12791                Self::VerificationConfigNotFound => std::option::Option::Some(6),
12792                Self::CloudBuildRequestFailed => std::option::Option::Some(7),
12793                Self::OperationFeatureNotSupported => std::option::Option::Some(8),
12794                Self::UnknownValue(u) => u.0.value(),
12795            }
12796        }
12797
12798        /// Gets the enum value as a string.
12799        ///
12800        /// Returns `None` if the enum contains an unknown value deserialized from
12801        /// the integer representation of enums.
12802        pub fn name(&self) -> std::option::Option<&str> {
12803            match self {
12804                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12805                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12806                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12807                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12808                Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
12809                Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
12810                Self::VerificationConfigNotFound => {
12811                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12812                }
12813                Self::CloudBuildRequestFailed => {
12814                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12815                }
12816                Self::OperationFeatureNotSupported => {
12817                    std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
12818                }
12819                Self::UnknownValue(u) => u.0.name(),
12820            }
12821        }
12822    }
12823
12824    impl std::default::Default for FailureCause {
12825        fn default() -> Self {
12826            use std::convert::From;
12827            Self::from(0)
12828        }
12829    }
12830
12831    impl std::fmt::Display for FailureCause {
12832        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12833            wkt::internal::display_enum(f, self.name(), self.value())
12834        }
12835    }
12836
12837    impl std::convert::From<i32> for FailureCause {
12838        fn from(value: i32) -> Self {
12839            match value {
12840                0 => Self::Unspecified,
12841                1 => Self::CloudBuildUnavailable,
12842                2 => Self::ExecutionFailed,
12843                3 => Self::DeadlineExceeded,
12844                4 => Self::ReleaseFailed,
12845                5 => Self::ReleaseAbandoned,
12846                6 => Self::VerificationConfigNotFound,
12847                7 => Self::CloudBuildRequestFailed,
12848                8 => Self::OperationFeatureNotSupported,
12849                _ => Self::UnknownValue(failure_cause::UnknownValue(
12850                    wkt::internal::UnknownEnumValue::Integer(value),
12851                )),
12852            }
12853        }
12854    }
12855
12856    impl std::convert::From<&str> for FailureCause {
12857        fn from(value: &str) -> Self {
12858            use std::string::ToString;
12859            match value {
12860                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12861                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12862                "EXECUTION_FAILED" => Self::ExecutionFailed,
12863                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12864                "RELEASE_FAILED" => Self::ReleaseFailed,
12865                "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
12866                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12867                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12868                "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
12869                _ => Self::UnknownValue(failure_cause::UnknownValue(
12870                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12871                )),
12872            }
12873        }
12874    }
12875
12876    impl serde::ser::Serialize for FailureCause {
12877        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12878        where
12879            S: serde::Serializer,
12880        {
12881            match self {
12882                Self::Unspecified => serializer.serialize_i32(0),
12883                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12884                Self::ExecutionFailed => serializer.serialize_i32(2),
12885                Self::DeadlineExceeded => serializer.serialize_i32(3),
12886                Self::ReleaseFailed => serializer.serialize_i32(4),
12887                Self::ReleaseAbandoned => serializer.serialize_i32(5),
12888                Self::VerificationConfigNotFound => serializer.serialize_i32(6),
12889                Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
12890                Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
12891                Self::UnknownValue(u) => u.0.serialize(serializer),
12892            }
12893        }
12894    }
12895
12896    impl<'de> serde::de::Deserialize<'de> for FailureCause {
12897        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12898        where
12899            D: serde::Deserializer<'de>,
12900        {
12901            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12902                ".google.cloud.deploy.v1.Rollout.FailureCause",
12903            ))
12904        }
12905    }
12906}
12907
12908/// Metadata includes information associated with a `Rollout`.
12909#[derive(Clone, Default, PartialEq)]
12910#[non_exhaustive]
12911pub struct Metadata {
12912    /// Output only. The name of the Cloud Run Service that is associated with a
12913    /// `Rollout`.
12914    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12915
12916    /// Output only. AutomationRolloutMetadata contains the information about the
12917    /// interactions between Automation service and this rollout.
12918    pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
12919
12920    /// Output only. Custom metadata provided by user-defined `Rollout` operations.
12921    pub custom: std::option::Option<crate::model::CustomMetadata>,
12922
12923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12924}
12925
12926impl Metadata {
12927    /// Creates a new default instance.
12928    pub fn new() -> Self {
12929        std::default::Default::default()
12930    }
12931
12932    /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
12933    ///
12934    /// # Example
12935    /// ```ignore,no_run
12936    /// # use google_cloud_deploy_v1::model::Metadata;
12937    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12938    /// let x = Metadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12939    /// ```
12940    pub fn set_cloud_run<T>(mut self, v: T) -> Self
12941    where
12942        T: std::convert::Into<crate::model::CloudRunMetadata>,
12943    {
12944        self.cloud_run = std::option::Option::Some(v.into());
12945        self
12946    }
12947
12948    /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
12949    ///
12950    /// # Example
12951    /// ```ignore,no_run
12952    /// # use google_cloud_deploy_v1::model::Metadata;
12953    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12954    /// let x = Metadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12955    /// let x = Metadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12956    /// ```
12957    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12958    where
12959        T: std::convert::Into<crate::model::CloudRunMetadata>,
12960    {
12961        self.cloud_run = v.map(|x| x.into());
12962        self
12963    }
12964
12965    /// Sets the value of [automation][crate::model::Metadata::automation].
12966    ///
12967    /// # Example
12968    /// ```ignore,no_run
12969    /// # use google_cloud_deploy_v1::model::Metadata;
12970    /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12971    /// let x = Metadata::new().set_automation(AutomationRolloutMetadata::default()/* use setters */);
12972    /// ```
12973    pub fn set_automation<T>(mut self, v: T) -> Self
12974    where
12975        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12976    {
12977        self.automation = std::option::Option::Some(v.into());
12978        self
12979    }
12980
12981    /// Sets or clears the value of [automation][crate::model::Metadata::automation].
12982    ///
12983    /// # Example
12984    /// ```ignore,no_run
12985    /// # use google_cloud_deploy_v1::model::Metadata;
12986    /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12987    /// let x = Metadata::new().set_or_clear_automation(Some(AutomationRolloutMetadata::default()/* use setters */));
12988    /// let x = Metadata::new().set_or_clear_automation(None::<AutomationRolloutMetadata>);
12989    /// ```
12990    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
12991    where
12992        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12993    {
12994        self.automation = v.map(|x| x.into());
12995        self
12996    }
12997
12998    /// Sets the value of [custom][crate::model::Metadata::custom].
12999    ///
13000    /// # Example
13001    /// ```ignore,no_run
13002    /// # use google_cloud_deploy_v1::model::Metadata;
13003    /// use google_cloud_deploy_v1::model::CustomMetadata;
13004    /// let x = Metadata::new().set_custom(CustomMetadata::default()/* use setters */);
13005    /// ```
13006    pub fn set_custom<T>(mut self, v: T) -> Self
13007    where
13008        T: std::convert::Into<crate::model::CustomMetadata>,
13009    {
13010        self.custom = std::option::Option::Some(v.into());
13011        self
13012    }
13013
13014    /// Sets or clears the value of [custom][crate::model::Metadata::custom].
13015    ///
13016    /// # Example
13017    /// ```ignore,no_run
13018    /// # use google_cloud_deploy_v1::model::Metadata;
13019    /// use google_cloud_deploy_v1::model::CustomMetadata;
13020    /// let x = Metadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13021    /// let x = Metadata::new().set_or_clear_custom(None::<CustomMetadata>);
13022    /// ```
13023    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13024    where
13025        T: std::convert::Into<crate::model::CustomMetadata>,
13026    {
13027        self.custom = v.map(|x| x.into());
13028        self
13029    }
13030}
13031
13032impl wkt::message::Message for Metadata {
13033    fn typename() -> &'static str {
13034        "type.googleapis.com/google.cloud.deploy.v1.Metadata"
13035    }
13036}
13037
13038/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
13039/// the user.
13040#[derive(Clone, Default, PartialEq)]
13041#[non_exhaustive]
13042pub struct DeployJobRunMetadata {
13043    /// Output only. The name of the Cloud Run Service that is associated with a
13044    /// `DeployJobRun`.
13045    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
13046
13047    /// Output only. Custom Target metadata associated with a `DeployJobRun`.
13048    pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
13049
13050    /// Output only. Custom metadata provided by user-defined deploy operation.
13051    pub custom: std::option::Option<crate::model::CustomMetadata>,
13052
13053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13054}
13055
13056impl DeployJobRunMetadata {
13057    /// Creates a new default instance.
13058    pub fn new() -> Self {
13059        std::default::Default::default()
13060    }
13061
13062    /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
13063    ///
13064    /// # Example
13065    /// ```ignore,no_run
13066    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13067    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13068    /// let x = DeployJobRunMetadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
13069    /// ```
13070    pub fn set_cloud_run<T>(mut self, v: T) -> Self
13071    where
13072        T: std::convert::Into<crate::model::CloudRunMetadata>,
13073    {
13074        self.cloud_run = std::option::Option::Some(v.into());
13075        self
13076    }
13077
13078    /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
13079    ///
13080    /// # Example
13081    /// ```ignore,no_run
13082    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13083    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13084    /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
13085    /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
13086    /// ```
13087    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
13088    where
13089        T: std::convert::Into<crate::model::CloudRunMetadata>,
13090    {
13091        self.cloud_run = v.map(|x| x.into());
13092        self
13093    }
13094
13095    /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13096    ///
13097    /// # Example
13098    /// ```ignore,no_run
13099    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13100    /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13101    /// let x = DeployJobRunMetadata::new().set_custom_target(CustomTargetDeployMetadata::default()/* use setters */);
13102    /// ```
13103    pub fn set_custom_target<T>(mut self, v: T) -> Self
13104    where
13105        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13106    {
13107        self.custom_target = std::option::Option::Some(v.into());
13108        self
13109    }
13110
13111    /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13112    ///
13113    /// # Example
13114    /// ```ignore,no_run
13115    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13116    /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13117    /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(Some(CustomTargetDeployMetadata::default()/* use setters */));
13118    /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(None::<CustomTargetDeployMetadata>);
13119    /// ```
13120    pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
13121    where
13122        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13123    {
13124        self.custom_target = v.map(|x| x.into());
13125        self
13126    }
13127
13128    /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
13129    ///
13130    /// # Example
13131    /// ```ignore,no_run
13132    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13133    /// use google_cloud_deploy_v1::model::CustomMetadata;
13134    /// let x = DeployJobRunMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
13135    /// ```
13136    pub fn set_custom<T>(mut self, v: T) -> Self
13137    where
13138        T: std::convert::Into<crate::model::CustomMetadata>,
13139    {
13140        self.custom = std::option::Option::Some(v.into());
13141        self
13142    }
13143
13144    /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
13145    ///
13146    /// # Example
13147    /// ```ignore,no_run
13148    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13149    /// use google_cloud_deploy_v1::model::CustomMetadata;
13150    /// let x = DeployJobRunMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13151    /// let x = DeployJobRunMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
13152    /// ```
13153    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13154    where
13155        T: std::convert::Into<crate::model::CustomMetadata>,
13156    {
13157        self.custom = v.map(|x| x.into());
13158        self
13159    }
13160}
13161
13162impl wkt::message::Message for DeployJobRunMetadata {
13163    fn typename() -> &'static str {
13164        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
13165    }
13166}
13167
13168/// CloudRunMetadata contains information from a Cloud Run deployment.
13169#[derive(Clone, Default, PartialEq)]
13170#[non_exhaustive]
13171pub struct CloudRunMetadata {
13172    /// Output only. The name of the Cloud Run Service that is associated with a
13173    /// `Rollout`. Format is
13174    /// `projects/{project}/locations/{location}/services/{service}`.
13175    pub service: std::string::String,
13176
13177    /// Output only. The Cloud Run Service urls that are associated with a
13178    /// `Rollout`.
13179    pub service_urls: std::vec::Vec<std::string::String>,
13180
13181    /// Output only. The Cloud Run Revision id associated with a `Rollout`.
13182    pub revision: std::string::String,
13183
13184    /// Output only. The name of the Cloud Run job that is associated with a
13185    /// `Rollout`. Format is
13186    /// `projects/{project}/locations/{location}/jobs/{job_name}`.
13187    pub job: std::string::String,
13188
13189    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13190}
13191
13192impl CloudRunMetadata {
13193    /// Creates a new default instance.
13194    pub fn new() -> Self {
13195        std::default::Default::default()
13196    }
13197
13198    /// Sets the value of [service][crate::model::CloudRunMetadata::service].
13199    ///
13200    /// # Example
13201    /// ```ignore,no_run
13202    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13203    /// let x = CloudRunMetadata::new().set_service("example");
13204    /// ```
13205    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13206        self.service = v.into();
13207        self
13208    }
13209
13210    /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
13211    ///
13212    /// # Example
13213    /// ```ignore,no_run
13214    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13215    /// let x = CloudRunMetadata::new().set_service_urls(["a", "b", "c"]);
13216    /// ```
13217    pub fn set_service_urls<T, V>(mut self, v: T) -> Self
13218    where
13219        T: std::iter::IntoIterator<Item = V>,
13220        V: std::convert::Into<std::string::String>,
13221    {
13222        use std::iter::Iterator;
13223        self.service_urls = v.into_iter().map(|i| i.into()).collect();
13224        self
13225    }
13226
13227    /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
13228    ///
13229    /// # Example
13230    /// ```ignore,no_run
13231    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13232    /// let x = CloudRunMetadata::new().set_revision("example");
13233    /// ```
13234    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13235        self.revision = v.into();
13236        self
13237    }
13238
13239    /// Sets the value of [job][crate::model::CloudRunMetadata::job].
13240    ///
13241    /// # Example
13242    /// ```ignore,no_run
13243    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13244    /// let x = CloudRunMetadata::new().set_job("example");
13245    /// ```
13246    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13247        self.job = v.into();
13248        self
13249    }
13250}
13251
13252impl wkt::message::Message for CloudRunMetadata {
13253    fn typename() -> &'static str {
13254        "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
13255    }
13256}
13257
13258/// CustomTargetDeployMetadata contains information from a Custom Target
13259/// deploy operation.
13260#[derive(Clone, Default, PartialEq)]
13261#[non_exhaustive]
13262pub struct CustomTargetDeployMetadata {
13263    /// Output only. Skip message provided in the results of a custom deploy
13264    /// operation.
13265    pub skip_message: std::string::String,
13266
13267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13268}
13269
13270impl CustomTargetDeployMetadata {
13271    /// Creates a new default instance.
13272    pub fn new() -> Self {
13273        std::default::Default::default()
13274    }
13275
13276    /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
13277    ///
13278    /// # Example
13279    /// ```ignore,no_run
13280    /// # use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13281    /// let x = CustomTargetDeployMetadata::new().set_skip_message("example");
13282    /// ```
13283    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13284        self.skip_message = v.into();
13285        self
13286    }
13287}
13288
13289impl wkt::message::Message for CustomTargetDeployMetadata {
13290    fn typename() -> &'static str {
13291        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
13292    }
13293}
13294
13295/// AutomationRolloutMetadata contains Automation-related actions that
13296/// were performed on a rollout.
13297#[derive(Clone, Default, PartialEq)]
13298#[non_exhaustive]
13299pub struct AutomationRolloutMetadata {
13300    /// Output only. The name of the AutomationRun initiated by a promote release
13301    /// rule.
13302    pub promote_automation_run: std::string::String,
13303
13304    /// Output only. The names of the AutomationRuns initiated by an advance
13305    /// rollout rule.
13306    pub advance_automation_runs: std::vec::Vec<std::string::String>,
13307
13308    /// Output only. The names of the AutomationRuns initiated by a repair rollout
13309    /// rule.
13310    pub repair_automation_runs: std::vec::Vec<std::string::String>,
13311
13312    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13313}
13314
13315impl AutomationRolloutMetadata {
13316    /// Creates a new default instance.
13317    pub fn new() -> Self {
13318        std::default::Default::default()
13319    }
13320
13321    /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
13322    ///
13323    /// # Example
13324    /// ```ignore,no_run
13325    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13326    /// let x = AutomationRolloutMetadata::new().set_promote_automation_run("example");
13327    /// ```
13328    pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
13329        mut self,
13330        v: T,
13331    ) -> Self {
13332        self.promote_automation_run = v.into();
13333        self
13334    }
13335
13336    /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
13337    ///
13338    /// # Example
13339    /// ```ignore,no_run
13340    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13341    /// let x = AutomationRolloutMetadata::new().set_advance_automation_runs(["a", "b", "c"]);
13342    /// ```
13343    pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
13344    where
13345        T: std::iter::IntoIterator<Item = V>,
13346        V: std::convert::Into<std::string::String>,
13347    {
13348        use std::iter::Iterator;
13349        self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
13350        self
13351    }
13352
13353    /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
13354    ///
13355    /// # Example
13356    /// ```ignore,no_run
13357    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13358    /// let x = AutomationRolloutMetadata::new().set_repair_automation_runs(["a", "b", "c"]);
13359    /// ```
13360    pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
13361    where
13362        T: std::iter::IntoIterator<Item = V>,
13363        V: std::convert::Into<std::string::String>,
13364    {
13365        use std::iter::Iterator;
13366        self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
13367        self
13368    }
13369}
13370
13371impl wkt::message::Message for AutomationRolloutMetadata {
13372    fn typename() -> &'static str {
13373        "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
13374    }
13375}
13376
13377/// CustomMetadata contains information from a user-defined operation.
13378#[derive(Clone, Default, PartialEq)]
13379#[non_exhaustive]
13380pub struct CustomMetadata {
13381    /// Output only. Key-value pairs provided by the user-defined operation.
13382    pub values: std::collections::HashMap<std::string::String, std::string::String>,
13383
13384    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13385}
13386
13387impl CustomMetadata {
13388    /// Creates a new default instance.
13389    pub fn new() -> Self {
13390        std::default::Default::default()
13391    }
13392
13393    /// Sets the value of [values][crate::model::CustomMetadata::values].
13394    ///
13395    /// # Example
13396    /// ```ignore,no_run
13397    /// # use google_cloud_deploy_v1::model::CustomMetadata;
13398    /// let x = CustomMetadata::new().set_values([
13399    ///     ("key0", "abc"),
13400    ///     ("key1", "xyz"),
13401    /// ]);
13402    /// ```
13403    pub fn set_values<T, K, V>(mut self, v: T) -> Self
13404    where
13405        T: std::iter::IntoIterator<Item = (K, V)>,
13406        K: std::convert::Into<std::string::String>,
13407        V: std::convert::Into<std::string::String>,
13408    {
13409        use std::iter::Iterator;
13410        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13411        self
13412    }
13413}
13414
13415impl wkt::message::Message for CustomMetadata {
13416    fn typename() -> &'static str {
13417        "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
13418    }
13419}
13420
13421/// Phase represents a collection of jobs that are logically grouped together
13422/// for a `Rollout`.
13423#[derive(Clone, Default, PartialEq)]
13424#[non_exhaustive]
13425pub struct Phase {
13426    /// Output only. The ID of the Phase.
13427    pub id: std::string::String,
13428
13429    /// Output only. Current state of the Phase.
13430    pub state: crate::model::phase::State,
13431
13432    /// Output only. Additional information on why the Phase was skipped, if
13433    /// available.
13434    pub skip_message: std::string::String,
13435
13436    /// The job composition of this Phase.
13437    pub jobs: std::option::Option<crate::model::phase::Jobs>,
13438
13439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13440}
13441
13442impl Phase {
13443    /// Creates a new default instance.
13444    pub fn new() -> Self {
13445        std::default::Default::default()
13446    }
13447
13448    /// Sets the value of [id][crate::model::Phase::id].
13449    ///
13450    /// # Example
13451    /// ```ignore,no_run
13452    /// # use google_cloud_deploy_v1::model::Phase;
13453    /// let x = Phase::new().set_id("example");
13454    /// ```
13455    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13456        self.id = v.into();
13457        self
13458    }
13459
13460    /// Sets the value of [state][crate::model::Phase::state].
13461    ///
13462    /// # Example
13463    /// ```ignore,no_run
13464    /// # use google_cloud_deploy_v1::model::Phase;
13465    /// use google_cloud_deploy_v1::model::phase::State;
13466    /// let x0 = Phase::new().set_state(State::Pending);
13467    /// let x1 = Phase::new().set_state(State::InProgress);
13468    /// let x2 = Phase::new().set_state(State::Succeeded);
13469    /// ```
13470    pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
13471        self.state = v.into();
13472        self
13473    }
13474
13475    /// Sets the value of [skip_message][crate::model::Phase::skip_message].
13476    ///
13477    /// # Example
13478    /// ```ignore,no_run
13479    /// # use google_cloud_deploy_v1::model::Phase;
13480    /// let x = Phase::new().set_skip_message("example");
13481    /// ```
13482    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13483        self.skip_message = v.into();
13484        self
13485    }
13486
13487    /// Sets the value of [jobs][crate::model::Phase::jobs].
13488    ///
13489    /// Note that all the setters affecting `jobs` are mutually
13490    /// exclusive.
13491    ///
13492    /// # Example
13493    /// ```ignore,no_run
13494    /// # use google_cloud_deploy_v1::model::Phase;
13495    /// use google_cloud_deploy_v1::model::DeploymentJobs;
13496    /// let x = Phase::new().set_jobs(Some(
13497    ///     google_cloud_deploy_v1::model::phase::Jobs::DeploymentJobs(DeploymentJobs::default().into())));
13498    /// ```
13499    pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
13500        mut self,
13501        v: T,
13502    ) -> Self {
13503        self.jobs = v.into();
13504        self
13505    }
13506
13507    /// The value of [jobs][crate::model::Phase::jobs]
13508    /// if it holds a `DeploymentJobs`, `None` if the field is not set or
13509    /// holds a different branch.
13510    pub fn deployment_jobs(
13511        &self,
13512    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
13513        #[allow(unreachable_patterns)]
13514        self.jobs.as_ref().and_then(|v| match v {
13515            crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
13516            _ => std::option::Option::None,
13517        })
13518    }
13519
13520    /// Sets the value of [jobs][crate::model::Phase::jobs]
13521    /// to hold a `DeploymentJobs`.
13522    ///
13523    /// Note that all the setters affecting `jobs` are
13524    /// mutually exclusive.
13525    ///
13526    /// # Example
13527    /// ```ignore,no_run
13528    /// # use google_cloud_deploy_v1::model::Phase;
13529    /// use google_cloud_deploy_v1::model::DeploymentJobs;
13530    /// let x = Phase::new().set_deployment_jobs(DeploymentJobs::default()/* use setters */);
13531    /// assert!(x.deployment_jobs().is_some());
13532    /// assert!(x.child_rollout_jobs().is_none());
13533    /// ```
13534    pub fn set_deployment_jobs<
13535        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
13536    >(
13537        mut self,
13538        v: T,
13539    ) -> Self {
13540        self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
13541        self
13542    }
13543
13544    /// The value of [jobs][crate::model::Phase::jobs]
13545    /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
13546    /// holds a different branch.
13547    pub fn child_rollout_jobs(
13548        &self,
13549    ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
13550        #[allow(unreachable_patterns)]
13551        self.jobs.as_ref().and_then(|v| match v {
13552            crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
13553            _ => std::option::Option::None,
13554        })
13555    }
13556
13557    /// Sets the value of [jobs][crate::model::Phase::jobs]
13558    /// to hold a `ChildRolloutJobs`.
13559    ///
13560    /// Note that all the setters affecting `jobs` are
13561    /// mutually exclusive.
13562    ///
13563    /// # Example
13564    /// ```ignore,no_run
13565    /// # use google_cloud_deploy_v1::model::Phase;
13566    /// use google_cloud_deploy_v1::model::ChildRolloutJobs;
13567    /// let x = Phase::new().set_child_rollout_jobs(ChildRolloutJobs::default()/* use setters */);
13568    /// assert!(x.child_rollout_jobs().is_some());
13569    /// assert!(x.deployment_jobs().is_none());
13570    /// ```
13571    pub fn set_child_rollout_jobs<
13572        T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
13573    >(
13574        mut self,
13575        v: T,
13576    ) -> Self {
13577        self.jobs =
13578            std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
13579        self
13580    }
13581}
13582
13583impl wkt::message::Message for Phase {
13584    fn typename() -> &'static str {
13585        "type.googleapis.com/google.cloud.deploy.v1.Phase"
13586    }
13587}
13588
13589/// Defines additional types related to [Phase].
13590pub mod phase {
13591    #[allow(unused_imports)]
13592    use super::*;
13593
13594    /// Valid states of a Phase.
13595    ///
13596    /// # Working with unknown values
13597    ///
13598    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13599    /// additional enum variants at any time. Adding new variants is not considered
13600    /// a breaking change. Applications should write their code in anticipation of:
13601    ///
13602    /// - New values appearing in future releases of the client library, **and**
13603    /// - New values received dynamically, without application changes.
13604    ///
13605    /// Please consult the [Working with enums] section in the user guide for some
13606    /// guidelines.
13607    ///
13608    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13609    #[derive(Clone, Debug, PartialEq)]
13610    #[non_exhaustive]
13611    pub enum State {
13612        /// The Phase has an unspecified state.
13613        Unspecified,
13614        /// The Phase is waiting for an earlier Phase(s) to complete.
13615        Pending,
13616        /// The Phase is in progress.
13617        InProgress,
13618        /// The Phase has succeeded.
13619        Succeeded,
13620        /// The Phase has failed.
13621        Failed,
13622        /// The Phase was aborted.
13623        Aborted,
13624        /// The Phase was skipped.
13625        Skipped,
13626        /// If set, the enum was initialized with an unknown value.
13627        ///
13628        /// Applications can examine the value using [State::value] or
13629        /// [State::name].
13630        UnknownValue(state::UnknownValue),
13631    }
13632
13633    #[doc(hidden)]
13634    pub mod state {
13635        #[allow(unused_imports)]
13636        use super::*;
13637        #[derive(Clone, Debug, PartialEq)]
13638        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13639    }
13640
13641    impl State {
13642        /// Gets the enum value.
13643        ///
13644        /// Returns `None` if the enum contains an unknown value deserialized from
13645        /// the string representation of enums.
13646        pub fn value(&self) -> std::option::Option<i32> {
13647            match self {
13648                Self::Unspecified => std::option::Option::Some(0),
13649                Self::Pending => std::option::Option::Some(1),
13650                Self::InProgress => std::option::Option::Some(2),
13651                Self::Succeeded => std::option::Option::Some(3),
13652                Self::Failed => std::option::Option::Some(4),
13653                Self::Aborted => std::option::Option::Some(5),
13654                Self::Skipped => std::option::Option::Some(6),
13655                Self::UnknownValue(u) => u.0.value(),
13656            }
13657        }
13658
13659        /// Gets the enum value as a string.
13660        ///
13661        /// Returns `None` if the enum contains an unknown value deserialized from
13662        /// the integer representation of enums.
13663        pub fn name(&self) -> std::option::Option<&str> {
13664            match self {
13665                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13666                Self::Pending => std::option::Option::Some("PENDING"),
13667                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
13668                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13669                Self::Failed => std::option::Option::Some("FAILED"),
13670                Self::Aborted => std::option::Option::Some("ABORTED"),
13671                Self::Skipped => std::option::Option::Some("SKIPPED"),
13672                Self::UnknownValue(u) => u.0.name(),
13673            }
13674        }
13675    }
13676
13677    impl std::default::Default for State {
13678        fn default() -> Self {
13679            use std::convert::From;
13680            Self::from(0)
13681        }
13682    }
13683
13684    impl std::fmt::Display for State {
13685        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13686            wkt::internal::display_enum(f, self.name(), self.value())
13687        }
13688    }
13689
13690    impl std::convert::From<i32> for State {
13691        fn from(value: i32) -> Self {
13692            match value {
13693                0 => Self::Unspecified,
13694                1 => Self::Pending,
13695                2 => Self::InProgress,
13696                3 => Self::Succeeded,
13697                4 => Self::Failed,
13698                5 => Self::Aborted,
13699                6 => Self::Skipped,
13700                _ => Self::UnknownValue(state::UnknownValue(
13701                    wkt::internal::UnknownEnumValue::Integer(value),
13702                )),
13703            }
13704        }
13705    }
13706
13707    impl std::convert::From<&str> for State {
13708        fn from(value: &str) -> Self {
13709            use std::string::ToString;
13710            match value {
13711                "STATE_UNSPECIFIED" => Self::Unspecified,
13712                "PENDING" => Self::Pending,
13713                "IN_PROGRESS" => Self::InProgress,
13714                "SUCCEEDED" => Self::Succeeded,
13715                "FAILED" => Self::Failed,
13716                "ABORTED" => Self::Aborted,
13717                "SKIPPED" => Self::Skipped,
13718                _ => Self::UnknownValue(state::UnknownValue(
13719                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13720                )),
13721            }
13722        }
13723    }
13724
13725    impl serde::ser::Serialize for State {
13726        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13727        where
13728            S: serde::Serializer,
13729        {
13730            match self {
13731                Self::Unspecified => serializer.serialize_i32(0),
13732                Self::Pending => serializer.serialize_i32(1),
13733                Self::InProgress => serializer.serialize_i32(2),
13734                Self::Succeeded => serializer.serialize_i32(3),
13735                Self::Failed => serializer.serialize_i32(4),
13736                Self::Aborted => serializer.serialize_i32(5),
13737                Self::Skipped => serializer.serialize_i32(6),
13738                Self::UnknownValue(u) => u.0.serialize(serializer),
13739            }
13740        }
13741    }
13742
13743    impl<'de> serde::de::Deserialize<'de> for State {
13744        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13745        where
13746            D: serde::Deserializer<'de>,
13747        {
13748            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13749                ".google.cloud.deploy.v1.Phase.State",
13750            ))
13751        }
13752    }
13753
13754    /// The job composition of this Phase.
13755    #[derive(Clone, Debug, PartialEq)]
13756    #[non_exhaustive]
13757    pub enum Jobs {
13758        /// Output only. Deployment job composition.
13759        DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
13760        /// Output only. ChildRollout job composition.
13761        ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
13762    }
13763}
13764
13765/// Deployment job composition.
13766#[derive(Clone, Default, PartialEq)]
13767#[non_exhaustive]
13768pub struct DeploymentJobs {
13769    /// Output only. The predeploy Job, which is the first job on the phase.
13770    pub predeploy_job: std::option::Option<crate::model::Job>,
13771
13772    /// Output only. The deploy Job. This is the deploy job in the phase.
13773    pub deploy_job: std::option::Option<crate::model::Job>,
13774
13775    /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
13776    pub verify_job: std::option::Option<crate::model::Job>,
13777
13778    /// Output only. The postdeploy Job, which is the last job on the phase.
13779    pub postdeploy_job: std::option::Option<crate::model::Job>,
13780
13781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13782}
13783
13784impl DeploymentJobs {
13785    /// Creates a new default instance.
13786    pub fn new() -> Self {
13787        std::default::Default::default()
13788    }
13789
13790    /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13791    ///
13792    /// # Example
13793    /// ```ignore,no_run
13794    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13795    /// use google_cloud_deploy_v1::model::Job;
13796    /// let x = DeploymentJobs::new().set_predeploy_job(Job::default()/* use setters */);
13797    /// ```
13798    pub fn set_predeploy_job<T>(mut self, v: T) -> Self
13799    where
13800        T: std::convert::Into<crate::model::Job>,
13801    {
13802        self.predeploy_job = std::option::Option::Some(v.into());
13803        self
13804    }
13805
13806    /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13807    ///
13808    /// # Example
13809    /// ```ignore,no_run
13810    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13811    /// use google_cloud_deploy_v1::model::Job;
13812    /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(Some(Job::default()/* use setters */));
13813    /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(None::<Job>);
13814    /// ```
13815    pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13816    where
13817        T: std::convert::Into<crate::model::Job>,
13818    {
13819        self.predeploy_job = v.map(|x| x.into());
13820        self
13821    }
13822
13823    /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13824    ///
13825    /// # Example
13826    /// ```ignore,no_run
13827    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13828    /// use google_cloud_deploy_v1::model::Job;
13829    /// let x = DeploymentJobs::new().set_deploy_job(Job::default()/* use setters */);
13830    /// ```
13831    pub fn set_deploy_job<T>(mut self, v: T) -> Self
13832    where
13833        T: std::convert::Into<crate::model::Job>,
13834    {
13835        self.deploy_job = std::option::Option::Some(v.into());
13836        self
13837    }
13838
13839    /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13840    ///
13841    /// # Example
13842    /// ```ignore,no_run
13843    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13844    /// use google_cloud_deploy_v1::model::Job;
13845    /// let x = DeploymentJobs::new().set_or_clear_deploy_job(Some(Job::default()/* use setters */));
13846    /// let x = DeploymentJobs::new().set_or_clear_deploy_job(None::<Job>);
13847    /// ```
13848    pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13849    where
13850        T: std::convert::Into<crate::model::Job>,
13851    {
13852        self.deploy_job = v.map(|x| x.into());
13853        self
13854    }
13855
13856    /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13857    ///
13858    /// # Example
13859    /// ```ignore,no_run
13860    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13861    /// use google_cloud_deploy_v1::model::Job;
13862    /// let x = DeploymentJobs::new().set_verify_job(Job::default()/* use setters */);
13863    /// ```
13864    pub fn set_verify_job<T>(mut self, v: T) -> Self
13865    where
13866        T: std::convert::Into<crate::model::Job>,
13867    {
13868        self.verify_job = std::option::Option::Some(v.into());
13869        self
13870    }
13871
13872    /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13873    ///
13874    /// # Example
13875    /// ```ignore,no_run
13876    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13877    /// use google_cloud_deploy_v1::model::Job;
13878    /// let x = DeploymentJobs::new().set_or_clear_verify_job(Some(Job::default()/* use setters */));
13879    /// let x = DeploymentJobs::new().set_or_clear_verify_job(None::<Job>);
13880    /// ```
13881    pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
13882    where
13883        T: std::convert::Into<crate::model::Job>,
13884    {
13885        self.verify_job = v.map(|x| x.into());
13886        self
13887    }
13888
13889    /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13890    ///
13891    /// # Example
13892    /// ```ignore,no_run
13893    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13894    /// use google_cloud_deploy_v1::model::Job;
13895    /// let x = DeploymentJobs::new().set_postdeploy_job(Job::default()/* use setters */);
13896    /// ```
13897    pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
13898    where
13899        T: std::convert::Into<crate::model::Job>,
13900    {
13901        self.postdeploy_job = std::option::Option::Some(v.into());
13902        self
13903    }
13904
13905    /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13906    ///
13907    /// # Example
13908    /// ```ignore,no_run
13909    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13910    /// use google_cloud_deploy_v1::model::Job;
13911    /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(Some(Job::default()/* use setters */));
13912    /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(None::<Job>);
13913    /// ```
13914    pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13915    where
13916        T: std::convert::Into<crate::model::Job>,
13917    {
13918        self.postdeploy_job = v.map(|x| x.into());
13919        self
13920    }
13921}
13922
13923impl wkt::message::Message for DeploymentJobs {
13924    fn typename() -> &'static str {
13925        "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
13926    }
13927}
13928
13929/// ChildRollouts job composition
13930#[derive(Clone, Default, PartialEq)]
13931#[non_exhaustive]
13932pub struct ChildRolloutJobs {
13933    /// Output only. List of CreateChildRolloutJobs
13934    pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
13935
13936    /// Output only. List of AdvanceChildRolloutJobs
13937    pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
13938
13939    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13940}
13941
13942impl ChildRolloutJobs {
13943    /// Creates a new default instance.
13944    pub fn new() -> Self {
13945        std::default::Default::default()
13946    }
13947
13948    /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
13949    ///
13950    /// # Example
13951    /// ```ignore,no_run
13952    /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13953    /// use google_cloud_deploy_v1::model::Job;
13954    /// let x = ChildRolloutJobs::new()
13955    ///     .set_create_rollout_jobs([
13956    ///         Job::default()/* use setters */,
13957    ///         Job::default()/* use (different) setters */,
13958    ///     ]);
13959    /// ```
13960    pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
13961    where
13962        T: std::iter::IntoIterator<Item = V>,
13963        V: std::convert::Into<crate::model::Job>,
13964    {
13965        use std::iter::Iterator;
13966        self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13967        self
13968    }
13969
13970    /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
13971    ///
13972    /// # Example
13973    /// ```ignore,no_run
13974    /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13975    /// use google_cloud_deploy_v1::model::Job;
13976    /// let x = ChildRolloutJobs::new()
13977    ///     .set_advance_rollout_jobs([
13978    ///         Job::default()/* use setters */,
13979    ///         Job::default()/* use (different) setters */,
13980    ///     ]);
13981    /// ```
13982    pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
13983    where
13984        T: std::iter::IntoIterator<Item = V>,
13985        V: std::convert::Into<crate::model::Job>,
13986    {
13987        use std::iter::Iterator;
13988        self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13989        self
13990    }
13991}
13992
13993impl wkt::message::Message for ChildRolloutJobs {
13994    fn typename() -> &'static str {
13995        "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
13996    }
13997}
13998
13999/// Job represents an operation for a `Rollout`.
14000#[derive(Clone, Default, PartialEq)]
14001#[non_exhaustive]
14002pub struct Job {
14003    /// Output only. The ID of the Job.
14004    pub id: std::string::String,
14005
14006    /// Output only. The current state of the Job.
14007    pub state: crate::model::job::State,
14008
14009    /// Output only. Additional information on why the Job was skipped, if
14010    /// available.
14011    pub skip_message: std::string::String,
14012
14013    /// Output only. The name of the `JobRun` responsible for the most recent
14014    /// invocation of this Job.
14015    pub job_run: std::string::String,
14016
14017    /// The type of Job.
14018    pub job_type: std::option::Option<crate::model::job::JobType>,
14019
14020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14021}
14022
14023impl Job {
14024    /// Creates a new default instance.
14025    pub fn new() -> Self {
14026        std::default::Default::default()
14027    }
14028
14029    /// Sets the value of [id][crate::model::Job::id].
14030    ///
14031    /// # Example
14032    /// ```ignore,no_run
14033    /// # use google_cloud_deploy_v1::model::Job;
14034    /// let x = Job::new().set_id("example");
14035    /// ```
14036    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14037        self.id = v.into();
14038        self
14039    }
14040
14041    /// Sets the value of [state][crate::model::Job::state].
14042    ///
14043    /// # Example
14044    /// ```ignore,no_run
14045    /// # use google_cloud_deploy_v1::model::Job;
14046    /// use google_cloud_deploy_v1::model::job::State;
14047    /// let x0 = Job::new().set_state(State::Pending);
14048    /// let x1 = Job::new().set_state(State::Disabled);
14049    /// let x2 = Job::new().set_state(State::InProgress);
14050    /// ```
14051    pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
14052        self.state = v.into();
14053        self
14054    }
14055
14056    /// Sets the value of [skip_message][crate::model::Job::skip_message].
14057    ///
14058    /// # Example
14059    /// ```ignore,no_run
14060    /// # use google_cloud_deploy_v1::model::Job;
14061    /// let x = Job::new().set_skip_message("example");
14062    /// ```
14063    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14064        self.skip_message = v.into();
14065        self
14066    }
14067
14068    /// Sets the value of [job_run][crate::model::Job::job_run].
14069    ///
14070    /// # Example
14071    /// ```ignore,no_run
14072    /// # use google_cloud_deploy_v1::model::Job;
14073    /// let x = Job::new().set_job_run("example");
14074    /// ```
14075    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14076        self.job_run = v.into();
14077        self
14078    }
14079
14080    /// Sets the value of [job_type][crate::model::Job::job_type].
14081    ///
14082    /// Note that all the setters affecting `job_type` are mutually
14083    /// exclusive.
14084    ///
14085    /// # Example
14086    /// ```ignore,no_run
14087    /// # use google_cloud_deploy_v1::model::Job;
14088    /// use google_cloud_deploy_v1::model::DeployJob;
14089    /// let x = Job::new().set_job_type(Some(
14090    ///     google_cloud_deploy_v1::model::job::JobType::DeployJob(DeployJob::default().into())));
14091    /// ```
14092    pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
14093        mut self,
14094        v: T,
14095    ) -> Self {
14096        self.job_type = v.into();
14097        self
14098    }
14099
14100    /// The value of [job_type][crate::model::Job::job_type]
14101    /// if it holds a `DeployJob`, `None` if the field is not set or
14102    /// holds a different branch.
14103    pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
14104        #[allow(unreachable_patterns)]
14105        self.job_type.as_ref().and_then(|v| match v {
14106            crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
14107            _ => std::option::Option::None,
14108        })
14109    }
14110
14111    /// Sets the value of [job_type][crate::model::Job::job_type]
14112    /// to hold a `DeployJob`.
14113    ///
14114    /// Note that all the setters affecting `job_type` are
14115    /// mutually exclusive.
14116    ///
14117    /// # Example
14118    /// ```ignore,no_run
14119    /// # use google_cloud_deploy_v1::model::Job;
14120    /// use google_cloud_deploy_v1::model::DeployJob;
14121    /// let x = Job::new().set_deploy_job(DeployJob::default()/* use setters */);
14122    /// assert!(x.deploy_job().is_some());
14123    /// assert!(x.verify_job().is_none());
14124    /// assert!(x.predeploy_job().is_none());
14125    /// assert!(x.postdeploy_job().is_none());
14126    /// assert!(x.create_child_rollout_job().is_none());
14127    /// assert!(x.advance_child_rollout_job().is_none());
14128    /// ```
14129    pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
14130        mut self,
14131        v: T,
14132    ) -> Self {
14133        self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
14134        self
14135    }
14136
14137    /// The value of [job_type][crate::model::Job::job_type]
14138    /// if it holds a `VerifyJob`, `None` if the field is not set or
14139    /// holds a different branch.
14140    pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
14141        #[allow(unreachable_patterns)]
14142        self.job_type.as_ref().and_then(|v| match v {
14143            crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
14144            _ => std::option::Option::None,
14145        })
14146    }
14147
14148    /// Sets the value of [job_type][crate::model::Job::job_type]
14149    /// to hold a `VerifyJob`.
14150    ///
14151    /// Note that all the setters affecting `job_type` are
14152    /// mutually exclusive.
14153    ///
14154    /// # Example
14155    /// ```ignore,no_run
14156    /// # use google_cloud_deploy_v1::model::Job;
14157    /// use google_cloud_deploy_v1::model::VerifyJob;
14158    /// let x = Job::new().set_verify_job(VerifyJob::default()/* use setters */);
14159    /// assert!(x.verify_job().is_some());
14160    /// assert!(x.deploy_job().is_none());
14161    /// assert!(x.predeploy_job().is_none());
14162    /// assert!(x.postdeploy_job().is_none());
14163    /// assert!(x.create_child_rollout_job().is_none());
14164    /// assert!(x.advance_child_rollout_job().is_none());
14165    /// ```
14166    pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
14167        mut self,
14168        v: T,
14169    ) -> Self {
14170        self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
14171        self
14172    }
14173
14174    /// The value of [job_type][crate::model::Job::job_type]
14175    /// if it holds a `PredeployJob`, `None` if the field is not set or
14176    /// holds a different branch.
14177    pub fn predeploy_job(
14178        &self,
14179    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
14180        #[allow(unreachable_patterns)]
14181        self.job_type.as_ref().and_then(|v| match v {
14182            crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
14183            _ => std::option::Option::None,
14184        })
14185    }
14186
14187    /// Sets the value of [job_type][crate::model::Job::job_type]
14188    /// to hold a `PredeployJob`.
14189    ///
14190    /// Note that all the setters affecting `job_type` are
14191    /// mutually exclusive.
14192    ///
14193    /// # Example
14194    /// ```ignore,no_run
14195    /// # use google_cloud_deploy_v1::model::Job;
14196    /// use google_cloud_deploy_v1::model::PredeployJob;
14197    /// let x = Job::new().set_predeploy_job(PredeployJob::default()/* use setters */);
14198    /// assert!(x.predeploy_job().is_some());
14199    /// assert!(x.deploy_job().is_none());
14200    /// assert!(x.verify_job().is_none());
14201    /// assert!(x.postdeploy_job().is_none());
14202    /// assert!(x.create_child_rollout_job().is_none());
14203    /// assert!(x.advance_child_rollout_job().is_none());
14204    /// ```
14205    pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
14206        mut self,
14207        v: T,
14208    ) -> Self {
14209        self.job_type =
14210            std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
14211        self
14212    }
14213
14214    /// The value of [job_type][crate::model::Job::job_type]
14215    /// if it holds a `PostdeployJob`, `None` if the field is not set or
14216    /// holds a different branch.
14217    pub fn postdeploy_job(
14218        &self,
14219    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
14220        #[allow(unreachable_patterns)]
14221        self.job_type.as_ref().and_then(|v| match v {
14222            crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
14223            _ => std::option::Option::None,
14224        })
14225    }
14226
14227    /// Sets the value of [job_type][crate::model::Job::job_type]
14228    /// to hold a `PostdeployJob`.
14229    ///
14230    /// Note that all the setters affecting `job_type` are
14231    /// mutually exclusive.
14232    ///
14233    /// # Example
14234    /// ```ignore,no_run
14235    /// # use google_cloud_deploy_v1::model::Job;
14236    /// use google_cloud_deploy_v1::model::PostdeployJob;
14237    /// let x = Job::new().set_postdeploy_job(PostdeployJob::default()/* use setters */);
14238    /// assert!(x.postdeploy_job().is_some());
14239    /// assert!(x.deploy_job().is_none());
14240    /// assert!(x.verify_job().is_none());
14241    /// assert!(x.predeploy_job().is_none());
14242    /// assert!(x.create_child_rollout_job().is_none());
14243    /// assert!(x.advance_child_rollout_job().is_none());
14244    /// ```
14245    pub fn set_postdeploy_job<
14246        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
14247    >(
14248        mut self,
14249        v: T,
14250    ) -> Self {
14251        self.job_type =
14252            std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
14253        self
14254    }
14255
14256    /// The value of [job_type][crate::model::Job::job_type]
14257    /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
14258    /// holds a different branch.
14259    pub fn create_child_rollout_job(
14260        &self,
14261    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
14262        #[allow(unreachable_patterns)]
14263        self.job_type.as_ref().and_then(|v| match v {
14264            crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
14265            _ => std::option::Option::None,
14266        })
14267    }
14268
14269    /// Sets the value of [job_type][crate::model::Job::job_type]
14270    /// to hold a `CreateChildRolloutJob`.
14271    ///
14272    /// Note that all the setters affecting `job_type` are
14273    /// mutually exclusive.
14274    ///
14275    /// # Example
14276    /// ```ignore,no_run
14277    /// # use google_cloud_deploy_v1::model::Job;
14278    /// use google_cloud_deploy_v1::model::CreateChildRolloutJob;
14279    /// let x = Job::new().set_create_child_rollout_job(CreateChildRolloutJob::default()/* use setters */);
14280    /// assert!(x.create_child_rollout_job().is_some());
14281    /// assert!(x.deploy_job().is_none());
14282    /// assert!(x.verify_job().is_none());
14283    /// assert!(x.predeploy_job().is_none());
14284    /// assert!(x.postdeploy_job().is_none());
14285    /// assert!(x.advance_child_rollout_job().is_none());
14286    /// ```
14287    pub fn set_create_child_rollout_job<
14288        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
14289    >(
14290        mut self,
14291        v: T,
14292    ) -> Self {
14293        self.job_type =
14294            std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
14295        self
14296    }
14297
14298    /// The value of [job_type][crate::model::Job::job_type]
14299    /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
14300    /// holds a different branch.
14301    pub fn advance_child_rollout_job(
14302        &self,
14303    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
14304        #[allow(unreachable_patterns)]
14305        self.job_type.as_ref().and_then(|v| match v {
14306            crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
14307            _ => std::option::Option::None,
14308        })
14309    }
14310
14311    /// Sets the value of [job_type][crate::model::Job::job_type]
14312    /// to hold a `AdvanceChildRolloutJob`.
14313    ///
14314    /// Note that all the setters affecting `job_type` are
14315    /// mutually exclusive.
14316    ///
14317    /// # Example
14318    /// ```ignore,no_run
14319    /// # use google_cloud_deploy_v1::model::Job;
14320    /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJob;
14321    /// let x = Job::new().set_advance_child_rollout_job(AdvanceChildRolloutJob::default()/* use setters */);
14322    /// assert!(x.advance_child_rollout_job().is_some());
14323    /// assert!(x.deploy_job().is_none());
14324    /// assert!(x.verify_job().is_none());
14325    /// assert!(x.predeploy_job().is_none());
14326    /// assert!(x.postdeploy_job().is_none());
14327    /// assert!(x.create_child_rollout_job().is_none());
14328    /// ```
14329    pub fn set_advance_child_rollout_job<
14330        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
14331    >(
14332        mut self,
14333        v: T,
14334    ) -> Self {
14335        self.job_type =
14336            std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
14337        self
14338    }
14339}
14340
14341impl wkt::message::Message for Job {
14342    fn typename() -> &'static str {
14343        "type.googleapis.com/google.cloud.deploy.v1.Job"
14344    }
14345}
14346
14347/// Defines additional types related to [Job].
14348pub mod job {
14349    #[allow(unused_imports)]
14350    use super::*;
14351
14352    /// Valid states of a Job.
14353    ///
14354    /// # Working with unknown values
14355    ///
14356    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14357    /// additional enum variants at any time. Adding new variants is not considered
14358    /// a breaking change. Applications should write their code in anticipation of:
14359    ///
14360    /// - New values appearing in future releases of the client library, **and**
14361    /// - New values received dynamically, without application changes.
14362    ///
14363    /// Please consult the [Working with enums] section in the user guide for some
14364    /// guidelines.
14365    ///
14366    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14367    #[derive(Clone, Debug, PartialEq)]
14368    #[non_exhaustive]
14369    pub enum State {
14370        /// The Job has an unspecified state.
14371        Unspecified,
14372        /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
14373        Pending,
14374        /// The Job is disabled.
14375        Disabled,
14376        /// The Job is in progress.
14377        InProgress,
14378        /// The Job succeeded.
14379        Succeeded,
14380        /// The Job failed.
14381        Failed,
14382        /// The Job was aborted.
14383        Aborted,
14384        /// The Job was skipped.
14385        Skipped,
14386        /// The Job was ignored.
14387        Ignored,
14388        /// If set, the enum was initialized with an unknown value.
14389        ///
14390        /// Applications can examine the value using [State::value] or
14391        /// [State::name].
14392        UnknownValue(state::UnknownValue),
14393    }
14394
14395    #[doc(hidden)]
14396    pub mod state {
14397        #[allow(unused_imports)]
14398        use super::*;
14399        #[derive(Clone, Debug, PartialEq)]
14400        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14401    }
14402
14403    impl State {
14404        /// Gets the enum value.
14405        ///
14406        /// Returns `None` if the enum contains an unknown value deserialized from
14407        /// the string representation of enums.
14408        pub fn value(&self) -> std::option::Option<i32> {
14409            match self {
14410                Self::Unspecified => std::option::Option::Some(0),
14411                Self::Pending => std::option::Option::Some(1),
14412                Self::Disabled => std::option::Option::Some(2),
14413                Self::InProgress => std::option::Option::Some(3),
14414                Self::Succeeded => std::option::Option::Some(4),
14415                Self::Failed => std::option::Option::Some(5),
14416                Self::Aborted => std::option::Option::Some(6),
14417                Self::Skipped => std::option::Option::Some(7),
14418                Self::Ignored => std::option::Option::Some(8),
14419                Self::UnknownValue(u) => u.0.value(),
14420            }
14421        }
14422
14423        /// Gets the enum value as a string.
14424        ///
14425        /// Returns `None` if the enum contains an unknown value deserialized from
14426        /// the integer representation of enums.
14427        pub fn name(&self) -> std::option::Option<&str> {
14428            match self {
14429                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14430                Self::Pending => std::option::Option::Some("PENDING"),
14431                Self::Disabled => std::option::Option::Some("DISABLED"),
14432                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
14433                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14434                Self::Failed => std::option::Option::Some("FAILED"),
14435                Self::Aborted => std::option::Option::Some("ABORTED"),
14436                Self::Skipped => std::option::Option::Some("SKIPPED"),
14437                Self::Ignored => std::option::Option::Some("IGNORED"),
14438                Self::UnknownValue(u) => u.0.name(),
14439            }
14440        }
14441    }
14442
14443    impl std::default::Default for State {
14444        fn default() -> Self {
14445            use std::convert::From;
14446            Self::from(0)
14447        }
14448    }
14449
14450    impl std::fmt::Display for State {
14451        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14452            wkt::internal::display_enum(f, self.name(), self.value())
14453        }
14454    }
14455
14456    impl std::convert::From<i32> for State {
14457        fn from(value: i32) -> Self {
14458            match value {
14459                0 => Self::Unspecified,
14460                1 => Self::Pending,
14461                2 => Self::Disabled,
14462                3 => Self::InProgress,
14463                4 => Self::Succeeded,
14464                5 => Self::Failed,
14465                6 => Self::Aborted,
14466                7 => Self::Skipped,
14467                8 => Self::Ignored,
14468                _ => Self::UnknownValue(state::UnknownValue(
14469                    wkt::internal::UnknownEnumValue::Integer(value),
14470                )),
14471            }
14472        }
14473    }
14474
14475    impl std::convert::From<&str> for State {
14476        fn from(value: &str) -> Self {
14477            use std::string::ToString;
14478            match value {
14479                "STATE_UNSPECIFIED" => Self::Unspecified,
14480                "PENDING" => Self::Pending,
14481                "DISABLED" => Self::Disabled,
14482                "IN_PROGRESS" => Self::InProgress,
14483                "SUCCEEDED" => Self::Succeeded,
14484                "FAILED" => Self::Failed,
14485                "ABORTED" => Self::Aborted,
14486                "SKIPPED" => Self::Skipped,
14487                "IGNORED" => Self::Ignored,
14488                _ => Self::UnknownValue(state::UnknownValue(
14489                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14490                )),
14491            }
14492        }
14493    }
14494
14495    impl serde::ser::Serialize for State {
14496        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14497        where
14498            S: serde::Serializer,
14499        {
14500            match self {
14501                Self::Unspecified => serializer.serialize_i32(0),
14502                Self::Pending => serializer.serialize_i32(1),
14503                Self::Disabled => serializer.serialize_i32(2),
14504                Self::InProgress => serializer.serialize_i32(3),
14505                Self::Succeeded => serializer.serialize_i32(4),
14506                Self::Failed => serializer.serialize_i32(5),
14507                Self::Aborted => serializer.serialize_i32(6),
14508                Self::Skipped => serializer.serialize_i32(7),
14509                Self::Ignored => serializer.serialize_i32(8),
14510                Self::UnknownValue(u) => u.0.serialize(serializer),
14511            }
14512        }
14513    }
14514
14515    impl<'de> serde::de::Deserialize<'de> for State {
14516        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14517        where
14518            D: serde::Deserializer<'de>,
14519        {
14520            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14521                ".google.cloud.deploy.v1.Job.State",
14522            ))
14523        }
14524    }
14525
14526    /// The type of Job.
14527    #[derive(Clone, Debug, PartialEq)]
14528    #[non_exhaustive]
14529    pub enum JobType {
14530        /// Output only. A deploy Job.
14531        DeployJob(std::boxed::Box<crate::model::DeployJob>),
14532        /// Output only. A verify Job.
14533        VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
14534        /// Output only. A predeploy Job.
14535        PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
14536        /// Output only. A postdeploy Job.
14537        PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
14538        /// Output only. A createChildRollout Job.
14539        CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
14540        /// Output only. An advanceChildRollout Job.
14541        AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
14542    }
14543}
14544
14545/// A deploy Job.
14546#[derive(Clone, Default, PartialEq)]
14547#[non_exhaustive]
14548pub struct DeployJob {
14549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14550}
14551
14552impl DeployJob {
14553    /// Creates a new default instance.
14554    pub fn new() -> Self {
14555        std::default::Default::default()
14556    }
14557}
14558
14559impl wkt::message::Message for DeployJob {
14560    fn typename() -> &'static str {
14561        "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
14562    }
14563}
14564
14565/// A verify Job.
14566#[derive(Clone, Default, PartialEq)]
14567#[non_exhaustive]
14568pub struct VerifyJob {
14569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14570}
14571
14572impl VerifyJob {
14573    /// Creates a new default instance.
14574    pub fn new() -> Self {
14575        std::default::Default::default()
14576    }
14577}
14578
14579impl wkt::message::Message for VerifyJob {
14580    fn typename() -> &'static str {
14581        "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
14582    }
14583}
14584
14585/// A predeploy Job.
14586#[derive(Clone, Default, PartialEq)]
14587#[non_exhaustive]
14588pub struct PredeployJob {
14589    /// Output only. The custom actions that the predeploy Job executes.
14590    pub actions: std::vec::Vec<std::string::String>,
14591
14592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14593}
14594
14595impl PredeployJob {
14596    /// Creates a new default instance.
14597    pub fn new() -> Self {
14598        std::default::Default::default()
14599    }
14600
14601    /// Sets the value of [actions][crate::model::PredeployJob::actions].
14602    ///
14603    /// # Example
14604    /// ```ignore,no_run
14605    /// # use google_cloud_deploy_v1::model::PredeployJob;
14606    /// let x = PredeployJob::new().set_actions(["a", "b", "c"]);
14607    /// ```
14608    pub fn set_actions<T, V>(mut self, v: T) -> Self
14609    where
14610        T: std::iter::IntoIterator<Item = V>,
14611        V: std::convert::Into<std::string::String>,
14612    {
14613        use std::iter::Iterator;
14614        self.actions = v.into_iter().map(|i| i.into()).collect();
14615        self
14616    }
14617}
14618
14619impl wkt::message::Message for PredeployJob {
14620    fn typename() -> &'static str {
14621        "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
14622    }
14623}
14624
14625/// A postdeploy Job.
14626#[derive(Clone, Default, PartialEq)]
14627#[non_exhaustive]
14628pub struct PostdeployJob {
14629    /// Output only. The custom actions that the postdeploy Job executes.
14630    pub actions: std::vec::Vec<std::string::String>,
14631
14632    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14633}
14634
14635impl PostdeployJob {
14636    /// Creates a new default instance.
14637    pub fn new() -> Self {
14638        std::default::Default::default()
14639    }
14640
14641    /// Sets the value of [actions][crate::model::PostdeployJob::actions].
14642    ///
14643    /// # Example
14644    /// ```ignore,no_run
14645    /// # use google_cloud_deploy_v1::model::PostdeployJob;
14646    /// let x = PostdeployJob::new().set_actions(["a", "b", "c"]);
14647    /// ```
14648    pub fn set_actions<T, V>(mut self, v: T) -> Self
14649    where
14650        T: std::iter::IntoIterator<Item = V>,
14651        V: std::convert::Into<std::string::String>,
14652    {
14653        use std::iter::Iterator;
14654        self.actions = v.into_iter().map(|i| i.into()).collect();
14655        self
14656    }
14657}
14658
14659impl wkt::message::Message for PostdeployJob {
14660    fn typename() -> &'static str {
14661        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
14662    }
14663}
14664
14665/// A createChildRollout Job.
14666#[derive(Clone, Default, PartialEq)]
14667#[non_exhaustive]
14668pub struct CreateChildRolloutJob {
14669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14670}
14671
14672impl CreateChildRolloutJob {
14673    /// Creates a new default instance.
14674    pub fn new() -> Self {
14675        std::default::Default::default()
14676    }
14677}
14678
14679impl wkt::message::Message for CreateChildRolloutJob {
14680    fn typename() -> &'static str {
14681        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
14682    }
14683}
14684
14685/// An advanceChildRollout Job.
14686#[derive(Clone, Default, PartialEq)]
14687#[non_exhaustive]
14688pub struct AdvanceChildRolloutJob {
14689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14690}
14691
14692impl AdvanceChildRolloutJob {
14693    /// Creates a new default instance.
14694    pub fn new() -> Self {
14695        std::default::Default::default()
14696    }
14697}
14698
14699impl wkt::message::Message for AdvanceChildRolloutJob {
14700    fn typename() -> &'static str {
14701        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
14702    }
14703}
14704
14705/// ListRolloutsRequest is the request object used by `ListRollouts`.
14706#[derive(Clone, Default, PartialEq)]
14707#[non_exhaustive]
14708pub struct ListRolloutsRequest {
14709    /// Required. The `Release` which owns this collection of `Rollout` objects.
14710    pub parent: std::string::String,
14711
14712    /// Optional. The maximum number of `Rollout` objects to return. The service
14713    /// may return fewer than this value. If unspecified, at most 50 `Rollout`
14714    /// objects will be returned. The maximum value is 1000; values above 1000 will
14715    /// be set to 1000.
14716    pub page_size: i32,
14717
14718    /// Optional. A page token, received from a previous `ListRollouts` call.
14719    /// Provide this to retrieve the subsequent page.
14720    ///
14721    /// When paginating, all other provided parameters match
14722    /// the call that provided the page token.
14723    pub page_token: std::string::String,
14724
14725    /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
14726    /// for more details.
14727    pub filter: std::string::String,
14728
14729    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
14730    /// more details.
14731    pub order_by: std::string::String,
14732
14733    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14734}
14735
14736impl ListRolloutsRequest {
14737    /// Creates a new default instance.
14738    pub fn new() -> Self {
14739        std::default::Default::default()
14740    }
14741
14742    /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
14743    ///
14744    /// # Example
14745    /// ```ignore,no_run
14746    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14747    /// let x = ListRolloutsRequest::new().set_parent("example");
14748    /// ```
14749    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14750        self.parent = v.into();
14751        self
14752    }
14753
14754    /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
14755    ///
14756    /// # Example
14757    /// ```ignore,no_run
14758    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14759    /// let x = ListRolloutsRequest::new().set_page_size(42);
14760    /// ```
14761    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14762        self.page_size = v.into();
14763        self
14764    }
14765
14766    /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
14767    ///
14768    /// # Example
14769    /// ```ignore,no_run
14770    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14771    /// let x = ListRolloutsRequest::new().set_page_token("example");
14772    /// ```
14773    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14774        self.page_token = v.into();
14775        self
14776    }
14777
14778    /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
14779    ///
14780    /// # Example
14781    /// ```ignore,no_run
14782    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14783    /// let x = ListRolloutsRequest::new().set_filter("example");
14784    /// ```
14785    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14786        self.filter = v.into();
14787        self
14788    }
14789
14790    /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
14791    ///
14792    /// # Example
14793    /// ```ignore,no_run
14794    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14795    /// let x = ListRolloutsRequest::new().set_order_by("example");
14796    /// ```
14797    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14798        self.order_by = v.into();
14799        self
14800    }
14801}
14802
14803impl wkt::message::Message for ListRolloutsRequest {
14804    fn typename() -> &'static str {
14805        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
14806    }
14807}
14808
14809/// ListRolloutsResponse is the response object returned by `ListRollouts`.
14810#[derive(Clone, Default, PartialEq)]
14811#[non_exhaustive]
14812pub struct ListRolloutsResponse {
14813    /// The `Rollout` objects.
14814    pub rollouts: std::vec::Vec<crate::model::Rollout>,
14815
14816    /// A token, which can be sent as `page_token` to retrieve the next page.
14817    /// If this field is omitted, there are no subsequent pages.
14818    pub next_page_token: std::string::String,
14819
14820    /// Locations that could not be reached.
14821    pub unreachable: std::vec::Vec<std::string::String>,
14822
14823    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14824}
14825
14826impl ListRolloutsResponse {
14827    /// Creates a new default instance.
14828    pub fn new() -> Self {
14829        std::default::Default::default()
14830    }
14831
14832    /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
14833    ///
14834    /// # Example
14835    /// ```ignore,no_run
14836    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14837    /// use google_cloud_deploy_v1::model::Rollout;
14838    /// let x = ListRolloutsResponse::new()
14839    ///     .set_rollouts([
14840    ///         Rollout::default()/* use setters */,
14841    ///         Rollout::default()/* use (different) setters */,
14842    ///     ]);
14843    /// ```
14844    pub fn set_rollouts<T, V>(mut self, v: T) -> Self
14845    where
14846        T: std::iter::IntoIterator<Item = V>,
14847        V: std::convert::Into<crate::model::Rollout>,
14848    {
14849        use std::iter::Iterator;
14850        self.rollouts = v.into_iter().map(|i| i.into()).collect();
14851        self
14852    }
14853
14854    /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
14855    ///
14856    /// # Example
14857    /// ```ignore,no_run
14858    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14859    /// let x = ListRolloutsResponse::new().set_next_page_token("example");
14860    /// ```
14861    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14862        self.next_page_token = v.into();
14863        self
14864    }
14865
14866    /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
14867    ///
14868    /// # Example
14869    /// ```ignore,no_run
14870    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14871    /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
14872    /// ```
14873    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14874    where
14875        T: std::iter::IntoIterator<Item = V>,
14876        V: std::convert::Into<std::string::String>,
14877    {
14878        use std::iter::Iterator;
14879        self.unreachable = v.into_iter().map(|i| i.into()).collect();
14880        self
14881    }
14882}
14883
14884impl wkt::message::Message for ListRolloutsResponse {
14885    fn typename() -> &'static str {
14886        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
14887    }
14888}
14889
14890#[doc(hidden)]
14891impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
14892    type PageItem = crate::model::Rollout;
14893
14894    fn items(self) -> std::vec::Vec<Self::PageItem> {
14895        self.rollouts
14896    }
14897
14898    fn next_page_token(&self) -> std::string::String {
14899        use std::clone::Clone;
14900        self.next_page_token.clone()
14901    }
14902}
14903
14904/// GetRolloutRequest is the request object used by `GetRollout`.
14905#[derive(Clone, Default, PartialEq)]
14906#[non_exhaustive]
14907pub struct GetRolloutRequest {
14908    /// Required. Name of the `Rollout`. Format must be
14909    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
14910    pub name: std::string::String,
14911
14912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14913}
14914
14915impl GetRolloutRequest {
14916    /// Creates a new default instance.
14917    pub fn new() -> Self {
14918        std::default::Default::default()
14919    }
14920
14921    /// Sets the value of [name][crate::model::GetRolloutRequest::name].
14922    ///
14923    /// # Example
14924    /// ```ignore,no_run
14925    /// # use google_cloud_deploy_v1::model::GetRolloutRequest;
14926    /// let x = GetRolloutRequest::new().set_name("example");
14927    /// ```
14928    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14929        self.name = v.into();
14930        self
14931    }
14932}
14933
14934impl wkt::message::Message for GetRolloutRequest {
14935    fn typename() -> &'static str {
14936        "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
14937    }
14938}
14939
14940/// CreateRolloutRequest is the request object used by `CreateRollout`.
14941#[derive(Clone, Default, PartialEq)]
14942#[non_exhaustive]
14943pub struct CreateRolloutRequest {
14944    /// Required. The parent collection in which the `Rollout` must be created.
14945    /// The format is
14946    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
14947    pub parent: std::string::String,
14948
14949    /// Required. ID of the `Rollout`.
14950    pub rollout_id: std::string::String,
14951
14952    /// Required. The `Rollout` to create.
14953    pub rollout: std::option::Option<crate::model::Rollout>,
14954
14955    /// Optional. A request ID to identify requests. Specify a unique request ID
14956    /// so that if you must retry your request, the server knows to ignore the
14957    /// request if it has already been completed. The server guarantees that for
14958    /// at least 60 minutes after the first request.
14959    ///
14960    /// For example, consider a situation where you make an initial request and the
14961    /// request times out. If you make the request again with the same request ID,
14962    /// the server can check if original operation with the same request ID was
14963    /// received, and if so, will ignore the second request. This prevents clients
14964    /// from accidentally creating duplicate commitments.
14965    ///
14966    /// The request ID must be a valid UUID with the exception that zero UUID is
14967    /// not supported (00000000-0000-0000-0000-000000000000).
14968    pub request_id: std::string::String,
14969
14970    /// Optional. If set to true, the request is validated and the user is provided
14971    /// with an expected result, but no actual change is made.
14972    pub validate_only: bool,
14973
14974    /// Optional. Deploy policies to override. Format is
14975    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
14976    pub override_deploy_policy: std::vec::Vec<std::string::String>,
14977
14978    /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
14979    /// will start at the first phase.
14980    pub starting_phase_id: std::string::String,
14981
14982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14983}
14984
14985impl CreateRolloutRequest {
14986    /// Creates a new default instance.
14987    pub fn new() -> Self {
14988        std::default::Default::default()
14989    }
14990
14991    /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
14992    ///
14993    /// # Example
14994    /// ```ignore,no_run
14995    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14996    /// let x = CreateRolloutRequest::new().set_parent("example");
14997    /// ```
14998    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14999        self.parent = v.into();
15000        self
15001    }
15002
15003    /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
15004    ///
15005    /// # Example
15006    /// ```ignore,no_run
15007    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15008    /// let x = CreateRolloutRequest::new().set_rollout_id("example");
15009    /// ```
15010    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15011        self.rollout_id = v.into();
15012        self
15013    }
15014
15015    /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
15016    ///
15017    /// # Example
15018    /// ```ignore,no_run
15019    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15020    /// use google_cloud_deploy_v1::model::Rollout;
15021    /// let x = CreateRolloutRequest::new().set_rollout(Rollout::default()/* use setters */);
15022    /// ```
15023    pub fn set_rollout<T>(mut self, v: T) -> Self
15024    where
15025        T: std::convert::Into<crate::model::Rollout>,
15026    {
15027        self.rollout = std::option::Option::Some(v.into());
15028        self
15029    }
15030
15031    /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
15032    ///
15033    /// # Example
15034    /// ```ignore,no_run
15035    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15036    /// use google_cloud_deploy_v1::model::Rollout;
15037    /// let x = CreateRolloutRequest::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
15038    /// let x = CreateRolloutRequest::new().set_or_clear_rollout(None::<Rollout>);
15039    /// ```
15040    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
15041    where
15042        T: std::convert::Into<crate::model::Rollout>,
15043    {
15044        self.rollout = v.map(|x| x.into());
15045        self
15046    }
15047
15048    /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
15049    ///
15050    /// # Example
15051    /// ```ignore,no_run
15052    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15053    /// let x = CreateRolloutRequest::new().set_request_id("example");
15054    /// ```
15055    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15056        self.request_id = v.into();
15057        self
15058    }
15059
15060    /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
15061    ///
15062    /// # Example
15063    /// ```ignore,no_run
15064    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15065    /// let x = CreateRolloutRequest::new().set_validate_only(true);
15066    /// ```
15067    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15068        self.validate_only = v.into();
15069        self
15070    }
15071
15072    /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
15073    ///
15074    /// # Example
15075    /// ```ignore,no_run
15076    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15077    /// let x = CreateRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15078    /// ```
15079    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15080    where
15081        T: std::iter::IntoIterator<Item = V>,
15082        V: std::convert::Into<std::string::String>,
15083    {
15084        use std::iter::Iterator;
15085        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15086        self
15087    }
15088
15089    /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
15090    ///
15091    /// # Example
15092    /// ```ignore,no_run
15093    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15094    /// let x = CreateRolloutRequest::new().set_starting_phase_id("example");
15095    /// ```
15096    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
15097        mut self,
15098        v: T,
15099    ) -> Self {
15100        self.starting_phase_id = v.into();
15101        self
15102    }
15103}
15104
15105impl wkt::message::Message for CreateRolloutRequest {
15106    fn typename() -> &'static str {
15107        "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
15108    }
15109}
15110
15111/// Represents the metadata of the long-running operation.
15112#[derive(Clone, Default, PartialEq)]
15113#[non_exhaustive]
15114pub struct OperationMetadata {
15115    /// Output only. The time the operation was created.
15116    pub create_time: std::option::Option<wkt::Timestamp>,
15117
15118    /// Output only. The time the operation finished running.
15119    pub end_time: std::option::Option<wkt::Timestamp>,
15120
15121    /// Output only. Server-defined resource path for the target of the operation.
15122    pub target: std::string::String,
15123
15124    /// Output only. Name of the verb executed by the operation.
15125    pub verb: std::string::String,
15126
15127    /// Output only. Human-readable status of the operation, if any.
15128    pub status_message: std::string::String,
15129
15130    /// Output only. Identifies whether the user has requested cancellation
15131    /// of the operation. Operations that have successfully been cancelled
15132    /// have
15133    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
15134    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
15135    /// corresponding to `Code.CANCELLED`.
15136    ///
15137    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
15138    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
15139    pub requested_cancellation: bool,
15140
15141    /// Output only. API version used to start the operation.
15142    pub api_version: std::string::String,
15143
15144    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15145}
15146
15147impl OperationMetadata {
15148    /// Creates a new default instance.
15149    pub fn new() -> Self {
15150        std::default::Default::default()
15151    }
15152
15153    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
15154    ///
15155    /// # Example
15156    /// ```ignore,no_run
15157    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15158    /// use wkt::Timestamp;
15159    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15160    /// ```
15161    pub fn set_create_time<T>(mut self, v: T) -> Self
15162    where
15163        T: std::convert::Into<wkt::Timestamp>,
15164    {
15165        self.create_time = std::option::Option::Some(v.into());
15166        self
15167    }
15168
15169    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
15170    ///
15171    /// # Example
15172    /// ```ignore,no_run
15173    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15174    /// use wkt::Timestamp;
15175    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15176    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15177    /// ```
15178    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15179    where
15180        T: std::convert::Into<wkt::Timestamp>,
15181    {
15182        self.create_time = v.map(|x| x.into());
15183        self
15184    }
15185
15186    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
15187    ///
15188    /// # Example
15189    /// ```ignore,no_run
15190    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15191    /// use wkt::Timestamp;
15192    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15193    /// ```
15194    pub fn set_end_time<T>(mut self, v: T) -> Self
15195    where
15196        T: std::convert::Into<wkt::Timestamp>,
15197    {
15198        self.end_time = std::option::Option::Some(v.into());
15199        self
15200    }
15201
15202    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
15203    ///
15204    /// # Example
15205    /// ```ignore,no_run
15206    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15207    /// use wkt::Timestamp;
15208    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15209    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15210    /// ```
15211    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15212    where
15213        T: std::convert::Into<wkt::Timestamp>,
15214    {
15215        self.end_time = v.map(|x| x.into());
15216        self
15217    }
15218
15219    /// Sets the value of [target][crate::model::OperationMetadata::target].
15220    ///
15221    /// # Example
15222    /// ```ignore,no_run
15223    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15224    /// let x = OperationMetadata::new().set_target("example");
15225    /// ```
15226    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15227        self.target = v.into();
15228        self
15229    }
15230
15231    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
15232    ///
15233    /// # Example
15234    /// ```ignore,no_run
15235    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15236    /// let x = OperationMetadata::new().set_verb("example");
15237    /// ```
15238    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15239        self.verb = v.into();
15240        self
15241    }
15242
15243    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
15244    ///
15245    /// # Example
15246    /// ```ignore,no_run
15247    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15248    /// let x = OperationMetadata::new().set_status_message("example");
15249    /// ```
15250    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15251        self.status_message = v.into();
15252        self
15253    }
15254
15255    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
15256    ///
15257    /// # Example
15258    /// ```ignore,no_run
15259    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15260    /// let x = OperationMetadata::new().set_requested_cancellation(true);
15261    /// ```
15262    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15263        self.requested_cancellation = v.into();
15264        self
15265    }
15266
15267    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
15268    ///
15269    /// # Example
15270    /// ```ignore,no_run
15271    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15272    /// let x = OperationMetadata::new().set_api_version("example");
15273    /// ```
15274    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15275        self.api_version = v.into();
15276        self
15277    }
15278}
15279
15280impl wkt::message::Message for OperationMetadata {
15281    fn typename() -> &'static str {
15282        "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
15283    }
15284}
15285
15286/// The request object used by `ApproveRollout`.
15287#[derive(Clone, Default, PartialEq)]
15288#[non_exhaustive]
15289pub struct ApproveRolloutRequest {
15290    /// Required. Name of the Rollout. Format is
15291    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15292    pub name: std::string::String,
15293
15294    /// Required. True = approve; false = reject
15295    pub approved: bool,
15296
15297    /// Optional. Deploy policies to override. Format is
15298    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15299    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15300
15301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15302}
15303
15304impl ApproveRolloutRequest {
15305    /// Creates a new default instance.
15306    pub fn new() -> Self {
15307        std::default::Default::default()
15308    }
15309
15310    /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
15311    ///
15312    /// # Example
15313    /// ```ignore,no_run
15314    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15315    /// let x = ApproveRolloutRequest::new().set_name("example");
15316    /// ```
15317    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15318        self.name = v.into();
15319        self
15320    }
15321
15322    /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
15323    ///
15324    /// # Example
15325    /// ```ignore,no_run
15326    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15327    /// let x = ApproveRolloutRequest::new().set_approved(true);
15328    /// ```
15329    pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15330        self.approved = v.into();
15331        self
15332    }
15333
15334    /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
15335    ///
15336    /// # Example
15337    /// ```ignore,no_run
15338    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15339    /// let x = ApproveRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15340    /// ```
15341    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15342    where
15343        T: std::iter::IntoIterator<Item = V>,
15344        V: std::convert::Into<std::string::String>,
15345    {
15346        use std::iter::Iterator;
15347        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15348        self
15349    }
15350}
15351
15352impl wkt::message::Message for ApproveRolloutRequest {
15353    fn typename() -> &'static str {
15354        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
15355    }
15356}
15357
15358/// The response object from `ApproveRollout`.
15359#[derive(Clone, Default, PartialEq)]
15360#[non_exhaustive]
15361pub struct ApproveRolloutResponse {
15362    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15363}
15364
15365impl ApproveRolloutResponse {
15366    /// Creates a new default instance.
15367    pub fn new() -> Self {
15368        std::default::Default::default()
15369    }
15370}
15371
15372impl wkt::message::Message for ApproveRolloutResponse {
15373    fn typename() -> &'static str {
15374        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
15375    }
15376}
15377
15378/// The request object used by `AdvanceRollout`.
15379#[derive(Clone, Default, PartialEq)]
15380#[non_exhaustive]
15381pub struct AdvanceRolloutRequest {
15382    /// Required. Name of the Rollout. Format is
15383    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15384    pub name: std::string::String,
15385
15386    /// Required. The phase ID to advance the `Rollout` to.
15387    pub phase_id: std::string::String,
15388
15389    /// Optional. Deploy policies to override. Format is
15390    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15391    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15392
15393    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15394}
15395
15396impl AdvanceRolloutRequest {
15397    /// Creates a new default instance.
15398    pub fn new() -> Self {
15399        std::default::Default::default()
15400    }
15401
15402    /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
15403    ///
15404    /// # Example
15405    /// ```ignore,no_run
15406    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15407    /// let x = AdvanceRolloutRequest::new().set_name("example");
15408    /// ```
15409    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15410        self.name = v.into();
15411        self
15412    }
15413
15414    /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
15415    ///
15416    /// # Example
15417    /// ```ignore,no_run
15418    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15419    /// let x = AdvanceRolloutRequest::new().set_phase_id("example");
15420    /// ```
15421    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15422        self.phase_id = v.into();
15423        self
15424    }
15425
15426    /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
15427    ///
15428    /// # Example
15429    /// ```ignore,no_run
15430    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15431    /// let x = AdvanceRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15432    /// ```
15433    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15434    where
15435        T: std::iter::IntoIterator<Item = V>,
15436        V: std::convert::Into<std::string::String>,
15437    {
15438        use std::iter::Iterator;
15439        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15440        self
15441    }
15442}
15443
15444impl wkt::message::Message for AdvanceRolloutRequest {
15445    fn typename() -> &'static str {
15446        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
15447    }
15448}
15449
15450/// The response object from `AdvanceRollout`.
15451#[derive(Clone, Default, PartialEq)]
15452#[non_exhaustive]
15453pub struct AdvanceRolloutResponse {
15454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15455}
15456
15457impl AdvanceRolloutResponse {
15458    /// Creates a new default instance.
15459    pub fn new() -> Self {
15460        std::default::Default::default()
15461    }
15462}
15463
15464impl wkt::message::Message for AdvanceRolloutResponse {
15465    fn typename() -> &'static str {
15466        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
15467    }
15468}
15469
15470/// The request object used by `CancelRollout`.
15471#[derive(Clone, Default, PartialEq)]
15472#[non_exhaustive]
15473pub struct CancelRolloutRequest {
15474    /// Required. Name of the Rollout. Format is
15475    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15476    pub name: std::string::String,
15477
15478    /// Optional. Deploy policies to override. Format is
15479    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15480    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15481
15482    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15483}
15484
15485impl CancelRolloutRequest {
15486    /// Creates a new default instance.
15487    pub fn new() -> Self {
15488        std::default::Default::default()
15489    }
15490
15491    /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
15492    ///
15493    /// # Example
15494    /// ```ignore,no_run
15495    /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15496    /// let x = CancelRolloutRequest::new().set_name("example");
15497    /// ```
15498    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15499        self.name = v.into();
15500        self
15501    }
15502
15503    /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
15504    ///
15505    /// # Example
15506    /// ```ignore,no_run
15507    /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15508    /// let x = CancelRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15509    /// ```
15510    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15511    where
15512        T: std::iter::IntoIterator<Item = V>,
15513        V: std::convert::Into<std::string::String>,
15514    {
15515        use std::iter::Iterator;
15516        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15517        self
15518    }
15519}
15520
15521impl wkt::message::Message for CancelRolloutRequest {
15522    fn typename() -> &'static str {
15523        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
15524    }
15525}
15526
15527/// The response object from `CancelRollout`.
15528#[derive(Clone, Default, PartialEq)]
15529#[non_exhaustive]
15530pub struct CancelRolloutResponse {
15531    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15532}
15533
15534impl CancelRolloutResponse {
15535    /// Creates a new default instance.
15536    pub fn new() -> Self {
15537        std::default::Default::default()
15538    }
15539}
15540
15541impl wkt::message::Message for CancelRolloutResponse {
15542    fn typename() -> &'static str {
15543        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
15544    }
15545}
15546
15547/// The request object used by `IgnoreJob`.
15548#[derive(Clone, Default, PartialEq)]
15549#[non_exhaustive]
15550pub struct IgnoreJobRequest {
15551    /// Required. Name of the Rollout. Format is
15552    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15553    pub rollout: std::string::String,
15554
15555    /// Required. The phase ID the Job to ignore belongs to.
15556    pub phase_id: std::string::String,
15557
15558    /// Required. The job ID for the Job to ignore.
15559    pub job_id: std::string::String,
15560
15561    /// Optional. Deploy policies to override. Format is
15562    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15563    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15564
15565    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15566}
15567
15568impl IgnoreJobRequest {
15569    /// Creates a new default instance.
15570    pub fn new() -> Self {
15571        std::default::Default::default()
15572    }
15573
15574    /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
15575    ///
15576    /// # Example
15577    /// ```ignore,no_run
15578    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15579    /// let x = IgnoreJobRequest::new().set_rollout("example");
15580    /// ```
15581    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15582        self.rollout = v.into();
15583        self
15584    }
15585
15586    /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
15587    ///
15588    /// # Example
15589    /// ```ignore,no_run
15590    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15591    /// let x = IgnoreJobRequest::new().set_phase_id("example");
15592    /// ```
15593    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15594        self.phase_id = v.into();
15595        self
15596    }
15597
15598    /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
15599    ///
15600    /// # Example
15601    /// ```ignore,no_run
15602    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15603    /// let x = IgnoreJobRequest::new().set_job_id("example");
15604    /// ```
15605    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15606        self.job_id = v.into();
15607        self
15608    }
15609
15610    /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
15611    ///
15612    /// # Example
15613    /// ```ignore,no_run
15614    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15615    /// let x = IgnoreJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15616    /// ```
15617    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15618    where
15619        T: std::iter::IntoIterator<Item = V>,
15620        V: std::convert::Into<std::string::String>,
15621    {
15622        use std::iter::Iterator;
15623        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15624        self
15625    }
15626}
15627
15628impl wkt::message::Message for IgnoreJobRequest {
15629    fn typename() -> &'static str {
15630        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
15631    }
15632}
15633
15634/// The response object from `IgnoreJob`.
15635#[derive(Clone, Default, PartialEq)]
15636#[non_exhaustive]
15637pub struct IgnoreJobResponse {
15638    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15639}
15640
15641impl IgnoreJobResponse {
15642    /// Creates a new default instance.
15643    pub fn new() -> Self {
15644        std::default::Default::default()
15645    }
15646}
15647
15648impl wkt::message::Message for IgnoreJobResponse {
15649    fn typename() -> &'static str {
15650        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
15651    }
15652}
15653
15654/// RetryJobRequest is the request object used by `RetryJob`.
15655#[derive(Clone, Default, PartialEq)]
15656#[non_exhaustive]
15657pub struct RetryJobRequest {
15658    /// Required. Name of the Rollout. Format is
15659    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15660    pub rollout: std::string::String,
15661
15662    /// Required. The phase ID the Job to retry belongs to.
15663    pub phase_id: std::string::String,
15664
15665    /// Required. The job ID for the Job to retry.
15666    pub job_id: std::string::String,
15667
15668    /// Optional. Deploy policies to override. Format is
15669    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15670    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15671
15672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15673}
15674
15675impl RetryJobRequest {
15676    /// Creates a new default instance.
15677    pub fn new() -> Self {
15678        std::default::Default::default()
15679    }
15680
15681    /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
15682    ///
15683    /// # Example
15684    /// ```ignore,no_run
15685    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15686    /// let x = RetryJobRequest::new().set_rollout("example");
15687    /// ```
15688    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15689        self.rollout = v.into();
15690        self
15691    }
15692
15693    /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
15694    ///
15695    /// # Example
15696    /// ```ignore,no_run
15697    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15698    /// let x = RetryJobRequest::new().set_phase_id("example");
15699    /// ```
15700    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15701        self.phase_id = v.into();
15702        self
15703    }
15704
15705    /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
15706    ///
15707    /// # Example
15708    /// ```ignore,no_run
15709    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15710    /// let x = RetryJobRequest::new().set_job_id("example");
15711    /// ```
15712    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15713        self.job_id = v.into();
15714        self
15715    }
15716
15717    /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
15718    ///
15719    /// # Example
15720    /// ```ignore,no_run
15721    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15722    /// let x = RetryJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15723    /// ```
15724    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15725    where
15726        T: std::iter::IntoIterator<Item = V>,
15727        V: std::convert::Into<std::string::String>,
15728    {
15729        use std::iter::Iterator;
15730        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15731        self
15732    }
15733}
15734
15735impl wkt::message::Message for RetryJobRequest {
15736    fn typename() -> &'static str {
15737        "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
15738    }
15739}
15740
15741/// The response object from 'RetryJob'.
15742#[derive(Clone, Default, PartialEq)]
15743#[non_exhaustive]
15744pub struct RetryJobResponse {
15745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15746}
15747
15748impl RetryJobResponse {
15749    /// Creates a new default instance.
15750    pub fn new() -> Self {
15751        std::default::Default::default()
15752    }
15753}
15754
15755impl wkt::message::Message for RetryJobResponse {
15756    fn typename() -> &'static str {
15757        "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
15758    }
15759}
15760
15761/// The request object used by `AbandonRelease`.
15762#[derive(Clone, Default, PartialEq)]
15763#[non_exhaustive]
15764pub struct AbandonReleaseRequest {
15765    /// Required. Name of the Release. Format is
15766    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
15767    pub name: std::string::String,
15768
15769    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15770}
15771
15772impl AbandonReleaseRequest {
15773    /// Creates a new default instance.
15774    pub fn new() -> Self {
15775        std::default::Default::default()
15776    }
15777
15778    /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
15779    ///
15780    /// # Example
15781    /// ```ignore,no_run
15782    /// # use google_cloud_deploy_v1::model::AbandonReleaseRequest;
15783    /// let x = AbandonReleaseRequest::new().set_name("example");
15784    /// ```
15785    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15786        self.name = v.into();
15787        self
15788    }
15789}
15790
15791impl wkt::message::Message for AbandonReleaseRequest {
15792    fn typename() -> &'static str {
15793        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
15794    }
15795}
15796
15797/// The response object for `AbandonRelease`.
15798#[derive(Clone, Default, PartialEq)]
15799#[non_exhaustive]
15800pub struct AbandonReleaseResponse {
15801    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15802}
15803
15804impl AbandonReleaseResponse {
15805    /// Creates a new default instance.
15806    pub fn new() -> Self {
15807        std::default::Default::default()
15808    }
15809}
15810
15811impl wkt::message::Message for AbandonReleaseResponse {
15812    fn typename() -> &'static str {
15813        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
15814    }
15815}
15816
15817/// A `JobRun` resource in the Cloud Deploy API.
15818///
15819/// A `JobRun` contains information of a single `Rollout` job evaluation.
15820#[derive(Clone, Default, PartialEq)]
15821#[non_exhaustive]
15822pub struct JobRun {
15823    /// Output only. Name of the `JobRun`. Format is
15824    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
15825    pub name: std::string::String,
15826
15827    /// Output only. Unique identifier of the `JobRun`.
15828    pub uid: std::string::String,
15829
15830    /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
15831    pub phase_id: std::string::String,
15832
15833    /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
15834    pub job_id: std::string::String,
15835
15836    /// Output only. Time at which the `JobRun` was created.
15837    pub create_time: std::option::Option<wkt::Timestamp>,
15838
15839    /// Output only. Time at which the `JobRun` was started.
15840    pub start_time: std::option::Option<wkt::Timestamp>,
15841
15842    /// Output only. Time at which the `JobRun` ended.
15843    pub end_time: std::option::Option<wkt::Timestamp>,
15844
15845    /// Output only. The current state of the `JobRun`.
15846    pub state: crate::model::job_run::State,
15847
15848    /// Output only. This checksum is computed by the server based on the value of
15849    /// other fields, and may be sent on update and delete requests to ensure the
15850    /// client has an up-to-date value before proceeding.
15851    pub etag: std::string::String,
15852
15853    /// The `JobRun` type and the information for that type.
15854    pub job_run: std::option::Option<crate::model::job_run::JobRun>,
15855
15856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15857}
15858
15859impl JobRun {
15860    /// Creates a new default instance.
15861    pub fn new() -> Self {
15862        std::default::Default::default()
15863    }
15864
15865    /// Sets the value of [name][crate::model::JobRun::name].
15866    ///
15867    /// # Example
15868    /// ```ignore,no_run
15869    /// # use google_cloud_deploy_v1::model::JobRun;
15870    /// let x = JobRun::new().set_name("example");
15871    /// ```
15872    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15873        self.name = v.into();
15874        self
15875    }
15876
15877    /// Sets the value of [uid][crate::model::JobRun::uid].
15878    ///
15879    /// # Example
15880    /// ```ignore,no_run
15881    /// # use google_cloud_deploy_v1::model::JobRun;
15882    /// let x = JobRun::new().set_uid("example");
15883    /// ```
15884    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15885        self.uid = v.into();
15886        self
15887    }
15888
15889    /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
15890    ///
15891    /// # Example
15892    /// ```ignore,no_run
15893    /// # use google_cloud_deploy_v1::model::JobRun;
15894    /// let x = JobRun::new().set_phase_id("example");
15895    /// ```
15896    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15897        self.phase_id = v.into();
15898        self
15899    }
15900
15901    /// Sets the value of [job_id][crate::model::JobRun::job_id].
15902    ///
15903    /// # Example
15904    /// ```ignore,no_run
15905    /// # use google_cloud_deploy_v1::model::JobRun;
15906    /// let x = JobRun::new().set_job_id("example");
15907    /// ```
15908    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15909        self.job_id = v.into();
15910        self
15911    }
15912
15913    /// Sets the value of [create_time][crate::model::JobRun::create_time].
15914    ///
15915    /// # Example
15916    /// ```ignore,no_run
15917    /// # use google_cloud_deploy_v1::model::JobRun;
15918    /// use wkt::Timestamp;
15919    /// let x = JobRun::new().set_create_time(Timestamp::default()/* use setters */);
15920    /// ```
15921    pub fn set_create_time<T>(mut self, v: T) -> Self
15922    where
15923        T: std::convert::Into<wkt::Timestamp>,
15924    {
15925        self.create_time = std::option::Option::Some(v.into());
15926        self
15927    }
15928
15929    /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
15930    ///
15931    /// # Example
15932    /// ```ignore,no_run
15933    /// # use google_cloud_deploy_v1::model::JobRun;
15934    /// use wkt::Timestamp;
15935    /// let x = JobRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15936    /// let x = JobRun::new().set_or_clear_create_time(None::<Timestamp>);
15937    /// ```
15938    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15939    where
15940        T: std::convert::Into<wkt::Timestamp>,
15941    {
15942        self.create_time = v.map(|x| x.into());
15943        self
15944    }
15945
15946    /// Sets the value of [start_time][crate::model::JobRun::start_time].
15947    ///
15948    /// # Example
15949    /// ```ignore,no_run
15950    /// # use google_cloud_deploy_v1::model::JobRun;
15951    /// use wkt::Timestamp;
15952    /// let x = JobRun::new().set_start_time(Timestamp::default()/* use setters */);
15953    /// ```
15954    pub fn set_start_time<T>(mut self, v: T) -> Self
15955    where
15956        T: std::convert::Into<wkt::Timestamp>,
15957    {
15958        self.start_time = std::option::Option::Some(v.into());
15959        self
15960    }
15961
15962    /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
15963    ///
15964    /// # Example
15965    /// ```ignore,no_run
15966    /// # use google_cloud_deploy_v1::model::JobRun;
15967    /// use wkt::Timestamp;
15968    /// let x = JobRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
15969    /// let x = JobRun::new().set_or_clear_start_time(None::<Timestamp>);
15970    /// ```
15971    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15972    where
15973        T: std::convert::Into<wkt::Timestamp>,
15974    {
15975        self.start_time = v.map(|x| x.into());
15976        self
15977    }
15978
15979    /// Sets the value of [end_time][crate::model::JobRun::end_time].
15980    ///
15981    /// # Example
15982    /// ```ignore,no_run
15983    /// # use google_cloud_deploy_v1::model::JobRun;
15984    /// use wkt::Timestamp;
15985    /// let x = JobRun::new().set_end_time(Timestamp::default()/* use setters */);
15986    /// ```
15987    pub fn set_end_time<T>(mut self, v: T) -> Self
15988    where
15989        T: std::convert::Into<wkt::Timestamp>,
15990    {
15991        self.end_time = std::option::Option::Some(v.into());
15992        self
15993    }
15994
15995    /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
15996    ///
15997    /// # Example
15998    /// ```ignore,no_run
15999    /// # use google_cloud_deploy_v1::model::JobRun;
16000    /// use wkt::Timestamp;
16001    /// let x = JobRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16002    /// let x = JobRun::new().set_or_clear_end_time(None::<Timestamp>);
16003    /// ```
16004    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16005    where
16006        T: std::convert::Into<wkt::Timestamp>,
16007    {
16008        self.end_time = v.map(|x| x.into());
16009        self
16010    }
16011
16012    /// Sets the value of [state][crate::model::JobRun::state].
16013    ///
16014    /// # Example
16015    /// ```ignore,no_run
16016    /// # use google_cloud_deploy_v1::model::JobRun;
16017    /// use google_cloud_deploy_v1::model::job_run::State;
16018    /// let x0 = JobRun::new().set_state(State::InProgress);
16019    /// let x1 = JobRun::new().set_state(State::Succeeded);
16020    /// let x2 = JobRun::new().set_state(State::Failed);
16021    /// ```
16022    pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
16023        self.state = v.into();
16024        self
16025    }
16026
16027    /// Sets the value of [etag][crate::model::JobRun::etag].
16028    ///
16029    /// # Example
16030    /// ```ignore,no_run
16031    /// # use google_cloud_deploy_v1::model::JobRun;
16032    /// let x = JobRun::new().set_etag("example");
16033    /// ```
16034    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16035        self.etag = v.into();
16036        self
16037    }
16038
16039    /// Sets the value of [job_run][crate::model::JobRun::job_run].
16040    ///
16041    /// Note that all the setters affecting `job_run` are mutually
16042    /// exclusive.
16043    ///
16044    /// # Example
16045    /// ```ignore,no_run
16046    /// # use google_cloud_deploy_v1::model::JobRun;
16047    /// use google_cloud_deploy_v1::model::DeployJobRun;
16048    /// let x = JobRun::new().set_job_run(Some(
16049    ///     google_cloud_deploy_v1::model::job_run::JobRun::DeployJobRun(DeployJobRun::default().into())));
16050    /// ```
16051    pub fn set_job_run<
16052        T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
16053    >(
16054        mut self,
16055        v: T,
16056    ) -> Self {
16057        self.job_run = v.into();
16058        self
16059    }
16060
16061    /// The value of [job_run][crate::model::JobRun::job_run]
16062    /// if it holds a `DeployJobRun`, `None` if the field is not set or
16063    /// holds a different branch.
16064    pub fn deploy_job_run(
16065        &self,
16066    ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
16067        #[allow(unreachable_patterns)]
16068        self.job_run.as_ref().and_then(|v| match v {
16069            crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
16070            _ => std::option::Option::None,
16071        })
16072    }
16073
16074    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16075    /// to hold a `DeployJobRun`.
16076    ///
16077    /// Note that all the setters affecting `job_run` are
16078    /// mutually exclusive.
16079    ///
16080    /// # Example
16081    /// ```ignore,no_run
16082    /// # use google_cloud_deploy_v1::model::JobRun;
16083    /// use google_cloud_deploy_v1::model::DeployJobRun;
16084    /// let x = JobRun::new().set_deploy_job_run(DeployJobRun::default()/* use setters */);
16085    /// assert!(x.deploy_job_run().is_some());
16086    /// assert!(x.verify_job_run().is_none());
16087    /// assert!(x.predeploy_job_run().is_none());
16088    /// assert!(x.postdeploy_job_run().is_none());
16089    /// assert!(x.create_child_rollout_job_run().is_none());
16090    /// assert!(x.advance_child_rollout_job_run().is_none());
16091    /// ```
16092    pub fn set_deploy_job_run<
16093        T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
16094    >(
16095        mut self,
16096        v: T,
16097    ) -> Self {
16098        self.job_run =
16099            std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
16100        self
16101    }
16102
16103    /// The value of [job_run][crate::model::JobRun::job_run]
16104    /// if it holds a `VerifyJobRun`, `None` if the field is not set or
16105    /// holds a different branch.
16106    pub fn verify_job_run(
16107        &self,
16108    ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
16109        #[allow(unreachable_patterns)]
16110        self.job_run.as_ref().and_then(|v| match v {
16111            crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
16112            _ => std::option::Option::None,
16113        })
16114    }
16115
16116    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16117    /// to hold a `VerifyJobRun`.
16118    ///
16119    /// Note that all the setters affecting `job_run` are
16120    /// mutually exclusive.
16121    ///
16122    /// # Example
16123    /// ```ignore,no_run
16124    /// # use google_cloud_deploy_v1::model::JobRun;
16125    /// use google_cloud_deploy_v1::model::VerifyJobRun;
16126    /// let x = JobRun::new().set_verify_job_run(VerifyJobRun::default()/* use setters */);
16127    /// assert!(x.verify_job_run().is_some());
16128    /// assert!(x.deploy_job_run().is_none());
16129    /// assert!(x.predeploy_job_run().is_none());
16130    /// assert!(x.postdeploy_job_run().is_none());
16131    /// assert!(x.create_child_rollout_job_run().is_none());
16132    /// assert!(x.advance_child_rollout_job_run().is_none());
16133    /// ```
16134    pub fn set_verify_job_run<
16135        T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
16136    >(
16137        mut self,
16138        v: T,
16139    ) -> Self {
16140        self.job_run =
16141            std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
16142        self
16143    }
16144
16145    /// The value of [job_run][crate::model::JobRun::job_run]
16146    /// if it holds a `PredeployJobRun`, `None` if the field is not set or
16147    /// holds a different branch.
16148    pub fn predeploy_job_run(
16149        &self,
16150    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
16151        #[allow(unreachable_patterns)]
16152        self.job_run.as_ref().and_then(|v| match v {
16153            crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
16154            _ => std::option::Option::None,
16155        })
16156    }
16157
16158    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16159    /// to hold a `PredeployJobRun`.
16160    ///
16161    /// Note that all the setters affecting `job_run` are
16162    /// mutually exclusive.
16163    ///
16164    /// # Example
16165    /// ```ignore,no_run
16166    /// # use google_cloud_deploy_v1::model::JobRun;
16167    /// use google_cloud_deploy_v1::model::PredeployJobRun;
16168    /// let x = JobRun::new().set_predeploy_job_run(PredeployJobRun::default()/* use setters */);
16169    /// assert!(x.predeploy_job_run().is_some());
16170    /// assert!(x.deploy_job_run().is_none());
16171    /// assert!(x.verify_job_run().is_none());
16172    /// assert!(x.postdeploy_job_run().is_none());
16173    /// assert!(x.create_child_rollout_job_run().is_none());
16174    /// assert!(x.advance_child_rollout_job_run().is_none());
16175    /// ```
16176    pub fn set_predeploy_job_run<
16177        T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
16178    >(
16179        mut self,
16180        v: T,
16181    ) -> Self {
16182        self.job_run =
16183            std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
16184        self
16185    }
16186
16187    /// The value of [job_run][crate::model::JobRun::job_run]
16188    /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
16189    /// holds a different branch.
16190    pub fn postdeploy_job_run(
16191        &self,
16192    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
16193        #[allow(unreachable_patterns)]
16194        self.job_run.as_ref().and_then(|v| match v {
16195            crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
16196            _ => std::option::Option::None,
16197        })
16198    }
16199
16200    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16201    /// to hold a `PostdeployJobRun`.
16202    ///
16203    /// Note that all the setters affecting `job_run` are
16204    /// mutually exclusive.
16205    ///
16206    /// # Example
16207    /// ```ignore,no_run
16208    /// # use google_cloud_deploy_v1::model::JobRun;
16209    /// use google_cloud_deploy_v1::model::PostdeployJobRun;
16210    /// let x = JobRun::new().set_postdeploy_job_run(PostdeployJobRun::default()/* use setters */);
16211    /// assert!(x.postdeploy_job_run().is_some());
16212    /// assert!(x.deploy_job_run().is_none());
16213    /// assert!(x.verify_job_run().is_none());
16214    /// assert!(x.predeploy_job_run().is_none());
16215    /// assert!(x.create_child_rollout_job_run().is_none());
16216    /// assert!(x.advance_child_rollout_job_run().is_none());
16217    /// ```
16218    pub fn set_postdeploy_job_run<
16219        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
16220    >(
16221        mut self,
16222        v: T,
16223    ) -> Self {
16224        self.job_run =
16225            std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
16226        self
16227    }
16228
16229    /// The value of [job_run][crate::model::JobRun::job_run]
16230    /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
16231    /// holds a different branch.
16232    pub fn create_child_rollout_job_run(
16233        &self,
16234    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
16235        #[allow(unreachable_patterns)]
16236        self.job_run.as_ref().and_then(|v| match v {
16237            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
16238                std::option::Option::Some(v)
16239            }
16240            _ => std::option::Option::None,
16241        })
16242    }
16243
16244    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16245    /// to hold a `CreateChildRolloutJobRun`.
16246    ///
16247    /// Note that all the setters affecting `job_run` are
16248    /// mutually exclusive.
16249    ///
16250    /// # Example
16251    /// ```ignore,no_run
16252    /// # use google_cloud_deploy_v1::model::JobRun;
16253    /// use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
16254    /// let x = JobRun::new().set_create_child_rollout_job_run(CreateChildRolloutJobRun::default()/* use setters */);
16255    /// assert!(x.create_child_rollout_job_run().is_some());
16256    /// assert!(x.deploy_job_run().is_none());
16257    /// assert!(x.verify_job_run().is_none());
16258    /// assert!(x.predeploy_job_run().is_none());
16259    /// assert!(x.postdeploy_job_run().is_none());
16260    /// assert!(x.advance_child_rollout_job_run().is_none());
16261    /// ```
16262    pub fn set_create_child_rollout_job_run<
16263        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
16264    >(
16265        mut self,
16266        v: T,
16267    ) -> Self {
16268        self.job_run = std::option::Option::Some(
16269            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
16270        );
16271        self
16272    }
16273
16274    /// The value of [job_run][crate::model::JobRun::job_run]
16275    /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
16276    /// holds a different branch.
16277    pub fn advance_child_rollout_job_run(
16278        &self,
16279    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
16280        #[allow(unreachable_patterns)]
16281        self.job_run.as_ref().and_then(|v| match v {
16282            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
16283                std::option::Option::Some(v)
16284            }
16285            _ => std::option::Option::None,
16286        })
16287    }
16288
16289    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16290    /// to hold a `AdvanceChildRolloutJobRun`.
16291    ///
16292    /// Note that all the setters affecting `job_run` are
16293    /// mutually exclusive.
16294    ///
16295    /// # Example
16296    /// ```ignore,no_run
16297    /// # use google_cloud_deploy_v1::model::JobRun;
16298    /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
16299    /// let x = JobRun::new().set_advance_child_rollout_job_run(AdvanceChildRolloutJobRun::default()/* use setters */);
16300    /// assert!(x.advance_child_rollout_job_run().is_some());
16301    /// assert!(x.deploy_job_run().is_none());
16302    /// assert!(x.verify_job_run().is_none());
16303    /// assert!(x.predeploy_job_run().is_none());
16304    /// assert!(x.postdeploy_job_run().is_none());
16305    /// assert!(x.create_child_rollout_job_run().is_none());
16306    /// ```
16307    pub fn set_advance_child_rollout_job_run<
16308        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
16309    >(
16310        mut self,
16311        v: T,
16312    ) -> Self {
16313        self.job_run = std::option::Option::Some(
16314            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
16315        );
16316        self
16317    }
16318}
16319
16320impl wkt::message::Message for JobRun {
16321    fn typename() -> &'static str {
16322        "type.googleapis.com/google.cloud.deploy.v1.JobRun"
16323    }
16324}
16325
16326/// Defines additional types related to [JobRun].
16327pub mod job_run {
16328    #[allow(unused_imports)]
16329    use super::*;
16330
16331    /// Valid states of a `JobRun`.
16332    ///
16333    /// # Working with unknown values
16334    ///
16335    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16336    /// additional enum variants at any time. Adding new variants is not considered
16337    /// a breaking change. Applications should write their code in anticipation of:
16338    ///
16339    /// - New values appearing in future releases of the client library, **and**
16340    /// - New values received dynamically, without application changes.
16341    ///
16342    /// Please consult the [Working with enums] section in the user guide for some
16343    /// guidelines.
16344    ///
16345    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16346    #[derive(Clone, Debug, PartialEq)]
16347    #[non_exhaustive]
16348    pub enum State {
16349        /// The `JobRun` has an unspecified state.
16350        Unspecified,
16351        /// The `JobRun` is in progress.
16352        InProgress,
16353        /// The `JobRun` has succeeded.
16354        Succeeded,
16355        /// The `JobRun` has failed.
16356        Failed,
16357        /// The `JobRun` is terminating.
16358        Terminating,
16359        /// The `JobRun` was terminated.
16360        Terminated,
16361        /// If set, the enum was initialized with an unknown value.
16362        ///
16363        /// Applications can examine the value using [State::value] or
16364        /// [State::name].
16365        UnknownValue(state::UnknownValue),
16366    }
16367
16368    #[doc(hidden)]
16369    pub mod state {
16370        #[allow(unused_imports)]
16371        use super::*;
16372        #[derive(Clone, Debug, PartialEq)]
16373        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16374    }
16375
16376    impl State {
16377        /// Gets the enum value.
16378        ///
16379        /// Returns `None` if the enum contains an unknown value deserialized from
16380        /// the string representation of enums.
16381        pub fn value(&self) -> std::option::Option<i32> {
16382            match self {
16383                Self::Unspecified => std::option::Option::Some(0),
16384                Self::InProgress => std::option::Option::Some(1),
16385                Self::Succeeded => std::option::Option::Some(2),
16386                Self::Failed => std::option::Option::Some(3),
16387                Self::Terminating => std::option::Option::Some(4),
16388                Self::Terminated => std::option::Option::Some(5),
16389                Self::UnknownValue(u) => u.0.value(),
16390            }
16391        }
16392
16393        /// Gets the enum value as a string.
16394        ///
16395        /// Returns `None` if the enum contains an unknown value deserialized from
16396        /// the integer representation of enums.
16397        pub fn name(&self) -> std::option::Option<&str> {
16398            match self {
16399                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16400                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16401                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16402                Self::Failed => std::option::Option::Some("FAILED"),
16403                Self::Terminating => std::option::Option::Some("TERMINATING"),
16404                Self::Terminated => std::option::Option::Some("TERMINATED"),
16405                Self::UnknownValue(u) => u.0.name(),
16406            }
16407        }
16408    }
16409
16410    impl std::default::Default for State {
16411        fn default() -> Self {
16412            use std::convert::From;
16413            Self::from(0)
16414        }
16415    }
16416
16417    impl std::fmt::Display for State {
16418        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16419            wkt::internal::display_enum(f, self.name(), self.value())
16420        }
16421    }
16422
16423    impl std::convert::From<i32> for State {
16424        fn from(value: i32) -> Self {
16425            match value {
16426                0 => Self::Unspecified,
16427                1 => Self::InProgress,
16428                2 => Self::Succeeded,
16429                3 => Self::Failed,
16430                4 => Self::Terminating,
16431                5 => Self::Terminated,
16432                _ => Self::UnknownValue(state::UnknownValue(
16433                    wkt::internal::UnknownEnumValue::Integer(value),
16434                )),
16435            }
16436        }
16437    }
16438
16439    impl std::convert::From<&str> for State {
16440        fn from(value: &str) -> Self {
16441            use std::string::ToString;
16442            match value {
16443                "STATE_UNSPECIFIED" => Self::Unspecified,
16444                "IN_PROGRESS" => Self::InProgress,
16445                "SUCCEEDED" => Self::Succeeded,
16446                "FAILED" => Self::Failed,
16447                "TERMINATING" => Self::Terminating,
16448                "TERMINATED" => Self::Terminated,
16449                _ => Self::UnknownValue(state::UnknownValue(
16450                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16451                )),
16452            }
16453        }
16454    }
16455
16456    impl serde::ser::Serialize for State {
16457        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16458        where
16459            S: serde::Serializer,
16460        {
16461            match self {
16462                Self::Unspecified => serializer.serialize_i32(0),
16463                Self::InProgress => serializer.serialize_i32(1),
16464                Self::Succeeded => serializer.serialize_i32(2),
16465                Self::Failed => serializer.serialize_i32(3),
16466                Self::Terminating => serializer.serialize_i32(4),
16467                Self::Terminated => serializer.serialize_i32(5),
16468                Self::UnknownValue(u) => u.0.serialize(serializer),
16469            }
16470        }
16471    }
16472
16473    impl<'de> serde::de::Deserialize<'de> for State {
16474        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16475        where
16476            D: serde::Deserializer<'de>,
16477        {
16478            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16479                ".google.cloud.deploy.v1.JobRun.State",
16480            ))
16481        }
16482    }
16483
16484    /// The `JobRun` type and the information for that type.
16485    #[derive(Clone, Debug, PartialEq)]
16486    #[non_exhaustive]
16487    pub enum JobRun {
16488        /// Output only. Information specific to a deploy `JobRun`.
16489        DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
16490        /// Output only. Information specific to a verify `JobRun`.
16491        VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
16492        /// Output only. Information specific to a predeploy `JobRun`.
16493        PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
16494        /// Output only. Information specific to a postdeploy `JobRun`.
16495        PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
16496        /// Output only. Information specific to a createChildRollout `JobRun`.
16497        CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
16498        /// Output only. Information specific to an advanceChildRollout `JobRun`
16499        AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
16500    }
16501}
16502
16503/// DeployJobRun contains information specific to a deploy `JobRun`.
16504#[derive(Clone, Default, PartialEq)]
16505#[non_exhaustive]
16506pub struct DeployJobRun {
16507    /// Output only. The resource name of the Cloud Build `Build` object that is
16508    /// used to deploy. Format is
16509    /// `projects/{project}/locations/{location}/builds/{build}`.
16510    pub build: std::string::String,
16511
16512    /// Output only. The reason the deploy failed. This will always be unspecified
16513    /// while the deploy is in progress or if it succeeded.
16514    pub failure_cause: crate::model::deploy_job_run::FailureCause,
16515
16516    /// Output only. Additional information about the deploy failure, if available.
16517    pub failure_message: std::string::String,
16518
16519    /// Output only. Metadata containing information about the deploy job run.
16520    pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
16521
16522    /// Output only. The artifact of a deploy job run, if available.
16523    pub artifact: std::option::Option<crate::model::DeployArtifact>,
16524
16525    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16526}
16527
16528impl DeployJobRun {
16529    /// Creates a new default instance.
16530    pub fn new() -> Self {
16531        std::default::Default::default()
16532    }
16533
16534    /// Sets the value of [build][crate::model::DeployJobRun::build].
16535    ///
16536    /// # Example
16537    /// ```ignore,no_run
16538    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16539    /// let x = DeployJobRun::new().set_build("example");
16540    /// ```
16541    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16542        self.build = v.into();
16543        self
16544    }
16545
16546    /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
16547    ///
16548    /// # Example
16549    /// ```ignore,no_run
16550    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16551    /// use google_cloud_deploy_v1::model::deploy_job_run::FailureCause;
16552    /// let x0 = DeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16553    /// let x1 = DeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16554    /// let x2 = DeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16555    /// ```
16556    pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
16557        mut self,
16558        v: T,
16559    ) -> Self {
16560        self.failure_cause = v.into();
16561        self
16562    }
16563
16564    /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
16565    ///
16566    /// # Example
16567    /// ```ignore,no_run
16568    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16569    /// let x = DeployJobRun::new().set_failure_message("example");
16570    /// ```
16571    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16572        self.failure_message = v.into();
16573        self
16574    }
16575
16576    /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
16577    ///
16578    /// # Example
16579    /// ```ignore,no_run
16580    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16581    /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16582    /// let x = DeployJobRun::new().set_metadata(DeployJobRunMetadata::default()/* use setters */);
16583    /// ```
16584    pub fn set_metadata<T>(mut self, v: T) -> Self
16585    where
16586        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16587    {
16588        self.metadata = std::option::Option::Some(v.into());
16589        self
16590    }
16591
16592    /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
16593    ///
16594    /// # Example
16595    /// ```ignore,no_run
16596    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16597    /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16598    /// let x = DeployJobRun::new().set_or_clear_metadata(Some(DeployJobRunMetadata::default()/* use setters */));
16599    /// let x = DeployJobRun::new().set_or_clear_metadata(None::<DeployJobRunMetadata>);
16600    /// ```
16601    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16602    where
16603        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16604    {
16605        self.metadata = v.map(|x| x.into());
16606        self
16607    }
16608
16609    /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
16610    ///
16611    /// # Example
16612    /// ```ignore,no_run
16613    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16614    /// use google_cloud_deploy_v1::model::DeployArtifact;
16615    /// let x = DeployJobRun::new().set_artifact(DeployArtifact::default()/* use setters */);
16616    /// ```
16617    pub fn set_artifact<T>(mut self, v: T) -> Self
16618    where
16619        T: std::convert::Into<crate::model::DeployArtifact>,
16620    {
16621        self.artifact = std::option::Option::Some(v.into());
16622        self
16623    }
16624
16625    /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
16626    ///
16627    /// # Example
16628    /// ```ignore,no_run
16629    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16630    /// use google_cloud_deploy_v1::model::DeployArtifact;
16631    /// let x = DeployJobRun::new().set_or_clear_artifact(Some(DeployArtifact::default()/* use setters */));
16632    /// let x = DeployJobRun::new().set_or_clear_artifact(None::<DeployArtifact>);
16633    /// ```
16634    pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
16635    where
16636        T: std::convert::Into<crate::model::DeployArtifact>,
16637    {
16638        self.artifact = v.map(|x| x.into());
16639        self
16640    }
16641}
16642
16643impl wkt::message::Message for DeployJobRun {
16644    fn typename() -> &'static str {
16645        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
16646    }
16647}
16648
16649/// Defines additional types related to [DeployJobRun].
16650pub mod deploy_job_run {
16651    #[allow(unused_imports)]
16652    use super::*;
16653
16654    /// Well-known deploy failures.
16655    ///
16656    /// # Working with unknown values
16657    ///
16658    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16659    /// additional enum variants at any time. Adding new variants is not considered
16660    /// a breaking change. Applications should write their code in anticipation of:
16661    ///
16662    /// - New values appearing in future releases of the client library, **and**
16663    /// - New values received dynamically, without application changes.
16664    ///
16665    /// Please consult the [Working with enums] section in the user guide for some
16666    /// guidelines.
16667    ///
16668    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16669    #[derive(Clone, Debug, PartialEq)]
16670    #[non_exhaustive]
16671    pub enum FailureCause {
16672        /// No reason for failure is specified.
16673        Unspecified,
16674        /// Cloud Build is not available, either because it is not enabled or because
16675        /// Cloud Deploy has insufficient permissions. See [Required
16676        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16677        CloudBuildUnavailable,
16678        /// The deploy operation did not complete successfully; check Cloud Build
16679        /// logs.
16680        ExecutionFailed,
16681        /// The deploy job run did not complete within the allotted time.
16682        DeadlineExceeded,
16683        /// There were missing resources in the runtime environment required for a
16684        /// canary deployment. Check the Cloud Build logs for more information.
16685        MissingResourcesForCanary,
16686        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16687        /// for additional details.
16688        CloudBuildRequestFailed,
16689        /// The deploy operation had a feature configured that is not supported.
16690        DeployFeatureNotSupported,
16691        /// If set, the enum was initialized with an unknown value.
16692        ///
16693        /// Applications can examine the value using [FailureCause::value] or
16694        /// [FailureCause::name].
16695        UnknownValue(failure_cause::UnknownValue),
16696    }
16697
16698    #[doc(hidden)]
16699    pub mod failure_cause {
16700        #[allow(unused_imports)]
16701        use super::*;
16702        #[derive(Clone, Debug, PartialEq)]
16703        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16704    }
16705
16706    impl FailureCause {
16707        /// Gets the enum value.
16708        ///
16709        /// Returns `None` if the enum contains an unknown value deserialized from
16710        /// the string representation of enums.
16711        pub fn value(&self) -> std::option::Option<i32> {
16712            match self {
16713                Self::Unspecified => std::option::Option::Some(0),
16714                Self::CloudBuildUnavailable => std::option::Option::Some(1),
16715                Self::ExecutionFailed => std::option::Option::Some(2),
16716                Self::DeadlineExceeded => std::option::Option::Some(3),
16717                Self::MissingResourcesForCanary => std::option::Option::Some(4),
16718                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16719                Self::DeployFeatureNotSupported => std::option::Option::Some(6),
16720                Self::UnknownValue(u) => u.0.value(),
16721            }
16722        }
16723
16724        /// Gets the enum value as a string.
16725        ///
16726        /// Returns `None` if the enum contains an unknown value deserialized from
16727        /// the integer representation of enums.
16728        pub fn name(&self) -> std::option::Option<&str> {
16729            match self {
16730                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16731                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16732                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16733                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16734                Self::MissingResourcesForCanary => {
16735                    std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
16736                }
16737                Self::CloudBuildRequestFailed => {
16738                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16739                }
16740                Self::DeployFeatureNotSupported => {
16741                    std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
16742                }
16743                Self::UnknownValue(u) => u.0.name(),
16744            }
16745        }
16746    }
16747
16748    impl std::default::Default for FailureCause {
16749        fn default() -> Self {
16750            use std::convert::From;
16751            Self::from(0)
16752        }
16753    }
16754
16755    impl std::fmt::Display for FailureCause {
16756        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16757            wkt::internal::display_enum(f, self.name(), self.value())
16758        }
16759    }
16760
16761    impl std::convert::From<i32> for FailureCause {
16762        fn from(value: i32) -> Self {
16763            match value {
16764                0 => Self::Unspecified,
16765                1 => Self::CloudBuildUnavailable,
16766                2 => Self::ExecutionFailed,
16767                3 => Self::DeadlineExceeded,
16768                4 => Self::MissingResourcesForCanary,
16769                5 => Self::CloudBuildRequestFailed,
16770                6 => Self::DeployFeatureNotSupported,
16771                _ => Self::UnknownValue(failure_cause::UnknownValue(
16772                    wkt::internal::UnknownEnumValue::Integer(value),
16773                )),
16774            }
16775        }
16776    }
16777
16778    impl std::convert::From<&str> for FailureCause {
16779        fn from(value: &str) -> Self {
16780            use std::string::ToString;
16781            match value {
16782                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16783                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16784                "EXECUTION_FAILED" => Self::ExecutionFailed,
16785                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16786                "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
16787                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16788                "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
16789                _ => Self::UnknownValue(failure_cause::UnknownValue(
16790                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16791                )),
16792            }
16793        }
16794    }
16795
16796    impl serde::ser::Serialize for FailureCause {
16797        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16798        where
16799            S: serde::Serializer,
16800        {
16801            match self {
16802                Self::Unspecified => serializer.serialize_i32(0),
16803                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16804                Self::ExecutionFailed => serializer.serialize_i32(2),
16805                Self::DeadlineExceeded => serializer.serialize_i32(3),
16806                Self::MissingResourcesForCanary => serializer.serialize_i32(4),
16807                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16808                Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
16809                Self::UnknownValue(u) => u.0.serialize(serializer),
16810            }
16811        }
16812    }
16813
16814    impl<'de> serde::de::Deserialize<'de> for FailureCause {
16815        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16816        where
16817            D: serde::Deserializer<'de>,
16818        {
16819            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16820                ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
16821            ))
16822        }
16823    }
16824}
16825
16826/// VerifyJobRun contains information specific to a verify `JobRun`.
16827#[derive(Clone, Default, PartialEq)]
16828#[non_exhaustive]
16829pub struct VerifyJobRun {
16830    /// Output only. The resource name of the Cloud Build `Build` object that is
16831    /// used to verify. Format is
16832    /// `projects/{project}/locations/{location}/builds/{build}`.
16833    pub build: std::string::String,
16834
16835    /// Output only. URI of a directory containing the verify artifacts. This
16836    /// contains the Skaffold event log.
16837    pub artifact_uri: std::string::String,
16838
16839    /// Output only. File path of the Skaffold event log relative to the artifact
16840    /// URI.
16841    pub event_log_path: std::string::String,
16842
16843    /// Output only. The reason the verify failed. This will always be unspecified
16844    /// while the verify is in progress or if it succeeded.
16845    pub failure_cause: crate::model::verify_job_run::FailureCause,
16846
16847    /// Output only. Additional information about the verify failure, if available.
16848    pub failure_message: std::string::String,
16849
16850    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16851}
16852
16853impl VerifyJobRun {
16854    /// Creates a new default instance.
16855    pub fn new() -> Self {
16856        std::default::Default::default()
16857    }
16858
16859    /// Sets the value of [build][crate::model::VerifyJobRun::build].
16860    ///
16861    /// # Example
16862    /// ```ignore,no_run
16863    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16864    /// let x = VerifyJobRun::new().set_build("example");
16865    /// ```
16866    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16867        self.build = v.into();
16868        self
16869    }
16870
16871    /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
16872    ///
16873    /// # Example
16874    /// ```ignore,no_run
16875    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16876    /// let x = VerifyJobRun::new().set_artifact_uri("example");
16877    /// ```
16878    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16879        self.artifact_uri = v.into();
16880        self
16881    }
16882
16883    /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
16884    ///
16885    /// # Example
16886    /// ```ignore,no_run
16887    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16888    /// let x = VerifyJobRun::new().set_event_log_path("example");
16889    /// ```
16890    pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16891        self.event_log_path = v.into();
16892        self
16893    }
16894
16895    /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
16896    ///
16897    /// # Example
16898    /// ```ignore,no_run
16899    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16900    /// use google_cloud_deploy_v1::model::verify_job_run::FailureCause;
16901    /// let x0 = VerifyJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16902    /// let x1 = VerifyJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16903    /// let x2 = VerifyJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16904    /// ```
16905    pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
16906        mut self,
16907        v: T,
16908    ) -> Self {
16909        self.failure_cause = v.into();
16910        self
16911    }
16912
16913    /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
16914    ///
16915    /// # Example
16916    /// ```ignore,no_run
16917    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16918    /// let x = VerifyJobRun::new().set_failure_message("example");
16919    /// ```
16920    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16921        self.failure_message = v.into();
16922        self
16923    }
16924}
16925
16926impl wkt::message::Message for VerifyJobRun {
16927    fn typename() -> &'static str {
16928        "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
16929    }
16930}
16931
16932/// Defines additional types related to [VerifyJobRun].
16933pub mod verify_job_run {
16934    #[allow(unused_imports)]
16935    use super::*;
16936
16937    /// Well-known verify failures.
16938    ///
16939    /// # Working with unknown values
16940    ///
16941    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16942    /// additional enum variants at any time. Adding new variants is not considered
16943    /// a breaking change. Applications should write their code in anticipation of:
16944    ///
16945    /// - New values appearing in future releases of the client library, **and**
16946    /// - New values received dynamically, without application changes.
16947    ///
16948    /// Please consult the [Working with enums] section in the user guide for some
16949    /// guidelines.
16950    ///
16951    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16952    #[derive(Clone, Debug, PartialEq)]
16953    #[non_exhaustive]
16954    pub enum FailureCause {
16955        /// No reason for failure is specified.
16956        Unspecified,
16957        /// Cloud Build is not available, either because it is not enabled or because
16958        /// Cloud Deploy has insufficient permissions. See [required
16959        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16960        CloudBuildUnavailable,
16961        /// The verify operation did not complete successfully; check Cloud Build
16962        /// logs.
16963        ExecutionFailed,
16964        /// The verify job run did not complete within the allotted time.
16965        DeadlineExceeded,
16966        /// No Skaffold verify configuration was found.
16967        VerificationConfigNotFound,
16968        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16969        /// for additional details.
16970        CloudBuildRequestFailed,
16971        /// If set, the enum was initialized with an unknown value.
16972        ///
16973        /// Applications can examine the value using [FailureCause::value] or
16974        /// [FailureCause::name].
16975        UnknownValue(failure_cause::UnknownValue),
16976    }
16977
16978    #[doc(hidden)]
16979    pub mod failure_cause {
16980        #[allow(unused_imports)]
16981        use super::*;
16982        #[derive(Clone, Debug, PartialEq)]
16983        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16984    }
16985
16986    impl FailureCause {
16987        /// Gets the enum value.
16988        ///
16989        /// Returns `None` if the enum contains an unknown value deserialized from
16990        /// the string representation of enums.
16991        pub fn value(&self) -> std::option::Option<i32> {
16992            match self {
16993                Self::Unspecified => std::option::Option::Some(0),
16994                Self::CloudBuildUnavailable => std::option::Option::Some(1),
16995                Self::ExecutionFailed => std::option::Option::Some(2),
16996                Self::DeadlineExceeded => std::option::Option::Some(3),
16997                Self::VerificationConfigNotFound => std::option::Option::Some(4),
16998                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16999                Self::UnknownValue(u) => u.0.value(),
17000            }
17001        }
17002
17003        /// Gets the enum value as a string.
17004        ///
17005        /// Returns `None` if the enum contains an unknown value deserialized from
17006        /// the integer representation of enums.
17007        pub fn name(&self) -> std::option::Option<&str> {
17008            match self {
17009                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17010                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17011                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17012                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17013                Self::VerificationConfigNotFound => {
17014                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
17015                }
17016                Self::CloudBuildRequestFailed => {
17017                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17018                }
17019                Self::UnknownValue(u) => u.0.name(),
17020            }
17021        }
17022    }
17023
17024    impl std::default::Default for FailureCause {
17025        fn default() -> Self {
17026            use std::convert::From;
17027            Self::from(0)
17028        }
17029    }
17030
17031    impl std::fmt::Display for FailureCause {
17032        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17033            wkt::internal::display_enum(f, self.name(), self.value())
17034        }
17035    }
17036
17037    impl std::convert::From<i32> for FailureCause {
17038        fn from(value: i32) -> Self {
17039            match value {
17040                0 => Self::Unspecified,
17041                1 => Self::CloudBuildUnavailable,
17042                2 => Self::ExecutionFailed,
17043                3 => Self::DeadlineExceeded,
17044                4 => Self::VerificationConfigNotFound,
17045                5 => Self::CloudBuildRequestFailed,
17046                _ => Self::UnknownValue(failure_cause::UnknownValue(
17047                    wkt::internal::UnknownEnumValue::Integer(value),
17048                )),
17049            }
17050        }
17051    }
17052
17053    impl std::convert::From<&str> for FailureCause {
17054        fn from(value: &str) -> Self {
17055            use std::string::ToString;
17056            match value {
17057                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17058                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17059                "EXECUTION_FAILED" => Self::ExecutionFailed,
17060                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17061                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
17062                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17063                _ => Self::UnknownValue(failure_cause::UnknownValue(
17064                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17065                )),
17066            }
17067        }
17068    }
17069
17070    impl serde::ser::Serialize for FailureCause {
17071        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17072        where
17073            S: serde::Serializer,
17074        {
17075            match self {
17076                Self::Unspecified => serializer.serialize_i32(0),
17077                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17078                Self::ExecutionFailed => serializer.serialize_i32(2),
17079                Self::DeadlineExceeded => serializer.serialize_i32(3),
17080                Self::VerificationConfigNotFound => serializer.serialize_i32(4),
17081                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
17082                Self::UnknownValue(u) => u.0.serialize(serializer),
17083            }
17084        }
17085    }
17086
17087    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17088        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17089        where
17090            D: serde::Deserializer<'de>,
17091        {
17092            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17093                ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
17094            ))
17095        }
17096    }
17097}
17098
17099/// PredeployJobRun contains information specific to a predeploy `JobRun`.
17100#[derive(Clone, Default, PartialEq)]
17101#[non_exhaustive]
17102pub struct PredeployJobRun {
17103    /// Output only. The resource name of the Cloud Build `Build` object that is
17104    /// used to execute the custom actions associated with the predeploy Job.
17105    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17106    pub build: std::string::String,
17107
17108    /// Output only. The reason the predeploy failed. This will always be
17109    /// unspecified while the predeploy is in progress or if it succeeded.
17110    pub failure_cause: crate::model::predeploy_job_run::FailureCause,
17111
17112    /// Output only. Additional information about the predeploy failure, if
17113    /// available.
17114    pub failure_message: std::string::String,
17115
17116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17117}
17118
17119impl PredeployJobRun {
17120    /// Creates a new default instance.
17121    pub fn new() -> Self {
17122        std::default::Default::default()
17123    }
17124
17125    /// Sets the value of [build][crate::model::PredeployJobRun::build].
17126    ///
17127    /// # Example
17128    /// ```ignore,no_run
17129    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17130    /// let x = PredeployJobRun::new().set_build("example");
17131    /// ```
17132    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17133        self.build = v.into();
17134        self
17135    }
17136
17137    /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
17138    ///
17139    /// # Example
17140    /// ```ignore,no_run
17141    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17142    /// use google_cloud_deploy_v1::model::predeploy_job_run::FailureCause;
17143    /// let x0 = PredeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17144    /// let x1 = PredeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17145    /// let x2 = PredeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17146    /// ```
17147    pub fn set_failure_cause<
17148        T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
17149    >(
17150        mut self,
17151        v: T,
17152    ) -> Self {
17153        self.failure_cause = v.into();
17154        self
17155    }
17156
17157    /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
17158    ///
17159    /// # Example
17160    /// ```ignore,no_run
17161    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17162    /// let x = PredeployJobRun::new().set_failure_message("example");
17163    /// ```
17164    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17165        self.failure_message = v.into();
17166        self
17167    }
17168}
17169
17170impl wkt::message::Message for PredeployJobRun {
17171    fn typename() -> &'static str {
17172        "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
17173    }
17174}
17175
17176/// Defines additional types related to [PredeployJobRun].
17177pub mod predeploy_job_run {
17178    #[allow(unused_imports)]
17179    use super::*;
17180
17181    /// Well-known predeploy failures.
17182    ///
17183    /// # Working with unknown values
17184    ///
17185    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17186    /// additional enum variants at any time. Adding new variants is not considered
17187    /// a breaking change. Applications should write their code in anticipation of:
17188    ///
17189    /// - New values appearing in future releases of the client library, **and**
17190    /// - New values received dynamically, without application changes.
17191    ///
17192    /// Please consult the [Working with enums] section in the user guide for some
17193    /// guidelines.
17194    ///
17195    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17196    #[derive(Clone, Debug, PartialEq)]
17197    #[non_exhaustive]
17198    pub enum FailureCause {
17199        /// No reason for failure is specified.
17200        Unspecified,
17201        /// Cloud Build is not available, either because it is not enabled or because
17202        /// Cloud Deploy has insufficient permissions. See [required
17203        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17204        CloudBuildUnavailable,
17205        /// The predeploy operation did not complete successfully; check Cloud Build
17206        /// logs.
17207        ExecutionFailed,
17208        /// The predeploy job run did not complete within the allotted time.
17209        DeadlineExceeded,
17210        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17211        /// for additional details.
17212        CloudBuildRequestFailed,
17213        /// If set, the enum was initialized with an unknown value.
17214        ///
17215        /// Applications can examine the value using [FailureCause::value] or
17216        /// [FailureCause::name].
17217        UnknownValue(failure_cause::UnknownValue),
17218    }
17219
17220    #[doc(hidden)]
17221    pub mod failure_cause {
17222        #[allow(unused_imports)]
17223        use super::*;
17224        #[derive(Clone, Debug, PartialEq)]
17225        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17226    }
17227
17228    impl FailureCause {
17229        /// Gets the enum value.
17230        ///
17231        /// Returns `None` if the enum contains an unknown value deserialized from
17232        /// the string representation of enums.
17233        pub fn value(&self) -> std::option::Option<i32> {
17234            match self {
17235                Self::Unspecified => std::option::Option::Some(0),
17236                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17237                Self::ExecutionFailed => std::option::Option::Some(2),
17238                Self::DeadlineExceeded => std::option::Option::Some(3),
17239                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17240                Self::UnknownValue(u) => u.0.value(),
17241            }
17242        }
17243
17244        /// Gets the enum value as a string.
17245        ///
17246        /// Returns `None` if the enum contains an unknown value deserialized from
17247        /// the integer representation of enums.
17248        pub fn name(&self) -> std::option::Option<&str> {
17249            match self {
17250                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17251                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17252                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17253                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17254                Self::CloudBuildRequestFailed => {
17255                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17256                }
17257                Self::UnknownValue(u) => u.0.name(),
17258            }
17259        }
17260    }
17261
17262    impl std::default::Default for FailureCause {
17263        fn default() -> Self {
17264            use std::convert::From;
17265            Self::from(0)
17266        }
17267    }
17268
17269    impl std::fmt::Display for FailureCause {
17270        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17271            wkt::internal::display_enum(f, self.name(), self.value())
17272        }
17273    }
17274
17275    impl std::convert::From<i32> for FailureCause {
17276        fn from(value: i32) -> Self {
17277            match value {
17278                0 => Self::Unspecified,
17279                1 => Self::CloudBuildUnavailable,
17280                2 => Self::ExecutionFailed,
17281                3 => Self::DeadlineExceeded,
17282                4 => Self::CloudBuildRequestFailed,
17283                _ => Self::UnknownValue(failure_cause::UnknownValue(
17284                    wkt::internal::UnknownEnumValue::Integer(value),
17285                )),
17286            }
17287        }
17288    }
17289
17290    impl std::convert::From<&str> for FailureCause {
17291        fn from(value: &str) -> Self {
17292            use std::string::ToString;
17293            match value {
17294                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17295                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17296                "EXECUTION_FAILED" => Self::ExecutionFailed,
17297                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17298                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17299                _ => Self::UnknownValue(failure_cause::UnknownValue(
17300                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17301                )),
17302            }
17303        }
17304    }
17305
17306    impl serde::ser::Serialize for FailureCause {
17307        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17308        where
17309            S: serde::Serializer,
17310        {
17311            match self {
17312                Self::Unspecified => serializer.serialize_i32(0),
17313                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17314                Self::ExecutionFailed => serializer.serialize_i32(2),
17315                Self::DeadlineExceeded => serializer.serialize_i32(3),
17316                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17317                Self::UnknownValue(u) => u.0.serialize(serializer),
17318            }
17319        }
17320    }
17321
17322    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17323        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17324        where
17325            D: serde::Deserializer<'de>,
17326        {
17327            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17328                ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
17329            ))
17330        }
17331    }
17332}
17333
17334/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
17335#[derive(Clone, Default, PartialEq)]
17336#[non_exhaustive]
17337pub struct PostdeployJobRun {
17338    /// Output only. The resource name of the Cloud Build `Build` object that is
17339    /// used to execute the custom actions associated with the postdeploy Job.
17340    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17341    pub build: std::string::String,
17342
17343    /// Output only. The reason the postdeploy failed. This will always be
17344    /// unspecified while the postdeploy is in progress or if it succeeded.
17345    pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
17346
17347    /// Output only. Additional information about the postdeploy failure, if
17348    /// available.
17349    pub failure_message: std::string::String,
17350
17351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17352}
17353
17354impl PostdeployJobRun {
17355    /// Creates a new default instance.
17356    pub fn new() -> Self {
17357        std::default::Default::default()
17358    }
17359
17360    /// Sets the value of [build][crate::model::PostdeployJobRun::build].
17361    ///
17362    /// # Example
17363    /// ```ignore,no_run
17364    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17365    /// let x = PostdeployJobRun::new().set_build("example");
17366    /// ```
17367    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17368        self.build = v.into();
17369        self
17370    }
17371
17372    /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
17373    ///
17374    /// # Example
17375    /// ```ignore,no_run
17376    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17377    /// use google_cloud_deploy_v1::model::postdeploy_job_run::FailureCause;
17378    /// let x0 = PostdeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17379    /// let x1 = PostdeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17380    /// let x2 = PostdeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17381    /// ```
17382    pub fn set_failure_cause<
17383        T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
17384    >(
17385        mut self,
17386        v: T,
17387    ) -> Self {
17388        self.failure_cause = v.into();
17389        self
17390    }
17391
17392    /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
17393    ///
17394    /// # Example
17395    /// ```ignore,no_run
17396    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17397    /// let x = PostdeployJobRun::new().set_failure_message("example");
17398    /// ```
17399    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17400        self.failure_message = v.into();
17401        self
17402    }
17403}
17404
17405impl wkt::message::Message for PostdeployJobRun {
17406    fn typename() -> &'static str {
17407        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
17408    }
17409}
17410
17411/// Defines additional types related to [PostdeployJobRun].
17412pub mod postdeploy_job_run {
17413    #[allow(unused_imports)]
17414    use super::*;
17415
17416    /// Well-known postdeploy failures.
17417    ///
17418    /// # Working with unknown values
17419    ///
17420    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17421    /// additional enum variants at any time. Adding new variants is not considered
17422    /// a breaking change. Applications should write their code in anticipation of:
17423    ///
17424    /// - New values appearing in future releases of the client library, **and**
17425    /// - New values received dynamically, without application changes.
17426    ///
17427    /// Please consult the [Working with enums] section in the user guide for some
17428    /// guidelines.
17429    ///
17430    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17431    #[derive(Clone, Debug, PartialEq)]
17432    #[non_exhaustive]
17433    pub enum FailureCause {
17434        /// No reason for failure is specified.
17435        Unspecified,
17436        /// Cloud Build is not available, either because it is not enabled or because
17437        /// Cloud Deploy has insufficient permissions. See [required
17438        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17439        CloudBuildUnavailable,
17440        /// The postdeploy operation did not complete successfully; check Cloud Build
17441        /// logs.
17442        ExecutionFailed,
17443        /// The postdeploy job run did not complete within the allotted time.
17444        DeadlineExceeded,
17445        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17446        /// for additional details.
17447        CloudBuildRequestFailed,
17448        /// If set, the enum was initialized with an unknown value.
17449        ///
17450        /// Applications can examine the value using [FailureCause::value] or
17451        /// [FailureCause::name].
17452        UnknownValue(failure_cause::UnknownValue),
17453    }
17454
17455    #[doc(hidden)]
17456    pub mod failure_cause {
17457        #[allow(unused_imports)]
17458        use super::*;
17459        #[derive(Clone, Debug, PartialEq)]
17460        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17461    }
17462
17463    impl FailureCause {
17464        /// Gets the enum value.
17465        ///
17466        /// Returns `None` if the enum contains an unknown value deserialized from
17467        /// the string representation of enums.
17468        pub fn value(&self) -> std::option::Option<i32> {
17469            match self {
17470                Self::Unspecified => std::option::Option::Some(0),
17471                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17472                Self::ExecutionFailed => std::option::Option::Some(2),
17473                Self::DeadlineExceeded => std::option::Option::Some(3),
17474                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17475                Self::UnknownValue(u) => u.0.value(),
17476            }
17477        }
17478
17479        /// Gets the enum value as a string.
17480        ///
17481        /// Returns `None` if the enum contains an unknown value deserialized from
17482        /// the integer representation of enums.
17483        pub fn name(&self) -> std::option::Option<&str> {
17484            match self {
17485                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17486                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17487                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17488                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17489                Self::CloudBuildRequestFailed => {
17490                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17491                }
17492                Self::UnknownValue(u) => u.0.name(),
17493            }
17494        }
17495    }
17496
17497    impl std::default::Default for FailureCause {
17498        fn default() -> Self {
17499            use std::convert::From;
17500            Self::from(0)
17501        }
17502    }
17503
17504    impl std::fmt::Display for FailureCause {
17505        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17506            wkt::internal::display_enum(f, self.name(), self.value())
17507        }
17508    }
17509
17510    impl std::convert::From<i32> for FailureCause {
17511        fn from(value: i32) -> Self {
17512            match value {
17513                0 => Self::Unspecified,
17514                1 => Self::CloudBuildUnavailable,
17515                2 => Self::ExecutionFailed,
17516                3 => Self::DeadlineExceeded,
17517                4 => Self::CloudBuildRequestFailed,
17518                _ => Self::UnknownValue(failure_cause::UnknownValue(
17519                    wkt::internal::UnknownEnumValue::Integer(value),
17520                )),
17521            }
17522        }
17523    }
17524
17525    impl std::convert::From<&str> for FailureCause {
17526        fn from(value: &str) -> Self {
17527            use std::string::ToString;
17528            match value {
17529                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17530                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17531                "EXECUTION_FAILED" => Self::ExecutionFailed,
17532                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17533                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17534                _ => Self::UnknownValue(failure_cause::UnknownValue(
17535                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17536                )),
17537            }
17538        }
17539    }
17540
17541    impl serde::ser::Serialize for FailureCause {
17542        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17543        where
17544            S: serde::Serializer,
17545        {
17546            match self {
17547                Self::Unspecified => serializer.serialize_i32(0),
17548                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17549                Self::ExecutionFailed => serializer.serialize_i32(2),
17550                Self::DeadlineExceeded => serializer.serialize_i32(3),
17551                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17552                Self::UnknownValue(u) => u.0.serialize(serializer),
17553            }
17554        }
17555    }
17556
17557    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17558        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17559        where
17560            D: serde::Deserializer<'de>,
17561        {
17562            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17563                ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
17564            ))
17565        }
17566    }
17567}
17568
17569/// CreateChildRolloutJobRun contains information specific to a
17570/// createChildRollout `JobRun`.
17571#[derive(Clone, Default, PartialEq)]
17572#[non_exhaustive]
17573pub struct CreateChildRolloutJobRun {
17574    /// Output only. Name of the `ChildRollout`. Format is
17575    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17576    pub rollout: std::string::String,
17577
17578    /// Output only. The ID of the childRollout Phase initiated by this JobRun.
17579    pub rollout_phase_id: std::string::String,
17580
17581    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17582}
17583
17584impl CreateChildRolloutJobRun {
17585    /// Creates a new default instance.
17586    pub fn new() -> Self {
17587        std::default::Default::default()
17588    }
17589
17590    /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
17591    ///
17592    /// # Example
17593    /// ```ignore,no_run
17594    /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17595    /// let x = CreateChildRolloutJobRun::new().set_rollout("example");
17596    /// ```
17597    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17598        self.rollout = v.into();
17599        self
17600    }
17601
17602    /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
17603    ///
17604    /// # Example
17605    /// ```ignore,no_run
17606    /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17607    /// let x = CreateChildRolloutJobRun::new().set_rollout_phase_id("example");
17608    /// ```
17609    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17610        mut self,
17611        v: T,
17612    ) -> Self {
17613        self.rollout_phase_id = v.into();
17614        self
17615    }
17616}
17617
17618impl wkt::message::Message for CreateChildRolloutJobRun {
17619    fn typename() -> &'static str {
17620        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
17621    }
17622}
17623
17624/// AdvanceChildRolloutJobRun contains information specific to a
17625/// advanceChildRollout `JobRun`.
17626#[derive(Clone, Default, PartialEq)]
17627#[non_exhaustive]
17628pub struct AdvanceChildRolloutJobRun {
17629    /// Output only. Name of the `ChildRollout`. Format is
17630    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17631    pub rollout: std::string::String,
17632
17633    /// Output only. the ID of the ChildRollout's Phase.
17634    pub rollout_phase_id: std::string::String,
17635
17636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17637}
17638
17639impl AdvanceChildRolloutJobRun {
17640    /// Creates a new default instance.
17641    pub fn new() -> Self {
17642        std::default::Default::default()
17643    }
17644
17645    /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
17646    ///
17647    /// # Example
17648    /// ```ignore,no_run
17649    /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17650    /// let x = AdvanceChildRolloutJobRun::new().set_rollout("example");
17651    /// ```
17652    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17653        self.rollout = v.into();
17654        self
17655    }
17656
17657    /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
17658    ///
17659    /// # Example
17660    /// ```ignore,no_run
17661    /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17662    /// let x = AdvanceChildRolloutJobRun::new().set_rollout_phase_id("example");
17663    /// ```
17664    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17665        mut self,
17666        v: T,
17667    ) -> Self {
17668        self.rollout_phase_id = v.into();
17669        self
17670    }
17671}
17672
17673impl wkt::message::Message for AdvanceChildRolloutJobRun {
17674    fn typename() -> &'static str {
17675        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
17676    }
17677}
17678
17679/// ListJobRunsRequest is the request object used by `ListJobRuns`.
17680#[derive(Clone, Default, PartialEq)]
17681#[non_exhaustive]
17682pub struct ListJobRunsRequest {
17683    /// Required. The `Rollout` which owns this collection of `JobRun` objects.
17684    pub parent: std::string::String,
17685
17686    /// Optional. The maximum number of `JobRun` objects to return. The service may
17687    /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
17688    /// will be returned. The maximum value is 1000; values above 1000 will be set
17689    /// to 1000.
17690    pub page_size: i32,
17691
17692    /// Optional. A page token, received from a previous `ListJobRuns` call.
17693    /// Provide this to retrieve the subsequent page.
17694    ///
17695    /// When paginating, all other provided parameters match the call that provided
17696    /// the page token.
17697    pub page_token: std::string::String,
17698
17699    /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
17700    /// more details.
17701    pub filter: std::string::String,
17702
17703    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
17704    /// more details.
17705    pub order_by: std::string::String,
17706
17707    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17708}
17709
17710impl ListJobRunsRequest {
17711    /// Creates a new default instance.
17712    pub fn new() -> Self {
17713        std::default::Default::default()
17714    }
17715
17716    /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
17717    ///
17718    /// # Example
17719    /// ```ignore,no_run
17720    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17721    /// let x = ListJobRunsRequest::new().set_parent("example");
17722    /// ```
17723    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17724        self.parent = v.into();
17725        self
17726    }
17727
17728    /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
17729    ///
17730    /// # Example
17731    /// ```ignore,no_run
17732    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17733    /// let x = ListJobRunsRequest::new().set_page_size(42);
17734    /// ```
17735    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17736        self.page_size = v.into();
17737        self
17738    }
17739
17740    /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
17741    ///
17742    /// # Example
17743    /// ```ignore,no_run
17744    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17745    /// let x = ListJobRunsRequest::new().set_page_token("example");
17746    /// ```
17747    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17748        self.page_token = v.into();
17749        self
17750    }
17751
17752    /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
17753    ///
17754    /// # Example
17755    /// ```ignore,no_run
17756    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17757    /// let x = ListJobRunsRequest::new().set_filter("example");
17758    /// ```
17759    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17760        self.filter = v.into();
17761        self
17762    }
17763
17764    /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
17765    ///
17766    /// # Example
17767    /// ```ignore,no_run
17768    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17769    /// let x = ListJobRunsRequest::new().set_order_by("example");
17770    /// ```
17771    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17772        self.order_by = v.into();
17773        self
17774    }
17775}
17776
17777impl wkt::message::Message for ListJobRunsRequest {
17778    fn typename() -> &'static str {
17779        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
17780    }
17781}
17782
17783/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
17784#[derive(Clone, Default, PartialEq)]
17785#[non_exhaustive]
17786pub struct ListJobRunsResponse {
17787    /// The `JobRun` objects.
17788    pub job_runs: std::vec::Vec<crate::model::JobRun>,
17789
17790    /// A token, which can be sent as `page_token` to retrieve the next page. If
17791    /// this field is omitted, there are no subsequent pages.
17792    pub next_page_token: std::string::String,
17793
17794    /// Locations that could not be reached
17795    pub unreachable: std::vec::Vec<std::string::String>,
17796
17797    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17798}
17799
17800impl ListJobRunsResponse {
17801    /// Creates a new default instance.
17802    pub fn new() -> Self {
17803        std::default::Default::default()
17804    }
17805
17806    /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
17807    ///
17808    /// # Example
17809    /// ```ignore,no_run
17810    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17811    /// use google_cloud_deploy_v1::model::JobRun;
17812    /// let x = ListJobRunsResponse::new()
17813    ///     .set_job_runs([
17814    ///         JobRun::default()/* use setters */,
17815    ///         JobRun::default()/* use (different) setters */,
17816    ///     ]);
17817    /// ```
17818    pub fn set_job_runs<T, V>(mut self, v: T) -> Self
17819    where
17820        T: std::iter::IntoIterator<Item = V>,
17821        V: std::convert::Into<crate::model::JobRun>,
17822    {
17823        use std::iter::Iterator;
17824        self.job_runs = v.into_iter().map(|i| i.into()).collect();
17825        self
17826    }
17827
17828    /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
17829    ///
17830    /// # Example
17831    /// ```ignore,no_run
17832    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17833    /// let x = ListJobRunsResponse::new().set_next_page_token("example");
17834    /// ```
17835    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17836        self.next_page_token = v.into();
17837        self
17838    }
17839
17840    /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
17841    ///
17842    /// # Example
17843    /// ```ignore,no_run
17844    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17845    /// let x = ListJobRunsResponse::new().set_unreachable(["a", "b", "c"]);
17846    /// ```
17847    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17848    where
17849        T: std::iter::IntoIterator<Item = V>,
17850        V: std::convert::Into<std::string::String>,
17851    {
17852        use std::iter::Iterator;
17853        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17854        self
17855    }
17856}
17857
17858impl wkt::message::Message for ListJobRunsResponse {
17859    fn typename() -> &'static str {
17860        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
17861    }
17862}
17863
17864#[doc(hidden)]
17865impl google_cloud_gax::paginator::internal::PageableResponse for ListJobRunsResponse {
17866    type PageItem = crate::model::JobRun;
17867
17868    fn items(self) -> std::vec::Vec<Self::PageItem> {
17869        self.job_runs
17870    }
17871
17872    fn next_page_token(&self) -> std::string::String {
17873        use std::clone::Clone;
17874        self.next_page_token.clone()
17875    }
17876}
17877
17878/// GetJobRunRequest is the request object used by `GetJobRun`.
17879#[derive(Clone, Default, PartialEq)]
17880#[non_exhaustive]
17881pub struct GetJobRunRequest {
17882    /// Required. Name of the `JobRun`. Format must be
17883    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
17884    pub name: std::string::String,
17885
17886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17887}
17888
17889impl GetJobRunRequest {
17890    /// Creates a new default instance.
17891    pub fn new() -> Self {
17892        std::default::Default::default()
17893    }
17894
17895    /// Sets the value of [name][crate::model::GetJobRunRequest::name].
17896    ///
17897    /// # Example
17898    /// ```ignore,no_run
17899    /// # use google_cloud_deploy_v1::model::GetJobRunRequest;
17900    /// let x = GetJobRunRequest::new().set_name("example");
17901    /// ```
17902    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17903        self.name = v.into();
17904        self
17905    }
17906}
17907
17908impl wkt::message::Message for GetJobRunRequest {
17909    fn typename() -> &'static str {
17910        "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
17911    }
17912}
17913
17914/// The request object used by `TerminateJobRun`.
17915#[derive(Clone, Default, PartialEq)]
17916#[non_exhaustive]
17917pub struct TerminateJobRunRequest {
17918    /// Required. Name of the `JobRun`. Format must be
17919    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
17920    pub name: std::string::String,
17921
17922    /// Optional. Deploy policies to override. Format is
17923    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
17924    pub override_deploy_policy: std::vec::Vec<std::string::String>,
17925
17926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17927}
17928
17929impl TerminateJobRunRequest {
17930    /// Creates a new default instance.
17931    pub fn new() -> Self {
17932        std::default::Default::default()
17933    }
17934
17935    /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
17936    ///
17937    /// # Example
17938    /// ```ignore,no_run
17939    /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17940    /// let x = TerminateJobRunRequest::new().set_name("example");
17941    /// ```
17942    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17943        self.name = v.into();
17944        self
17945    }
17946
17947    /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
17948    ///
17949    /// # Example
17950    /// ```ignore,no_run
17951    /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17952    /// let x = TerminateJobRunRequest::new().set_override_deploy_policy(["a", "b", "c"]);
17953    /// ```
17954    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
17955    where
17956        T: std::iter::IntoIterator<Item = V>,
17957        V: std::convert::Into<std::string::String>,
17958    {
17959        use std::iter::Iterator;
17960        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
17961        self
17962    }
17963}
17964
17965impl wkt::message::Message for TerminateJobRunRequest {
17966    fn typename() -> &'static str {
17967        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
17968    }
17969}
17970
17971/// The response object from `TerminateJobRun`.
17972#[derive(Clone, Default, PartialEq)]
17973#[non_exhaustive]
17974pub struct TerminateJobRunResponse {
17975    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17976}
17977
17978impl TerminateJobRunResponse {
17979    /// Creates a new default instance.
17980    pub fn new() -> Self {
17981        std::default::Default::default()
17982    }
17983}
17984
17985impl wkt::message::Message for TerminateJobRunResponse {
17986    fn typename() -> &'static str {
17987        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
17988    }
17989}
17990
17991/// Service-wide configuration.
17992#[derive(Clone, Default, PartialEq)]
17993#[non_exhaustive]
17994pub struct Config {
17995    /// Name of the configuration.
17996    pub name: std::string::String,
17997
17998    /// All supported versions of Skaffold.
17999    pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
18000
18001    /// Default Skaffold version that is assigned when a Release is created without
18002    /// specifying a Skaffold version.
18003    pub default_skaffold_version: std::string::String,
18004
18005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18006}
18007
18008impl Config {
18009    /// Creates a new default instance.
18010    pub fn new() -> Self {
18011        std::default::Default::default()
18012    }
18013
18014    /// Sets the value of [name][crate::model::Config::name].
18015    ///
18016    /// # Example
18017    /// ```ignore,no_run
18018    /// # use google_cloud_deploy_v1::model::Config;
18019    /// let x = Config::new().set_name("example");
18020    /// ```
18021    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18022        self.name = v.into();
18023        self
18024    }
18025
18026    /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
18027    ///
18028    /// # Example
18029    /// ```ignore,no_run
18030    /// # use google_cloud_deploy_v1::model::Config;
18031    /// use google_cloud_deploy_v1::model::SkaffoldVersion;
18032    /// let x = Config::new()
18033    ///     .set_supported_versions([
18034    ///         SkaffoldVersion::default()/* use setters */,
18035    ///         SkaffoldVersion::default()/* use (different) setters */,
18036    ///     ]);
18037    /// ```
18038    pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
18039    where
18040        T: std::iter::IntoIterator<Item = V>,
18041        V: std::convert::Into<crate::model::SkaffoldVersion>,
18042    {
18043        use std::iter::Iterator;
18044        self.supported_versions = v.into_iter().map(|i| i.into()).collect();
18045        self
18046    }
18047
18048    /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
18049    ///
18050    /// # Example
18051    /// ```ignore,no_run
18052    /// # use google_cloud_deploy_v1::model::Config;
18053    /// let x = Config::new().set_default_skaffold_version("example");
18054    /// ```
18055    pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
18056        mut self,
18057        v: T,
18058    ) -> Self {
18059        self.default_skaffold_version = v.into();
18060        self
18061    }
18062}
18063
18064impl wkt::message::Message for Config {
18065    fn typename() -> &'static str {
18066        "type.googleapis.com/google.cloud.deploy.v1.Config"
18067    }
18068}
18069
18070/// Details of a supported Skaffold version.
18071#[derive(Clone, Default, PartialEq)]
18072#[non_exhaustive]
18073pub struct SkaffoldVersion {
18074    /// Release version number. For example, "1.20.3".
18075    pub version: std::string::String,
18076
18077    /// The time at which this version of Skaffold will enter maintenance mode.
18078    pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
18079
18080    /// The time at which this version of Skaffold will no longer be supported.
18081    pub support_expiration_time: std::option::Option<wkt::Timestamp>,
18082
18083    /// Date when this version is expected to no longer be supported.
18084    pub support_end_date: std::option::Option<google_cloud_type::model::Date>,
18085
18086    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18087}
18088
18089impl SkaffoldVersion {
18090    /// Creates a new default instance.
18091    pub fn new() -> Self {
18092        std::default::Default::default()
18093    }
18094
18095    /// Sets the value of [version][crate::model::SkaffoldVersion::version].
18096    ///
18097    /// # Example
18098    /// ```ignore,no_run
18099    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18100    /// let x = SkaffoldVersion::new().set_version("example");
18101    /// ```
18102    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18103        self.version = v.into();
18104        self
18105    }
18106
18107    /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
18108    ///
18109    /// # Example
18110    /// ```ignore,no_run
18111    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18112    /// use wkt::Timestamp;
18113    /// let x = SkaffoldVersion::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
18114    /// ```
18115    pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
18116    where
18117        T: std::convert::Into<wkt::Timestamp>,
18118    {
18119        self.maintenance_mode_time = std::option::Option::Some(v.into());
18120        self
18121    }
18122
18123    /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
18124    ///
18125    /// # Example
18126    /// ```ignore,no_run
18127    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18128    /// use wkt::Timestamp;
18129    /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
18130    /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
18131    /// ```
18132    pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
18133    where
18134        T: std::convert::Into<wkt::Timestamp>,
18135    {
18136        self.maintenance_mode_time = v.map(|x| x.into());
18137        self
18138    }
18139
18140    /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18141    ///
18142    /// # Example
18143    /// ```ignore,no_run
18144    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18145    /// use wkt::Timestamp;
18146    /// let x = SkaffoldVersion::new().set_support_expiration_time(Timestamp::default()/* use setters */);
18147    /// ```
18148    pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
18149    where
18150        T: std::convert::Into<wkt::Timestamp>,
18151    {
18152        self.support_expiration_time = std::option::Option::Some(v.into());
18153        self
18154    }
18155
18156    /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18157    ///
18158    /// # Example
18159    /// ```ignore,no_run
18160    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18161    /// use wkt::Timestamp;
18162    /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
18163    /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(None::<Timestamp>);
18164    /// ```
18165    pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18166    where
18167        T: std::convert::Into<wkt::Timestamp>,
18168    {
18169        self.support_expiration_time = v.map(|x| x.into());
18170        self
18171    }
18172
18173    /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18174    ///
18175    /// # Example
18176    /// ```ignore,no_run
18177    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18178    /// use google_cloud_type::model::Date;
18179    /// let x = SkaffoldVersion::new().set_support_end_date(Date::default()/* use setters */);
18180    /// ```
18181    pub fn set_support_end_date<T>(mut self, v: T) -> Self
18182    where
18183        T: std::convert::Into<google_cloud_type::model::Date>,
18184    {
18185        self.support_end_date = std::option::Option::Some(v.into());
18186        self
18187    }
18188
18189    /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18190    ///
18191    /// # Example
18192    /// ```ignore,no_run
18193    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18194    /// use google_cloud_type::model::Date;
18195    /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(Some(Date::default()/* use setters */));
18196    /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(None::<Date>);
18197    /// ```
18198    pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
18199    where
18200        T: std::convert::Into<google_cloud_type::model::Date>,
18201    {
18202        self.support_end_date = v.map(|x| x.into());
18203        self
18204    }
18205}
18206
18207impl wkt::message::Message for SkaffoldVersion {
18208    fn typename() -> &'static str {
18209        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
18210    }
18211}
18212
18213/// Request to get a configuration.
18214#[derive(Clone, Default, PartialEq)]
18215#[non_exhaustive]
18216pub struct GetConfigRequest {
18217    /// Required. Name of requested configuration.
18218    pub name: std::string::String,
18219
18220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18221}
18222
18223impl GetConfigRequest {
18224    /// Creates a new default instance.
18225    pub fn new() -> Self {
18226        std::default::Default::default()
18227    }
18228
18229    /// Sets the value of [name][crate::model::GetConfigRequest::name].
18230    ///
18231    /// # Example
18232    /// ```ignore,no_run
18233    /// # use google_cloud_deploy_v1::model::GetConfigRequest;
18234    /// let x = GetConfigRequest::new().set_name("example");
18235    /// ```
18236    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18237        self.name = v.into();
18238        self
18239    }
18240}
18241
18242impl wkt::message::Message for GetConfigRequest {
18243    fn typename() -> &'static str {
18244        "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
18245    }
18246}
18247
18248/// An `Automation` resource in the Cloud Deploy API.
18249///
18250/// An `Automation` enables the automation of manually driven actions for
18251/// a Delivery Pipeline, which includes Release promotion among Targets,
18252/// Rollout repair and Rollout deployment strategy advancement. The intention
18253/// of Automation is to reduce manual intervention in the continuous delivery
18254/// process.
18255#[derive(Clone, Default, PartialEq)]
18256#[non_exhaustive]
18257pub struct Automation {
18258    /// Output only. Name of the `Automation`. Format is
18259    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
18260    pub name: std::string::String,
18261
18262    /// Output only. Unique identifier of the `Automation`.
18263    pub uid: std::string::String,
18264
18265    /// Optional. Description of the `Automation`. Max length is 255 characters.
18266    pub description: std::string::String,
18267
18268    /// Output only. Time at which the automation was created.
18269    pub create_time: std::option::Option<wkt::Timestamp>,
18270
18271    /// Output only. Time at which the automation was updated.
18272    pub update_time: std::option::Option<wkt::Timestamp>,
18273
18274    /// Optional. User annotations. These attributes can only be set and used by
18275    /// the user, and not by Cloud Deploy. Annotations must meet the following
18276    /// constraints:
18277    ///
18278    /// * Annotations are key/value pairs.
18279    /// * Valid annotation keys have two segments: an optional prefix and name,
18280    ///   separated by a slash (`/`).
18281    /// * The name segment is required and must be 63 characters or less,
18282    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
18283    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
18284    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
18285    ///   a series of DNS labels separated by dots(`.`), not longer than 253
18286    ///   characters in total, followed by a slash (`/`).
18287    ///
18288    /// See
18289    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
18290    /// for more details.
18291    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18292
18293    /// Optional. Labels are attributes that can be set and used by both the
18294    /// user and by Cloud Deploy. Labels must meet the following constraints:
18295    ///
18296    /// * Keys and values can contain only lowercase letters, numeric characters,
18297    ///   underscores, and dashes.
18298    /// * All characters must use UTF-8 encoding, and international characters are
18299    ///   allowed.
18300    /// * Keys must start with a lowercase letter or international character.
18301    /// * Each resource is limited to a maximum of 64 labels.
18302    ///
18303    /// Both keys and values are additionally constrained to be <= 63 characters.
18304    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18305
18306    /// Optional. The weak etag of the `Automation` resource.
18307    /// This checksum is computed by the server based on the value of other
18308    /// fields, and may be sent on update and delete requests to ensure the
18309    /// client has an up-to-date value before proceeding.
18310    pub etag: std::string::String,
18311
18312    /// Optional. When Suspended, automation is deactivated from execution.
18313    pub suspended: bool,
18314
18315    /// Required. Email address of the user-managed IAM service account that
18316    /// creates Cloud Deploy release and rollout resources.
18317    pub service_account: std::string::String,
18318
18319    /// Required. Selected resources to which the automation will be applied.
18320    pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
18321
18322    /// Required. List of Automation rules associated with the Automation resource.
18323    /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
18324    /// Note: the order of the rules here is not the same as the order of
18325    /// execution.
18326    pub rules: std::vec::Vec<crate::model::AutomationRule>,
18327
18328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18329}
18330
18331impl Automation {
18332    /// Creates a new default instance.
18333    pub fn new() -> Self {
18334        std::default::Default::default()
18335    }
18336
18337    /// Sets the value of [name][crate::model::Automation::name].
18338    ///
18339    /// # Example
18340    /// ```ignore,no_run
18341    /// # use google_cloud_deploy_v1::model::Automation;
18342    /// let x = Automation::new().set_name("example");
18343    /// ```
18344    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18345        self.name = v.into();
18346        self
18347    }
18348
18349    /// Sets the value of [uid][crate::model::Automation::uid].
18350    ///
18351    /// # Example
18352    /// ```ignore,no_run
18353    /// # use google_cloud_deploy_v1::model::Automation;
18354    /// let x = Automation::new().set_uid("example");
18355    /// ```
18356    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18357        self.uid = v.into();
18358        self
18359    }
18360
18361    /// Sets the value of [description][crate::model::Automation::description].
18362    ///
18363    /// # Example
18364    /// ```ignore,no_run
18365    /// # use google_cloud_deploy_v1::model::Automation;
18366    /// let x = Automation::new().set_description("example");
18367    /// ```
18368    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18369        self.description = v.into();
18370        self
18371    }
18372
18373    /// Sets the value of [create_time][crate::model::Automation::create_time].
18374    ///
18375    /// # Example
18376    /// ```ignore,no_run
18377    /// # use google_cloud_deploy_v1::model::Automation;
18378    /// use wkt::Timestamp;
18379    /// let x = Automation::new().set_create_time(Timestamp::default()/* use setters */);
18380    /// ```
18381    pub fn set_create_time<T>(mut self, v: T) -> Self
18382    where
18383        T: std::convert::Into<wkt::Timestamp>,
18384    {
18385        self.create_time = std::option::Option::Some(v.into());
18386        self
18387    }
18388
18389    /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
18390    ///
18391    /// # Example
18392    /// ```ignore,no_run
18393    /// # use google_cloud_deploy_v1::model::Automation;
18394    /// use wkt::Timestamp;
18395    /// let x = Automation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18396    /// let x = Automation::new().set_or_clear_create_time(None::<Timestamp>);
18397    /// ```
18398    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18399    where
18400        T: std::convert::Into<wkt::Timestamp>,
18401    {
18402        self.create_time = v.map(|x| x.into());
18403        self
18404    }
18405
18406    /// Sets the value of [update_time][crate::model::Automation::update_time].
18407    ///
18408    /// # Example
18409    /// ```ignore,no_run
18410    /// # use google_cloud_deploy_v1::model::Automation;
18411    /// use wkt::Timestamp;
18412    /// let x = Automation::new().set_update_time(Timestamp::default()/* use setters */);
18413    /// ```
18414    pub fn set_update_time<T>(mut self, v: T) -> Self
18415    where
18416        T: std::convert::Into<wkt::Timestamp>,
18417    {
18418        self.update_time = std::option::Option::Some(v.into());
18419        self
18420    }
18421
18422    /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
18423    ///
18424    /// # Example
18425    /// ```ignore,no_run
18426    /// # use google_cloud_deploy_v1::model::Automation;
18427    /// use wkt::Timestamp;
18428    /// let x = Automation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18429    /// let x = Automation::new().set_or_clear_update_time(None::<Timestamp>);
18430    /// ```
18431    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18432    where
18433        T: std::convert::Into<wkt::Timestamp>,
18434    {
18435        self.update_time = v.map(|x| x.into());
18436        self
18437    }
18438
18439    /// Sets the value of [annotations][crate::model::Automation::annotations].
18440    ///
18441    /// # Example
18442    /// ```ignore,no_run
18443    /// # use google_cloud_deploy_v1::model::Automation;
18444    /// let x = Automation::new().set_annotations([
18445    ///     ("key0", "abc"),
18446    ///     ("key1", "xyz"),
18447    /// ]);
18448    /// ```
18449    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18450    where
18451        T: std::iter::IntoIterator<Item = (K, V)>,
18452        K: std::convert::Into<std::string::String>,
18453        V: std::convert::Into<std::string::String>,
18454    {
18455        use std::iter::Iterator;
18456        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18457        self
18458    }
18459
18460    /// Sets the value of [labels][crate::model::Automation::labels].
18461    ///
18462    /// # Example
18463    /// ```ignore,no_run
18464    /// # use google_cloud_deploy_v1::model::Automation;
18465    /// let x = Automation::new().set_labels([
18466    ///     ("key0", "abc"),
18467    ///     ("key1", "xyz"),
18468    /// ]);
18469    /// ```
18470    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18471    where
18472        T: std::iter::IntoIterator<Item = (K, V)>,
18473        K: std::convert::Into<std::string::String>,
18474        V: std::convert::Into<std::string::String>,
18475    {
18476        use std::iter::Iterator;
18477        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18478        self
18479    }
18480
18481    /// Sets the value of [etag][crate::model::Automation::etag].
18482    ///
18483    /// # Example
18484    /// ```ignore,no_run
18485    /// # use google_cloud_deploy_v1::model::Automation;
18486    /// let x = Automation::new().set_etag("example");
18487    /// ```
18488    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18489        self.etag = v.into();
18490        self
18491    }
18492
18493    /// Sets the value of [suspended][crate::model::Automation::suspended].
18494    ///
18495    /// # Example
18496    /// ```ignore,no_run
18497    /// # use google_cloud_deploy_v1::model::Automation;
18498    /// let x = Automation::new().set_suspended(true);
18499    /// ```
18500    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18501        self.suspended = v.into();
18502        self
18503    }
18504
18505    /// Sets the value of [service_account][crate::model::Automation::service_account].
18506    ///
18507    /// # Example
18508    /// ```ignore,no_run
18509    /// # use google_cloud_deploy_v1::model::Automation;
18510    /// let x = Automation::new().set_service_account("example");
18511    /// ```
18512    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18513        self.service_account = v.into();
18514        self
18515    }
18516
18517    /// Sets the value of [selector][crate::model::Automation::selector].
18518    ///
18519    /// # Example
18520    /// ```ignore,no_run
18521    /// # use google_cloud_deploy_v1::model::Automation;
18522    /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18523    /// let x = Automation::new().set_selector(AutomationResourceSelector::default()/* use setters */);
18524    /// ```
18525    pub fn set_selector<T>(mut self, v: T) -> Self
18526    where
18527        T: std::convert::Into<crate::model::AutomationResourceSelector>,
18528    {
18529        self.selector = std::option::Option::Some(v.into());
18530        self
18531    }
18532
18533    /// Sets or clears the value of [selector][crate::model::Automation::selector].
18534    ///
18535    /// # Example
18536    /// ```ignore,no_run
18537    /// # use google_cloud_deploy_v1::model::Automation;
18538    /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18539    /// let x = Automation::new().set_or_clear_selector(Some(AutomationResourceSelector::default()/* use setters */));
18540    /// let x = Automation::new().set_or_clear_selector(None::<AutomationResourceSelector>);
18541    /// ```
18542    pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
18543    where
18544        T: std::convert::Into<crate::model::AutomationResourceSelector>,
18545    {
18546        self.selector = v.map(|x| x.into());
18547        self
18548    }
18549
18550    /// Sets the value of [rules][crate::model::Automation::rules].
18551    ///
18552    /// # Example
18553    /// ```ignore,no_run
18554    /// # use google_cloud_deploy_v1::model::Automation;
18555    /// use google_cloud_deploy_v1::model::AutomationRule;
18556    /// let x = Automation::new()
18557    ///     .set_rules([
18558    ///         AutomationRule::default()/* use setters */,
18559    ///         AutomationRule::default()/* use (different) setters */,
18560    ///     ]);
18561    /// ```
18562    pub fn set_rules<T, V>(mut self, v: T) -> Self
18563    where
18564        T: std::iter::IntoIterator<Item = V>,
18565        V: std::convert::Into<crate::model::AutomationRule>,
18566    {
18567        use std::iter::Iterator;
18568        self.rules = v.into_iter().map(|i| i.into()).collect();
18569        self
18570    }
18571}
18572
18573impl wkt::message::Message for Automation {
18574    fn typename() -> &'static str {
18575        "type.googleapis.com/google.cloud.deploy.v1.Automation"
18576    }
18577}
18578
18579/// AutomationResourceSelector contains the information to select the resources
18580/// to which an Automation is going to be applied.
18581#[derive(Clone, Default, PartialEq)]
18582#[non_exhaustive]
18583pub struct AutomationResourceSelector {
18584    /// Optional. Contains attributes about a target.
18585    pub targets: std::vec::Vec<crate::model::TargetAttribute>,
18586
18587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18588}
18589
18590impl AutomationResourceSelector {
18591    /// Creates a new default instance.
18592    pub fn new() -> Self {
18593        std::default::Default::default()
18594    }
18595
18596    /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
18597    ///
18598    /// # Example
18599    /// ```ignore,no_run
18600    /// # use google_cloud_deploy_v1::model::AutomationResourceSelector;
18601    /// use google_cloud_deploy_v1::model::TargetAttribute;
18602    /// let x = AutomationResourceSelector::new()
18603    ///     .set_targets([
18604    ///         TargetAttribute::default()/* use setters */,
18605    ///         TargetAttribute::default()/* use (different) setters */,
18606    ///     ]);
18607    /// ```
18608    pub fn set_targets<T, V>(mut self, v: T) -> Self
18609    where
18610        T: std::iter::IntoIterator<Item = V>,
18611        V: std::convert::Into<crate::model::TargetAttribute>,
18612    {
18613        use std::iter::Iterator;
18614        self.targets = v.into_iter().map(|i| i.into()).collect();
18615        self
18616    }
18617}
18618
18619impl wkt::message::Message for AutomationResourceSelector {
18620    fn typename() -> &'static str {
18621        "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
18622    }
18623}
18624
18625/// `AutomationRule` defines the automation activities.
18626#[derive(Clone, Default, PartialEq)]
18627#[non_exhaustive]
18628pub struct AutomationRule {
18629    /// The configuration of the Automation rule.
18630    pub rule: std::option::Option<crate::model::automation_rule::Rule>,
18631
18632    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18633}
18634
18635impl AutomationRule {
18636    /// Creates a new default instance.
18637    pub fn new() -> Self {
18638        std::default::Default::default()
18639    }
18640
18641    /// Sets the value of [rule][crate::model::AutomationRule::rule].
18642    ///
18643    /// Note that all the setters affecting `rule` are mutually
18644    /// exclusive.
18645    ///
18646    /// # Example
18647    /// ```ignore,no_run
18648    /// # use google_cloud_deploy_v1::model::AutomationRule;
18649    /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18650    /// let x = AutomationRule::new().set_rule(Some(
18651    ///     google_cloud_deploy_v1::model::automation_rule::Rule::PromoteReleaseRule(PromoteReleaseRule::default().into())));
18652    /// ```
18653    pub fn set_rule<
18654        T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
18655    >(
18656        mut self,
18657        v: T,
18658    ) -> Self {
18659        self.rule = v.into();
18660        self
18661    }
18662
18663    /// The value of [rule][crate::model::AutomationRule::rule]
18664    /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
18665    /// holds a different branch.
18666    pub fn promote_release_rule(
18667        &self,
18668    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
18669        #[allow(unreachable_patterns)]
18670        self.rule.as_ref().and_then(|v| match v {
18671            crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
18672                std::option::Option::Some(v)
18673            }
18674            _ => std::option::Option::None,
18675        })
18676    }
18677
18678    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18679    /// to hold a `PromoteReleaseRule`.
18680    ///
18681    /// Note that all the setters affecting `rule` are
18682    /// mutually exclusive.
18683    ///
18684    /// # Example
18685    /// ```ignore,no_run
18686    /// # use google_cloud_deploy_v1::model::AutomationRule;
18687    /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18688    /// let x = AutomationRule::new().set_promote_release_rule(PromoteReleaseRule::default()/* use setters */);
18689    /// assert!(x.promote_release_rule().is_some());
18690    /// assert!(x.advance_rollout_rule().is_none());
18691    /// assert!(x.repair_rollout_rule().is_none());
18692    /// assert!(x.timed_promote_release_rule().is_none());
18693    /// ```
18694    pub fn set_promote_release_rule<
18695        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
18696    >(
18697        mut self,
18698        v: T,
18699    ) -> Self {
18700        self.rule = std::option::Option::Some(
18701            crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
18702        );
18703        self
18704    }
18705
18706    /// The value of [rule][crate::model::AutomationRule::rule]
18707    /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
18708    /// holds a different branch.
18709    pub fn advance_rollout_rule(
18710        &self,
18711    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
18712        #[allow(unreachable_patterns)]
18713        self.rule.as_ref().and_then(|v| match v {
18714            crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
18715                std::option::Option::Some(v)
18716            }
18717            _ => std::option::Option::None,
18718        })
18719    }
18720
18721    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18722    /// to hold a `AdvanceRolloutRule`.
18723    ///
18724    /// Note that all the setters affecting `rule` are
18725    /// mutually exclusive.
18726    ///
18727    /// # Example
18728    /// ```ignore,no_run
18729    /// # use google_cloud_deploy_v1::model::AutomationRule;
18730    /// use google_cloud_deploy_v1::model::AdvanceRolloutRule;
18731    /// let x = AutomationRule::new().set_advance_rollout_rule(AdvanceRolloutRule::default()/* use setters */);
18732    /// assert!(x.advance_rollout_rule().is_some());
18733    /// assert!(x.promote_release_rule().is_none());
18734    /// assert!(x.repair_rollout_rule().is_none());
18735    /// assert!(x.timed_promote_release_rule().is_none());
18736    /// ```
18737    pub fn set_advance_rollout_rule<
18738        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
18739    >(
18740        mut self,
18741        v: T,
18742    ) -> Self {
18743        self.rule = std::option::Option::Some(
18744            crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
18745        );
18746        self
18747    }
18748
18749    /// The value of [rule][crate::model::AutomationRule::rule]
18750    /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
18751    /// holds a different branch.
18752    pub fn repair_rollout_rule(
18753        &self,
18754    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
18755        #[allow(unreachable_patterns)]
18756        self.rule.as_ref().and_then(|v| match v {
18757            crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
18758                std::option::Option::Some(v)
18759            }
18760            _ => std::option::Option::None,
18761        })
18762    }
18763
18764    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18765    /// to hold a `RepairRolloutRule`.
18766    ///
18767    /// Note that all the setters affecting `rule` are
18768    /// mutually exclusive.
18769    ///
18770    /// # Example
18771    /// ```ignore,no_run
18772    /// # use google_cloud_deploy_v1::model::AutomationRule;
18773    /// use google_cloud_deploy_v1::model::RepairRolloutRule;
18774    /// let x = AutomationRule::new().set_repair_rollout_rule(RepairRolloutRule::default()/* use setters */);
18775    /// assert!(x.repair_rollout_rule().is_some());
18776    /// assert!(x.promote_release_rule().is_none());
18777    /// assert!(x.advance_rollout_rule().is_none());
18778    /// assert!(x.timed_promote_release_rule().is_none());
18779    /// ```
18780    pub fn set_repair_rollout_rule<
18781        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
18782    >(
18783        mut self,
18784        v: T,
18785    ) -> Self {
18786        self.rule = std::option::Option::Some(
18787            crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
18788        );
18789        self
18790    }
18791
18792    /// The value of [rule][crate::model::AutomationRule::rule]
18793    /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
18794    /// holds a different branch.
18795    pub fn timed_promote_release_rule(
18796        &self,
18797    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
18798        #[allow(unreachable_patterns)]
18799        self.rule.as_ref().and_then(|v| match v {
18800            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
18801                std::option::Option::Some(v)
18802            }
18803            _ => std::option::Option::None,
18804        })
18805    }
18806
18807    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18808    /// to hold a `TimedPromoteReleaseRule`.
18809    ///
18810    /// Note that all the setters affecting `rule` are
18811    /// mutually exclusive.
18812    ///
18813    /// # Example
18814    /// ```ignore,no_run
18815    /// # use google_cloud_deploy_v1::model::AutomationRule;
18816    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18817    /// let x = AutomationRule::new().set_timed_promote_release_rule(TimedPromoteReleaseRule::default()/* use setters */);
18818    /// assert!(x.timed_promote_release_rule().is_some());
18819    /// assert!(x.promote_release_rule().is_none());
18820    /// assert!(x.advance_rollout_rule().is_none());
18821    /// assert!(x.repair_rollout_rule().is_none());
18822    /// ```
18823    pub fn set_timed_promote_release_rule<
18824        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
18825    >(
18826        mut self,
18827        v: T,
18828    ) -> Self {
18829        self.rule = std::option::Option::Some(
18830            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
18831        );
18832        self
18833    }
18834}
18835
18836impl wkt::message::Message for AutomationRule {
18837    fn typename() -> &'static str {
18838        "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
18839    }
18840}
18841
18842/// Defines additional types related to [AutomationRule].
18843pub mod automation_rule {
18844    #[allow(unused_imports)]
18845    use super::*;
18846
18847    /// The configuration of the Automation rule.
18848    #[derive(Clone, Debug, PartialEq)]
18849    #[non_exhaustive]
18850    pub enum Rule {
18851        /// Optional. `PromoteReleaseRule` will automatically promote a release from
18852        /// the current target to a specified target.
18853        PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
18854        /// Optional. The `AdvanceRolloutRule` will automatically advance a
18855        /// successful Rollout.
18856        AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
18857        /// Optional. The `RepairRolloutRule` will automatically repair a failed
18858        /// rollout.
18859        RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
18860        /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
18861        /// release from the current target(s) to the specified target(s) on a
18862        /// configured schedule.
18863        TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
18864    }
18865}
18866
18867/// The `TimedPromoteReleaseRule` will automatically promote a release from the
18868/// current target(s) to the specified target(s) on a configured schedule.
18869#[derive(Clone, Default, PartialEq)]
18870#[non_exhaustive]
18871pub struct TimedPromoteReleaseRule {
18872    /// Required. ID of the rule. This ID must be unique in the `Automation`
18873    /// resource to which this rule belongs. The format is
18874    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
18875    pub id: std::string::String,
18876
18877    /// Optional. The ID of the stage in the pipeline to which this `Release` is
18878    /// deploying. If unspecified, default it to the next stage in the promotion
18879    /// flow. The value of this field could be one of the following:
18880    ///
18881    /// * The last segment of a target name
18882    /// * "@next", the next target in the promotion sequence
18883    pub destination_target_id: std::string::String,
18884
18885    /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
18886    /// 9am.
18887    pub schedule: std::string::String,
18888
18889    /// Required. The time zone in IANA format [IANA Time Zone
18890    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
18891    pub time_zone: std::string::String,
18892
18893    /// Output only. Information around the state of the Automation rule.
18894    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18895
18896    /// Optional. The starting phase of the rollout created by this rule. Default
18897    /// to the first phase.
18898    pub destination_phase: std::string::String,
18899
18900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18901}
18902
18903impl TimedPromoteReleaseRule {
18904    /// Creates a new default instance.
18905    pub fn new() -> Self {
18906        std::default::Default::default()
18907    }
18908
18909    /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
18910    ///
18911    /// # Example
18912    /// ```ignore,no_run
18913    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18914    /// let x = TimedPromoteReleaseRule::new().set_id("example");
18915    /// ```
18916    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18917        self.id = v.into();
18918        self
18919    }
18920
18921    /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
18922    ///
18923    /// # Example
18924    /// ```ignore,no_run
18925    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18926    /// let x = TimedPromoteReleaseRule::new().set_destination_target_id("example");
18927    /// ```
18928    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18929        mut self,
18930        v: T,
18931    ) -> Self {
18932        self.destination_target_id = v.into();
18933        self
18934    }
18935
18936    /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
18937    ///
18938    /// # Example
18939    /// ```ignore,no_run
18940    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18941    /// let x = TimedPromoteReleaseRule::new().set_schedule("example");
18942    /// ```
18943    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18944        self.schedule = v.into();
18945        self
18946    }
18947
18948    /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
18949    ///
18950    /// # Example
18951    /// ```ignore,no_run
18952    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18953    /// let x = TimedPromoteReleaseRule::new().set_time_zone("example");
18954    /// ```
18955    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18956        self.time_zone = v.into();
18957        self
18958    }
18959
18960    /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18961    ///
18962    /// # Example
18963    /// ```ignore,no_run
18964    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18965    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18966    /// let x = TimedPromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18967    /// ```
18968    pub fn set_condition<T>(mut self, v: T) -> Self
18969    where
18970        T: std::convert::Into<crate::model::AutomationRuleCondition>,
18971    {
18972        self.condition = std::option::Option::Some(v.into());
18973        self
18974    }
18975
18976    /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18977    ///
18978    /// # Example
18979    /// ```ignore,no_run
18980    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18981    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18982    /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18983    /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18984    /// ```
18985    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18986    where
18987        T: std::convert::Into<crate::model::AutomationRuleCondition>,
18988    {
18989        self.condition = v.map(|x| x.into());
18990        self
18991    }
18992
18993    /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
18994    ///
18995    /// # Example
18996    /// ```ignore,no_run
18997    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18998    /// let x = TimedPromoteReleaseRule::new().set_destination_phase("example");
18999    /// ```
19000    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19001        mut self,
19002        v: T,
19003    ) -> Self {
19004        self.destination_phase = v.into();
19005        self
19006    }
19007}
19008
19009impl wkt::message::Message for TimedPromoteReleaseRule {
19010    fn typename() -> &'static str {
19011        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
19012    }
19013}
19014
19015/// The `PromoteRelease` rule will automatically promote a release from the
19016/// current target to a specified target.
19017#[derive(Clone, Default, PartialEq)]
19018#[non_exhaustive]
19019pub struct PromoteReleaseRule {
19020    /// Required. ID of the rule. This id must be unique in the `Automation`
19021    /// resource to which this rule belongs. The format is
19022    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19023    pub id: std::string::String,
19024
19025    /// Optional. How long the release need to be paused until being promoted to
19026    /// the next target.
19027    pub wait: std::option::Option<wkt::Duration>,
19028
19029    /// Optional. The ID of the stage in the pipeline to which this `Release` is
19030    /// deploying. If unspecified, default it to the next stage in the promotion
19031    /// flow. The value of this field could be one of the following:
19032    ///
19033    /// * The last segment of a target name
19034    /// * "@next", the next target in the promotion sequence
19035    pub destination_target_id: std::string::String,
19036
19037    /// Output only. Information around the state of the Automation rule.
19038    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19039
19040    /// Optional. The starting phase of the rollout created by this operation.
19041    /// Default to the first phase.
19042    pub destination_phase: std::string::String,
19043
19044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19045}
19046
19047impl PromoteReleaseRule {
19048    /// Creates a new default instance.
19049    pub fn new() -> Self {
19050        std::default::Default::default()
19051    }
19052
19053    /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
19054    ///
19055    /// # Example
19056    /// ```ignore,no_run
19057    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19058    /// let x = PromoteReleaseRule::new().set_id("example");
19059    /// ```
19060    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19061        self.id = v.into();
19062        self
19063    }
19064
19065    /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
19066    ///
19067    /// # Example
19068    /// ```ignore,no_run
19069    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19070    /// use wkt::Duration;
19071    /// let x = PromoteReleaseRule::new().set_wait(Duration::default()/* use setters */);
19072    /// ```
19073    pub fn set_wait<T>(mut self, v: T) -> Self
19074    where
19075        T: std::convert::Into<wkt::Duration>,
19076    {
19077        self.wait = std::option::Option::Some(v.into());
19078        self
19079    }
19080
19081    /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
19082    ///
19083    /// # Example
19084    /// ```ignore,no_run
19085    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19086    /// use wkt::Duration;
19087    /// let x = PromoteReleaseRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19088    /// let x = PromoteReleaseRule::new().set_or_clear_wait(None::<Duration>);
19089    /// ```
19090    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19091    where
19092        T: std::convert::Into<wkt::Duration>,
19093    {
19094        self.wait = v.map(|x| x.into());
19095        self
19096    }
19097
19098    /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
19099    ///
19100    /// # Example
19101    /// ```ignore,no_run
19102    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19103    /// let x = PromoteReleaseRule::new().set_destination_target_id("example");
19104    /// ```
19105    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19106        mut self,
19107        v: T,
19108    ) -> Self {
19109        self.destination_target_id = v.into();
19110        self
19111    }
19112
19113    /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
19114    ///
19115    /// # Example
19116    /// ```ignore,no_run
19117    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19118    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19119    /// let x = PromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19120    /// ```
19121    pub fn set_condition<T>(mut self, v: T) -> Self
19122    where
19123        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19124    {
19125        self.condition = std::option::Option::Some(v.into());
19126        self
19127    }
19128
19129    /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
19130    ///
19131    /// # Example
19132    /// ```ignore,no_run
19133    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19134    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19135    /// let x = PromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19136    /// let x = PromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19137    /// ```
19138    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19139    where
19140        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19141    {
19142        self.condition = v.map(|x| x.into());
19143        self
19144    }
19145
19146    /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
19147    ///
19148    /// # Example
19149    /// ```ignore,no_run
19150    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19151    /// let x = PromoteReleaseRule::new().set_destination_phase("example");
19152    /// ```
19153    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19154        mut self,
19155        v: T,
19156    ) -> Self {
19157        self.destination_phase = v.into();
19158        self
19159    }
19160}
19161
19162impl wkt::message::Message for PromoteReleaseRule {
19163    fn typename() -> &'static str {
19164        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
19165    }
19166}
19167
19168/// The `AdvanceRollout` automation rule will automatically advance a successful
19169/// Rollout to the next phase.
19170#[derive(Clone, Default, PartialEq)]
19171#[non_exhaustive]
19172pub struct AdvanceRolloutRule {
19173    /// Required. ID of the rule. This id must be unique in the `Automation`
19174    /// resource to which this rule belongs. The format is
19175    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19176    pub id: std::string::String,
19177
19178    /// Optional. Proceeds only after phase name matched any one in the list.
19179    /// This value must consist of lower-case letters, numbers, and hyphens,
19180    /// start with a letter and end with a letter or a number, and have a max
19181    /// length of 63 characters. In other words, it must match the following
19182    /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19183    pub source_phases: std::vec::Vec<std::string::String>,
19184
19185    /// Optional. How long to wait after a rollout is finished.
19186    pub wait: std::option::Option<wkt::Duration>,
19187
19188    /// Output only. Information around the state of the Automation rule.
19189    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19190
19191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19192}
19193
19194impl AdvanceRolloutRule {
19195    /// Creates a new default instance.
19196    pub fn new() -> Self {
19197        std::default::Default::default()
19198    }
19199
19200    /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
19201    ///
19202    /// # Example
19203    /// ```ignore,no_run
19204    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19205    /// let x = AdvanceRolloutRule::new().set_id("example");
19206    /// ```
19207    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19208        self.id = v.into();
19209        self
19210    }
19211
19212    /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
19213    ///
19214    /// # Example
19215    /// ```ignore,no_run
19216    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19217    /// let x = AdvanceRolloutRule::new().set_source_phases(["a", "b", "c"]);
19218    /// ```
19219    pub fn set_source_phases<T, V>(mut self, v: T) -> Self
19220    where
19221        T: std::iter::IntoIterator<Item = V>,
19222        V: std::convert::Into<std::string::String>,
19223    {
19224        use std::iter::Iterator;
19225        self.source_phases = v.into_iter().map(|i| i.into()).collect();
19226        self
19227    }
19228
19229    /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
19230    ///
19231    /// # Example
19232    /// ```ignore,no_run
19233    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19234    /// use wkt::Duration;
19235    /// let x = AdvanceRolloutRule::new().set_wait(Duration::default()/* use setters */);
19236    /// ```
19237    pub fn set_wait<T>(mut self, v: T) -> Self
19238    where
19239        T: std::convert::Into<wkt::Duration>,
19240    {
19241        self.wait = std::option::Option::Some(v.into());
19242        self
19243    }
19244
19245    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
19246    ///
19247    /// # Example
19248    /// ```ignore,no_run
19249    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19250    /// use wkt::Duration;
19251    /// let x = AdvanceRolloutRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19252    /// let x = AdvanceRolloutRule::new().set_or_clear_wait(None::<Duration>);
19253    /// ```
19254    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19255    where
19256        T: std::convert::Into<wkt::Duration>,
19257    {
19258        self.wait = v.map(|x| x.into());
19259        self
19260    }
19261
19262    /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
19263    ///
19264    /// # Example
19265    /// ```ignore,no_run
19266    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19267    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19268    /// let x = AdvanceRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19269    /// ```
19270    pub fn set_condition<T>(mut self, v: T) -> Self
19271    where
19272        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19273    {
19274        self.condition = std::option::Option::Some(v.into());
19275        self
19276    }
19277
19278    /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
19279    ///
19280    /// # Example
19281    /// ```ignore,no_run
19282    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19283    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19284    /// let x = AdvanceRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19285    /// let x = AdvanceRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19286    /// ```
19287    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19288    where
19289        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19290    {
19291        self.condition = v.map(|x| x.into());
19292        self
19293    }
19294}
19295
19296impl wkt::message::Message for AdvanceRolloutRule {
19297    fn typename() -> &'static str {
19298        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
19299    }
19300}
19301
19302/// The `RepairRolloutRule` automation rule will automatically repair a failed
19303/// `Rollout`.
19304#[derive(Clone, Default, PartialEq)]
19305#[non_exhaustive]
19306pub struct RepairRolloutRule {
19307    /// Required. ID of the rule. This id must be unique in the `Automation`
19308    /// resource to which this rule belongs. The format is
19309    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19310    pub id: std::string::String,
19311
19312    /// Optional. Phases within which jobs are subject to automatic repair actions
19313    /// on failure. Proceeds only after phase name matched any one in the list, or
19314    /// for all phases if unspecified. This value must consist of lower-case
19315    /// letters, numbers, and hyphens, start with a letter and end with a letter or
19316    /// a number, and have a max length of 63 characters. In other words, it must
19317    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19318    pub phases: std::vec::Vec<std::string::String>,
19319
19320    /// Optional. Jobs to repair. Proceeds only after job name matched any one in
19321    /// the list, or for all jobs if unspecified or empty. The phase that includes
19322    /// the job must match the phase ID specified in `source_phase`. This value
19323    /// must consist of lower-case letters, numbers, and hyphens, start with a
19324    /// letter and end with a letter or a number, and have a max length of 63
19325    /// characters. In other words, it must match the following regex:
19326    /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19327    pub jobs: std::vec::Vec<std::string::String>,
19328
19329    /// Output only. Information around the state of the 'Automation' rule.
19330    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19331
19332    /// Required. Defines the types of automatic repair phases for failed jobs.
19333    pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
19334
19335    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19336}
19337
19338impl RepairRolloutRule {
19339    /// Creates a new default instance.
19340    pub fn new() -> Self {
19341        std::default::Default::default()
19342    }
19343
19344    /// Sets the value of [id][crate::model::RepairRolloutRule::id].
19345    ///
19346    /// # Example
19347    /// ```ignore,no_run
19348    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19349    /// let x = RepairRolloutRule::new().set_id("example");
19350    /// ```
19351    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19352        self.id = v.into();
19353        self
19354    }
19355
19356    /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
19357    ///
19358    /// # Example
19359    /// ```ignore,no_run
19360    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19361    /// let x = RepairRolloutRule::new().set_phases(["a", "b", "c"]);
19362    /// ```
19363    pub fn set_phases<T, V>(mut self, v: T) -> Self
19364    where
19365        T: std::iter::IntoIterator<Item = V>,
19366        V: std::convert::Into<std::string::String>,
19367    {
19368        use std::iter::Iterator;
19369        self.phases = v.into_iter().map(|i| i.into()).collect();
19370        self
19371    }
19372
19373    /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
19374    ///
19375    /// # Example
19376    /// ```ignore,no_run
19377    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19378    /// let x = RepairRolloutRule::new().set_jobs(["a", "b", "c"]);
19379    /// ```
19380    pub fn set_jobs<T, V>(mut self, v: T) -> Self
19381    where
19382        T: std::iter::IntoIterator<Item = V>,
19383        V: std::convert::Into<std::string::String>,
19384    {
19385        use std::iter::Iterator;
19386        self.jobs = v.into_iter().map(|i| i.into()).collect();
19387        self
19388    }
19389
19390    /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
19391    ///
19392    /// # Example
19393    /// ```ignore,no_run
19394    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19395    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19396    /// let x = RepairRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19397    /// ```
19398    pub fn set_condition<T>(mut self, v: T) -> Self
19399    where
19400        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19401    {
19402        self.condition = std::option::Option::Some(v.into());
19403        self
19404    }
19405
19406    /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
19407    ///
19408    /// # Example
19409    /// ```ignore,no_run
19410    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19411    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19412    /// let x = RepairRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19413    /// let x = RepairRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19414    /// ```
19415    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19416    where
19417        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19418    {
19419        self.condition = v.map(|x| x.into());
19420        self
19421    }
19422
19423    /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
19424    ///
19425    /// # Example
19426    /// ```ignore,no_run
19427    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19428    /// use google_cloud_deploy_v1::model::RepairPhaseConfig;
19429    /// let x = RepairRolloutRule::new()
19430    ///     .set_repair_phases([
19431    ///         RepairPhaseConfig::default()/* use setters */,
19432    ///         RepairPhaseConfig::default()/* use (different) setters */,
19433    ///     ]);
19434    /// ```
19435    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
19436    where
19437        T: std::iter::IntoIterator<Item = V>,
19438        V: std::convert::Into<crate::model::RepairPhaseConfig>,
19439    {
19440        use std::iter::Iterator;
19441        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
19442        self
19443    }
19444}
19445
19446impl wkt::message::Message for RepairRolloutRule {
19447    fn typename() -> &'static str {
19448        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
19449    }
19450}
19451
19452/// Configuration of the repair phase.
19453#[derive(Clone, Default, PartialEq)]
19454#[non_exhaustive]
19455pub struct RepairPhaseConfig {
19456    /// The repair phase to perform.
19457    pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
19458
19459    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19460}
19461
19462impl RepairPhaseConfig {
19463    /// Creates a new default instance.
19464    pub fn new() -> Self {
19465        std::default::Default::default()
19466    }
19467
19468    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
19469    ///
19470    /// Note that all the setters affecting `repair_phase` are mutually
19471    /// exclusive.
19472    ///
19473    /// # Example
19474    /// ```ignore,no_run
19475    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19476    /// use google_cloud_deploy_v1::model::Retry;
19477    /// let x = RepairPhaseConfig::new().set_repair_phase(Some(
19478    ///     google_cloud_deploy_v1::model::repair_phase_config::RepairPhase::Retry(Retry::default().into())));
19479    /// ```
19480    pub fn set_repair_phase<
19481        T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
19482    >(
19483        mut self,
19484        v: T,
19485    ) -> Self {
19486        self.repair_phase = v.into();
19487        self
19488    }
19489
19490    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19491    /// if it holds a `Retry`, `None` if the field is not set or
19492    /// holds a different branch.
19493    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
19494        #[allow(unreachable_patterns)]
19495        self.repair_phase.as_ref().and_then(|v| match v {
19496            crate::model::repair_phase_config::RepairPhase::Retry(v) => {
19497                std::option::Option::Some(v)
19498            }
19499            _ => std::option::Option::None,
19500        })
19501    }
19502
19503    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19504    /// to hold a `Retry`.
19505    ///
19506    /// Note that all the setters affecting `repair_phase` are
19507    /// mutually exclusive.
19508    ///
19509    /// # Example
19510    /// ```ignore,no_run
19511    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19512    /// use google_cloud_deploy_v1::model::Retry;
19513    /// let x = RepairPhaseConfig::new().set_retry(Retry::default()/* use setters */);
19514    /// assert!(x.retry().is_some());
19515    /// assert!(x.rollback().is_none());
19516    /// ```
19517    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
19518        mut self,
19519        v: T,
19520    ) -> Self {
19521        self.repair_phase = std::option::Option::Some(
19522            crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
19523        );
19524        self
19525    }
19526
19527    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19528    /// if it holds a `Rollback`, `None` if the field is not set or
19529    /// holds a different branch.
19530    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
19531        #[allow(unreachable_patterns)]
19532        self.repair_phase.as_ref().and_then(|v| match v {
19533            crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
19534                std::option::Option::Some(v)
19535            }
19536            _ => std::option::Option::None,
19537        })
19538    }
19539
19540    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19541    /// to hold a `Rollback`.
19542    ///
19543    /// Note that all the setters affecting `repair_phase` are
19544    /// mutually exclusive.
19545    ///
19546    /// # Example
19547    /// ```ignore,no_run
19548    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19549    /// use google_cloud_deploy_v1::model::Rollback;
19550    /// let x = RepairPhaseConfig::new().set_rollback(Rollback::default()/* use setters */);
19551    /// assert!(x.rollback().is_some());
19552    /// assert!(x.retry().is_none());
19553    /// ```
19554    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
19555        mut self,
19556        v: T,
19557    ) -> Self {
19558        self.repair_phase = std::option::Option::Some(
19559            crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
19560        );
19561        self
19562    }
19563}
19564
19565impl wkt::message::Message for RepairPhaseConfig {
19566    fn typename() -> &'static str {
19567        "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
19568    }
19569}
19570
19571/// Defines additional types related to [RepairPhaseConfig].
19572pub mod repair_phase_config {
19573    #[allow(unused_imports)]
19574    use super::*;
19575
19576    /// The repair phase to perform.
19577    #[derive(Clone, Debug, PartialEq)]
19578    #[non_exhaustive]
19579    pub enum RepairPhase {
19580        /// Optional. Retries a failed job.
19581        Retry(std::boxed::Box<crate::model::Retry>),
19582        /// Optional. Rolls back a `Rollout`.
19583        Rollback(std::boxed::Box<crate::model::Rollback>),
19584    }
19585}
19586
19587/// Retries the failed job.
19588#[derive(Clone, Default, PartialEq)]
19589#[non_exhaustive]
19590pub struct Retry {
19591    /// Required. Total number of retries. Retry is skipped if set to 0; The
19592    /// minimum value is 1, and the maximum value is 10.
19593    pub attempts: i64,
19594
19595    /// Optional. How long to wait for the first retry. Default is 0, and the
19596    /// maximum value is 14d.
19597    pub wait: std::option::Option<wkt::Duration>,
19598
19599    /// Optional. The pattern of how wait time will be increased. Default is
19600    /// linear. Backoff mode will be ignored if `wait` is 0.
19601    pub backoff_mode: crate::model::BackoffMode,
19602
19603    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19604}
19605
19606impl Retry {
19607    /// Creates a new default instance.
19608    pub fn new() -> Self {
19609        std::default::Default::default()
19610    }
19611
19612    /// Sets the value of [attempts][crate::model::Retry::attempts].
19613    ///
19614    /// # Example
19615    /// ```ignore,no_run
19616    /// # use google_cloud_deploy_v1::model::Retry;
19617    /// let x = Retry::new().set_attempts(42);
19618    /// ```
19619    pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19620        self.attempts = v.into();
19621        self
19622    }
19623
19624    /// Sets the value of [wait][crate::model::Retry::wait].
19625    ///
19626    /// # Example
19627    /// ```ignore,no_run
19628    /// # use google_cloud_deploy_v1::model::Retry;
19629    /// use wkt::Duration;
19630    /// let x = Retry::new().set_wait(Duration::default()/* use setters */);
19631    /// ```
19632    pub fn set_wait<T>(mut self, v: T) -> Self
19633    where
19634        T: std::convert::Into<wkt::Duration>,
19635    {
19636        self.wait = std::option::Option::Some(v.into());
19637        self
19638    }
19639
19640    /// Sets or clears the value of [wait][crate::model::Retry::wait].
19641    ///
19642    /// # Example
19643    /// ```ignore,no_run
19644    /// # use google_cloud_deploy_v1::model::Retry;
19645    /// use wkt::Duration;
19646    /// let x = Retry::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19647    /// let x = Retry::new().set_or_clear_wait(None::<Duration>);
19648    /// ```
19649    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19650    where
19651        T: std::convert::Into<wkt::Duration>,
19652    {
19653        self.wait = v.map(|x| x.into());
19654        self
19655    }
19656
19657    /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
19658    ///
19659    /// # Example
19660    /// ```ignore,no_run
19661    /// # use google_cloud_deploy_v1::model::Retry;
19662    /// use google_cloud_deploy_v1::model::BackoffMode;
19663    /// let x0 = Retry::new().set_backoff_mode(BackoffMode::Linear);
19664    /// let x1 = Retry::new().set_backoff_mode(BackoffMode::Exponential);
19665    /// ```
19666    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
19667        mut self,
19668        v: T,
19669    ) -> Self {
19670        self.backoff_mode = v.into();
19671        self
19672    }
19673}
19674
19675impl wkt::message::Message for Retry {
19676    fn typename() -> &'static str {
19677        "type.googleapis.com/google.cloud.deploy.v1.Retry"
19678    }
19679}
19680
19681/// Rolls back a `Rollout`.
19682#[derive(Clone, Default, PartialEq)]
19683#[non_exhaustive]
19684pub struct Rollback {
19685    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
19686    /// `Rollout` will start in the stable phase.
19687    pub destination_phase: std::string::String,
19688
19689    /// Optional. If pending rollout exists on the target, the rollback operation
19690    /// will be aborted.
19691    pub disable_rollback_if_rollout_pending: bool,
19692
19693    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19694}
19695
19696impl Rollback {
19697    /// Creates a new default instance.
19698    pub fn new() -> Self {
19699        std::default::Default::default()
19700    }
19701
19702    /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
19703    ///
19704    /// # Example
19705    /// ```ignore,no_run
19706    /// # use google_cloud_deploy_v1::model::Rollback;
19707    /// let x = Rollback::new().set_destination_phase("example");
19708    /// ```
19709    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19710        mut self,
19711        v: T,
19712    ) -> Self {
19713        self.destination_phase = v.into();
19714        self
19715    }
19716
19717    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
19718    ///
19719    /// # Example
19720    /// ```ignore,no_run
19721    /// # use google_cloud_deploy_v1::model::Rollback;
19722    /// let x = Rollback::new().set_disable_rollback_if_rollout_pending(true);
19723    /// ```
19724    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
19725        mut self,
19726        v: T,
19727    ) -> Self {
19728        self.disable_rollback_if_rollout_pending = v.into();
19729        self
19730    }
19731}
19732
19733impl wkt::message::Message for Rollback {
19734    fn typename() -> &'static str {
19735        "type.googleapis.com/google.cloud.deploy.v1.Rollback"
19736    }
19737}
19738
19739/// `AutomationRuleCondition` contains conditions relevant to an
19740/// `Automation` rule.
19741#[derive(Clone, Default, PartialEq)]
19742#[non_exhaustive]
19743pub struct AutomationRuleCondition {
19744    /// Optional. Details around targets enumerated in the rule.
19745    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
19746
19747    /// Details specific to the automation rule type.
19748    pub rule_type_condition:
19749        std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19750
19751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19752}
19753
19754impl AutomationRuleCondition {
19755    /// Creates a new default instance.
19756    pub fn new() -> Self {
19757        std::default::Default::default()
19758    }
19759
19760    /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19761    ///
19762    /// # Example
19763    /// ```ignore,no_run
19764    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19765    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19766    /// let x = AutomationRuleCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
19767    /// ```
19768    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
19769    where
19770        T: std::convert::Into<crate::model::TargetsPresentCondition>,
19771    {
19772        self.targets_present_condition = std::option::Option::Some(v.into());
19773        self
19774    }
19775
19776    /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19777    ///
19778    /// # Example
19779    /// ```ignore,no_run
19780    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19781    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19782    /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
19783    /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
19784    /// ```
19785    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
19786    where
19787        T: std::convert::Into<crate::model::TargetsPresentCondition>,
19788    {
19789        self.targets_present_condition = v.map(|x| x.into());
19790        self
19791    }
19792
19793    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
19794    ///
19795    /// Note that all the setters affecting `rule_type_condition` are mutually
19796    /// exclusive.
19797    ///
19798    /// # Example
19799    /// ```ignore,no_run
19800    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19801    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19802    /// let x = AutomationRuleCondition::new().set_rule_type_condition(Some(
19803    ///     google_cloud_deploy_v1::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(TimedPromoteReleaseCondition::default().into())));
19804    /// ```
19805    pub fn set_rule_type_condition<
19806        T: std::convert::Into<
19807                std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19808            >,
19809    >(
19810        mut self,
19811        v: T,
19812    ) -> Self {
19813        self.rule_type_condition = v.into();
19814        self
19815    }
19816
19817    /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19818    /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
19819    /// holds a different branch.
19820    pub fn timed_promote_release_condition(
19821        &self,
19822    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
19823        #[allow(unreachable_patterns)]
19824        self.rule_type_condition.as_ref().and_then(|v| match v {
19825            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
19826            _ => std::option::Option::None,
19827        })
19828    }
19829
19830    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19831    /// to hold a `TimedPromoteReleaseCondition`.
19832    ///
19833    /// Note that all the setters affecting `rule_type_condition` are
19834    /// mutually exclusive.
19835    ///
19836    /// # Example
19837    /// ```ignore,no_run
19838    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19839    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19840    /// let x = AutomationRuleCondition::new().set_timed_promote_release_condition(TimedPromoteReleaseCondition::default()/* use setters */);
19841    /// assert!(x.timed_promote_release_condition().is_some());
19842    /// ```
19843    pub fn set_timed_promote_release_condition<
19844        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
19845    >(
19846        mut self,
19847        v: T,
19848    ) -> Self {
19849        self.rule_type_condition = std::option::Option::Some(
19850            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
19851                v.into()
19852            )
19853        );
19854        self
19855    }
19856}
19857
19858impl wkt::message::Message for AutomationRuleCondition {
19859    fn typename() -> &'static str {
19860        "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
19861    }
19862}
19863
19864/// Defines additional types related to [AutomationRuleCondition].
19865pub mod automation_rule_condition {
19866    #[allow(unused_imports)]
19867    use super::*;
19868
19869    /// Details specific to the automation rule type.
19870    #[derive(Clone, Debug, PartialEq)]
19871    #[non_exhaustive]
19872    pub enum RuleTypeCondition {
19873        /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
19874        /// to a an Automation with a timed promote release rule defined.
19875        TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
19876    }
19877}
19878
19879/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
19880/// with a Timed Promote Release rule defined.
19881#[derive(Clone, Default, PartialEq)]
19882#[non_exhaustive]
19883pub struct TimedPromoteReleaseCondition {
19884    /// Output only. When the next scheduled promotion(s) will occur.
19885    pub next_promotion_time: std::option::Option<wkt::Timestamp>,
19886
19887    /// Output only. A list of targets involved in the upcoming timed promotion(s).
19888    pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
19889
19890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19891}
19892
19893impl TimedPromoteReleaseCondition {
19894    /// Creates a new default instance.
19895    pub fn new() -> Self {
19896        std::default::Default::default()
19897    }
19898
19899    /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19900    ///
19901    /// # Example
19902    /// ```ignore,no_run
19903    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19904    /// use wkt::Timestamp;
19905    /// let x = TimedPromoteReleaseCondition::new().set_next_promotion_time(Timestamp::default()/* use setters */);
19906    /// ```
19907    pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
19908    where
19909        T: std::convert::Into<wkt::Timestamp>,
19910    {
19911        self.next_promotion_time = std::option::Option::Some(v.into());
19912        self
19913    }
19914
19915    /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19916    ///
19917    /// # Example
19918    /// ```ignore,no_run
19919    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19920    /// use wkt::Timestamp;
19921    /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(Some(Timestamp::default()/* use setters */));
19922    /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(None::<Timestamp>);
19923    /// ```
19924    pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
19925    where
19926        T: std::convert::Into<wkt::Timestamp>,
19927    {
19928        self.next_promotion_time = v.map(|x| x.into());
19929        self
19930    }
19931
19932    /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
19933    ///
19934    /// # Example
19935    /// ```ignore,no_run
19936    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19937    /// use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19938    /// let x = TimedPromoteReleaseCondition::new()
19939    ///     .set_targets_list([
19940    ///         Targets::default()/* use setters */,
19941    ///         Targets::default()/* use (different) setters */,
19942    ///     ]);
19943    /// ```
19944    pub fn set_targets_list<T, V>(mut self, v: T) -> Self
19945    where
19946        T: std::iter::IntoIterator<Item = V>,
19947        V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
19948    {
19949        use std::iter::Iterator;
19950        self.targets_list = v.into_iter().map(|i| i.into()).collect();
19951        self
19952    }
19953}
19954
19955impl wkt::message::Message for TimedPromoteReleaseCondition {
19956    fn typename() -> &'static str {
19957        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
19958    }
19959}
19960
19961/// Defines additional types related to [TimedPromoteReleaseCondition].
19962pub mod timed_promote_release_condition {
19963    #[allow(unused_imports)]
19964    use super::*;
19965
19966    /// The targets involved in a single timed promotion.
19967    #[derive(Clone, Default, PartialEq)]
19968    #[non_exhaustive]
19969    pub struct Targets {
19970        /// Optional. The source target ID.
19971        pub source_target_id: std::string::String,
19972
19973        /// Optional. The destination target ID.
19974        pub destination_target_id: std::string::String,
19975
19976        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19977    }
19978
19979    impl Targets {
19980        /// Creates a new default instance.
19981        pub fn new() -> Self {
19982            std::default::Default::default()
19983        }
19984
19985        /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
19986        ///
19987        /// # Example
19988        /// ```ignore,no_run
19989        /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19990        /// let x = Targets::new().set_source_target_id("example");
19991        /// ```
19992        pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
19993            mut self,
19994            v: T,
19995        ) -> Self {
19996            self.source_target_id = v.into();
19997            self
19998        }
19999
20000        /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
20001        ///
20002        /// # Example
20003        /// ```ignore,no_run
20004        /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20005        /// let x = Targets::new().set_destination_target_id("example");
20006        /// ```
20007        pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
20008            mut self,
20009            v: T,
20010        ) -> Self {
20011            self.destination_target_id = v.into();
20012            self
20013        }
20014    }
20015
20016    impl wkt::message::Message for Targets {
20017        fn typename() -> &'static str {
20018            "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
20019        }
20020    }
20021}
20022
20023/// The request object for `CreateAutomation`.
20024#[derive(Clone, Default, PartialEq)]
20025#[non_exhaustive]
20026pub struct CreateAutomationRequest {
20027    /// Required. The parent collection in which the `Automation` must be created.
20028    /// The format is
20029    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20030    pub parent: std::string::String,
20031
20032    /// Required. ID of the `Automation`.
20033    pub automation_id: std::string::String,
20034
20035    /// Required. The `Automation` to create.
20036    pub automation: std::option::Option<crate::model::Automation>,
20037
20038    /// Optional. A request ID to identify requests. Specify a unique request ID
20039    /// so that if you must retry your request, the server knows to ignore the
20040    /// request if it has already been completed. The server guarantees that for
20041    /// at least 60 minutes after the first request.
20042    ///
20043    /// For example, consider a situation where you make an initial request and the
20044    /// request times out. If you make the request again with the same request ID,
20045    /// the server can check if original operation with the same request ID was
20046    /// received, and if so, will ignore the second request. This prevents clients
20047    /// from accidentally creating duplicate commitments.
20048    ///
20049    /// The request ID must be a valid UUID with the exception that zero UUID is
20050    /// not supported (00000000-0000-0000-0000-000000000000).
20051    pub request_id: std::string::String,
20052
20053    /// Optional. If set to true, the request is validated and the user is provided
20054    /// with an expected result, but no actual change is made.
20055    pub validate_only: bool,
20056
20057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20058}
20059
20060impl CreateAutomationRequest {
20061    /// Creates a new default instance.
20062    pub fn new() -> Self {
20063        std::default::Default::default()
20064    }
20065
20066    /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
20067    ///
20068    /// # Example
20069    /// ```ignore,no_run
20070    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20071    /// let x = CreateAutomationRequest::new().set_parent("example");
20072    /// ```
20073    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20074        self.parent = v.into();
20075        self
20076    }
20077
20078    /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
20079    ///
20080    /// # Example
20081    /// ```ignore,no_run
20082    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20083    /// let x = CreateAutomationRequest::new().set_automation_id("example");
20084    /// ```
20085    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20086        self.automation_id = v.into();
20087        self
20088    }
20089
20090    /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
20091    ///
20092    /// # Example
20093    /// ```ignore,no_run
20094    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20095    /// use google_cloud_deploy_v1::model::Automation;
20096    /// let x = CreateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20097    /// ```
20098    pub fn set_automation<T>(mut self, v: T) -> Self
20099    where
20100        T: std::convert::Into<crate::model::Automation>,
20101    {
20102        self.automation = std::option::Option::Some(v.into());
20103        self
20104    }
20105
20106    /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
20107    ///
20108    /// # Example
20109    /// ```ignore,no_run
20110    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20111    /// use google_cloud_deploy_v1::model::Automation;
20112    /// let x = CreateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20113    /// let x = CreateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20114    /// ```
20115    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20116    where
20117        T: std::convert::Into<crate::model::Automation>,
20118    {
20119        self.automation = v.map(|x| x.into());
20120        self
20121    }
20122
20123    /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
20124    ///
20125    /// # Example
20126    /// ```ignore,no_run
20127    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20128    /// let x = CreateAutomationRequest::new().set_request_id("example");
20129    /// ```
20130    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20131        self.request_id = v.into();
20132        self
20133    }
20134
20135    /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
20136    ///
20137    /// # Example
20138    /// ```ignore,no_run
20139    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20140    /// let x = CreateAutomationRequest::new().set_validate_only(true);
20141    /// ```
20142    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20143        self.validate_only = v.into();
20144        self
20145    }
20146}
20147
20148impl wkt::message::Message for CreateAutomationRequest {
20149    fn typename() -> &'static str {
20150        "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
20151    }
20152}
20153
20154/// The request object for `UpdateAutomation`.
20155#[derive(Clone, Default, PartialEq)]
20156#[non_exhaustive]
20157pub struct UpdateAutomationRequest {
20158    /// Required. Field mask is used to specify the fields to be overwritten by the
20159    /// update in the `Automation` resource. The fields specified in the
20160    /// update_mask are relative to the resource, not the full request. A field
20161    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
20162    /// then all fields are overwritten.
20163    pub update_mask: std::option::Option<wkt::FieldMask>,
20164
20165    /// Required. The `Automation` to update.
20166    pub automation: std::option::Option<crate::model::Automation>,
20167
20168    /// Optional. A request ID to identify requests. Specify a unique request ID
20169    /// so that if you must retry your request, the server knows to ignore the
20170    /// request if it has already been completed. The server guarantees that for
20171    /// at least 60 minutes after the first request.
20172    ///
20173    /// For example, consider a situation where you make an initial request and the
20174    /// request times out. If you make the request again with the same request ID,
20175    /// the server can check if original operation with the same request ID was
20176    /// received, and if so, will ignore the second request. This prevents clients
20177    /// from accidentally creating duplicate commitments.
20178    ///
20179    /// The request ID must be a valid UUID with the exception that zero UUID is
20180    /// not supported (00000000-0000-0000-0000-000000000000).
20181    pub request_id: std::string::String,
20182
20183    /// Optional. If set to true, updating a `Automation` that does not exist will
20184    /// result in the creation of a new `Automation`.
20185    pub allow_missing: bool,
20186
20187    /// Optional. If set to true, the request is validated and the user is provided
20188    /// with an expected result, but no actual change is made.
20189    pub validate_only: bool,
20190
20191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20192}
20193
20194impl UpdateAutomationRequest {
20195    /// Creates a new default instance.
20196    pub fn new() -> Self {
20197        std::default::Default::default()
20198    }
20199
20200    /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20201    ///
20202    /// # Example
20203    /// ```ignore,no_run
20204    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20205    /// use wkt::FieldMask;
20206    /// let x = UpdateAutomationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20207    /// ```
20208    pub fn set_update_mask<T>(mut self, v: T) -> Self
20209    where
20210        T: std::convert::Into<wkt::FieldMask>,
20211    {
20212        self.update_mask = std::option::Option::Some(v.into());
20213        self
20214    }
20215
20216    /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20217    ///
20218    /// # Example
20219    /// ```ignore,no_run
20220    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20221    /// use wkt::FieldMask;
20222    /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20223    /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20224    /// ```
20225    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20226    where
20227        T: std::convert::Into<wkt::FieldMask>,
20228    {
20229        self.update_mask = v.map(|x| x.into());
20230        self
20231    }
20232
20233    /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
20234    ///
20235    /// # Example
20236    /// ```ignore,no_run
20237    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20238    /// use google_cloud_deploy_v1::model::Automation;
20239    /// let x = UpdateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20240    /// ```
20241    pub fn set_automation<T>(mut self, v: T) -> Self
20242    where
20243        T: std::convert::Into<crate::model::Automation>,
20244    {
20245        self.automation = std::option::Option::Some(v.into());
20246        self
20247    }
20248
20249    /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
20250    ///
20251    /// # Example
20252    /// ```ignore,no_run
20253    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20254    /// use google_cloud_deploy_v1::model::Automation;
20255    /// let x = UpdateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20256    /// let x = UpdateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20257    /// ```
20258    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20259    where
20260        T: std::convert::Into<crate::model::Automation>,
20261    {
20262        self.automation = v.map(|x| x.into());
20263        self
20264    }
20265
20266    /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
20267    ///
20268    /// # Example
20269    /// ```ignore,no_run
20270    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20271    /// let x = UpdateAutomationRequest::new().set_request_id("example");
20272    /// ```
20273    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20274        self.request_id = v.into();
20275        self
20276    }
20277
20278    /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
20279    ///
20280    /// # Example
20281    /// ```ignore,no_run
20282    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20283    /// let x = UpdateAutomationRequest::new().set_allow_missing(true);
20284    /// ```
20285    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20286        self.allow_missing = v.into();
20287        self
20288    }
20289
20290    /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
20291    ///
20292    /// # Example
20293    /// ```ignore,no_run
20294    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20295    /// let x = UpdateAutomationRequest::new().set_validate_only(true);
20296    /// ```
20297    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20298        self.validate_only = v.into();
20299        self
20300    }
20301}
20302
20303impl wkt::message::Message for UpdateAutomationRequest {
20304    fn typename() -> &'static str {
20305        "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
20306    }
20307}
20308
20309/// The request object for `DeleteAutomation`.
20310#[derive(Clone, Default, PartialEq)]
20311#[non_exhaustive]
20312pub struct DeleteAutomationRequest {
20313    /// Required. The name of the `Automation` to delete. The format is
20314    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20315    pub name: std::string::String,
20316
20317    /// Optional. A request ID to identify requests. Specify a unique request ID
20318    /// so that if you must retry your request, the server knows to ignore the
20319    /// request if it has already been completed. The server guarantees that for
20320    /// at least 60 minutes after the first request.
20321    ///
20322    /// For example, consider a situation where you make an initial request and the
20323    /// request times out. If you make the request again with the same request ID,
20324    /// the server can check if original operation with the same request ID was
20325    /// received, and if so, will ignore the second request. This prevents clients
20326    /// from accidentally creating duplicate commitments.
20327    ///
20328    /// The request ID must be a valid UUID with the exception that zero UUID is
20329    /// not supported (00000000-0000-0000-0000-000000000000).
20330    pub request_id: std::string::String,
20331
20332    /// Optional. If set to true, then deleting an already deleted or non-existing
20333    /// `Automation` will succeed.
20334    pub allow_missing: bool,
20335
20336    /// Optional. If set, validate the request and verify whether the resource
20337    /// exists, but do not actually post it.
20338    pub validate_only: bool,
20339
20340    /// Optional. The weak etag of the request.
20341    /// This checksum is computed by the server based on the value of other
20342    /// fields, and may be sent on update and delete requests to ensure the
20343    /// client has an up-to-date value before proceeding.
20344    pub etag: std::string::String,
20345
20346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20347}
20348
20349impl DeleteAutomationRequest {
20350    /// Creates a new default instance.
20351    pub fn new() -> Self {
20352        std::default::Default::default()
20353    }
20354
20355    /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
20356    ///
20357    /// # Example
20358    /// ```ignore,no_run
20359    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20360    /// let x = DeleteAutomationRequest::new().set_name("example");
20361    /// ```
20362    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20363        self.name = v.into();
20364        self
20365    }
20366
20367    /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
20368    ///
20369    /// # Example
20370    /// ```ignore,no_run
20371    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20372    /// let x = DeleteAutomationRequest::new().set_request_id("example");
20373    /// ```
20374    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20375        self.request_id = v.into();
20376        self
20377    }
20378
20379    /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
20380    ///
20381    /// # Example
20382    /// ```ignore,no_run
20383    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20384    /// let x = DeleteAutomationRequest::new().set_allow_missing(true);
20385    /// ```
20386    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20387        self.allow_missing = v.into();
20388        self
20389    }
20390
20391    /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
20392    ///
20393    /// # Example
20394    /// ```ignore,no_run
20395    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20396    /// let x = DeleteAutomationRequest::new().set_validate_only(true);
20397    /// ```
20398    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20399        self.validate_only = v.into();
20400        self
20401    }
20402
20403    /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
20404    ///
20405    /// # Example
20406    /// ```ignore,no_run
20407    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20408    /// let x = DeleteAutomationRequest::new().set_etag("example");
20409    /// ```
20410    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20411        self.etag = v.into();
20412        self
20413    }
20414}
20415
20416impl wkt::message::Message for DeleteAutomationRequest {
20417    fn typename() -> &'static str {
20418        "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
20419    }
20420}
20421
20422/// The request object for `ListAutomations`.
20423#[derive(Clone, Default, PartialEq)]
20424#[non_exhaustive]
20425pub struct ListAutomationsRequest {
20426    /// Required. The parent `Delivery Pipeline`, which owns this collection of
20427    /// automations. Format must be
20428    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20429    pub parent: std::string::String,
20430
20431    /// The maximum number of automations to return. The service may return
20432    /// fewer than this value. If unspecified, at most 50 automations will
20433    /// be returned. The maximum value is 1000; values above 1000 will be set
20434    /// to 1000.
20435    pub page_size: i32,
20436
20437    /// A page token, received from a previous `ListAutomations` call.
20438    /// Provide this to retrieve the subsequent page.
20439    ///
20440    /// When paginating, all other provided parameters match
20441    /// the call that provided the page token.
20442    pub page_token: std::string::String,
20443
20444    /// Filter automations to be returned. All fields can be used in the
20445    /// filter.
20446    pub filter: std::string::String,
20447
20448    /// Field to sort by.
20449    pub order_by: std::string::String,
20450
20451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20452}
20453
20454impl ListAutomationsRequest {
20455    /// Creates a new default instance.
20456    pub fn new() -> Self {
20457        std::default::Default::default()
20458    }
20459
20460    /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
20461    ///
20462    /// # Example
20463    /// ```ignore,no_run
20464    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20465    /// let x = ListAutomationsRequest::new().set_parent("example");
20466    /// ```
20467    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20468        self.parent = v.into();
20469        self
20470    }
20471
20472    /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
20473    ///
20474    /// # Example
20475    /// ```ignore,no_run
20476    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20477    /// let x = ListAutomationsRequest::new().set_page_size(42);
20478    /// ```
20479    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20480        self.page_size = v.into();
20481        self
20482    }
20483
20484    /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
20485    ///
20486    /// # Example
20487    /// ```ignore,no_run
20488    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20489    /// let x = ListAutomationsRequest::new().set_page_token("example");
20490    /// ```
20491    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20492        self.page_token = v.into();
20493        self
20494    }
20495
20496    /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
20497    ///
20498    /// # Example
20499    /// ```ignore,no_run
20500    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20501    /// let x = ListAutomationsRequest::new().set_filter("example");
20502    /// ```
20503    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20504        self.filter = v.into();
20505        self
20506    }
20507
20508    /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
20509    ///
20510    /// # Example
20511    /// ```ignore,no_run
20512    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20513    /// let x = ListAutomationsRequest::new().set_order_by("example");
20514    /// ```
20515    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20516        self.order_by = v.into();
20517        self
20518    }
20519}
20520
20521impl wkt::message::Message for ListAutomationsRequest {
20522    fn typename() -> &'static str {
20523        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
20524    }
20525}
20526
20527/// The response object from `ListAutomations`.
20528#[derive(Clone, Default, PartialEq)]
20529#[non_exhaustive]
20530pub struct ListAutomationsResponse {
20531    /// The `Automation` objects.
20532    pub automations: std::vec::Vec<crate::model::Automation>,
20533
20534    /// A token, which can be sent as `page_token` to retrieve the next page.
20535    /// If this field is omitted, there are no subsequent pages.
20536    pub next_page_token: std::string::String,
20537
20538    /// Locations that could not be reached.
20539    pub unreachable: std::vec::Vec<std::string::String>,
20540
20541    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20542}
20543
20544impl ListAutomationsResponse {
20545    /// Creates a new default instance.
20546    pub fn new() -> Self {
20547        std::default::Default::default()
20548    }
20549
20550    /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
20551    ///
20552    /// # Example
20553    /// ```ignore,no_run
20554    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20555    /// use google_cloud_deploy_v1::model::Automation;
20556    /// let x = ListAutomationsResponse::new()
20557    ///     .set_automations([
20558    ///         Automation::default()/* use setters */,
20559    ///         Automation::default()/* use (different) setters */,
20560    ///     ]);
20561    /// ```
20562    pub fn set_automations<T, V>(mut self, v: T) -> Self
20563    where
20564        T: std::iter::IntoIterator<Item = V>,
20565        V: std::convert::Into<crate::model::Automation>,
20566    {
20567        use std::iter::Iterator;
20568        self.automations = v.into_iter().map(|i| i.into()).collect();
20569        self
20570    }
20571
20572    /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
20573    ///
20574    /// # Example
20575    /// ```ignore,no_run
20576    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20577    /// let x = ListAutomationsResponse::new().set_next_page_token("example");
20578    /// ```
20579    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20580        self.next_page_token = v.into();
20581        self
20582    }
20583
20584    /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
20585    ///
20586    /// # Example
20587    /// ```ignore,no_run
20588    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20589    /// let x = ListAutomationsResponse::new().set_unreachable(["a", "b", "c"]);
20590    /// ```
20591    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20592    where
20593        T: std::iter::IntoIterator<Item = V>,
20594        V: std::convert::Into<std::string::String>,
20595    {
20596        use std::iter::Iterator;
20597        self.unreachable = v.into_iter().map(|i| i.into()).collect();
20598        self
20599    }
20600}
20601
20602impl wkt::message::Message for ListAutomationsResponse {
20603    fn typename() -> &'static str {
20604        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
20605    }
20606}
20607
20608#[doc(hidden)]
20609impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationsResponse {
20610    type PageItem = crate::model::Automation;
20611
20612    fn items(self) -> std::vec::Vec<Self::PageItem> {
20613        self.automations
20614    }
20615
20616    fn next_page_token(&self) -> std::string::String {
20617        use std::clone::Clone;
20618        self.next_page_token.clone()
20619    }
20620}
20621
20622/// The request object for `GetAutomation`
20623#[derive(Clone, Default, PartialEq)]
20624#[non_exhaustive]
20625pub struct GetAutomationRequest {
20626    /// Required. Name of the `Automation`. Format must be
20627    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20628    pub name: std::string::String,
20629
20630    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20631}
20632
20633impl GetAutomationRequest {
20634    /// Creates a new default instance.
20635    pub fn new() -> Self {
20636        std::default::Default::default()
20637    }
20638
20639    /// Sets the value of [name][crate::model::GetAutomationRequest::name].
20640    ///
20641    /// # Example
20642    /// ```ignore,no_run
20643    /// # use google_cloud_deploy_v1::model::GetAutomationRequest;
20644    /// let x = GetAutomationRequest::new().set_name("example");
20645    /// ```
20646    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20647        self.name = v.into();
20648        self
20649    }
20650}
20651
20652impl wkt::message::Message for GetAutomationRequest {
20653    fn typename() -> &'static str {
20654        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
20655    }
20656}
20657
20658/// An `AutomationRun` resource in the Cloud Deploy API.
20659///
20660/// An `AutomationRun` represents an execution instance of an
20661/// automation rule.
20662#[derive(Clone, Default, PartialEq)]
20663#[non_exhaustive]
20664pub struct AutomationRun {
20665    /// Output only. Name of the `AutomationRun`. Format is
20666    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
20667    pub name: std::string::String,
20668
20669    /// Output only. Time at which the `AutomationRun` was created.
20670    pub create_time: std::option::Option<wkt::Timestamp>,
20671
20672    /// Output only. Time at which the automationRun was updated.
20673    pub update_time: std::option::Option<wkt::Timestamp>,
20674
20675    /// Output only. The weak etag of the `AutomationRun` resource.
20676    /// This checksum is computed by the server based on the value of other
20677    /// fields, and may be sent on update and delete requests to ensure the
20678    /// client has an up-to-date value before proceeding.
20679    pub etag: std::string::String,
20680
20681    /// Output only. Email address of the user-managed IAM service account that
20682    /// performs the operations against Cloud Deploy resources.
20683    pub service_account: std::string::String,
20684
20685    /// Output only. Snapshot of the Automation taken at AutomationRun creation
20686    /// time.
20687    pub automation_snapshot: std::option::Option<crate::model::Automation>,
20688
20689    /// Output only. The ID of the source target that initiates the
20690    /// `AutomationRun`. The value of this field is the last segment of a target
20691    /// name.
20692    pub target_id: std::string::String,
20693
20694    /// Output only. Current state of the `AutomationRun`.
20695    pub state: crate::model::automation_run::State,
20696
20697    /// Output only. Explains the current state of the `AutomationRun`. Present
20698    /// only when an explanation is needed.
20699    pub state_description: std::string::String,
20700
20701    /// Output only. Contains information about what policies prevented the
20702    /// `AutomationRun` from proceeding.
20703    pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
20704
20705    /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
20706    /// after 14 days from its creation date.
20707    pub expire_time: std::option::Option<wkt::Timestamp>,
20708
20709    /// Output only. The ID of the automation rule that initiated the operation.
20710    pub rule_id: std::string::String,
20711
20712    /// Output only. The ID of the automation that initiated the operation.
20713    pub automation_id: std::string::String,
20714
20715    /// Output only. Earliest time the `AutomationRun` will attempt to resume.
20716    /// Wait-time is configured by `wait` in automation rule.
20717    pub wait_until_time: std::option::Option<wkt::Timestamp>,
20718
20719    /// The operation that the `AutomationRun` will perform.
20720    pub operation: std::option::Option<crate::model::automation_run::Operation>,
20721
20722    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20723}
20724
20725impl AutomationRun {
20726    /// Creates a new default instance.
20727    pub fn new() -> Self {
20728        std::default::Default::default()
20729    }
20730
20731    /// Sets the value of [name][crate::model::AutomationRun::name].
20732    ///
20733    /// # Example
20734    /// ```ignore,no_run
20735    /// # use google_cloud_deploy_v1::model::AutomationRun;
20736    /// let x = AutomationRun::new().set_name("example");
20737    /// ```
20738    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20739        self.name = v.into();
20740        self
20741    }
20742
20743    /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
20744    ///
20745    /// # Example
20746    /// ```ignore,no_run
20747    /// # use google_cloud_deploy_v1::model::AutomationRun;
20748    /// use wkt::Timestamp;
20749    /// let x = AutomationRun::new().set_create_time(Timestamp::default()/* use setters */);
20750    /// ```
20751    pub fn set_create_time<T>(mut self, v: T) -> Self
20752    where
20753        T: std::convert::Into<wkt::Timestamp>,
20754    {
20755        self.create_time = std::option::Option::Some(v.into());
20756        self
20757    }
20758
20759    /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
20760    ///
20761    /// # Example
20762    /// ```ignore,no_run
20763    /// # use google_cloud_deploy_v1::model::AutomationRun;
20764    /// use wkt::Timestamp;
20765    /// let x = AutomationRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20766    /// let x = AutomationRun::new().set_or_clear_create_time(None::<Timestamp>);
20767    /// ```
20768    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20769    where
20770        T: std::convert::Into<wkt::Timestamp>,
20771    {
20772        self.create_time = v.map(|x| x.into());
20773        self
20774    }
20775
20776    /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
20777    ///
20778    /// # Example
20779    /// ```ignore,no_run
20780    /// # use google_cloud_deploy_v1::model::AutomationRun;
20781    /// use wkt::Timestamp;
20782    /// let x = AutomationRun::new().set_update_time(Timestamp::default()/* use setters */);
20783    /// ```
20784    pub fn set_update_time<T>(mut self, v: T) -> Self
20785    where
20786        T: std::convert::Into<wkt::Timestamp>,
20787    {
20788        self.update_time = std::option::Option::Some(v.into());
20789        self
20790    }
20791
20792    /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
20793    ///
20794    /// # Example
20795    /// ```ignore,no_run
20796    /// # use google_cloud_deploy_v1::model::AutomationRun;
20797    /// use wkt::Timestamp;
20798    /// let x = AutomationRun::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20799    /// let x = AutomationRun::new().set_or_clear_update_time(None::<Timestamp>);
20800    /// ```
20801    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20802    where
20803        T: std::convert::Into<wkt::Timestamp>,
20804    {
20805        self.update_time = v.map(|x| x.into());
20806        self
20807    }
20808
20809    /// Sets the value of [etag][crate::model::AutomationRun::etag].
20810    ///
20811    /// # Example
20812    /// ```ignore,no_run
20813    /// # use google_cloud_deploy_v1::model::AutomationRun;
20814    /// let x = AutomationRun::new().set_etag("example");
20815    /// ```
20816    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20817        self.etag = v.into();
20818        self
20819    }
20820
20821    /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
20822    ///
20823    /// # Example
20824    /// ```ignore,no_run
20825    /// # use google_cloud_deploy_v1::model::AutomationRun;
20826    /// let x = AutomationRun::new().set_service_account("example");
20827    /// ```
20828    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20829        self.service_account = v.into();
20830        self
20831    }
20832
20833    /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20834    ///
20835    /// # Example
20836    /// ```ignore,no_run
20837    /// # use google_cloud_deploy_v1::model::AutomationRun;
20838    /// use google_cloud_deploy_v1::model::Automation;
20839    /// let x = AutomationRun::new().set_automation_snapshot(Automation::default()/* use setters */);
20840    /// ```
20841    pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
20842    where
20843        T: std::convert::Into<crate::model::Automation>,
20844    {
20845        self.automation_snapshot = std::option::Option::Some(v.into());
20846        self
20847    }
20848
20849    /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20850    ///
20851    /// # Example
20852    /// ```ignore,no_run
20853    /// # use google_cloud_deploy_v1::model::AutomationRun;
20854    /// use google_cloud_deploy_v1::model::Automation;
20855    /// let x = AutomationRun::new().set_or_clear_automation_snapshot(Some(Automation::default()/* use setters */));
20856    /// let x = AutomationRun::new().set_or_clear_automation_snapshot(None::<Automation>);
20857    /// ```
20858    pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
20859    where
20860        T: std::convert::Into<crate::model::Automation>,
20861    {
20862        self.automation_snapshot = v.map(|x| x.into());
20863        self
20864    }
20865
20866    /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
20867    ///
20868    /// # Example
20869    /// ```ignore,no_run
20870    /// # use google_cloud_deploy_v1::model::AutomationRun;
20871    /// let x = AutomationRun::new().set_target_id("example");
20872    /// ```
20873    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20874        self.target_id = v.into();
20875        self
20876    }
20877
20878    /// Sets the value of [state][crate::model::AutomationRun::state].
20879    ///
20880    /// # Example
20881    /// ```ignore,no_run
20882    /// # use google_cloud_deploy_v1::model::AutomationRun;
20883    /// use google_cloud_deploy_v1::model::automation_run::State;
20884    /// let x0 = AutomationRun::new().set_state(State::Succeeded);
20885    /// let x1 = AutomationRun::new().set_state(State::Cancelled);
20886    /// let x2 = AutomationRun::new().set_state(State::Failed);
20887    /// ```
20888    pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
20889        mut self,
20890        v: T,
20891    ) -> Self {
20892        self.state = v.into();
20893        self
20894    }
20895
20896    /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
20897    ///
20898    /// # Example
20899    /// ```ignore,no_run
20900    /// # use google_cloud_deploy_v1::model::AutomationRun;
20901    /// let x = AutomationRun::new().set_state_description("example");
20902    /// ```
20903    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
20904        mut self,
20905        v: T,
20906    ) -> Self {
20907        self.state_description = v.into();
20908        self
20909    }
20910
20911    /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20912    ///
20913    /// # Example
20914    /// ```ignore,no_run
20915    /// # use google_cloud_deploy_v1::model::AutomationRun;
20916    /// use google_cloud_deploy_v1::model::PolicyViolation;
20917    /// let x = AutomationRun::new().set_policy_violation(PolicyViolation::default()/* use setters */);
20918    /// ```
20919    pub fn set_policy_violation<T>(mut self, v: T) -> Self
20920    where
20921        T: std::convert::Into<crate::model::PolicyViolation>,
20922    {
20923        self.policy_violation = std::option::Option::Some(v.into());
20924        self
20925    }
20926
20927    /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20928    ///
20929    /// # Example
20930    /// ```ignore,no_run
20931    /// # use google_cloud_deploy_v1::model::AutomationRun;
20932    /// use google_cloud_deploy_v1::model::PolicyViolation;
20933    /// let x = AutomationRun::new().set_or_clear_policy_violation(Some(PolicyViolation::default()/* use setters */));
20934    /// let x = AutomationRun::new().set_or_clear_policy_violation(None::<PolicyViolation>);
20935    /// ```
20936    pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
20937    where
20938        T: std::convert::Into<crate::model::PolicyViolation>,
20939    {
20940        self.policy_violation = v.map(|x| x.into());
20941        self
20942    }
20943
20944    /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
20945    ///
20946    /// # Example
20947    /// ```ignore,no_run
20948    /// # use google_cloud_deploy_v1::model::AutomationRun;
20949    /// use wkt::Timestamp;
20950    /// let x = AutomationRun::new().set_expire_time(Timestamp::default()/* use setters */);
20951    /// ```
20952    pub fn set_expire_time<T>(mut self, v: T) -> Self
20953    where
20954        T: std::convert::Into<wkt::Timestamp>,
20955    {
20956        self.expire_time = std::option::Option::Some(v.into());
20957        self
20958    }
20959
20960    /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
20961    ///
20962    /// # Example
20963    /// ```ignore,no_run
20964    /// # use google_cloud_deploy_v1::model::AutomationRun;
20965    /// use wkt::Timestamp;
20966    /// let x = AutomationRun::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
20967    /// let x = AutomationRun::new().set_or_clear_expire_time(None::<Timestamp>);
20968    /// ```
20969    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
20970    where
20971        T: std::convert::Into<wkt::Timestamp>,
20972    {
20973        self.expire_time = v.map(|x| x.into());
20974        self
20975    }
20976
20977    /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
20978    ///
20979    /// # Example
20980    /// ```ignore,no_run
20981    /// # use google_cloud_deploy_v1::model::AutomationRun;
20982    /// let x = AutomationRun::new().set_rule_id("example");
20983    /// ```
20984    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20985        self.rule_id = v.into();
20986        self
20987    }
20988
20989    /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
20990    ///
20991    /// # Example
20992    /// ```ignore,no_run
20993    /// # use google_cloud_deploy_v1::model::AutomationRun;
20994    /// let x = AutomationRun::new().set_automation_id("example");
20995    /// ```
20996    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20997        self.automation_id = v.into();
20998        self
20999    }
21000
21001    /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
21002    ///
21003    /// # Example
21004    /// ```ignore,no_run
21005    /// # use google_cloud_deploy_v1::model::AutomationRun;
21006    /// use wkt::Timestamp;
21007    /// let x = AutomationRun::new().set_wait_until_time(Timestamp::default()/* use setters */);
21008    /// ```
21009    pub fn set_wait_until_time<T>(mut self, v: T) -> Self
21010    where
21011        T: std::convert::Into<wkt::Timestamp>,
21012    {
21013        self.wait_until_time = std::option::Option::Some(v.into());
21014        self
21015    }
21016
21017    /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
21018    ///
21019    /// # Example
21020    /// ```ignore,no_run
21021    /// # use google_cloud_deploy_v1::model::AutomationRun;
21022    /// use wkt::Timestamp;
21023    /// let x = AutomationRun::new().set_or_clear_wait_until_time(Some(Timestamp::default()/* use setters */));
21024    /// let x = AutomationRun::new().set_or_clear_wait_until_time(None::<Timestamp>);
21025    /// ```
21026    pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
21027    where
21028        T: std::convert::Into<wkt::Timestamp>,
21029    {
21030        self.wait_until_time = v.map(|x| x.into());
21031        self
21032    }
21033
21034    /// Sets the value of [operation][crate::model::AutomationRun::operation].
21035    ///
21036    /// Note that all the setters affecting `operation` are mutually
21037    /// exclusive.
21038    ///
21039    /// # Example
21040    /// ```ignore,no_run
21041    /// # use google_cloud_deploy_v1::model::AutomationRun;
21042    /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21043    /// let x = AutomationRun::new().set_operation(Some(
21044    ///     google_cloud_deploy_v1::model::automation_run::Operation::PromoteReleaseOperation(PromoteReleaseOperation::default().into())));
21045    /// ```
21046    pub fn set_operation<
21047        T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
21048    >(
21049        mut self,
21050        v: T,
21051    ) -> Self {
21052        self.operation = v.into();
21053        self
21054    }
21055
21056    /// The value of [operation][crate::model::AutomationRun::operation]
21057    /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
21058    /// holds a different branch.
21059    pub fn promote_release_operation(
21060        &self,
21061    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
21062        #[allow(unreachable_patterns)]
21063        self.operation.as_ref().and_then(|v| match v {
21064            crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
21065                std::option::Option::Some(v)
21066            }
21067            _ => std::option::Option::None,
21068        })
21069    }
21070
21071    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21072    /// to hold a `PromoteReleaseOperation`.
21073    ///
21074    /// Note that all the setters affecting `operation` are
21075    /// mutually exclusive.
21076    ///
21077    /// # Example
21078    /// ```ignore,no_run
21079    /// # use google_cloud_deploy_v1::model::AutomationRun;
21080    /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21081    /// let x = AutomationRun::new().set_promote_release_operation(PromoteReleaseOperation::default()/* use setters */);
21082    /// assert!(x.promote_release_operation().is_some());
21083    /// assert!(x.advance_rollout_operation().is_none());
21084    /// assert!(x.repair_rollout_operation().is_none());
21085    /// assert!(x.timed_promote_release_operation().is_none());
21086    /// ```
21087    pub fn set_promote_release_operation<
21088        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
21089    >(
21090        mut self,
21091        v: T,
21092    ) -> Self {
21093        self.operation = std::option::Option::Some(
21094            crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
21095        );
21096        self
21097    }
21098
21099    /// The value of [operation][crate::model::AutomationRun::operation]
21100    /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
21101    /// holds a different branch.
21102    pub fn advance_rollout_operation(
21103        &self,
21104    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
21105        #[allow(unreachable_patterns)]
21106        self.operation.as_ref().and_then(|v| match v {
21107            crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
21108                std::option::Option::Some(v)
21109            }
21110            _ => std::option::Option::None,
21111        })
21112    }
21113
21114    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21115    /// to hold a `AdvanceRolloutOperation`.
21116    ///
21117    /// Note that all the setters affecting `operation` are
21118    /// mutually exclusive.
21119    ///
21120    /// # Example
21121    /// ```ignore,no_run
21122    /// # use google_cloud_deploy_v1::model::AutomationRun;
21123    /// use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21124    /// let x = AutomationRun::new().set_advance_rollout_operation(AdvanceRolloutOperation::default()/* use setters */);
21125    /// assert!(x.advance_rollout_operation().is_some());
21126    /// assert!(x.promote_release_operation().is_none());
21127    /// assert!(x.repair_rollout_operation().is_none());
21128    /// assert!(x.timed_promote_release_operation().is_none());
21129    /// ```
21130    pub fn set_advance_rollout_operation<
21131        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
21132    >(
21133        mut self,
21134        v: T,
21135    ) -> Self {
21136        self.operation = std::option::Option::Some(
21137            crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
21138        );
21139        self
21140    }
21141
21142    /// The value of [operation][crate::model::AutomationRun::operation]
21143    /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
21144    /// holds a different branch.
21145    pub fn repair_rollout_operation(
21146        &self,
21147    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
21148        #[allow(unreachable_patterns)]
21149        self.operation.as_ref().and_then(|v| match v {
21150            crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
21151                std::option::Option::Some(v)
21152            }
21153            _ => std::option::Option::None,
21154        })
21155    }
21156
21157    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21158    /// to hold a `RepairRolloutOperation`.
21159    ///
21160    /// Note that all the setters affecting `operation` are
21161    /// mutually exclusive.
21162    ///
21163    /// # Example
21164    /// ```ignore,no_run
21165    /// # use google_cloud_deploy_v1::model::AutomationRun;
21166    /// use google_cloud_deploy_v1::model::RepairRolloutOperation;
21167    /// let x = AutomationRun::new().set_repair_rollout_operation(RepairRolloutOperation::default()/* use setters */);
21168    /// assert!(x.repair_rollout_operation().is_some());
21169    /// assert!(x.promote_release_operation().is_none());
21170    /// assert!(x.advance_rollout_operation().is_none());
21171    /// assert!(x.timed_promote_release_operation().is_none());
21172    /// ```
21173    pub fn set_repair_rollout_operation<
21174        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
21175    >(
21176        mut self,
21177        v: T,
21178    ) -> Self {
21179        self.operation = std::option::Option::Some(
21180            crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
21181        );
21182        self
21183    }
21184
21185    /// The value of [operation][crate::model::AutomationRun::operation]
21186    /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
21187    /// holds a different branch.
21188    pub fn timed_promote_release_operation(
21189        &self,
21190    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
21191        #[allow(unreachable_patterns)]
21192        self.operation.as_ref().and_then(|v| match v {
21193            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
21194                std::option::Option::Some(v)
21195            }
21196            _ => std::option::Option::None,
21197        })
21198    }
21199
21200    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21201    /// to hold a `TimedPromoteReleaseOperation`.
21202    ///
21203    /// Note that all the setters affecting `operation` are
21204    /// mutually exclusive.
21205    ///
21206    /// # Example
21207    /// ```ignore,no_run
21208    /// # use google_cloud_deploy_v1::model::AutomationRun;
21209    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21210    /// let x = AutomationRun::new().set_timed_promote_release_operation(TimedPromoteReleaseOperation::default()/* use setters */);
21211    /// assert!(x.timed_promote_release_operation().is_some());
21212    /// assert!(x.promote_release_operation().is_none());
21213    /// assert!(x.advance_rollout_operation().is_none());
21214    /// assert!(x.repair_rollout_operation().is_none());
21215    /// ```
21216    pub fn set_timed_promote_release_operation<
21217        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
21218    >(
21219        mut self,
21220        v: T,
21221    ) -> Self {
21222        self.operation = std::option::Option::Some(
21223            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
21224        );
21225        self
21226    }
21227}
21228
21229impl wkt::message::Message for AutomationRun {
21230    fn typename() -> &'static str {
21231        "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
21232    }
21233}
21234
21235/// Defines additional types related to [AutomationRun].
21236pub mod automation_run {
21237    #[allow(unused_imports)]
21238    use super::*;
21239
21240    /// Valid state of an `AutomationRun`.
21241    ///
21242    /// # Working with unknown values
21243    ///
21244    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21245    /// additional enum variants at any time. Adding new variants is not considered
21246    /// a breaking change. Applications should write their code in anticipation of:
21247    ///
21248    /// - New values appearing in future releases of the client library, **and**
21249    /// - New values received dynamically, without application changes.
21250    ///
21251    /// Please consult the [Working with enums] section in the user guide for some
21252    /// guidelines.
21253    ///
21254    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21255    #[derive(Clone, Debug, PartialEq)]
21256    #[non_exhaustive]
21257    pub enum State {
21258        /// The `AutomationRun` has an unspecified state.
21259        Unspecified,
21260        /// The `AutomationRun` has succeeded.
21261        Succeeded,
21262        /// The `AutomationRun` was cancelled.
21263        Cancelled,
21264        /// The `AutomationRun` has failed.
21265        Failed,
21266        /// The `AutomationRun` is in progress.
21267        InProgress,
21268        /// The `AutomationRun` is pending.
21269        Pending,
21270        /// The `AutomationRun` was aborted.
21271        Aborted,
21272        /// If set, the enum was initialized with an unknown value.
21273        ///
21274        /// Applications can examine the value using [State::value] or
21275        /// [State::name].
21276        UnknownValue(state::UnknownValue),
21277    }
21278
21279    #[doc(hidden)]
21280    pub mod state {
21281        #[allow(unused_imports)]
21282        use super::*;
21283        #[derive(Clone, Debug, PartialEq)]
21284        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21285    }
21286
21287    impl State {
21288        /// Gets the enum value.
21289        ///
21290        /// Returns `None` if the enum contains an unknown value deserialized from
21291        /// the string representation of enums.
21292        pub fn value(&self) -> std::option::Option<i32> {
21293            match self {
21294                Self::Unspecified => std::option::Option::Some(0),
21295                Self::Succeeded => std::option::Option::Some(1),
21296                Self::Cancelled => std::option::Option::Some(2),
21297                Self::Failed => std::option::Option::Some(3),
21298                Self::InProgress => std::option::Option::Some(4),
21299                Self::Pending => std::option::Option::Some(5),
21300                Self::Aborted => std::option::Option::Some(6),
21301                Self::UnknownValue(u) => u.0.value(),
21302            }
21303        }
21304
21305        /// Gets the enum value as a string.
21306        ///
21307        /// Returns `None` if the enum contains an unknown value deserialized from
21308        /// the integer representation of enums.
21309        pub fn name(&self) -> std::option::Option<&str> {
21310            match self {
21311                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21312                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
21313                Self::Cancelled => std::option::Option::Some("CANCELLED"),
21314                Self::Failed => std::option::Option::Some("FAILED"),
21315                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
21316                Self::Pending => std::option::Option::Some("PENDING"),
21317                Self::Aborted => std::option::Option::Some("ABORTED"),
21318                Self::UnknownValue(u) => u.0.name(),
21319            }
21320        }
21321    }
21322
21323    impl std::default::Default for State {
21324        fn default() -> Self {
21325            use std::convert::From;
21326            Self::from(0)
21327        }
21328    }
21329
21330    impl std::fmt::Display for State {
21331        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21332            wkt::internal::display_enum(f, self.name(), self.value())
21333        }
21334    }
21335
21336    impl std::convert::From<i32> for State {
21337        fn from(value: i32) -> Self {
21338            match value {
21339                0 => Self::Unspecified,
21340                1 => Self::Succeeded,
21341                2 => Self::Cancelled,
21342                3 => Self::Failed,
21343                4 => Self::InProgress,
21344                5 => Self::Pending,
21345                6 => Self::Aborted,
21346                _ => Self::UnknownValue(state::UnknownValue(
21347                    wkt::internal::UnknownEnumValue::Integer(value),
21348                )),
21349            }
21350        }
21351    }
21352
21353    impl std::convert::From<&str> for State {
21354        fn from(value: &str) -> Self {
21355            use std::string::ToString;
21356            match value {
21357                "STATE_UNSPECIFIED" => Self::Unspecified,
21358                "SUCCEEDED" => Self::Succeeded,
21359                "CANCELLED" => Self::Cancelled,
21360                "FAILED" => Self::Failed,
21361                "IN_PROGRESS" => Self::InProgress,
21362                "PENDING" => Self::Pending,
21363                "ABORTED" => Self::Aborted,
21364                _ => Self::UnknownValue(state::UnknownValue(
21365                    wkt::internal::UnknownEnumValue::String(value.to_string()),
21366                )),
21367            }
21368        }
21369    }
21370
21371    impl serde::ser::Serialize for State {
21372        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21373        where
21374            S: serde::Serializer,
21375        {
21376            match self {
21377                Self::Unspecified => serializer.serialize_i32(0),
21378                Self::Succeeded => serializer.serialize_i32(1),
21379                Self::Cancelled => serializer.serialize_i32(2),
21380                Self::Failed => serializer.serialize_i32(3),
21381                Self::InProgress => serializer.serialize_i32(4),
21382                Self::Pending => serializer.serialize_i32(5),
21383                Self::Aborted => serializer.serialize_i32(6),
21384                Self::UnknownValue(u) => u.0.serialize(serializer),
21385            }
21386        }
21387    }
21388
21389    impl<'de> serde::de::Deserialize<'de> for State {
21390        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21391        where
21392            D: serde::Deserializer<'de>,
21393        {
21394            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21395                ".google.cloud.deploy.v1.AutomationRun.State",
21396            ))
21397        }
21398    }
21399
21400    /// The operation that the `AutomationRun` will perform.
21401    #[derive(Clone, Debug, PartialEq)]
21402    #[non_exhaustive]
21403    pub enum Operation {
21404        /// Output only. Promotes a release to a specified 'Target'.
21405        PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
21406        /// Output only. Advances a rollout to the next phase.
21407        AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
21408        /// Output only. Repairs a failed 'Rollout'.
21409        RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
21410        /// Output only. Promotes a release to a specified 'Target' as defined in a
21411        /// Timed Promote Release rule.
21412        TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
21413    }
21414}
21415
21416/// Contains the information of an automated promote-release operation.
21417#[derive(Clone, Default, PartialEq)]
21418#[non_exhaustive]
21419pub struct PromoteReleaseOperation {
21420    /// Output only. The ID of the target that represents the promotion stage to
21421    /// which the release will be promoted. The value of this field is the last
21422    /// segment of a target name.
21423    pub target_id: std::string::String,
21424
21425    /// Output only. How long the operation will be paused.
21426    pub wait: std::option::Option<wkt::Duration>,
21427
21428    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21429    pub rollout: std::string::String,
21430
21431    /// Output only. The starting phase of the rollout created by this operation.
21432    pub phase: std::string::String,
21433
21434    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21435}
21436
21437impl PromoteReleaseOperation {
21438    /// Creates a new default instance.
21439    pub fn new() -> Self {
21440        std::default::Default::default()
21441    }
21442
21443    /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
21444    ///
21445    /// # Example
21446    /// ```ignore,no_run
21447    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21448    /// let x = PromoteReleaseOperation::new().set_target_id("example");
21449    /// ```
21450    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21451        self.target_id = v.into();
21452        self
21453    }
21454
21455    /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
21456    ///
21457    /// # Example
21458    /// ```ignore,no_run
21459    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21460    /// use wkt::Duration;
21461    /// let x = PromoteReleaseOperation::new().set_wait(Duration::default()/* use setters */);
21462    /// ```
21463    pub fn set_wait<T>(mut self, v: T) -> Self
21464    where
21465        T: std::convert::Into<wkt::Duration>,
21466    {
21467        self.wait = std::option::Option::Some(v.into());
21468        self
21469    }
21470
21471    /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
21472    ///
21473    /// # Example
21474    /// ```ignore,no_run
21475    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21476    /// use wkt::Duration;
21477    /// let x = PromoteReleaseOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21478    /// let x = PromoteReleaseOperation::new().set_or_clear_wait(None::<Duration>);
21479    /// ```
21480    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21481    where
21482        T: std::convert::Into<wkt::Duration>,
21483    {
21484        self.wait = v.map(|x| x.into());
21485        self
21486    }
21487
21488    /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
21489    ///
21490    /// # Example
21491    /// ```ignore,no_run
21492    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21493    /// let x = PromoteReleaseOperation::new().set_rollout("example");
21494    /// ```
21495    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21496        self.rollout = v.into();
21497        self
21498    }
21499
21500    /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
21501    ///
21502    /// # Example
21503    /// ```ignore,no_run
21504    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21505    /// let x = PromoteReleaseOperation::new().set_phase("example");
21506    /// ```
21507    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21508        self.phase = v.into();
21509        self
21510    }
21511}
21512
21513impl wkt::message::Message for PromoteReleaseOperation {
21514    fn typename() -> &'static str {
21515        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
21516    }
21517}
21518
21519/// Contains the information of an automated advance-rollout operation.
21520#[derive(Clone, Default, PartialEq)]
21521#[non_exhaustive]
21522pub struct AdvanceRolloutOperation {
21523    /// Output only. The phase of a deployment that initiated the operation.
21524    pub source_phase: std::string::String,
21525
21526    /// Output only. How long the operation will be paused.
21527    pub wait: std::option::Option<wkt::Duration>,
21528
21529    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21530    pub rollout: std::string::String,
21531
21532    /// Output only. The phase the rollout will be advanced to.
21533    pub destination_phase: std::string::String,
21534
21535    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21536}
21537
21538impl AdvanceRolloutOperation {
21539    /// Creates a new default instance.
21540    pub fn new() -> Self {
21541        std::default::Default::default()
21542    }
21543
21544    /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
21545    ///
21546    /// # Example
21547    /// ```ignore,no_run
21548    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21549    /// let x = AdvanceRolloutOperation::new().set_source_phase("example");
21550    /// ```
21551    pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21552        self.source_phase = v.into();
21553        self
21554    }
21555
21556    /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21557    ///
21558    /// # Example
21559    /// ```ignore,no_run
21560    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21561    /// use wkt::Duration;
21562    /// let x = AdvanceRolloutOperation::new().set_wait(Duration::default()/* use setters */);
21563    /// ```
21564    pub fn set_wait<T>(mut self, v: T) -> Self
21565    where
21566        T: std::convert::Into<wkt::Duration>,
21567    {
21568        self.wait = std::option::Option::Some(v.into());
21569        self
21570    }
21571
21572    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21573    ///
21574    /// # Example
21575    /// ```ignore,no_run
21576    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21577    /// use wkt::Duration;
21578    /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21579    /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(None::<Duration>);
21580    /// ```
21581    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21582    where
21583        T: std::convert::Into<wkt::Duration>,
21584    {
21585        self.wait = v.map(|x| x.into());
21586        self
21587    }
21588
21589    /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
21590    ///
21591    /// # Example
21592    /// ```ignore,no_run
21593    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21594    /// let x = AdvanceRolloutOperation::new().set_rollout("example");
21595    /// ```
21596    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21597        self.rollout = v.into();
21598        self
21599    }
21600
21601    /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
21602    ///
21603    /// # Example
21604    /// ```ignore,no_run
21605    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21606    /// let x = AdvanceRolloutOperation::new().set_destination_phase("example");
21607    /// ```
21608    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21609        mut self,
21610        v: T,
21611    ) -> Self {
21612        self.destination_phase = v.into();
21613        self
21614    }
21615}
21616
21617impl wkt::message::Message for AdvanceRolloutOperation {
21618    fn typename() -> &'static str {
21619        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
21620    }
21621}
21622
21623/// Contains the information for an automated `repair rollout` operation.
21624#[derive(Clone, Default, PartialEq)]
21625#[non_exhaustive]
21626pub struct RepairRolloutOperation {
21627    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21628    pub rollout: std::string::String,
21629
21630    /// Output only. The index of the current repair action in the repair sequence.
21631    pub current_repair_phase_index: i64,
21632
21633    /// Output only. Records of the repair attempts. Each repair phase may have
21634    /// multiple retry attempts or single rollback attempt.
21635    pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
21636
21637    /// Output only. The phase ID of the phase that includes the job being
21638    /// repaired.
21639    pub phase_id: std::string::String,
21640
21641    /// Output only. The job ID for the Job to repair.
21642    pub job_id: std::string::String,
21643
21644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21645}
21646
21647impl RepairRolloutOperation {
21648    /// Creates a new default instance.
21649    pub fn new() -> Self {
21650        std::default::Default::default()
21651    }
21652
21653    /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
21654    ///
21655    /// # Example
21656    /// ```ignore,no_run
21657    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21658    /// let x = RepairRolloutOperation::new().set_rollout("example");
21659    /// ```
21660    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21661        self.rollout = v.into();
21662        self
21663    }
21664
21665    /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
21666    ///
21667    /// # Example
21668    /// ```ignore,no_run
21669    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21670    /// let x = RepairRolloutOperation::new().set_current_repair_phase_index(42);
21671    /// ```
21672    pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21673        self.current_repair_phase_index = v.into();
21674        self
21675    }
21676
21677    /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
21678    ///
21679    /// # Example
21680    /// ```ignore,no_run
21681    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21682    /// use google_cloud_deploy_v1::model::RepairPhase;
21683    /// let x = RepairRolloutOperation::new()
21684    ///     .set_repair_phases([
21685    ///         RepairPhase::default()/* use setters */,
21686    ///         RepairPhase::default()/* use (different) setters */,
21687    ///     ]);
21688    /// ```
21689    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
21690    where
21691        T: std::iter::IntoIterator<Item = V>,
21692        V: std::convert::Into<crate::model::RepairPhase>,
21693    {
21694        use std::iter::Iterator;
21695        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
21696        self
21697    }
21698
21699    /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
21700    ///
21701    /// # Example
21702    /// ```ignore,no_run
21703    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21704    /// let x = RepairRolloutOperation::new().set_phase_id("example");
21705    /// ```
21706    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21707        self.phase_id = v.into();
21708        self
21709    }
21710
21711    /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
21712    ///
21713    /// # Example
21714    /// ```ignore,no_run
21715    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21716    /// let x = RepairRolloutOperation::new().set_job_id("example");
21717    /// ```
21718    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21719        self.job_id = v.into();
21720        self
21721    }
21722}
21723
21724impl wkt::message::Message for RepairRolloutOperation {
21725    fn typename() -> &'static str {
21726        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
21727    }
21728}
21729
21730/// Contains the information of an automated timed promote-release operation.
21731#[derive(Clone, Default, PartialEq)]
21732#[non_exhaustive]
21733pub struct TimedPromoteReleaseOperation {
21734    /// Output only. The ID of the target that represents the promotion stage to
21735    /// which the release will be promoted. The value of this field is the last
21736    /// segment of a target name.
21737    pub target_id: std::string::String,
21738
21739    /// Output only. The name of the release to be promoted.
21740    pub release: std::string::String,
21741
21742    /// Output only. The starting phase of the rollout created by this operation.
21743    pub phase: std::string::String,
21744
21745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21746}
21747
21748impl TimedPromoteReleaseOperation {
21749    /// Creates a new default instance.
21750    pub fn new() -> Self {
21751        std::default::Default::default()
21752    }
21753
21754    /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
21755    ///
21756    /// # Example
21757    /// ```ignore,no_run
21758    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21759    /// let x = TimedPromoteReleaseOperation::new().set_target_id("example");
21760    /// ```
21761    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21762        self.target_id = v.into();
21763        self
21764    }
21765
21766    /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
21767    ///
21768    /// # Example
21769    /// ```ignore,no_run
21770    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21771    /// let x = TimedPromoteReleaseOperation::new().set_release("example");
21772    /// ```
21773    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21774        self.release = v.into();
21775        self
21776    }
21777
21778    /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
21779    ///
21780    /// # Example
21781    /// ```ignore,no_run
21782    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21783    /// let x = TimedPromoteReleaseOperation::new().set_phase("example");
21784    /// ```
21785    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21786        self.phase = v.into();
21787        self
21788    }
21789}
21790
21791impl wkt::message::Message for TimedPromoteReleaseOperation {
21792    fn typename() -> &'static str {
21793        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
21794    }
21795}
21796
21797/// RepairPhase tracks the repair attempts that have been made for
21798/// each `RepairPhaseConfig` specified in the `Automation` resource.
21799#[derive(Clone, Default, PartialEq)]
21800#[non_exhaustive]
21801pub struct RepairPhase {
21802    /// The `RepairPhase` type and the information for that type.
21803    pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
21804
21805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21806}
21807
21808impl RepairPhase {
21809    /// Creates a new default instance.
21810    pub fn new() -> Self {
21811        std::default::Default::default()
21812    }
21813
21814    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
21815    ///
21816    /// Note that all the setters affecting `repair_phase` are mutually
21817    /// exclusive.
21818    ///
21819    /// # Example
21820    /// ```ignore,no_run
21821    /// # use google_cloud_deploy_v1::model::RepairPhase;
21822    /// use google_cloud_deploy_v1::model::RetryPhase;
21823    /// let x = RepairPhase::new().set_repair_phase(Some(
21824    ///     google_cloud_deploy_v1::model::repair_phase::RepairPhase::Retry(RetryPhase::default().into())));
21825    /// ```
21826    pub fn set_repair_phase<
21827        T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
21828    >(
21829        mut self,
21830        v: T,
21831    ) -> Self {
21832        self.repair_phase = v.into();
21833        self
21834    }
21835
21836    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21837    /// if it holds a `Retry`, `None` if the field is not set or
21838    /// holds a different branch.
21839    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
21840        #[allow(unreachable_patterns)]
21841        self.repair_phase.as_ref().and_then(|v| match v {
21842            crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
21843            _ => std::option::Option::None,
21844        })
21845    }
21846
21847    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21848    /// to hold a `Retry`.
21849    ///
21850    /// Note that all the setters affecting `repair_phase` are
21851    /// mutually exclusive.
21852    ///
21853    /// # Example
21854    /// ```ignore,no_run
21855    /// # use google_cloud_deploy_v1::model::RepairPhase;
21856    /// use google_cloud_deploy_v1::model::RetryPhase;
21857    /// let x = RepairPhase::new().set_retry(RetryPhase::default()/* use setters */);
21858    /// assert!(x.retry().is_some());
21859    /// assert!(x.rollback().is_none());
21860    /// ```
21861    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
21862        mut self,
21863        v: T,
21864    ) -> Self {
21865        self.repair_phase =
21866            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
21867        self
21868    }
21869
21870    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21871    /// if it holds a `Rollback`, `None` if the field is not set or
21872    /// holds a different branch.
21873    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
21874        #[allow(unreachable_patterns)]
21875        self.repair_phase.as_ref().and_then(|v| match v {
21876            crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
21877            _ => std::option::Option::None,
21878        })
21879    }
21880
21881    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21882    /// to hold a `Rollback`.
21883    ///
21884    /// Note that all the setters affecting `repair_phase` are
21885    /// mutually exclusive.
21886    ///
21887    /// # Example
21888    /// ```ignore,no_run
21889    /// # use google_cloud_deploy_v1::model::RepairPhase;
21890    /// use google_cloud_deploy_v1::model::RollbackAttempt;
21891    /// let x = RepairPhase::new().set_rollback(RollbackAttempt::default()/* use setters */);
21892    /// assert!(x.rollback().is_some());
21893    /// assert!(x.retry().is_none());
21894    /// ```
21895    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
21896        mut self,
21897        v: T,
21898    ) -> Self {
21899        self.repair_phase =
21900            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
21901        self
21902    }
21903}
21904
21905impl wkt::message::Message for RepairPhase {
21906    fn typename() -> &'static str {
21907        "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
21908    }
21909}
21910
21911/// Defines additional types related to [RepairPhase].
21912pub mod repair_phase {
21913    #[allow(unused_imports)]
21914    use super::*;
21915
21916    /// The `RepairPhase` type and the information for that type.
21917    #[derive(Clone, Debug, PartialEq)]
21918    #[non_exhaustive]
21919    pub enum RepairPhase {
21920        /// Output only. Records of the retry attempts for retry repair mode.
21921        Retry(std::boxed::Box<crate::model::RetryPhase>),
21922        /// Output only. Rollback attempt for rollback repair mode .
21923        Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
21924    }
21925}
21926
21927/// RetryPhase contains the retry attempts and the metadata for initiating a
21928/// new attempt.
21929#[derive(Clone, Default, PartialEq)]
21930#[non_exhaustive]
21931pub struct RetryPhase {
21932    /// Output only. The number of attempts that have been made.
21933    pub total_attempts: i64,
21934
21935    /// Output only. The pattern of how the wait time of the retry attempt is
21936    /// calculated.
21937    pub backoff_mode: crate::model::BackoffMode,
21938
21939    /// Output only. Detail of a retry action.
21940    pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
21941
21942    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21943}
21944
21945impl RetryPhase {
21946    /// Creates a new default instance.
21947    pub fn new() -> Self {
21948        std::default::Default::default()
21949    }
21950
21951    /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
21952    ///
21953    /// # Example
21954    /// ```ignore,no_run
21955    /// # use google_cloud_deploy_v1::model::RetryPhase;
21956    /// let x = RetryPhase::new().set_total_attempts(42);
21957    /// ```
21958    pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21959        self.total_attempts = v.into();
21960        self
21961    }
21962
21963    /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
21964    ///
21965    /// # Example
21966    /// ```ignore,no_run
21967    /// # use google_cloud_deploy_v1::model::RetryPhase;
21968    /// use google_cloud_deploy_v1::model::BackoffMode;
21969    /// let x0 = RetryPhase::new().set_backoff_mode(BackoffMode::Linear);
21970    /// let x1 = RetryPhase::new().set_backoff_mode(BackoffMode::Exponential);
21971    /// ```
21972    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
21973        mut self,
21974        v: T,
21975    ) -> Self {
21976        self.backoff_mode = v.into();
21977        self
21978    }
21979
21980    /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
21981    ///
21982    /// # Example
21983    /// ```ignore,no_run
21984    /// # use google_cloud_deploy_v1::model::RetryPhase;
21985    /// use google_cloud_deploy_v1::model::RetryAttempt;
21986    /// let x = RetryPhase::new()
21987    ///     .set_attempts([
21988    ///         RetryAttempt::default()/* use setters */,
21989    ///         RetryAttempt::default()/* use (different) setters */,
21990    ///     ]);
21991    /// ```
21992    pub fn set_attempts<T, V>(mut self, v: T) -> Self
21993    where
21994        T: std::iter::IntoIterator<Item = V>,
21995        V: std::convert::Into<crate::model::RetryAttempt>,
21996    {
21997        use std::iter::Iterator;
21998        self.attempts = v.into_iter().map(|i| i.into()).collect();
21999        self
22000    }
22001}
22002
22003impl wkt::message::Message for RetryPhase {
22004    fn typename() -> &'static str {
22005        "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
22006    }
22007}
22008
22009/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
22010#[derive(Clone, Default, PartialEq)]
22011#[non_exhaustive]
22012pub struct RetryAttempt {
22013    /// Output only. The index of this retry attempt.
22014    pub attempt: i64,
22015
22016    /// Output only. How long the operation will be paused.
22017    pub wait: std::option::Option<wkt::Duration>,
22018
22019    /// Output only. Valid state of this retry action.
22020    pub state: crate::model::RepairState,
22021
22022    /// Output only. Description of the state of the Retry.
22023    pub state_desc: std::string::String,
22024
22025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22026}
22027
22028impl RetryAttempt {
22029    /// Creates a new default instance.
22030    pub fn new() -> Self {
22031        std::default::Default::default()
22032    }
22033
22034    /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
22035    ///
22036    /// # Example
22037    /// ```ignore,no_run
22038    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22039    /// let x = RetryAttempt::new().set_attempt(42);
22040    /// ```
22041    pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22042        self.attempt = v.into();
22043        self
22044    }
22045
22046    /// Sets the value of [wait][crate::model::RetryAttempt::wait].
22047    ///
22048    /// # Example
22049    /// ```ignore,no_run
22050    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22051    /// use wkt::Duration;
22052    /// let x = RetryAttempt::new().set_wait(Duration::default()/* use setters */);
22053    /// ```
22054    pub fn set_wait<T>(mut self, v: T) -> Self
22055    where
22056        T: std::convert::Into<wkt::Duration>,
22057    {
22058        self.wait = std::option::Option::Some(v.into());
22059        self
22060    }
22061
22062    /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
22063    ///
22064    /// # Example
22065    /// ```ignore,no_run
22066    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22067    /// use wkt::Duration;
22068    /// let x = RetryAttempt::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
22069    /// let x = RetryAttempt::new().set_or_clear_wait(None::<Duration>);
22070    /// ```
22071    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
22072    where
22073        T: std::convert::Into<wkt::Duration>,
22074    {
22075        self.wait = v.map(|x| x.into());
22076        self
22077    }
22078
22079    /// Sets the value of [state][crate::model::RetryAttempt::state].
22080    ///
22081    /// # Example
22082    /// ```ignore,no_run
22083    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22084    /// use google_cloud_deploy_v1::model::RepairState;
22085    /// let x0 = RetryAttempt::new().set_state(RepairState::Succeeded);
22086    /// let x1 = RetryAttempt::new().set_state(RepairState::Cancelled);
22087    /// let x2 = RetryAttempt::new().set_state(RepairState::Failed);
22088    /// ```
22089    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22090        self.state = v.into();
22091        self
22092    }
22093
22094    /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
22095    ///
22096    /// # Example
22097    /// ```ignore,no_run
22098    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22099    /// let x = RetryAttempt::new().set_state_desc("example");
22100    /// ```
22101    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22102        self.state_desc = v.into();
22103        self
22104    }
22105}
22106
22107impl wkt::message::Message for RetryAttempt {
22108    fn typename() -> &'static str {
22109        "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
22110    }
22111}
22112
22113/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
22114#[derive(Clone, Default, PartialEq)]
22115#[non_exhaustive]
22116pub struct RollbackAttempt {
22117    /// Output only. The phase to which the rollout will be rolled back to.
22118    pub destination_phase: std::string::String,
22119
22120    /// Output only. ID of the rollback `Rollout` to create.
22121    pub rollout_id: std::string::String,
22122
22123    /// Output only. Valid state of this rollback action.
22124    pub state: crate::model::RepairState,
22125
22126    /// Output only. Description of the state of the Rollback.
22127    pub state_desc: std::string::String,
22128
22129    /// Output only. If active rollout exists on the target, abort this rollback.
22130    pub disable_rollback_if_rollout_pending: bool,
22131
22132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22133}
22134
22135impl RollbackAttempt {
22136    /// Creates a new default instance.
22137    pub fn new() -> Self {
22138        std::default::Default::default()
22139    }
22140
22141    /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
22142    ///
22143    /// # Example
22144    /// ```ignore,no_run
22145    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22146    /// let x = RollbackAttempt::new().set_destination_phase("example");
22147    /// ```
22148    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
22149        mut self,
22150        v: T,
22151    ) -> Self {
22152        self.destination_phase = v.into();
22153        self
22154    }
22155
22156    /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
22157    ///
22158    /// # Example
22159    /// ```ignore,no_run
22160    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22161    /// let x = RollbackAttempt::new().set_rollout_id("example");
22162    /// ```
22163    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22164        self.rollout_id = v.into();
22165        self
22166    }
22167
22168    /// Sets the value of [state][crate::model::RollbackAttempt::state].
22169    ///
22170    /// # Example
22171    /// ```ignore,no_run
22172    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22173    /// use google_cloud_deploy_v1::model::RepairState;
22174    /// let x0 = RollbackAttempt::new().set_state(RepairState::Succeeded);
22175    /// let x1 = RollbackAttempt::new().set_state(RepairState::Cancelled);
22176    /// let x2 = RollbackAttempt::new().set_state(RepairState::Failed);
22177    /// ```
22178    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22179        self.state = v.into();
22180        self
22181    }
22182
22183    /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
22184    ///
22185    /// # Example
22186    /// ```ignore,no_run
22187    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22188    /// let x = RollbackAttempt::new().set_state_desc("example");
22189    /// ```
22190    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22191        self.state_desc = v.into();
22192        self
22193    }
22194
22195    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
22196    ///
22197    /// # Example
22198    /// ```ignore,no_run
22199    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22200    /// let x = RollbackAttempt::new().set_disable_rollback_if_rollout_pending(true);
22201    /// ```
22202    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
22203        mut self,
22204        v: T,
22205    ) -> Self {
22206        self.disable_rollback_if_rollout_pending = v.into();
22207        self
22208    }
22209}
22210
22211impl wkt::message::Message for RollbackAttempt {
22212    fn typename() -> &'static str {
22213        "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
22214    }
22215}
22216
22217/// The request object for `ListAutomationRuns`.
22218#[derive(Clone, Default, PartialEq)]
22219#[non_exhaustive]
22220pub struct ListAutomationRunsRequest {
22221    /// Required. The parent `Delivery Pipeline`, which owns this collection of
22222    /// automationRuns. Format must be
22223    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
22224    pub parent: std::string::String,
22225
22226    /// The maximum number of automationRuns to return. The service may return
22227    /// fewer than this value. If unspecified, at most 50 automationRuns will
22228    /// be returned. The maximum value is 1000; values above 1000 will be set
22229    /// to 1000.
22230    pub page_size: i32,
22231
22232    /// A page token, received from a previous `ListAutomationRuns` call.
22233    /// Provide this to retrieve the subsequent page.
22234    ///
22235    /// When paginating, all other provided parameters match
22236    /// the call that provided the page token.
22237    pub page_token: std::string::String,
22238
22239    /// Filter automationRuns to be returned. All fields can be used in the
22240    /// filter.
22241    pub filter: std::string::String,
22242
22243    /// Field to sort by.
22244    pub order_by: std::string::String,
22245
22246    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22247}
22248
22249impl ListAutomationRunsRequest {
22250    /// Creates a new default instance.
22251    pub fn new() -> Self {
22252        std::default::Default::default()
22253    }
22254
22255    /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
22256    ///
22257    /// # Example
22258    /// ```ignore,no_run
22259    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22260    /// let x = ListAutomationRunsRequest::new().set_parent("example");
22261    /// ```
22262    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22263        self.parent = v.into();
22264        self
22265    }
22266
22267    /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
22268    ///
22269    /// # Example
22270    /// ```ignore,no_run
22271    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22272    /// let x = ListAutomationRunsRequest::new().set_page_size(42);
22273    /// ```
22274    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22275        self.page_size = v.into();
22276        self
22277    }
22278
22279    /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
22280    ///
22281    /// # Example
22282    /// ```ignore,no_run
22283    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22284    /// let x = ListAutomationRunsRequest::new().set_page_token("example");
22285    /// ```
22286    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22287        self.page_token = v.into();
22288        self
22289    }
22290
22291    /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
22292    ///
22293    /// # Example
22294    /// ```ignore,no_run
22295    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22296    /// let x = ListAutomationRunsRequest::new().set_filter("example");
22297    /// ```
22298    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22299        self.filter = v.into();
22300        self
22301    }
22302
22303    /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
22304    ///
22305    /// # Example
22306    /// ```ignore,no_run
22307    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22308    /// let x = ListAutomationRunsRequest::new().set_order_by("example");
22309    /// ```
22310    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22311        self.order_by = v.into();
22312        self
22313    }
22314}
22315
22316impl wkt::message::Message for ListAutomationRunsRequest {
22317    fn typename() -> &'static str {
22318        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
22319    }
22320}
22321
22322/// The response object from `ListAutomationRuns`.
22323#[derive(Clone, Default, PartialEq)]
22324#[non_exhaustive]
22325pub struct ListAutomationRunsResponse {
22326    /// The `AutomationRuns` objects.
22327    pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
22328
22329    /// A token, which can be sent as `page_token` to retrieve the next page.
22330    /// If this field is omitted, there are no subsequent pages.
22331    pub next_page_token: std::string::String,
22332
22333    /// Locations that could not be reached.
22334    pub unreachable: std::vec::Vec<std::string::String>,
22335
22336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22337}
22338
22339impl ListAutomationRunsResponse {
22340    /// Creates a new default instance.
22341    pub fn new() -> Self {
22342        std::default::Default::default()
22343    }
22344
22345    /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
22346    ///
22347    /// # Example
22348    /// ```ignore,no_run
22349    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22350    /// use google_cloud_deploy_v1::model::AutomationRun;
22351    /// let x = ListAutomationRunsResponse::new()
22352    ///     .set_automation_runs([
22353    ///         AutomationRun::default()/* use setters */,
22354    ///         AutomationRun::default()/* use (different) setters */,
22355    ///     ]);
22356    /// ```
22357    pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
22358    where
22359        T: std::iter::IntoIterator<Item = V>,
22360        V: std::convert::Into<crate::model::AutomationRun>,
22361    {
22362        use std::iter::Iterator;
22363        self.automation_runs = v.into_iter().map(|i| i.into()).collect();
22364        self
22365    }
22366
22367    /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
22368    ///
22369    /// # Example
22370    /// ```ignore,no_run
22371    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22372    /// let x = ListAutomationRunsResponse::new().set_next_page_token("example");
22373    /// ```
22374    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22375        self.next_page_token = v.into();
22376        self
22377    }
22378
22379    /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
22380    ///
22381    /// # Example
22382    /// ```ignore,no_run
22383    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22384    /// let x = ListAutomationRunsResponse::new().set_unreachable(["a", "b", "c"]);
22385    /// ```
22386    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
22387    where
22388        T: std::iter::IntoIterator<Item = V>,
22389        V: std::convert::Into<std::string::String>,
22390    {
22391        use std::iter::Iterator;
22392        self.unreachable = v.into_iter().map(|i| i.into()).collect();
22393        self
22394    }
22395}
22396
22397impl wkt::message::Message for ListAutomationRunsResponse {
22398    fn typename() -> &'static str {
22399        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
22400    }
22401}
22402
22403#[doc(hidden)]
22404impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
22405    type PageItem = crate::model::AutomationRun;
22406
22407    fn items(self) -> std::vec::Vec<Self::PageItem> {
22408        self.automation_runs
22409    }
22410
22411    fn next_page_token(&self) -> std::string::String {
22412        use std::clone::Clone;
22413        self.next_page_token.clone()
22414    }
22415}
22416
22417/// The request object for `GetAutomationRun`
22418#[derive(Clone, Default, PartialEq)]
22419#[non_exhaustive]
22420pub struct GetAutomationRunRequest {
22421    /// Required. Name of the `AutomationRun`. Format must be
22422    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22423    pub name: std::string::String,
22424
22425    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22426}
22427
22428impl GetAutomationRunRequest {
22429    /// Creates a new default instance.
22430    pub fn new() -> Self {
22431        std::default::Default::default()
22432    }
22433
22434    /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
22435    ///
22436    /// # Example
22437    /// ```ignore,no_run
22438    /// # use google_cloud_deploy_v1::model::GetAutomationRunRequest;
22439    /// let x = GetAutomationRunRequest::new().set_name("example");
22440    /// ```
22441    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22442        self.name = v.into();
22443        self
22444    }
22445}
22446
22447impl wkt::message::Message for GetAutomationRunRequest {
22448    fn typename() -> &'static str {
22449        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
22450    }
22451}
22452
22453/// The request object used by `CancelAutomationRun`.
22454#[derive(Clone, Default, PartialEq)]
22455#[non_exhaustive]
22456pub struct CancelAutomationRunRequest {
22457    /// Required. Name of the `AutomationRun`. Format is
22458    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22459    pub name: std::string::String,
22460
22461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22462}
22463
22464impl CancelAutomationRunRequest {
22465    /// Creates a new default instance.
22466    pub fn new() -> Self {
22467        std::default::Default::default()
22468    }
22469
22470    /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
22471    ///
22472    /// # Example
22473    /// ```ignore,no_run
22474    /// # use google_cloud_deploy_v1::model::CancelAutomationRunRequest;
22475    /// let x = CancelAutomationRunRequest::new().set_name("example");
22476    /// ```
22477    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22478        self.name = v.into();
22479        self
22480    }
22481}
22482
22483impl wkt::message::Message for CancelAutomationRunRequest {
22484    fn typename() -> &'static str {
22485        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
22486    }
22487}
22488
22489/// The response object from `CancelAutomationRun`.
22490#[derive(Clone, Default, PartialEq)]
22491#[non_exhaustive]
22492pub struct CancelAutomationRunResponse {
22493    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22494}
22495
22496impl CancelAutomationRunResponse {
22497    /// Creates a new default instance.
22498    pub fn new() -> Self {
22499        std::default::Default::default()
22500    }
22501}
22502
22503impl wkt::message::Message for CancelAutomationRunResponse {
22504    fn typename() -> &'static str {
22505        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
22506    }
22507}
22508
22509/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
22510/// Platform Log event that describes the failure to send a custom target type
22511/// status change Pub/Sub notification.
22512#[derive(Clone, Default, PartialEq)]
22513#[non_exhaustive]
22514pub struct CustomTargetTypeNotificationEvent {
22515    /// Debug message for when a notification fails to send.
22516    pub message: std::string::String,
22517
22518    /// Unique identifier of the `CustomTargetType`.
22519    pub custom_target_type_uid: std::string::String,
22520
22521    /// The name of the `CustomTargetType`.
22522    pub custom_target_type: std::string::String,
22523
22524    /// Type of this notification, e.g. for a Pub/Sub failure.
22525    pub r#type: crate::model::Type,
22526
22527    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22528}
22529
22530impl CustomTargetTypeNotificationEvent {
22531    /// Creates a new default instance.
22532    pub fn new() -> Self {
22533        std::default::Default::default()
22534    }
22535
22536    /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
22537    ///
22538    /// # Example
22539    /// ```ignore,no_run
22540    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22541    /// let x = CustomTargetTypeNotificationEvent::new().set_message("example");
22542    /// ```
22543    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22544        self.message = v.into();
22545        self
22546    }
22547
22548    /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
22549    ///
22550    /// # Example
22551    /// ```ignore,no_run
22552    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22553    /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type_uid("example");
22554    /// ```
22555    pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
22556        mut self,
22557        v: T,
22558    ) -> Self {
22559        self.custom_target_type_uid = v.into();
22560        self
22561    }
22562
22563    /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
22564    ///
22565    /// # Example
22566    /// ```ignore,no_run
22567    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22568    /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type("example");
22569    /// ```
22570    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
22571        mut self,
22572        v: T,
22573    ) -> Self {
22574        self.custom_target_type = v.into();
22575        self
22576    }
22577
22578    /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
22579    ///
22580    /// # Example
22581    /// ```ignore,no_run
22582    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22583    /// use google_cloud_deploy_v1::model::Type;
22584    /// let x0 = CustomTargetTypeNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22585    /// let x1 = CustomTargetTypeNotificationEvent::new().set_type(Type::ResourceStateChange);
22586    /// let x2 = CustomTargetTypeNotificationEvent::new().set_type(Type::ProcessAborted);
22587    /// ```
22588    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22589        self.r#type = v.into();
22590        self
22591    }
22592}
22593
22594impl wkt::message::Message for CustomTargetTypeNotificationEvent {
22595    fn typename() -> &'static str {
22596        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
22597    }
22598}
22599
22600/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
22601/// Platform Log event that describes the failure to send delivery pipeline
22602/// status change Pub/Sub notification.
22603#[derive(Clone, Default, PartialEq)]
22604#[non_exhaustive]
22605pub struct DeliveryPipelineNotificationEvent {
22606    /// Debug message for when a notification fails to send.
22607    pub message: std::string::String,
22608
22609    /// Unique identifier of the `DeliveryPipeline`.
22610    pub pipeline_uid: std::string::String,
22611
22612    /// The name of the `Delivery Pipeline`.
22613    pub delivery_pipeline: std::string::String,
22614
22615    /// Type of this notification, e.g. for a Pub/Sub failure.
22616    pub r#type: crate::model::Type,
22617
22618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22619}
22620
22621impl DeliveryPipelineNotificationEvent {
22622    /// Creates a new default instance.
22623    pub fn new() -> Self {
22624        std::default::Default::default()
22625    }
22626
22627    /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
22628    ///
22629    /// # Example
22630    /// ```ignore,no_run
22631    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22632    /// let x = DeliveryPipelineNotificationEvent::new().set_message("example");
22633    /// ```
22634    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22635        self.message = v.into();
22636        self
22637    }
22638
22639    /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
22640    ///
22641    /// # Example
22642    /// ```ignore,no_run
22643    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22644    /// let x = DeliveryPipelineNotificationEvent::new().set_pipeline_uid("example");
22645    /// ```
22646    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22647        self.pipeline_uid = v.into();
22648        self
22649    }
22650
22651    /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
22652    ///
22653    /// # Example
22654    /// ```ignore,no_run
22655    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22656    /// let x = DeliveryPipelineNotificationEvent::new().set_delivery_pipeline("example");
22657    /// ```
22658    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22659        mut self,
22660        v: T,
22661    ) -> Self {
22662        self.delivery_pipeline = v.into();
22663        self
22664    }
22665
22666    /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
22667    ///
22668    /// # Example
22669    /// ```ignore,no_run
22670    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22671    /// use google_cloud_deploy_v1::model::Type;
22672    /// let x0 = DeliveryPipelineNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22673    /// let x1 = DeliveryPipelineNotificationEvent::new().set_type(Type::ResourceStateChange);
22674    /// let x2 = DeliveryPipelineNotificationEvent::new().set_type(Type::ProcessAborted);
22675    /// ```
22676    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22677        self.r#type = v.into();
22678        self
22679    }
22680}
22681
22682impl wkt::message::Message for DeliveryPipelineNotificationEvent {
22683    fn typename() -> &'static str {
22684        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
22685    }
22686}
22687
22688/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
22689/// Platform Log event that describes the deploy policy evaluation event.
22690#[derive(Clone, Default, PartialEq)]
22691#[non_exhaustive]
22692pub struct DeployPolicyEvaluationEvent {
22693    /// Debug message for when a deploy policy event occurs.
22694    pub message: std::string::String,
22695
22696    /// Rule type (e.g. Restrict Rollouts).
22697    pub rule_type: std::string::String,
22698
22699    /// Rule id.
22700    pub rule: std::string::String,
22701
22702    /// Unique identifier of the `Delivery Pipeline`.
22703    pub pipeline_uid: std::string::String,
22704
22705    /// The name of the `Delivery Pipeline`.
22706    pub delivery_pipeline: std::string::String,
22707
22708    /// Unique identifier of the `Target`. This is an optional field, as a `Target`
22709    /// may not always be applicable to a policy.
22710    pub target_uid: std::string::String,
22711
22712    /// The name of the `Target`. This is an optional field, as a `Target` may not
22713    /// always be applicable to a policy.
22714    pub target: std::string::String,
22715
22716    /// What invoked the action (e.g. a user or automation).
22717    pub invoker: crate::model::deploy_policy::Invoker,
22718
22719    /// The name of the `DeployPolicy`.
22720    pub deploy_policy: std::string::String,
22721
22722    /// Unique identifier of the `DeployPolicy`.
22723    pub deploy_policy_uid: std::string::String,
22724
22725    /// Whether the request is allowed. Allowed is set as true if:
22726    /// (1) the request complies with the policy; or
22727    /// (2) the request doesn't comply with the policy but the policy was
22728    /// overridden; or
22729    /// (3) the request doesn't comply with the policy but the policy was suspended
22730    pub allowed: bool,
22731
22732    /// The policy verdict of the request.
22733    pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
22734
22735    /// Things that could have overridden the policy verdict. Overrides together
22736    /// with verdict decide whether the request is allowed.
22737    pub overrides:
22738        std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22739
22740    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22741}
22742
22743impl DeployPolicyEvaluationEvent {
22744    /// Creates a new default instance.
22745    pub fn new() -> Self {
22746        std::default::Default::default()
22747    }
22748
22749    /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
22750    ///
22751    /// # Example
22752    /// ```ignore,no_run
22753    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22754    /// let x = DeployPolicyEvaluationEvent::new().set_message("example");
22755    /// ```
22756    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22757        self.message = v.into();
22758        self
22759    }
22760
22761    /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
22762    ///
22763    /// # Example
22764    /// ```ignore,no_run
22765    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22766    /// let x = DeployPolicyEvaluationEvent::new().set_rule_type("example");
22767    /// ```
22768    pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22769        self.rule_type = v.into();
22770        self
22771    }
22772
22773    /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
22774    ///
22775    /// # Example
22776    /// ```ignore,no_run
22777    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22778    /// let x = DeployPolicyEvaluationEvent::new().set_rule("example");
22779    /// ```
22780    pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22781        self.rule = v.into();
22782        self
22783    }
22784
22785    /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
22786    ///
22787    /// # Example
22788    /// ```ignore,no_run
22789    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22790    /// let x = DeployPolicyEvaluationEvent::new().set_pipeline_uid("example");
22791    /// ```
22792    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22793        self.pipeline_uid = v.into();
22794        self
22795    }
22796
22797    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
22798    ///
22799    /// # Example
22800    /// ```ignore,no_run
22801    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22802    /// let x = DeployPolicyEvaluationEvent::new().set_delivery_pipeline("example");
22803    /// ```
22804    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22805        mut self,
22806        v: T,
22807    ) -> Self {
22808        self.delivery_pipeline = v.into();
22809        self
22810    }
22811
22812    /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
22813    ///
22814    /// # Example
22815    /// ```ignore,no_run
22816    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22817    /// let x = DeployPolicyEvaluationEvent::new().set_target_uid("example");
22818    /// ```
22819    pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22820        self.target_uid = v.into();
22821        self
22822    }
22823
22824    /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
22825    ///
22826    /// # Example
22827    /// ```ignore,no_run
22828    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22829    /// let x = DeployPolicyEvaluationEvent::new().set_target("example");
22830    /// ```
22831    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22832        self.target = v.into();
22833        self
22834    }
22835
22836    /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
22837    ///
22838    /// # Example
22839    /// ```ignore,no_run
22840    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22841    /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
22842    /// let x0 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::User);
22843    /// let x1 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::DeployAutomation);
22844    /// ```
22845    pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
22846        mut self,
22847        v: T,
22848    ) -> Self {
22849        self.invoker = v.into();
22850        self
22851    }
22852
22853    /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
22854    ///
22855    /// # Example
22856    /// ```ignore,no_run
22857    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22858    /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy("example");
22859    /// ```
22860    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22861        self.deploy_policy = v.into();
22862        self
22863    }
22864
22865    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
22866    ///
22867    /// # Example
22868    /// ```ignore,no_run
22869    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22870    /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy_uid("example");
22871    /// ```
22872    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
22873        mut self,
22874        v: T,
22875    ) -> Self {
22876        self.deploy_policy_uid = v.into();
22877        self
22878    }
22879
22880    /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
22881    ///
22882    /// # Example
22883    /// ```ignore,no_run
22884    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22885    /// let x = DeployPolicyEvaluationEvent::new().set_allowed(true);
22886    /// ```
22887    pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22888        self.allowed = v.into();
22889        self
22890    }
22891
22892    /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
22893    ///
22894    /// # Example
22895    /// ```ignore,no_run
22896    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22897    /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdict;
22898    /// let x0 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::AllowedByPolicy);
22899    /// let x1 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::DeniedByPolicy);
22900    /// ```
22901    pub fn set_verdict<
22902        T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
22903    >(
22904        mut self,
22905        v: T,
22906    ) -> Self {
22907        self.verdict = v.into();
22908        self
22909    }
22910
22911    /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
22912    ///
22913    /// # Example
22914    /// ```ignore,no_run
22915    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22916    /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdictOverride;
22917    /// let x = DeployPolicyEvaluationEvent::new().set_overrides([
22918    ///     PolicyVerdictOverride::PolicyOverridden,
22919    ///     PolicyVerdictOverride::PolicySuspended,
22920    /// ]);
22921    /// ```
22922    pub fn set_overrides<T, V>(mut self, v: T) -> Self
22923    where
22924        T: std::iter::IntoIterator<Item = V>,
22925        V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22926    {
22927        use std::iter::Iterator;
22928        self.overrides = v.into_iter().map(|i| i.into()).collect();
22929        self
22930    }
22931}
22932
22933impl wkt::message::Message for DeployPolicyEvaluationEvent {
22934    fn typename() -> &'static str {
22935        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
22936    }
22937}
22938
22939/// Defines additional types related to [DeployPolicyEvaluationEvent].
22940pub mod deploy_policy_evaluation_event {
22941    #[allow(unused_imports)]
22942    use super::*;
22943
22944    /// The policy verdict of the request.
22945    ///
22946    /// # Working with unknown values
22947    ///
22948    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22949    /// additional enum variants at any time. Adding new variants is not considered
22950    /// a breaking change. Applications should write their code in anticipation of:
22951    ///
22952    /// - New values appearing in future releases of the client library, **and**
22953    /// - New values received dynamically, without application changes.
22954    ///
22955    /// Please consult the [Working with enums] section in the user guide for some
22956    /// guidelines.
22957    ///
22958    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22959    #[derive(Clone, Debug, PartialEq)]
22960    #[non_exhaustive]
22961    pub enum PolicyVerdict {
22962        /// This should never happen.
22963        Unspecified,
22964        /// Allowed by policy. This enum value is not currently used but may be used
22965        /// in the future. Currently logs are only generated when a request is denied
22966        /// by policy.
22967        AllowedByPolicy,
22968        /// Denied by policy.
22969        DeniedByPolicy,
22970        /// If set, the enum was initialized with an unknown value.
22971        ///
22972        /// Applications can examine the value using [PolicyVerdict::value] or
22973        /// [PolicyVerdict::name].
22974        UnknownValue(policy_verdict::UnknownValue),
22975    }
22976
22977    #[doc(hidden)]
22978    pub mod policy_verdict {
22979        #[allow(unused_imports)]
22980        use super::*;
22981        #[derive(Clone, Debug, PartialEq)]
22982        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22983    }
22984
22985    impl PolicyVerdict {
22986        /// Gets the enum value.
22987        ///
22988        /// Returns `None` if the enum contains an unknown value deserialized from
22989        /// the string representation of enums.
22990        pub fn value(&self) -> std::option::Option<i32> {
22991            match self {
22992                Self::Unspecified => std::option::Option::Some(0),
22993                Self::AllowedByPolicy => std::option::Option::Some(1),
22994                Self::DeniedByPolicy => std::option::Option::Some(2),
22995                Self::UnknownValue(u) => u.0.value(),
22996            }
22997        }
22998
22999        /// Gets the enum value as a string.
23000        ///
23001        /// Returns `None` if the enum contains an unknown value deserialized from
23002        /// the integer representation of enums.
23003        pub fn name(&self) -> std::option::Option<&str> {
23004            match self {
23005                Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
23006                Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
23007                Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
23008                Self::UnknownValue(u) => u.0.name(),
23009            }
23010        }
23011    }
23012
23013    impl std::default::Default for PolicyVerdict {
23014        fn default() -> Self {
23015            use std::convert::From;
23016            Self::from(0)
23017        }
23018    }
23019
23020    impl std::fmt::Display for PolicyVerdict {
23021        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23022            wkt::internal::display_enum(f, self.name(), self.value())
23023        }
23024    }
23025
23026    impl std::convert::From<i32> for PolicyVerdict {
23027        fn from(value: i32) -> Self {
23028            match value {
23029                0 => Self::Unspecified,
23030                1 => Self::AllowedByPolicy,
23031                2 => Self::DeniedByPolicy,
23032                _ => Self::UnknownValue(policy_verdict::UnknownValue(
23033                    wkt::internal::UnknownEnumValue::Integer(value),
23034                )),
23035            }
23036        }
23037    }
23038
23039    impl std::convert::From<&str> for PolicyVerdict {
23040        fn from(value: &str) -> Self {
23041            use std::string::ToString;
23042            match value {
23043                "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
23044                "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
23045                "DENIED_BY_POLICY" => Self::DeniedByPolicy,
23046                _ => Self::UnknownValue(policy_verdict::UnknownValue(
23047                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23048                )),
23049            }
23050        }
23051    }
23052
23053    impl serde::ser::Serialize for PolicyVerdict {
23054        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23055        where
23056            S: serde::Serializer,
23057        {
23058            match self {
23059                Self::Unspecified => serializer.serialize_i32(0),
23060                Self::AllowedByPolicy => serializer.serialize_i32(1),
23061                Self::DeniedByPolicy => serializer.serialize_i32(2),
23062                Self::UnknownValue(u) => u.0.serialize(serializer),
23063            }
23064        }
23065    }
23066
23067    impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
23068        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23069        where
23070            D: serde::Deserializer<'de>,
23071        {
23072            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
23073                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
23074            ))
23075        }
23076    }
23077
23078    /// Things that could have overridden the policy verdict. When overrides are
23079    /// used, the request will be allowed even if it is DENIED_BY_POLICY.
23080    ///
23081    /// # Working with unknown values
23082    ///
23083    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23084    /// additional enum variants at any time. Adding new variants is not considered
23085    /// a breaking change. Applications should write their code in anticipation of:
23086    ///
23087    /// - New values appearing in future releases of the client library, **and**
23088    /// - New values received dynamically, without application changes.
23089    ///
23090    /// Please consult the [Working with enums] section in the user guide for some
23091    /// guidelines.
23092    ///
23093    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23094    #[derive(Clone, Debug, PartialEq)]
23095    #[non_exhaustive]
23096    pub enum PolicyVerdictOverride {
23097        /// This should never happen.
23098        Unspecified,
23099        /// The policy was overridden.
23100        PolicyOverridden,
23101        /// The policy was suspended.
23102        PolicySuspended,
23103        /// If set, the enum was initialized with an unknown value.
23104        ///
23105        /// Applications can examine the value using [PolicyVerdictOverride::value] or
23106        /// [PolicyVerdictOverride::name].
23107        UnknownValue(policy_verdict_override::UnknownValue),
23108    }
23109
23110    #[doc(hidden)]
23111    pub mod policy_verdict_override {
23112        #[allow(unused_imports)]
23113        use super::*;
23114        #[derive(Clone, Debug, PartialEq)]
23115        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23116    }
23117
23118    impl PolicyVerdictOverride {
23119        /// Gets the enum value.
23120        ///
23121        /// Returns `None` if the enum contains an unknown value deserialized from
23122        /// the string representation of enums.
23123        pub fn value(&self) -> std::option::Option<i32> {
23124            match self {
23125                Self::Unspecified => std::option::Option::Some(0),
23126                Self::PolicyOverridden => std::option::Option::Some(1),
23127                Self::PolicySuspended => std::option::Option::Some(2),
23128                Self::UnknownValue(u) => u.0.value(),
23129            }
23130        }
23131
23132        /// Gets the enum value as a string.
23133        ///
23134        /// Returns `None` if the enum contains an unknown value deserialized from
23135        /// the integer representation of enums.
23136        pub fn name(&self) -> std::option::Option<&str> {
23137            match self {
23138                Self::Unspecified => {
23139                    std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
23140                }
23141                Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
23142                Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
23143                Self::UnknownValue(u) => u.0.name(),
23144            }
23145        }
23146    }
23147
23148    impl std::default::Default for PolicyVerdictOverride {
23149        fn default() -> Self {
23150            use std::convert::From;
23151            Self::from(0)
23152        }
23153    }
23154
23155    impl std::fmt::Display for PolicyVerdictOverride {
23156        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23157            wkt::internal::display_enum(f, self.name(), self.value())
23158        }
23159    }
23160
23161    impl std::convert::From<i32> for PolicyVerdictOverride {
23162        fn from(value: i32) -> Self {
23163            match value {
23164                0 => Self::Unspecified,
23165                1 => Self::PolicyOverridden,
23166                2 => Self::PolicySuspended,
23167                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23168                    wkt::internal::UnknownEnumValue::Integer(value),
23169                )),
23170            }
23171        }
23172    }
23173
23174    impl std::convert::From<&str> for PolicyVerdictOverride {
23175        fn from(value: &str) -> Self {
23176            use std::string::ToString;
23177            match value {
23178                "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
23179                "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
23180                "POLICY_SUSPENDED" => Self::PolicySuspended,
23181                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23182                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23183                )),
23184            }
23185        }
23186    }
23187
23188    impl serde::ser::Serialize for PolicyVerdictOverride {
23189        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23190        where
23191            S: serde::Serializer,
23192        {
23193            match self {
23194                Self::Unspecified => serializer.serialize_i32(0),
23195                Self::PolicyOverridden => serializer.serialize_i32(1),
23196                Self::PolicySuspended => serializer.serialize_i32(2),
23197                Self::UnknownValue(u) => u.0.serialize(serializer),
23198            }
23199        }
23200    }
23201
23202    impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
23203        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23204        where
23205            D: serde::Deserializer<'de>,
23206        {
23207            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
23208                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
23209            ))
23210        }
23211    }
23212}
23213
23214/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
23215/// Platform Log event that describes the failure to send a pub/sub notification
23216/// when there is a DeployPolicy status change.
23217#[derive(Clone, Default, PartialEq)]
23218#[non_exhaustive]
23219pub struct DeployPolicyNotificationEvent {
23220    /// Debug message for when a deploy policy fails to send a pub/sub
23221    /// notification.
23222    pub message: std::string::String,
23223
23224    /// The name of the `DeployPolicy`.
23225    pub deploy_policy: std::string::String,
23226
23227    /// Unique identifier of the deploy policy.
23228    pub deploy_policy_uid: std::string::String,
23229
23230    /// Type of this notification, e.g. for a Pub/Sub failure.
23231    pub r#type: crate::model::Type,
23232
23233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23234}
23235
23236impl DeployPolicyNotificationEvent {
23237    /// Creates a new default instance.
23238    pub fn new() -> Self {
23239        std::default::Default::default()
23240    }
23241
23242    /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
23243    ///
23244    /// # Example
23245    /// ```ignore,no_run
23246    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23247    /// let x = DeployPolicyNotificationEvent::new().set_message("example");
23248    /// ```
23249    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23250        self.message = v.into();
23251        self
23252    }
23253
23254    /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
23255    ///
23256    /// # Example
23257    /// ```ignore,no_run
23258    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23259    /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy("example");
23260    /// ```
23261    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23262        self.deploy_policy = v.into();
23263        self
23264    }
23265
23266    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
23267    ///
23268    /// # Example
23269    /// ```ignore,no_run
23270    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23271    /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy_uid("example");
23272    /// ```
23273    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23274        mut self,
23275        v: T,
23276    ) -> Self {
23277        self.deploy_policy_uid = v.into();
23278        self
23279    }
23280
23281    /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
23282    ///
23283    /// # Example
23284    /// ```ignore,no_run
23285    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23286    /// use google_cloud_deploy_v1::model::Type;
23287    /// let x0 = DeployPolicyNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23288    /// let x1 = DeployPolicyNotificationEvent::new().set_type(Type::ResourceStateChange);
23289    /// let x2 = DeployPolicyNotificationEvent::new().set_type(Type::ProcessAborted);
23290    /// ```
23291    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23292        self.r#type = v.into();
23293        self
23294    }
23295}
23296
23297impl wkt::message::Message for DeployPolicyNotificationEvent {
23298    fn typename() -> &'static str {
23299        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
23300    }
23301}
23302
23303/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
23304/// Platform Log event that describes the failure to send JobRun resource update
23305/// Pub/Sub notification.
23306#[derive(Clone, Default, PartialEq)]
23307#[non_exhaustive]
23308pub struct JobRunNotificationEvent {
23309    /// Debug message for when a notification fails to send.
23310    pub message: std::string::String,
23311
23312    /// The name of the `JobRun`.
23313    pub job_run: std::string::String,
23314
23315    /// Unique identifier of the `DeliveryPipeline`.
23316    pub pipeline_uid: std::string::String,
23317
23318    /// Unique identifier of the `Release`.
23319    pub release_uid: std::string::String,
23320
23321    /// The name of the `Release`.
23322    pub release: std::string::String,
23323
23324    /// Unique identifier of the `Rollout`.
23325    pub rollout_uid: std::string::String,
23326
23327    /// The name of the `Rollout`.
23328    pub rollout: std::string::String,
23329
23330    /// ID of the `Target`.
23331    pub target_id: std::string::String,
23332
23333    /// Type of this notification, e.g. for a Pub/Sub failure.
23334    pub r#type: crate::model::Type,
23335
23336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23337}
23338
23339impl JobRunNotificationEvent {
23340    /// Creates a new default instance.
23341    pub fn new() -> Self {
23342        std::default::Default::default()
23343    }
23344
23345    /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
23346    ///
23347    /// # Example
23348    /// ```ignore,no_run
23349    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23350    /// let x = JobRunNotificationEvent::new().set_message("example");
23351    /// ```
23352    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23353        self.message = v.into();
23354        self
23355    }
23356
23357    /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
23358    ///
23359    /// # Example
23360    /// ```ignore,no_run
23361    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23362    /// let x = JobRunNotificationEvent::new().set_job_run("example");
23363    /// ```
23364    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23365        self.job_run = v.into();
23366        self
23367    }
23368
23369    /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
23370    ///
23371    /// # Example
23372    /// ```ignore,no_run
23373    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23374    /// let x = JobRunNotificationEvent::new().set_pipeline_uid("example");
23375    /// ```
23376    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23377        self.pipeline_uid = v.into();
23378        self
23379    }
23380
23381    /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
23382    ///
23383    /// # Example
23384    /// ```ignore,no_run
23385    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23386    /// let x = JobRunNotificationEvent::new().set_release_uid("example");
23387    /// ```
23388    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23389        self.release_uid = v.into();
23390        self
23391    }
23392
23393    /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
23394    ///
23395    /// # Example
23396    /// ```ignore,no_run
23397    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23398    /// let x = JobRunNotificationEvent::new().set_release("example");
23399    /// ```
23400    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23401        self.release = v.into();
23402        self
23403    }
23404
23405    /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
23406    ///
23407    /// # Example
23408    /// ```ignore,no_run
23409    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23410    /// let x = JobRunNotificationEvent::new().set_rollout_uid("example");
23411    /// ```
23412    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23413        self.rollout_uid = v.into();
23414        self
23415    }
23416
23417    /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
23418    ///
23419    /// # Example
23420    /// ```ignore,no_run
23421    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23422    /// let x = JobRunNotificationEvent::new().set_rollout("example");
23423    /// ```
23424    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23425        self.rollout = v.into();
23426        self
23427    }
23428
23429    /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
23430    ///
23431    /// # Example
23432    /// ```ignore,no_run
23433    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23434    /// let x = JobRunNotificationEvent::new().set_target_id("example");
23435    /// ```
23436    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23437        self.target_id = v.into();
23438        self
23439    }
23440
23441    /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
23442    ///
23443    /// # Example
23444    /// ```ignore,no_run
23445    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23446    /// use google_cloud_deploy_v1::model::Type;
23447    /// let x0 = JobRunNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23448    /// let x1 = JobRunNotificationEvent::new().set_type(Type::ResourceStateChange);
23449    /// let x2 = JobRunNotificationEvent::new().set_type(Type::ProcessAborted);
23450    /// ```
23451    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23452        self.r#type = v.into();
23453        self
23454    }
23455}
23456
23457impl wkt::message::Message for JobRunNotificationEvent {
23458    fn typename() -> &'static str {
23459        "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
23460    }
23461}
23462
23463/// Payload proto for "clouddeploy.googleapis.com/release_notification"
23464/// Platform Log event that describes the failure to send release status change
23465/// Pub/Sub notification.
23466#[derive(Clone, Default, PartialEq)]
23467#[non_exhaustive]
23468pub struct ReleaseNotificationEvent {
23469    /// Debug message for when a notification fails to send.
23470    pub message: std::string::String,
23471
23472    /// Unique identifier of the `DeliveryPipeline`.
23473    pub pipeline_uid: std::string::String,
23474
23475    /// Unique identifier of the `Release`.
23476    pub release_uid: std::string::String,
23477
23478    /// The name of the `Release`.
23479    pub release: std::string::String,
23480
23481    /// Type of this notification, e.g. for a Pub/Sub failure.
23482    pub r#type: crate::model::Type,
23483
23484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23485}
23486
23487impl ReleaseNotificationEvent {
23488    /// Creates a new default instance.
23489    pub fn new() -> Self {
23490        std::default::Default::default()
23491    }
23492
23493    /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
23494    ///
23495    /// # Example
23496    /// ```ignore,no_run
23497    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23498    /// let x = ReleaseNotificationEvent::new().set_message("example");
23499    /// ```
23500    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23501        self.message = v.into();
23502        self
23503    }
23504
23505    /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
23506    ///
23507    /// # Example
23508    /// ```ignore,no_run
23509    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23510    /// let x = ReleaseNotificationEvent::new().set_pipeline_uid("example");
23511    /// ```
23512    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23513        self.pipeline_uid = v.into();
23514        self
23515    }
23516
23517    /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
23518    ///
23519    /// # Example
23520    /// ```ignore,no_run
23521    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23522    /// let x = ReleaseNotificationEvent::new().set_release_uid("example");
23523    /// ```
23524    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23525        self.release_uid = v.into();
23526        self
23527    }
23528
23529    /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
23530    ///
23531    /// # Example
23532    /// ```ignore,no_run
23533    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23534    /// let x = ReleaseNotificationEvent::new().set_release("example");
23535    /// ```
23536    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23537        self.release = v.into();
23538        self
23539    }
23540
23541    /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
23542    ///
23543    /// # Example
23544    /// ```ignore,no_run
23545    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23546    /// use google_cloud_deploy_v1::model::Type;
23547    /// let x0 = ReleaseNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23548    /// let x1 = ReleaseNotificationEvent::new().set_type(Type::ResourceStateChange);
23549    /// let x2 = ReleaseNotificationEvent::new().set_type(Type::ProcessAborted);
23550    /// ```
23551    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23552        self.r#type = v.into();
23553        self
23554    }
23555}
23556
23557impl wkt::message::Message for ReleaseNotificationEvent {
23558    fn typename() -> &'static str {
23559        "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
23560    }
23561}
23562
23563/// Payload proto for "clouddeploy.googleapis.com/release_render"
23564/// Platform Log event that describes the render status change.
23565#[derive(Clone, Default, PartialEq)]
23566#[non_exhaustive]
23567pub struct ReleaseRenderEvent {
23568    /// Debug message for when a render transition occurs. Provides further
23569    /// details as rendering progresses through render states.
23570    pub message: std::string::String,
23571
23572    /// Unique identifier of the `DeliveryPipeline`.
23573    pub pipeline_uid: std::string::String,
23574
23575    /// The name of the release.
23576    /// release_uid is not in this log message because we write some of these log
23577    /// messages at release creation time, before we've generated the uid.
23578    pub release: std::string::String,
23579
23580    /// Type of this notification, e.g. for a release render state change event.
23581    pub r#type: crate::model::Type,
23582
23583    /// The state of the release render.
23584    pub release_render_state: crate::model::release::RenderState,
23585
23586    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23587}
23588
23589impl ReleaseRenderEvent {
23590    /// Creates a new default instance.
23591    pub fn new() -> Self {
23592        std::default::Default::default()
23593    }
23594
23595    /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
23596    ///
23597    /// # Example
23598    /// ```ignore,no_run
23599    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23600    /// let x = ReleaseRenderEvent::new().set_message("example");
23601    /// ```
23602    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23603        self.message = v.into();
23604        self
23605    }
23606
23607    /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
23608    ///
23609    /// # Example
23610    /// ```ignore,no_run
23611    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23612    /// let x = ReleaseRenderEvent::new().set_pipeline_uid("example");
23613    /// ```
23614    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23615        self.pipeline_uid = v.into();
23616        self
23617    }
23618
23619    /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
23620    ///
23621    /// # Example
23622    /// ```ignore,no_run
23623    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23624    /// let x = ReleaseRenderEvent::new().set_release("example");
23625    /// ```
23626    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23627        self.release = v.into();
23628        self
23629    }
23630
23631    /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
23632    ///
23633    /// # Example
23634    /// ```ignore,no_run
23635    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23636    /// use google_cloud_deploy_v1::model::Type;
23637    /// let x0 = ReleaseRenderEvent::new().set_type(Type::PubsubNotificationFailure);
23638    /// let x1 = ReleaseRenderEvent::new().set_type(Type::ResourceStateChange);
23639    /// let x2 = ReleaseRenderEvent::new().set_type(Type::ProcessAborted);
23640    /// ```
23641    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23642        self.r#type = v.into();
23643        self
23644    }
23645
23646    /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
23647    ///
23648    /// # Example
23649    /// ```ignore,no_run
23650    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23651    /// use google_cloud_deploy_v1::model::release::RenderState;
23652    /// let x0 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Succeeded);
23653    /// let x1 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Failed);
23654    /// let x2 = ReleaseRenderEvent::new().set_release_render_state(RenderState::InProgress);
23655    /// ```
23656    pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
23657        mut self,
23658        v: T,
23659    ) -> Self {
23660        self.release_render_state = v.into();
23661        self
23662    }
23663}
23664
23665impl wkt::message::Message for ReleaseRenderEvent {
23666    fn typename() -> &'static str {
23667        "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
23668    }
23669}
23670
23671/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
23672/// Platform Log event that describes the failure to send rollout status change
23673/// Pub/Sub notification.
23674#[derive(Clone, Default, PartialEq)]
23675#[non_exhaustive]
23676pub struct RolloutNotificationEvent {
23677    /// Debug message for when a notification fails to send.
23678    pub message: std::string::String,
23679
23680    /// Unique identifier of the `DeliveryPipeline`.
23681    pub pipeline_uid: std::string::String,
23682
23683    /// Unique identifier of the `Release`.
23684    pub release_uid: std::string::String,
23685
23686    /// The name of the `Release`.
23687    pub release: std::string::String,
23688
23689    /// Unique identifier of the `Rollout`.
23690    pub rollout_uid: std::string::String,
23691
23692    /// The name of the `Rollout`.
23693    pub rollout: std::string::String,
23694
23695    /// ID of the `Target` that the rollout is deployed to.
23696    pub target_id: std::string::String,
23697
23698    /// Type of this notification, e.g. for a Pub/Sub failure.
23699    pub r#type: crate::model::Type,
23700
23701    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23702}
23703
23704impl RolloutNotificationEvent {
23705    /// Creates a new default instance.
23706    pub fn new() -> Self {
23707        std::default::Default::default()
23708    }
23709
23710    /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
23711    ///
23712    /// # Example
23713    /// ```ignore,no_run
23714    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23715    /// let x = RolloutNotificationEvent::new().set_message("example");
23716    /// ```
23717    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23718        self.message = v.into();
23719        self
23720    }
23721
23722    /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
23723    ///
23724    /// # Example
23725    /// ```ignore,no_run
23726    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23727    /// let x = RolloutNotificationEvent::new().set_pipeline_uid("example");
23728    /// ```
23729    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23730        self.pipeline_uid = v.into();
23731        self
23732    }
23733
23734    /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
23735    ///
23736    /// # Example
23737    /// ```ignore,no_run
23738    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23739    /// let x = RolloutNotificationEvent::new().set_release_uid("example");
23740    /// ```
23741    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23742        self.release_uid = v.into();
23743        self
23744    }
23745
23746    /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
23747    ///
23748    /// # Example
23749    /// ```ignore,no_run
23750    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23751    /// let x = RolloutNotificationEvent::new().set_release("example");
23752    /// ```
23753    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23754        self.release = v.into();
23755        self
23756    }
23757
23758    /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
23759    ///
23760    /// # Example
23761    /// ```ignore,no_run
23762    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23763    /// let x = RolloutNotificationEvent::new().set_rollout_uid("example");
23764    /// ```
23765    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23766        self.rollout_uid = v.into();
23767        self
23768    }
23769
23770    /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
23771    ///
23772    /// # Example
23773    /// ```ignore,no_run
23774    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23775    /// let x = RolloutNotificationEvent::new().set_rollout("example");
23776    /// ```
23777    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23778        self.rollout = v.into();
23779        self
23780    }
23781
23782    /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
23783    ///
23784    /// # Example
23785    /// ```ignore,no_run
23786    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23787    /// let x = RolloutNotificationEvent::new().set_target_id("example");
23788    /// ```
23789    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23790        self.target_id = v.into();
23791        self
23792    }
23793
23794    /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
23795    ///
23796    /// # Example
23797    /// ```ignore,no_run
23798    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23799    /// use google_cloud_deploy_v1::model::Type;
23800    /// let x0 = RolloutNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23801    /// let x1 = RolloutNotificationEvent::new().set_type(Type::ResourceStateChange);
23802    /// let x2 = RolloutNotificationEvent::new().set_type(Type::ProcessAborted);
23803    /// ```
23804    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23805        self.r#type = v.into();
23806        self
23807    }
23808}
23809
23810impl wkt::message::Message for RolloutNotificationEvent {
23811    fn typename() -> &'static str {
23812        "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
23813    }
23814}
23815
23816/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
23817/// Platform Log event that describes the rollout update event.
23818#[derive(Clone, Default, PartialEq)]
23819#[non_exhaustive]
23820pub struct RolloutUpdateEvent {
23821    /// Debug message for when a rollout update event occurs.
23822    pub message: std::string::String,
23823
23824    /// Unique identifier of the pipeline.
23825    pub pipeline_uid: std::string::String,
23826
23827    /// Unique identifier of the release.
23828    pub release_uid: std::string::String,
23829
23830    /// The name of the `Release`.
23831    pub release: std::string::String,
23832
23833    /// The name of the rollout.
23834    /// rollout_uid is not in this log message because we write some of these log
23835    /// messages at rollout creation time, before we've generated the uid.
23836    pub rollout: std::string::String,
23837
23838    /// ID of the target.
23839    pub target_id: std::string::String,
23840
23841    /// Type of this notification, e.g. for a rollout update event.
23842    pub r#type: crate::model::Type,
23843
23844    /// The type of the rollout update.
23845    pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
23846
23847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23848}
23849
23850impl RolloutUpdateEvent {
23851    /// Creates a new default instance.
23852    pub fn new() -> Self {
23853        std::default::Default::default()
23854    }
23855
23856    /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
23857    ///
23858    /// # Example
23859    /// ```ignore,no_run
23860    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23861    /// let x = RolloutUpdateEvent::new().set_message("example");
23862    /// ```
23863    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23864        self.message = v.into();
23865        self
23866    }
23867
23868    /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
23869    ///
23870    /// # Example
23871    /// ```ignore,no_run
23872    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23873    /// let x = RolloutUpdateEvent::new().set_pipeline_uid("example");
23874    /// ```
23875    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23876        self.pipeline_uid = v.into();
23877        self
23878    }
23879
23880    /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
23881    ///
23882    /// # Example
23883    /// ```ignore,no_run
23884    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23885    /// let x = RolloutUpdateEvent::new().set_release_uid("example");
23886    /// ```
23887    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23888        self.release_uid = v.into();
23889        self
23890    }
23891
23892    /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
23893    ///
23894    /// # Example
23895    /// ```ignore,no_run
23896    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23897    /// let x = RolloutUpdateEvent::new().set_release("example");
23898    /// ```
23899    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23900        self.release = v.into();
23901        self
23902    }
23903
23904    /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
23905    ///
23906    /// # Example
23907    /// ```ignore,no_run
23908    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23909    /// let x = RolloutUpdateEvent::new().set_rollout("example");
23910    /// ```
23911    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23912        self.rollout = v.into();
23913        self
23914    }
23915
23916    /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
23917    ///
23918    /// # Example
23919    /// ```ignore,no_run
23920    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23921    /// let x = RolloutUpdateEvent::new().set_target_id("example");
23922    /// ```
23923    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23924        self.target_id = v.into();
23925        self
23926    }
23927
23928    /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
23929    ///
23930    /// # Example
23931    /// ```ignore,no_run
23932    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23933    /// use google_cloud_deploy_v1::model::Type;
23934    /// let x0 = RolloutUpdateEvent::new().set_type(Type::PubsubNotificationFailure);
23935    /// let x1 = RolloutUpdateEvent::new().set_type(Type::ResourceStateChange);
23936    /// let x2 = RolloutUpdateEvent::new().set_type(Type::ProcessAborted);
23937    /// ```
23938    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23939        self.r#type = v.into();
23940        self
23941    }
23942
23943    /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
23944    ///
23945    /// # Example
23946    /// ```ignore,no_run
23947    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23948    /// use google_cloud_deploy_v1::model::rollout_update_event::RolloutUpdateType;
23949    /// let x0 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::Pending);
23950    /// let x1 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::PendingRelease);
23951    /// let x2 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::InProgress);
23952    /// ```
23953    pub fn set_rollout_update_type<
23954        T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
23955    >(
23956        mut self,
23957        v: T,
23958    ) -> Self {
23959        self.rollout_update_type = v.into();
23960        self
23961    }
23962}
23963
23964impl wkt::message::Message for RolloutUpdateEvent {
23965    fn typename() -> &'static str {
23966        "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
23967    }
23968}
23969
23970/// Defines additional types related to [RolloutUpdateEvent].
23971pub mod rollout_update_event {
23972    #[allow(unused_imports)]
23973    use super::*;
23974
23975    /// RolloutUpdateType indicates the type of the rollout update.
23976    ///
23977    /// # Working with unknown values
23978    ///
23979    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23980    /// additional enum variants at any time. Adding new variants is not considered
23981    /// a breaking change. Applications should write their code in anticipation of:
23982    ///
23983    /// - New values appearing in future releases of the client library, **and**
23984    /// - New values received dynamically, without application changes.
23985    ///
23986    /// Please consult the [Working with enums] section in the user guide for some
23987    /// guidelines.
23988    ///
23989    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23990    #[derive(Clone, Debug, PartialEq)]
23991    #[non_exhaustive]
23992    pub enum RolloutUpdateType {
23993        /// Rollout update type unspecified.
23994        Unspecified,
23995        /// rollout state updated to pending.
23996        Pending,
23997        /// Rollout state updated to pending release.
23998        PendingRelease,
23999        /// Rollout state updated to in progress.
24000        InProgress,
24001        /// Rollout state updated to cancelling.
24002        Cancelling,
24003        /// Rollout state updated to cancelled.
24004        Cancelled,
24005        /// Rollout state updated to halted.
24006        Halted,
24007        /// Rollout state updated to succeeded.
24008        Succeeded,
24009        /// Rollout state updated to failed.
24010        Failed,
24011        /// Rollout requires approval.
24012        ApprovalRequired,
24013        /// Rollout has been approved.
24014        Approved,
24015        /// Rollout has been rejected.
24016        Rejected,
24017        /// Rollout requires advance to the next phase.
24018        AdvanceRequired,
24019        /// Rollout has been advanced.
24020        Advanced,
24021        /// If set, the enum was initialized with an unknown value.
24022        ///
24023        /// Applications can examine the value using [RolloutUpdateType::value] or
24024        /// [RolloutUpdateType::name].
24025        UnknownValue(rollout_update_type::UnknownValue),
24026    }
24027
24028    #[doc(hidden)]
24029    pub mod rollout_update_type {
24030        #[allow(unused_imports)]
24031        use super::*;
24032        #[derive(Clone, Debug, PartialEq)]
24033        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24034    }
24035
24036    impl RolloutUpdateType {
24037        /// Gets the enum value.
24038        ///
24039        /// Returns `None` if the enum contains an unknown value deserialized from
24040        /// the string representation of enums.
24041        pub fn value(&self) -> std::option::Option<i32> {
24042            match self {
24043                Self::Unspecified => std::option::Option::Some(0),
24044                Self::Pending => std::option::Option::Some(1),
24045                Self::PendingRelease => std::option::Option::Some(2),
24046                Self::InProgress => std::option::Option::Some(3),
24047                Self::Cancelling => std::option::Option::Some(4),
24048                Self::Cancelled => std::option::Option::Some(5),
24049                Self::Halted => std::option::Option::Some(6),
24050                Self::Succeeded => std::option::Option::Some(7),
24051                Self::Failed => std::option::Option::Some(8),
24052                Self::ApprovalRequired => std::option::Option::Some(9),
24053                Self::Approved => std::option::Option::Some(10),
24054                Self::Rejected => std::option::Option::Some(11),
24055                Self::AdvanceRequired => std::option::Option::Some(12),
24056                Self::Advanced => std::option::Option::Some(13),
24057                Self::UnknownValue(u) => u.0.value(),
24058            }
24059        }
24060
24061        /// Gets the enum value as a string.
24062        ///
24063        /// Returns `None` if the enum contains an unknown value deserialized from
24064        /// the integer representation of enums.
24065        pub fn name(&self) -> std::option::Option<&str> {
24066            match self {
24067                Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
24068                Self::Pending => std::option::Option::Some("PENDING"),
24069                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
24070                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
24071                Self::Cancelling => std::option::Option::Some("CANCELLING"),
24072                Self::Cancelled => std::option::Option::Some("CANCELLED"),
24073                Self::Halted => std::option::Option::Some("HALTED"),
24074                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24075                Self::Failed => std::option::Option::Some("FAILED"),
24076                Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
24077                Self::Approved => std::option::Option::Some("APPROVED"),
24078                Self::Rejected => std::option::Option::Some("REJECTED"),
24079                Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
24080                Self::Advanced => std::option::Option::Some("ADVANCED"),
24081                Self::UnknownValue(u) => u.0.name(),
24082            }
24083        }
24084    }
24085
24086    impl std::default::Default for RolloutUpdateType {
24087        fn default() -> Self {
24088            use std::convert::From;
24089            Self::from(0)
24090        }
24091    }
24092
24093    impl std::fmt::Display for RolloutUpdateType {
24094        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24095            wkt::internal::display_enum(f, self.name(), self.value())
24096        }
24097    }
24098
24099    impl std::convert::From<i32> for RolloutUpdateType {
24100        fn from(value: i32) -> Self {
24101            match value {
24102                0 => Self::Unspecified,
24103                1 => Self::Pending,
24104                2 => Self::PendingRelease,
24105                3 => Self::InProgress,
24106                4 => Self::Cancelling,
24107                5 => Self::Cancelled,
24108                6 => Self::Halted,
24109                7 => Self::Succeeded,
24110                8 => Self::Failed,
24111                9 => Self::ApprovalRequired,
24112                10 => Self::Approved,
24113                11 => Self::Rejected,
24114                12 => Self::AdvanceRequired,
24115                13 => Self::Advanced,
24116                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
24117                    wkt::internal::UnknownEnumValue::Integer(value),
24118                )),
24119            }
24120        }
24121    }
24122
24123    impl std::convert::From<&str> for RolloutUpdateType {
24124        fn from(value: &str) -> Self {
24125            use std::string::ToString;
24126            match value {
24127                "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
24128                "PENDING" => Self::Pending,
24129                "PENDING_RELEASE" => Self::PendingRelease,
24130                "IN_PROGRESS" => Self::InProgress,
24131                "CANCELLING" => Self::Cancelling,
24132                "CANCELLED" => Self::Cancelled,
24133                "HALTED" => Self::Halted,
24134                "SUCCEEDED" => Self::Succeeded,
24135                "FAILED" => Self::Failed,
24136                "APPROVAL_REQUIRED" => Self::ApprovalRequired,
24137                "APPROVED" => Self::Approved,
24138                "REJECTED" => Self::Rejected,
24139                "ADVANCE_REQUIRED" => Self::AdvanceRequired,
24140                "ADVANCED" => Self::Advanced,
24141                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
24142                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24143                )),
24144            }
24145        }
24146    }
24147
24148    impl serde::ser::Serialize for RolloutUpdateType {
24149        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24150        where
24151            S: serde::Serializer,
24152        {
24153            match self {
24154                Self::Unspecified => serializer.serialize_i32(0),
24155                Self::Pending => serializer.serialize_i32(1),
24156                Self::PendingRelease => serializer.serialize_i32(2),
24157                Self::InProgress => serializer.serialize_i32(3),
24158                Self::Cancelling => serializer.serialize_i32(4),
24159                Self::Cancelled => serializer.serialize_i32(5),
24160                Self::Halted => serializer.serialize_i32(6),
24161                Self::Succeeded => serializer.serialize_i32(7),
24162                Self::Failed => serializer.serialize_i32(8),
24163                Self::ApprovalRequired => serializer.serialize_i32(9),
24164                Self::Approved => serializer.serialize_i32(10),
24165                Self::Rejected => serializer.serialize_i32(11),
24166                Self::AdvanceRequired => serializer.serialize_i32(12),
24167                Self::Advanced => serializer.serialize_i32(13),
24168                Self::UnknownValue(u) => u.0.serialize(serializer),
24169            }
24170        }
24171    }
24172
24173    impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
24174        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24175        where
24176            D: serde::Deserializer<'de>,
24177        {
24178            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
24179                ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
24180            ))
24181        }
24182    }
24183}
24184
24185/// Payload proto for "clouddeploy.googleapis.com/target_notification"
24186/// Platform Log event that describes the failure to send target status change
24187/// Pub/Sub notification.
24188#[derive(Clone, Default, PartialEq)]
24189#[non_exhaustive]
24190pub struct TargetNotificationEvent {
24191    /// Debug message for when a notification fails to send.
24192    pub message: std::string::String,
24193
24194    /// The name of the `Target`.
24195    pub target: std::string::String,
24196
24197    /// Type of this notification, e.g. for a Pub/Sub failure.
24198    pub r#type: crate::model::Type,
24199
24200    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24201}
24202
24203impl TargetNotificationEvent {
24204    /// Creates a new default instance.
24205    pub fn new() -> Self {
24206        std::default::Default::default()
24207    }
24208
24209    /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
24210    ///
24211    /// # Example
24212    /// ```ignore,no_run
24213    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24214    /// let x = TargetNotificationEvent::new().set_message("example");
24215    /// ```
24216    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24217        self.message = v.into();
24218        self
24219    }
24220
24221    /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
24222    ///
24223    /// # Example
24224    /// ```ignore,no_run
24225    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24226    /// let x = TargetNotificationEvent::new().set_target("example");
24227    /// ```
24228    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24229        self.target = v.into();
24230        self
24231    }
24232
24233    /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
24234    ///
24235    /// # Example
24236    /// ```ignore,no_run
24237    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24238    /// use google_cloud_deploy_v1::model::Type;
24239    /// let x0 = TargetNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
24240    /// let x1 = TargetNotificationEvent::new().set_type(Type::ResourceStateChange);
24241    /// let x2 = TargetNotificationEvent::new().set_type(Type::ProcessAborted);
24242    /// ```
24243    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24244        self.r#type = v.into();
24245        self
24246    }
24247}
24248
24249impl wkt::message::Message for TargetNotificationEvent {
24250    fn typename() -> &'static str {
24251        "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
24252    }
24253}
24254
24255/// The support state of a specific Skaffold version.
24256///
24257/// # Working with unknown values
24258///
24259/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24260/// additional enum variants at any time. Adding new variants is not considered
24261/// a breaking change. Applications should write their code in anticipation of:
24262///
24263/// - New values appearing in future releases of the client library, **and**
24264/// - New values received dynamically, without application changes.
24265///
24266/// Please consult the [Working with enums] section in the user guide for some
24267/// guidelines.
24268///
24269/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24270#[derive(Clone, Debug, PartialEq)]
24271#[non_exhaustive]
24272pub enum SkaffoldSupportState {
24273    /// Default value. This value is unused.
24274    Unspecified,
24275    /// This Skaffold version is currently supported.
24276    Supported,
24277    /// This Skaffold version is in maintenance mode.
24278    MaintenanceMode,
24279    /// This Skaffold version is no longer supported.
24280    Unsupported,
24281    /// If set, the enum was initialized with an unknown value.
24282    ///
24283    /// Applications can examine the value using [SkaffoldSupportState::value] or
24284    /// [SkaffoldSupportState::name].
24285    UnknownValue(skaffold_support_state::UnknownValue),
24286}
24287
24288#[doc(hidden)]
24289pub mod skaffold_support_state {
24290    #[allow(unused_imports)]
24291    use super::*;
24292    #[derive(Clone, Debug, PartialEq)]
24293    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24294}
24295
24296impl SkaffoldSupportState {
24297    /// Gets the enum value.
24298    ///
24299    /// Returns `None` if the enum contains an unknown value deserialized from
24300    /// the string representation of enums.
24301    pub fn value(&self) -> std::option::Option<i32> {
24302        match self {
24303            Self::Unspecified => std::option::Option::Some(0),
24304            Self::Supported => std::option::Option::Some(1),
24305            Self::MaintenanceMode => std::option::Option::Some(2),
24306            Self::Unsupported => std::option::Option::Some(3),
24307            Self::UnknownValue(u) => u.0.value(),
24308        }
24309    }
24310
24311    /// Gets the enum value as a string.
24312    ///
24313    /// Returns `None` if the enum contains an unknown value deserialized from
24314    /// the integer representation of enums.
24315    pub fn name(&self) -> std::option::Option<&str> {
24316        match self {
24317            Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
24318            Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
24319            Self::MaintenanceMode => {
24320                std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
24321            }
24322            Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
24323            Self::UnknownValue(u) => u.0.name(),
24324        }
24325    }
24326}
24327
24328impl std::default::Default for SkaffoldSupportState {
24329    fn default() -> Self {
24330        use std::convert::From;
24331        Self::from(0)
24332    }
24333}
24334
24335impl std::fmt::Display for SkaffoldSupportState {
24336    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24337        wkt::internal::display_enum(f, self.name(), self.value())
24338    }
24339}
24340
24341impl std::convert::From<i32> for SkaffoldSupportState {
24342    fn from(value: i32) -> Self {
24343        match value {
24344            0 => Self::Unspecified,
24345            1 => Self::Supported,
24346            2 => Self::MaintenanceMode,
24347            3 => Self::Unsupported,
24348            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24349                wkt::internal::UnknownEnumValue::Integer(value),
24350            )),
24351        }
24352    }
24353}
24354
24355impl std::convert::From<&str> for SkaffoldSupportState {
24356    fn from(value: &str) -> Self {
24357        use std::string::ToString;
24358        match value {
24359            "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
24360            "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
24361            "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
24362            "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
24363            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24364                wkt::internal::UnknownEnumValue::String(value.to_string()),
24365            )),
24366        }
24367    }
24368}
24369
24370impl serde::ser::Serialize for SkaffoldSupportState {
24371    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24372    where
24373        S: serde::Serializer,
24374    {
24375        match self {
24376            Self::Unspecified => serializer.serialize_i32(0),
24377            Self::Supported => serializer.serialize_i32(1),
24378            Self::MaintenanceMode => serializer.serialize_i32(2),
24379            Self::Unsupported => serializer.serialize_i32(3),
24380            Self::UnknownValue(u) => u.0.serialize(serializer),
24381        }
24382    }
24383}
24384
24385impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
24386    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24387    where
24388        D: serde::Deserializer<'de>,
24389    {
24390        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
24391            ".google.cloud.deploy.v1.SkaffoldSupportState",
24392        ))
24393    }
24394}
24395
24396/// The pattern of how wait time is increased.
24397///
24398/// # Working with unknown values
24399///
24400/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24401/// additional enum variants at any time. Adding new variants is not considered
24402/// a breaking change. Applications should write their code in anticipation of:
24403///
24404/// - New values appearing in future releases of the client library, **and**
24405/// - New values received dynamically, without application changes.
24406///
24407/// Please consult the [Working with enums] section in the user guide for some
24408/// guidelines.
24409///
24410/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24411#[derive(Clone, Debug, PartialEq)]
24412#[non_exhaustive]
24413pub enum BackoffMode {
24414    /// No WaitMode is specified.
24415    Unspecified,
24416    /// Increases the wait time linearly.
24417    Linear,
24418    /// Increases the wait time exponentially.
24419    Exponential,
24420    /// If set, the enum was initialized with an unknown value.
24421    ///
24422    /// Applications can examine the value using [BackoffMode::value] or
24423    /// [BackoffMode::name].
24424    UnknownValue(backoff_mode::UnknownValue),
24425}
24426
24427#[doc(hidden)]
24428pub mod backoff_mode {
24429    #[allow(unused_imports)]
24430    use super::*;
24431    #[derive(Clone, Debug, PartialEq)]
24432    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24433}
24434
24435impl BackoffMode {
24436    /// Gets the enum value.
24437    ///
24438    /// Returns `None` if the enum contains an unknown value deserialized from
24439    /// the string representation of enums.
24440    pub fn value(&self) -> std::option::Option<i32> {
24441        match self {
24442            Self::Unspecified => std::option::Option::Some(0),
24443            Self::Linear => std::option::Option::Some(1),
24444            Self::Exponential => std::option::Option::Some(2),
24445            Self::UnknownValue(u) => u.0.value(),
24446        }
24447    }
24448
24449    /// Gets the enum value as a string.
24450    ///
24451    /// Returns `None` if the enum contains an unknown value deserialized from
24452    /// the integer representation of enums.
24453    pub fn name(&self) -> std::option::Option<&str> {
24454        match self {
24455            Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
24456            Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
24457            Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
24458            Self::UnknownValue(u) => u.0.name(),
24459        }
24460    }
24461}
24462
24463impl std::default::Default for BackoffMode {
24464    fn default() -> Self {
24465        use std::convert::From;
24466        Self::from(0)
24467    }
24468}
24469
24470impl std::fmt::Display for BackoffMode {
24471    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24472        wkt::internal::display_enum(f, self.name(), self.value())
24473    }
24474}
24475
24476impl std::convert::From<i32> for BackoffMode {
24477    fn from(value: i32) -> Self {
24478        match value {
24479            0 => Self::Unspecified,
24480            1 => Self::Linear,
24481            2 => Self::Exponential,
24482            _ => Self::UnknownValue(backoff_mode::UnknownValue(
24483                wkt::internal::UnknownEnumValue::Integer(value),
24484            )),
24485        }
24486    }
24487}
24488
24489impl std::convert::From<&str> for BackoffMode {
24490    fn from(value: &str) -> Self {
24491        use std::string::ToString;
24492        match value {
24493            "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
24494            "BACKOFF_MODE_LINEAR" => Self::Linear,
24495            "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
24496            _ => Self::UnknownValue(backoff_mode::UnknownValue(
24497                wkt::internal::UnknownEnumValue::String(value.to_string()),
24498            )),
24499        }
24500    }
24501}
24502
24503impl serde::ser::Serialize for BackoffMode {
24504    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24505    where
24506        S: serde::Serializer,
24507    {
24508        match self {
24509            Self::Unspecified => serializer.serialize_i32(0),
24510            Self::Linear => serializer.serialize_i32(1),
24511            Self::Exponential => serializer.serialize_i32(2),
24512            Self::UnknownValue(u) => u.0.serialize(serializer),
24513        }
24514    }
24515}
24516
24517impl<'de> serde::de::Deserialize<'de> for BackoffMode {
24518    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24519    where
24520        D: serde::Deserializer<'de>,
24521    {
24522        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
24523            ".google.cloud.deploy.v1.BackoffMode",
24524        ))
24525    }
24526}
24527
24528/// Valid state of a repair attempt.
24529///
24530/// # Working with unknown values
24531///
24532/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24533/// additional enum variants at any time. Adding new variants is not considered
24534/// a breaking change. Applications should write their code in anticipation of:
24535///
24536/// - New values appearing in future releases of the client library, **and**
24537/// - New values received dynamically, without application changes.
24538///
24539/// Please consult the [Working with enums] section in the user guide for some
24540/// guidelines.
24541///
24542/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24543#[derive(Clone, Debug, PartialEq)]
24544#[non_exhaustive]
24545pub enum RepairState {
24546    /// The `repair` has an unspecified state.
24547    Unspecified,
24548    /// The `repair` action has succeeded.
24549    Succeeded,
24550    /// The `repair` action was cancelled.
24551    Cancelled,
24552    /// The `repair` action has failed.
24553    Failed,
24554    /// The `repair` action is in progress.
24555    InProgress,
24556    /// The `repair` action is pending.
24557    Pending,
24558    /// The `repair` action was aborted.
24559    Aborted,
24560    /// If set, the enum was initialized with an unknown value.
24561    ///
24562    /// Applications can examine the value using [RepairState::value] or
24563    /// [RepairState::name].
24564    UnknownValue(repair_state::UnknownValue),
24565}
24566
24567#[doc(hidden)]
24568pub mod repair_state {
24569    #[allow(unused_imports)]
24570    use super::*;
24571    #[derive(Clone, Debug, PartialEq)]
24572    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24573}
24574
24575impl RepairState {
24576    /// Gets the enum value.
24577    ///
24578    /// Returns `None` if the enum contains an unknown value deserialized from
24579    /// the string representation of enums.
24580    pub fn value(&self) -> std::option::Option<i32> {
24581        match self {
24582            Self::Unspecified => std::option::Option::Some(0),
24583            Self::Succeeded => std::option::Option::Some(1),
24584            Self::Cancelled => std::option::Option::Some(2),
24585            Self::Failed => std::option::Option::Some(3),
24586            Self::InProgress => std::option::Option::Some(4),
24587            Self::Pending => std::option::Option::Some(5),
24588            Self::Aborted => std::option::Option::Some(7),
24589            Self::UnknownValue(u) => u.0.value(),
24590        }
24591    }
24592
24593    /// Gets the enum value as a string.
24594    ///
24595    /// Returns `None` if the enum contains an unknown value deserialized from
24596    /// the integer representation of enums.
24597    pub fn name(&self) -> std::option::Option<&str> {
24598        match self {
24599            Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
24600            Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
24601            Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
24602            Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
24603            Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
24604            Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
24605            Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
24606            Self::UnknownValue(u) => u.0.name(),
24607        }
24608    }
24609}
24610
24611impl std::default::Default for RepairState {
24612    fn default() -> Self {
24613        use std::convert::From;
24614        Self::from(0)
24615    }
24616}
24617
24618impl std::fmt::Display for RepairState {
24619    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24620        wkt::internal::display_enum(f, self.name(), self.value())
24621    }
24622}
24623
24624impl std::convert::From<i32> for RepairState {
24625    fn from(value: i32) -> Self {
24626        match value {
24627            0 => Self::Unspecified,
24628            1 => Self::Succeeded,
24629            2 => Self::Cancelled,
24630            3 => Self::Failed,
24631            4 => Self::InProgress,
24632            5 => Self::Pending,
24633            7 => Self::Aborted,
24634            _ => Self::UnknownValue(repair_state::UnknownValue(
24635                wkt::internal::UnknownEnumValue::Integer(value),
24636            )),
24637        }
24638    }
24639}
24640
24641impl std::convert::From<&str> for RepairState {
24642    fn from(value: &str) -> Self {
24643        use std::string::ToString;
24644        match value {
24645            "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
24646            "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
24647            "REPAIR_STATE_CANCELLED" => Self::Cancelled,
24648            "REPAIR_STATE_FAILED" => Self::Failed,
24649            "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
24650            "REPAIR_STATE_PENDING" => Self::Pending,
24651            "REPAIR_STATE_ABORTED" => Self::Aborted,
24652            _ => Self::UnknownValue(repair_state::UnknownValue(
24653                wkt::internal::UnknownEnumValue::String(value.to_string()),
24654            )),
24655        }
24656    }
24657}
24658
24659impl serde::ser::Serialize for RepairState {
24660    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24661    where
24662        S: serde::Serializer,
24663    {
24664        match self {
24665            Self::Unspecified => serializer.serialize_i32(0),
24666            Self::Succeeded => serializer.serialize_i32(1),
24667            Self::Cancelled => serializer.serialize_i32(2),
24668            Self::Failed => serializer.serialize_i32(3),
24669            Self::InProgress => serializer.serialize_i32(4),
24670            Self::Pending => serializer.serialize_i32(5),
24671            Self::Aborted => serializer.serialize_i32(7),
24672            Self::UnknownValue(u) => u.0.serialize(serializer),
24673        }
24674    }
24675}
24676
24677impl<'de> serde::de::Deserialize<'de> for RepairState {
24678    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24679    where
24680        D: serde::Deserializer<'de>,
24681    {
24682        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
24683            ".google.cloud.deploy.v1.RepairState",
24684        ))
24685    }
24686}
24687
24688/// Type indicates the type of the log entry and can be used as a filter.
24689///
24690/// # Working with unknown values
24691///
24692/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24693/// additional enum variants at any time. Adding new variants is not considered
24694/// a breaking change. Applications should write their code in anticipation of:
24695///
24696/// - New values appearing in future releases of the client library, **and**
24697/// - New values received dynamically, without application changes.
24698///
24699/// Please consult the [Working with enums] section in the user guide for some
24700/// guidelines.
24701///
24702/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24703#[derive(Clone, Debug, PartialEq)]
24704#[non_exhaustive]
24705pub enum Type {
24706    /// Type is unspecified.
24707    Unspecified,
24708    /// A Pub/Sub notification failed to be sent.
24709    PubsubNotificationFailure,
24710    /// Resource state changed.
24711    ResourceStateChange,
24712    /// A process aborted.
24713    ProcessAborted,
24714    /// Restriction check failed.
24715    RestrictionViolated,
24716    /// Resource deleted.
24717    ResourceDeleted,
24718    /// Rollout updated.
24719    RolloutUpdate,
24720    /// Deploy Policy evaluation.
24721    DeployPolicyEvaluation,
24722    /// Deprecated: This field is never used. Use release_render log type instead.
24723    #[deprecated]
24724    RenderStatuesChange,
24725    /// If set, the enum was initialized with an unknown value.
24726    ///
24727    /// Applications can examine the value using [Type::value] or
24728    /// [Type::name].
24729    UnknownValue(r#type::UnknownValue),
24730}
24731
24732#[doc(hidden)]
24733pub mod r#type {
24734    #[allow(unused_imports)]
24735    use super::*;
24736    #[derive(Clone, Debug, PartialEq)]
24737    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24738}
24739
24740impl Type {
24741    /// Gets the enum value.
24742    ///
24743    /// Returns `None` if the enum contains an unknown value deserialized from
24744    /// the string representation of enums.
24745    pub fn value(&self) -> std::option::Option<i32> {
24746        match self {
24747            Self::Unspecified => std::option::Option::Some(0),
24748            Self::PubsubNotificationFailure => std::option::Option::Some(1),
24749            Self::ResourceStateChange => std::option::Option::Some(3),
24750            Self::ProcessAborted => std::option::Option::Some(4),
24751            Self::RestrictionViolated => std::option::Option::Some(5),
24752            Self::ResourceDeleted => std::option::Option::Some(6),
24753            Self::RolloutUpdate => std::option::Option::Some(7),
24754            Self::DeployPolicyEvaluation => std::option::Option::Some(8),
24755            Self::RenderStatuesChange => std::option::Option::Some(2),
24756            Self::UnknownValue(u) => u.0.value(),
24757        }
24758    }
24759
24760    /// Gets the enum value as a string.
24761    ///
24762    /// Returns `None` if the enum contains an unknown value deserialized from
24763    /// the integer representation of enums.
24764    pub fn name(&self) -> std::option::Option<&str> {
24765        match self {
24766            Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
24767            Self::PubsubNotificationFailure => {
24768                std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
24769            }
24770            Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
24771            Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
24772            Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
24773            Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
24774            Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
24775            Self::DeployPolicyEvaluation => {
24776                std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
24777            }
24778            Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
24779            Self::UnknownValue(u) => u.0.name(),
24780        }
24781    }
24782}
24783
24784impl std::default::Default for Type {
24785    fn default() -> Self {
24786        use std::convert::From;
24787        Self::from(0)
24788    }
24789}
24790
24791impl std::fmt::Display for Type {
24792    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24793        wkt::internal::display_enum(f, self.name(), self.value())
24794    }
24795}
24796
24797impl std::convert::From<i32> for Type {
24798    fn from(value: i32) -> Self {
24799        match value {
24800            0 => Self::Unspecified,
24801            1 => Self::PubsubNotificationFailure,
24802            2 => Self::RenderStatuesChange,
24803            3 => Self::ResourceStateChange,
24804            4 => Self::ProcessAborted,
24805            5 => Self::RestrictionViolated,
24806            6 => Self::ResourceDeleted,
24807            7 => Self::RolloutUpdate,
24808            8 => Self::DeployPolicyEvaluation,
24809            _ => Self::UnknownValue(r#type::UnknownValue(
24810                wkt::internal::UnknownEnumValue::Integer(value),
24811            )),
24812        }
24813    }
24814}
24815
24816impl std::convert::From<&str> for Type {
24817    fn from(value: &str) -> Self {
24818        use std::string::ToString;
24819        match value {
24820            "TYPE_UNSPECIFIED" => Self::Unspecified,
24821            "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
24822            "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
24823            "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
24824            "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
24825            "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
24826            "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
24827            "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
24828            "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
24829            _ => Self::UnknownValue(r#type::UnknownValue(
24830                wkt::internal::UnknownEnumValue::String(value.to_string()),
24831            )),
24832        }
24833    }
24834}
24835
24836impl serde::ser::Serialize for Type {
24837    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24838    where
24839        S: serde::Serializer,
24840    {
24841        match self {
24842            Self::Unspecified => serializer.serialize_i32(0),
24843            Self::PubsubNotificationFailure => serializer.serialize_i32(1),
24844            Self::ResourceStateChange => serializer.serialize_i32(3),
24845            Self::ProcessAborted => serializer.serialize_i32(4),
24846            Self::RestrictionViolated => serializer.serialize_i32(5),
24847            Self::ResourceDeleted => serializer.serialize_i32(6),
24848            Self::RolloutUpdate => serializer.serialize_i32(7),
24849            Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
24850            Self::RenderStatuesChange => serializer.serialize_i32(2),
24851            Self::UnknownValue(u) => u.0.serialize(serializer),
24852        }
24853    }
24854}
24855
24856impl<'de> serde::de::Deserialize<'de> for Type {
24857    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24858    where
24859        D: serde::Deserializer<'de>,
24860    {
24861        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
24862            ".google.cloud.deploy.v1.Type",
24863        ))
24864    }
24865}