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 gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate location;
28extern crate longrunning;
29extern crate lro;
30extern crate reqwest;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Payload proto for "clouddeploy.googleapis.com/automation"
43/// Platform Log event that describes the Automation related events.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct AutomationEvent {
47    /// Debug message for when there is an update on the AutomationRun.
48    /// Provides further details about the resource creation or state change.
49    pub message: std::string::String,
50
51    /// The name of the `AutomationRun`.
52    pub automation: std::string::String,
53
54    /// Unique identifier of the `DeliveryPipeline`.
55    pub pipeline_uid: std::string::String,
56
57    /// Type of this notification, e.g. for a Pub/Sub failure.
58    pub r#type: crate::model::Type,
59
60    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl AutomationEvent {
64    pub fn new() -> Self {
65        std::default::Default::default()
66    }
67
68    /// Sets the value of [message][crate::model::AutomationEvent::message].
69    ///
70    /// # Example
71    /// ```ignore,no_run
72    /// # use google_cloud_deploy_v1::model::AutomationEvent;
73    /// let x = AutomationEvent::new().set_message("example");
74    /// ```
75    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.message = v.into();
77        self
78    }
79
80    /// Sets the value of [automation][crate::model::AutomationEvent::automation].
81    ///
82    /// # Example
83    /// ```ignore,no_run
84    /// # use google_cloud_deploy_v1::model::AutomationEvent;
85    /// let x = AutomationEvent::new().set_automation("example");
86    /// ```
87    pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.automation = v.into();
89        self
90    }
91
92    /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
93    ///
94    /// # Example
95    /// ```ignore,no_run
96    /// # use google_cloud_deploy_v1::model::AutomationEvent;
97    /// let x = AutomationEvent::new().set_pipeline_uid("example");
98    /// ```
99    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.pipeline_uid = v.into();
101        self
102    }
103
104    /// Sets the value of [r#type][crate::model::AutomationEvent::type].
105    ///
106    /// # Example
107    /// ```ignore,no_run
108    /// # use google_cloud_deploy_v1::model::AutomationEvent;
109    /// use google_cloud_deploy_v1::model::Type;
110    /// let x0 = AutomationEvent::new().set_type(Type::PubsubNotificationFailure);
111    /// let x1 = AutomationEvent::new().set_type(Type::ResourceStateChange);
112    /// let x2 = AutomationEvent::new().set_type(Type::ProcessAborted);
113    /// ```
114    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
115        self.r#type = v.into();
116        self
117    }
118}
119
120impl wkt::message::Message for AutomationEvent {
121    fn typename() -> &'static str {
122        "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
123    }
124}
125
126/// Payload proto for "clouddeploy.googleapis.com/automation_run"
127/// Platform Log event that describes the AutomationRun related events.
128#[derive(Clone, Default, PartialEq)]
129#[non_exhaustive]
130pub struct AutomationRunEvent {
131    /// Debug message for when there is an update on the AutomationRun.
132    /// Provides further details about the resource creation or state change.
133    pub message: std::string::String,
134
135    /// The name of the `AutomationRun`.
136    pub automation_run: std::string::String,
137
138    /// Unique identifier of the `DeliveryPipeline`.
139    pub pipeline_uid: std::string::String,
140
141    /// Identifier of the `Automation`.
142    pub automation_id: std::string::String,
143
144    /// Identifier of the `Automation` rule.
145    pub rule_id: std::string::String,
146
147    /// ID of the `Target` to which the `AutomationRun` is created.
148    pub destination_target_id: std::string::String,
149
150    /// Type of this notification, e.g. for a Pub/Sub failure.
151    pub r#type: crate::model::Type,
152
153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl AutomationRunEvent {
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    pub fn new() -> Self {
321        std::default::Default::default()
322    }
323
324    /// Sets the value of [name][crate::model::DeliveryPipeline::name].
325    ///
326    /// # Example
327    /// ```ignore,no_run
328    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
329    /// let x = DeliveryPipeline::new().set_name("example");
330    /// ```
331    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
332        self.name = v.into();
333        self
334    }
335
336    /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
337    ///
338    /// # Example
339    /// ```ignore,no_run
340    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
341    /// let x = DeliveryPipeline::new().set_uid("example");
342    /// ```
343    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
344        self.uid = v.into();
345        self
346    }
347
348    /// Sets the value of [description][crate::model::DeliveryPipeline::description].
349    ///
350    /// # Example
351    /// ```ignore,no_run
352    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
353    /// let x = DeliveryPipeline::new().set_description("example");
354    /// ```
355    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
356        self.description = v.into();
357        self
358    }
359
360    /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
361    ///
362    /// # Example
363    /// ```ignore,no_run
364    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
365    /// let x = DeliveryPipeline::new().set_annotations([
366    ///     ("key0", "abc"),
367    ///     ("key1", "xyz"),
368    /// ]);
369    /// ```
370    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
371    where
372        T: std::iter::IntoIterator<Item = (K, V)>,
373        K: std::convert::Into<std::string::String>,
374        V: std::convert::Into<std::string::String>,
375    {
376        use std::iter::Iterator;
377        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
378        self
379    }
380
381    /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
382    ///
383    /// # Example
384    /// ```ignore,no_run
385    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
386    /// let x = DeliveryPipeline::new().set_labels([
387    ///     ("key0", "abc"),
388    ///     ("key1", "xyz"),
389    /// ]);
390    /// ```
391    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
392    where
393        T: std::iter::IntoIterator<Item = (K, V)>,
394        K: std::convert::Into<std::string::String>,
395        V: std::convert::Into<std::string::String>,
396    {
397        use std::iter::Iterator;
398        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
399        self
400    }
401
402    /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
403    ///
404    /// # Example
405    /// ```ignore,no_run
406    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
407    /// use wkt::Timestamp;
408    /// let x = DeliveryPipeline::new().set_create_time(Timestamp::default()/* use setters */);
409    /// ```
410    pub fn set_create_time<T>(mut self, v: T) -> Self
411    where
412        T: std::convert::Into<wkt::Timestamp>,
413    {
414        self.create_time = std::option::Option::Some(v.into());
415        self
416    }
417
418    /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
419    ///
420    /// # Example
421    /// ```ignore,no_run
422    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
423    /// use wkt::Timestamp;
424    /// let x = DeliveryPipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
425    /// let x = DeliveryPipeline::new().set_or_clear_create_time(None::<Timestamp>);
426    /// ```
427    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
428    where
429        T: std::convert::Into<wkt::Timestamp>,
430    {
431        self.create_time = v.map(|x| x.into());
432        self
433    }
434
435    /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
436    ///
437    /// # Example
438    /// ```ignore,no_run
439    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
440    /// use wkt::Timestamp;
441    /// let x = DeliveryPipeline::new().set_update_time(Timestamp::default()/* use setters */);
442    /// ```
443    pub fn set_update_time<T>(mut self, v: T) -> Self
444    where
445        T: std::convert::Into<wkt::Timestamp>,
446    {
447        self.update_time = std::option::Option::Some(v.into());
448        self
449    }
450
451    /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
452    ///
453    /// # Example
454    /// ```ignore,no_run
455    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
456    /// use wkt::Timestamp;
457    /// let x = DeliveryPipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
458    /// let x = DeliveryPipeline::new().set_or_clear_update_time(None::<Timestamp>);
459    /// ```
460    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
461    where
462        T: std::convert::Into<wkt::Timestamp>,
463    {
464        self.update_time = v.map(|x| x.into());
465        self
466    }
467
468    /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
469    ///
470    /// # Example
471    /// ```ignore,no_run
472    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
473    /// use google_cloud_deploy_v1::model::PipelineCondition;
474    /// let x = DeliveryPipeline::new().set_condition(PipelineCondition::default()/* use setters */);
475    /// ```
476    pub fn set_condition<T>(mut self, v: T) -> Self
477    where
478        T: std::convert::Into<crate::model::PipelineCondition>,
479    {
480        self.condition = std::option::Option::Some(v.into());
481        self
482    }
483
484    /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
485    ///
486    /// # Example
487    /// ```ignore,no_run
488    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
489    /// use google_cloud_deploy_v1::model::PipelineCondition;
490    /// let x = DeliveryPipeline::new().set_or_clear_condition(Some(PipelineCondition::default()/* use setters */));
491    /// let x = DeliveryPipeline::new().set_or_clear_condition(None::<PipelineCondition>);
492    /// ```
493    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
494    where
495        T: std::convert::Into<crate::model::PipelineCondition>,
496    {
497        self.condition = v.map(|x| x.into());
498        self
499    }
500
501    /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
502    ///
503    /// # Example
504    /// ```ignore,no_run
505    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
506    /// let x = DeliveryPipeline::new().set_etag("example");
507    /// ```
508    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
509        self.etag = v.into();
510        self
511    }
512
513    /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
514    ///
515    /// # Example
516    /// ```ignore,no_run
517    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
518    /// let x = DeliveryPipeline::new().set_suspended(true);
519    /// ```
520    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
521        self.suspended = v.into();
522        self
523    }
524
525    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
526    ///
527    /// Note that all the setters affecting `pipeline` are mutually
528    /// exclusive.
529    ///
530    /// # Example
531    /// ```ignore,no_run
532    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
533    /// use google_cloud_deploy_v1::model::SerialPipeline;
534    /// let x = DeliveryPipeline::new().set_pipeline(Some(
535    ///     google_cloud_deploy_v1::model::delivery_pipeline::Pipeline::SerialPipeline(SerialPipeline::default().into())));
536    /// ```
537    pub fn set_pipeline<
538        T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
539    >(
540        mut self,
541        v: T,
542    ) -> Self {
543        self.pipeline = v.into();
544        self
545    }
546
547    /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
548    /// if it holds a `SerialPipeline`, `None` if the field is not set or
549    /// holds a different branch.
550    pub fn serial_pipeline(
551        &self,
552    ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
553        #[allow(unreachable_patterns)]
554        self.pipeline.as_ref().and_then(|v| match v {
555            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
556                std::option::Option::Some(v)
557            }
558            _ => std::option::Option::None,
559        })
560    }
561
562    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
563    /// to hold a `SerialPipeline`.
564    ///
565    /// Note that all the setters affecting `pipeline` are
566    /// mutually exclusive.
567    ///
568    /// # Example
569    /// ```ignore,no_run
570    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
571    /// use google_cloud_deploy_v1::model::SerialPipeline;
572    /// let x = DeliveryPipeline::new().set_serial_pipeline(SerialPipeline::default()/* use setters */);
573    /// assert!(x.serial_pipeline().is_some());
574    /// ```
575    pub fn set_serial_pipeline<
576        T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
577    >(
578        mut self,
579        v: T,
580    ) -> Self {
581        self.pipeline = std::option::Option::Some(
582            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
583        );
584        self
585    }
586}
587
588impl wkt::message::Message for DeliveryPipeline {
589    fn typename() -> &'static str {
590        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
591    }
592}
593
594/// Defines additional types related to [DeliveryPipeline].
595pub mod delivery_pipeline {
596    #[allow(unused_imports)]
597    use super::*;
598
599    /// The ordering configuration of the `DeliveryPipeline`.
600    #[derive(Clone, Debug, PartialEq)]
601    #[non_exhaustive]
602    pub enum Pipeline {
603        /// Optional. SerialPipeline defines a sequential set of stages for a
604        /// `DeliveryPipeline`.
605        SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
606    }
607}
608
609/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
610#[derive(Clone, Default, PartialEq)]
611#[non_exhaustive]
612pub struct SerialPipeline {
613    /// Optional. Each stage specifies configuration for a `Target`. The ordering
614    /// of this list defines the promotion flow.
615    pub stages: std::vec::Vec<crate::model::Stage>,
616
617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
618}
619
620impl SerialPipeline {
621    pub fn new() -> Self {
622        std::default::Default::default()
623    }
624
625    /// Sets the value of [stages][crate::model::SerialPipeline::stages].
626    ///
627    /// # Example
628    /// ```ignore,no_run
629    /// # use google_cloud_deploy_v1::model::SerialPipeline;
630    /// use google_cloud_deploy_v1::model::Stage;
631    /// let x = SerialPipeline::new()
632    ///     .set_stages([
633    ///         Stage::default()/* use setters */,
634    ///         Stage::default()/* use (different) setters */,
635    ///     ]);
636    /// ```
637    pub fn set_stages<T, V>(mut self, v: T) -> Self
638    where
639        T: std::iter::IntoIterator<Item = V>,
640        V: std::convert::Into<crate::model::Stage>,
641    {
642        use std::iter::Iterator;
643        self.stages = v.into_iter().map(|i| i.into()).collect();
644        self
645    }
646}
647
648impl wkt::message::Message for SerialPipeline {
649    fn typename() -> &'static str {
650        "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
651    }
652}
653
654/// Stage specifies a location to which to deploy.
655#[derive(Clone, Default, PartialEq)]
656#[non_exhaustive]
657pub struct Stage {
658    /// Optional. The target_id to which this stage points. This field refers
659    /// exclusively to the last segment of a target name. For example, this field
660    /// would just be `my-target` (rather than
661    /// `projects/project/locations/location/targets/my-target`). The location of
662    /// the `Target` is inferred to be the same as the location of the
663    /// `DeliveryPipeline` that contains this `Stage`.
664    pub target_id: std::string::String,
665
666    /// Optional. Skaffold profiles to use when rendering the manifest for this
667    /// stage's `Target`.
668    pub profiles: std::vec::Vec<std::string::String>,
669
670    /// Optional. The strategy to use for a `Rollout` to this stage.
671    pub strategy: std::option::Option<crate::model::Strategy>,
672
673    /// Optional. The deploy parameters to use for the target in this stage.
674    pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
675
676    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
677}
678
679impl Stage {
680    pub fn new() -> Self {
681        std::default::Default::default()
682    }
683
684    /// Sets the value of [target_id][crate::model::Stage::target_id].
685    ///
686    /// # Example
687    /// ```ignore,no_run
688    /// # use google_cloud_deploy_v1::model::Stage;
689    /// let x = Stage::new().set_target_id("example");
690    /// ```
691    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
692        self.target_id = v.into();
693        self
694    }
695
696    /// Sets the value of [profiles][crate::model::Stage::profiles].
697    ///
698    /// # Example
699    /// ```ignore,no_run
700    /// # use google_cloud_deploy_v1::model::Stage;
701    /// let x = Stage::new().set_profiles(["a", "b", "c"]);
702    /// ```
703    pub fn set_profiles<T, V>(mut self, v: T) -> Self
704    where
705        T: std::iter::IntoIterator<Item = V>,
706        V: std::convert::Into<std::string::String>,
707    {
708        use std::iter::Iterator;
709        self.profiles = v.into_iter().map(|i| i.into()).collect();
710        self
711    }
712
713    /// Sets the value of [strategy][crate::model::Stage::strategy].
714    ///
715    /// # Example
716    /// ```ignore,no_run
717    /// # use google_cloud_deploy_v1::model::Stage;
718    /// use google_cloud_deploy_v1::model::Strategy;
719    /// let x = Stage::new().set_strategy(Strategy::default()/* use setters */);
720    /// ```
721    pub fn set_strategy<T>(mut self, v: T) -> Self
722    where
723        T: std::convert::Into<crate::model::Strategy>,
724    {
725        self.strategy = std::option::Option::Some(v.into());
726        self
727    }
728
729    /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
730    ///
731    /// # Example
732    /// ```ignore,no_run
733    /// # use google_cloud_deploy_v1::model::Stage;
734    /// use google_cloud_deploy_v1::model::Strategy;
735    /// let x = Stage::new().set_or_clear_strategy(Some(Strategy::default()/* use setters */));
736    /// let x = Stage::new().set_or_clear_strategy(None::<Strategy>);
737    /// ```
738    pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
739    where
740        T: std::convert::Into<crate::model::Strategy>,
741    {
742        self.strategy = v.map(|x| x.into());
743        self
744    }
745
746    /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
747    ///
748    /// # Example
749    /// ```ignore,no_run
750    /// # use google_cloud_deploy_v1::model::Stage;
751    /// use google_cloud_deploy_v1::model::DeployParameters;
752    /// let x = Stage::new()
753    ///     .set_deploy_parameters([
754    ///         DeployParameters::default()/* use setters */,
755    ///         DeployParameters::default()/* use (different) setters */,
756    ///     ]);
757    /// ```
758    pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
759    where
760        T: std::iter::IntoIterator<Item = V>,
761        V: std::convert::Into<crate::model::DeployParameters>,
762    {
763        use std::iter::Iterator;
764        self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
765        self
766    }
767}
768
769impl wkt::message::Message for Stage {
770    fn typename() -> &'static str {
771        "type.googleapis.com/google.cloud.deploy.v1.Stage"
772    }
773}
774
775/// DeployParameters contains deploy parameters information.
776#[derive(Clone, Default, PartialEq)]
777#[non_exhaustive]
778pub struct DeployParameters {
779    /// Required. Values are deploy parameters in key-value pairs.
780    pub values: std::collections::HashMap<std::string::String, std::string::String>,
781
782    /// Optional. Deploy parameters are applied to targets with match labels.
783    /// If unspecified, deploy parameters are applied to all targets (including
784    /// child targets of a multi-target).
785    pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
786
787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
788}
789
790impl DeployParameters {
791    pub fn new() -> Self {
792        std::default::Default::default()
793    }
794
795    /// Sets the value of [values][crate::model::DeployParameters::values].
796    ///
797    /// # Example
798    /// ```ignore,no_run
799    /// # use google_cloud_deploy_v1::model::DeployParameters;
800    /// let x = DeployParameters::new().set_values([
801    ///     ("key0", "abc"),
802    ///     ("key1", "xyz"),
803    /// ]);
804    /// ```
805    pub fn set_values<T, K, V>(mut self, v: T) -> Self
806    where
807        T: std::iter::IntoIterator<Item = (K, V)>,
808        K: std::convert::Into<std::string::String>,
809        V: std::convert::Into<std::string::String>,
810    {
811        use std::iter::Iterator;
812        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
813        self
814    }
815
816    /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
817    ///
818    /// # Example
819    /// ```ignore,no_run
820    /// # use google_cloud_deploy_v1::model::DeployParameters;
821    /// let x = DeployParameters::new().set_match_target_labels([
822    ///     ("key0", "abc"),
823    ///     ("key1", "xyz"),
824    /// ]);
825    /// ```
826    pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
827    where
828        T: std::iter::IntoIterator<Item = (K, V)>,
829        K: std::convert::Into<std::string::String>,
830        V: std::convert::Into<std::string::String>,
831    {
832        use std::iter::Iterator;
833        self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
834        self
835    }
836}
837
838impl wkt::message::Message for DeployParameters {
839    fn typename() -> &'static str {
840        "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
841    }
842}
843
844/// Strategy contains deployment strategy information.
845#[derive(Clone, Default, PartialEq)]
846#[non_exhaustive]
847pub struct Strategy {
848    /// Deployment strategy details.
849    pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
850
851    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
852}
853
854impl Strategy {
855    pub fn new() -> Self {
856        std::default::Default::default()
857    }
858
859    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
860    ///
861    /// Note that all the setters affecting `deployment_strategy` are mutually
862    /// exclusive.
863    ///
864    /// # Example
865    /// ```ignore,no_run
866    /// # use google_cloud_deploy_v1::model::Strategy;
867    /// use google_cloud_deploy_v1::model::Standard;
868    /// let x = Strategy::new().set_deployment_strategy(Some(
869    ///     google_cloud_deploy_v1::model::strategy::DeploymentStrategy::Standard(Standard::default().into())));
870    /// ```
871    pub fn set_deployment_strategy<
872        T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
873    >(
874        mut self,
875        v: T,
876    ) -> Self {
877        self.deployment_strategy = v.into();
878        self
879    }
880
881    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
882    /// if it holds a `Standard`, `None` if the field is not set or
883    /// holds a different branch.
884    pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
885        #[allow(unreachable_patterns)]
886        self.deployment_strategy.as_ref().and_then(|v| match v {
887            crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
888            _ => std::option::Option::None,
889        })
890    }
891
892    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
893    /// to hold a `Standard`.
894    ///
895    /// Note that all the setters affecting `deployment_strategy` are
896    /// mutually exclusive.
897    ///
898    /// # Example
899    /// ```ignore,no_run
900    /// # use google_cloud_deploy_v1::model::Strategy;
901    /// use google_cloud_deploy_v1::model::Standard;
902    /// let x = Strategy::new().set_standard(Standard::default()/* use setters */);
903    /// assert!(x.standard().is_some());
904    /// assert!(x.canary().is_none());
905    /// ```
906    pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
907        mut self,
908        v: T,
909    ) -> Self {
910        self.deployment_strategy = std::option::Option::Some(
911            crate::model::strategy::DeploymentStrategy::Standard(v.into()),
912        );
913        self
914    }
915
916    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
917    /// if it holds a `Canary`, `None` if the field is not set or
918    /// holds a different branch.
919    pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
920        #[allow(unreachable_patterns)]
921        self.deployment_strategy.as_ref().and_then(|v| match v {
922            crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
923            _ => std::option::Option::None,
924        })
925    }
926
927    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
928    /// to hold a `Canary`.
929    ///
930    /// Note that all the setters affecting `deployment_strategy` are
931    /// mutually exclusive.
932    ///
933    /// # Example
934    /// ```ignore,no_run
935    /// # use google_cloud_deploy_v1::model::Strategy;
936    /// use google_cloud_deploy_v1::model::Canary;
937    /// let x = Strategy::new().set_canary(Canary::default()/* use setters */);
938    /// assert!(x.canary().is_some());
939    /// assert!(x.standard().is_none());
940    /// ```
941    pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
942        mut self,
943        v: T,
944    ) -> Self {
945        self.deployment_strategy =
946            std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
947        self
948    }
949}
950
951impl wkt::message::Message for Strategy {
952    fn typename() -> &'static str {
953        "type.googleapis.com/google.cloud.deploy.v1.Strategy"
954    }
955}
956
957/// Defines additional types related to [Strategy].
958pub mod strategy {
959    #[allow(unused_imports)]
960    use super::*;
961
962    /// Deployment strategy details.
963    #[derive(Clone, Debug, PartialEq)]
964    #[non_exhaustive]
965    pub enum DeploymentStrategy {
966        /// Optional. Standard deployment strategy executes a single deploy and
967        /// allows verifying the deployment.
968        Standard(std::boxed::Box<crate::model::Standard>),
969        /// Optional. Canary deployment strategy provides progressive percentage
970        /// based deployments to a Target.
971        Canary(std::boxed::Box<crate::model::Canary>),
972    }
973}
974
975/// Predeploy contains the predeploy job configuration information.
976#[derive(Clone, Default, PartialEq)]
977#[non_exhaustive]
978pub struct Predeploy {
979    /// Optional. A sequence of Skaffold custom actions to invoke during execution
980    /// of the predeploy job.
981    pub actions: std::vec::Vec<std::string::String>,
982
983    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984}
985
986impl Predeploy {
987    pub fn new() -> Self {
988        std::default::Default::default()
989    }
990
991    /// Sets the value of [actions][crate::model::Predeploy::actions].
992    ///
993    /// # Example
994    /// ```ignore,no_run
995    /// # use google_cloud_deploy_v1::model::Predeploy;
996    /// let x = Predeploy::new().set_actions(["a", "b", "c"]);
997    /// ```
998    pub fn set_actions<T, V>(mut self, v: T) -> Self
999    where
1000        T: std::iter::IntoIterator<Item = V>,
1001        V: std::convert::Into<std::string::String>,
1002    {
1003        use std::iter::Iterator;
1004        self.actions = v.into_iter().map(|i| i.into()).collect();
1005        self
1006    }
1007}
1008
1009impl wkt::message::Message for Predeploy {
1010    fn typename() -> &'static str {
1011        "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
1012    }
1013}
1014
1015/// Postdeploy contains the postdeploy job configuration information.
1016#[derive(Clone, Default, PartialEq)]
1017#[non_exhaustive]
1018pub struct Postdeploy {
1019    /// Optional. A sequence of Skaffold custom actions to invoke during execution
1020    /// of the postdeploy job.
1021    pub actions: std::vec::Vec<std::string::String>,
1022
1023    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1024}
1025
1026impl Postdeploy {
1027    pub fn new() -> Self {
1028        std::default::Default::default()
1029    }
1030
1031    /// Sets the value of [actions][crate::model::Postdeploy::actions].
1032    ///
1033    /// # Example
1034    /// ```ignore,no_run
1035    /// # use google_cloud_deploy_v1::model::Postdeploy;
1036    /// let x = Postdeploy::new().set_actions(["a", "b", "c"]);
1037    /// ```
1038    pub fn set_actions<T, V>(mut self, v: T) -> Self
1039    where
1040        T: std::iter::IntoIterator<Item = V>,
1041        V: std::convert::Into<std::string::String>,
1042    {
1043        use std::iter::Iterator;
1044        self.actions = v.into_iter().map(|i| i.into()).collect();
1045        self
1046    }
1047}
1048
1049impl wkt::message::Message for Postdeploy {
1050    fn typename() -> &'static str {
1051        "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
1052    }
1053}
1054
1055/// Standard represents the standard deployment strategy.
1056#[derive(Clone, Default, PartialEq)]
1057#[non_exhaustive]
1058pub struct Standard {
1059    /// Optional. Whether to verify a deployment via `skaffold verify`.
1060    pub verify: bool,
1061
1062    /// Optional. Configuration for the predeploy job. If this is not configured,
1063    /// the predeploy job will not be present.
1064    pub predeploy: std::option::Option<crate::model::Predeploy>,
1065
1066    /// Optional. Configuration for the postdeploy job. If this is not configured,
1067    /// the postdeploy job will not be present.
1068    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1069
1070    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1071}
1072
1073impl Standard {
1074    pub fn new() -> Self {
1075        std::default::Default::default()
1076    }
1077
1078    /// Sets the value of [verify][crate::model::Standard::verify].
1079    ///
1080    /// # Example
1081    /// ```ignore,no_run
1082    /// # use google_cloud_deploy_v1::model::Standard;
1083    /// let x = Standard::new().set_verify(true);
1084    /// ```
1085    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1086        self.verify = v.into();
1087        self
1088    }
1089
1090    /// Sets the value of [predeploy][crate::model::Standard::predeploy].
1091    ///
1092    /// # Example
1093    /// ```ignore,no_run
1094    /// # use google_cloud_deploy_v1::model::Standard;
1095    /// use google_cloud_deploy_v1::model::Predeploy;
1096    /// let x = Standard::new().set_predeploy(Predeploy::default()/* use setters */);
1097    /// ```
1098    pub fn set_predeploy<T>(mut self, v: T) -> Self
1099    where
1100        T: std::convert::Into<crate::model::Predeploy>,
1101    {
1102        self.predeploy = std::option::Option::Some(v.into());
1103        self
1104    }
1105
1106    /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
1107    ///
1108    /// # Example
1109    /// ```ignore,no_run
1110    /// # use google_cloud_deploy_v1::model::Standard;
1111    /// use google_cloud_deploy_v1::model::Predeploy;
1112    /// let x = Standard::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1113    /// let x = Standard::new().set_or_clear_predeploy(None::<Predeploy>);
1114    /// ```
1115    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1116    where
1117        T: std::convert::Into<crate::model::Predeploy>,
1118    {
1119        self.predeploy = v.map(|x| x.into());
1120        self
1121    }
1122
1123    /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
1124    ///
1125    /// # Example
1126    /// ```ignore,no_run
1127    /// # use google_cloud_deploy_v1::model::Standard;
1128    /// use google_cloud_deploy_v1::model::Postdeploy;
1129    /// let x = Standard::new().set_postdeploy(Postdeploy::default()/* use setters */);
1130    /// ```
1131    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1132    where
1133        T: std::convert::Into<crate::model::Postdeploy>,
1134    {
1135        self.postdeploy = std::option::Option::Some(v.into());
1136        self
1137    }
1138
1139    /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
1140    ///
1141    /// # Example
1142    /// ```ignore,no_run
1143    /// # use google_cloud_deploy_v1::model::Standard;
1144    /// use google_cloud_deploy_v1::model::Postdeploy;
1145    /// let x = Standard::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1146    /// let x = Standard::new().set_or_clear_postdeploy(None::<Postdeploy>);
1147    /// ```
1148    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1149    where
1150        T: std::convert::Into<crate::model::Postdeploy>,
1151    {
1152        self.postdeploy = v.map(|x| x.into());
1153        self
1154    }
1155}
1156
1157impl wkt::message::Message for Standard {
1158    fn typename() -> &'static str {
1159        "type.googleapis.com/google.cloud.deploy.v1.Standard"
1160    }
1161}
1162
1163/// Canary represents the canary deployment strategy.
1164#[derive(Clone, Default, PartialEq)]
1165#[non_exhaustive]
1166pub struct Canary {
1167    /// Optional. Runtime specific configurations for the deployment strategy. The
1168    /// runtime configuration is used to determine how Cloud Deploy will split
1169    /// traffic to enable a progressive deployment.
1170    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1171
1172    /// The mode to use for the canary deployment strategy.
1173    pub mode: std::option::Option<crate::model::canary::Mode>,
1174
1175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1176}
1177
1178impl Canary {
1179    pub fn new() -> Self {
1180        std::default::Default::default()
1181    }
1182
1183    /// Sets the value of [runtime_config][crate::model::Canary::runtime_config].
1184    ///
1185    /// # Example
1186    /// ```ignore,no_run
1187    /// # use google_cloud_deploy_v1::model::Canary;
1188    /// use google_cloud_deploy_v1::model::RuntimeConfig;
1189    /// let x = Canary::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
1190    /// ```
1191    pub fn set_runtime_config<T>(mut self, v: T) -> Self
1192    where
1193        T: std::convert::Into<crate::model::RuntimeConfig>,
1194    {
1195        self.runtime_config = std::option::Option::Some(v.into());
1196        self
1197    }
1198
1199    /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
1200    ///
1201    /// # Example
1202    /// ```ignore,no_run
1203    /// # use google_cloud_deploy_v1::model::Canary;
1204    /// use google_cloud_deploy_v1::model::RuntimeConfig;
1205    /// let x = Canary::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
1206    /// let x = Canary::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
1207    /// ```
1208    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1209    where
1210        T: std::convert::Into<crate::model::RuntimeConfig>,
1211    {
1212        self.runtime_config = v.map(|x| x.into());
1213        self
1214    }
1215
1216    /// Sets the value of [mode][crate::model::Canary::mode].
1217    ///
1218    /// Note that all the setters affecting `mode` are mutually
1219    /// exclusive.
1220    ///
1221    /// # Example
1222    /// ```ignore,no_run
1223    /// # use google_cloud_deploy_v1::model::Canary;
1224    /// use google_cloud_deploy_v1::model::CanaryDeployment;
1225    /// let x = Canary::new().set_mode(Some(
1226    ///     google_cloud_deploy_v1::model::canary::Mode::CanaryDeployment(CanaryDeployment::default().into())));
1227    /// ```
1228    pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
1229        mut self,
1230        v: T,
1231    ) -> Self {
1232        self.mode = v.into();
1233        self
1234    }
1235
1236    /// The value of [mode][crate::model::Canary::mode]
1237    /// if it holds a `CanaryDeployment`, `None` if the field is not set or
1238    /// holds a different branch.
1239    pub fn canary_deployment(
1240        &self,
1241    ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
1242        #[allow(unreachable_patterns)]
1243        self.mode.as_ref().and_then(|v| match v {
1244            crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
1245            _ => std::option::Option::None,
1246        })
1247    }
1248
1249    /// Sets the value of [mode][crate::model::Canary::mode]
1250    /// to hold a `CanaryDeployment`.
1251    ///
1252    /// Note that all the setters affecting `mode` are
1253    /// mutually exclusive.
1254    ///
1255    /// # Example
1256    /// ```ignore,no_run
1257    /// # use google_cloud_deploy_v1::model::Canary;
1258    /// use google_cloud_deploy_v1::model::CanaryDeployment;
1259    /// let x = Canary::new().set_canary_deployment(CanaryDeployment::default()/* use setters */);
1260    /// assert!(x.canary_deployment().is_some());
1261    /// assert!(x.custom_canary_deployment().is_none());
1262    /// ```
1263    pub fn set_canary_deployment<
1264        T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
1265    >(
1266        mut self,
1267        v: T,
1268    ) -> Self {
1269        self.mode =
1270            std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
1271        self
1272    }
1273
1274    /// The value of [mode][crate::model::Canary::mode]
1275    /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
1276    /// holds a different branch.
1277    pub fn custom_canary_deployment(
1278        &self,
1279    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
1280        #[allow(unreachable_patterns)]
1281        self.mode.as_ref().and_then(|v| match v {
1282            crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
1283            _ => std::option::Option::None,
1284        })
1285    }
1286
1287    /// Sets the value of [mode][crate::model::Canary::mode]
1288    /// to hold a `CustomCanaryDeployment`.
1289    ///
1290    /// Note that all the setters affecting `mode` are
1291    /// mutually exclusive.
1292    ///
1293    /// # Example
1294    /// ```ignore,no_run
1295    /// # use google_cloud_deploy_v1::model::Canary;
1296    /// use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1297    /// let x = Canary::new().set_custom_canary_deployment(CustomCanaryDeployment::default()/* use setters */);
1298    /// assert!(x.custom_canary_deployment().is_some());
1299    /// assert!(x.canary_deployment().is_none());
1300    /// ```
1301    pub fn set_custom_canary_deployment<
1302        T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
1303    >(
1304        mut self,
1305        v: T,
1306    ) -> Self {
1307        self.mode =
1308            std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
1309        self
1310    }
1311}
1312
1313impl wkt::message::Message for Canary {
1314    fn typename() -> &'static str {
1315        "type.googleapis.com/google.cloud.deploy.v1.Canary"
1316    }
1317}
1318
1319/// Defines additional types related to [Canary].
1320pub mod canary {
1321    #[allow(unused_imports)]
1322    use super::*;
1323
1324    /// The mode to use for the canary deployment strategy.
1325    #[derive(Clone, Debug, PartialEq)]
1326    #[non_exhaustive]
1327    pub enum Mode {
1328        /// Optional. Configures the progressive based deployment for a Target.
1329        CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
1330        /// Optional. Configures the progressive based deployment for a Target, but
1331        /// allows customizing at the phase level where a phase represents each of
1332        /// the percentage deployments.
1333        CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
1334    }
1335}
1336
1337/// CanaryDeployment represents the canary deployment configuration
1338#[derive(Clone, Default, PartialEq)]
1339#[non_exhaustive]
1340pub struct CanaryDeployment {
1341    /// Required. The percentage based deployments that will occur as a part of a
1342    /// `Rollout`. List is expected in ascending order and each integer n is
1343    /// 0 <= n < 100.
1344    /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
1345    /// n is 0 <= n <= 100.
1346    pub percentages: std::vec::Vec<i32>,
1347
1348    /// Optional. Whether to run verify tests after each percentage deployment via
1349    /// `skaffold verify`.
1350    pub verify: bool,
1351
1352    /// Optional. Configuration for the predeploy job of the first phase. If this
1353    /// is not configured, there will be no predeploy job for this phase.
1354    pub predeploy: std::option::Option<crate::model::Predeploy>,
1355
1356    /// Optional. Configuration for the postdeploy job of the last phase. If this
1357    /// is not configured, there will be no postdeploy job for this phase.
1358    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1359
1360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1361}
1362
1363impl CanaryDeployment {
1364    pub fn new() -> Self {
1365        std::default::Default::default()
1366    }
1367
1368    /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1369    ///
1370    /// # Example
1371    /// ```ignore,no_run
1372    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1373    /// let x = CanaryDeployment::new().set_percentages([1, 2, 3]);
1374    /// ```
1375    pub fn set_percentages<T, V>(mut self, v: T) -> Self
1376    where
1377        T: std::iter::IntoIterator<Item = V>,
1378        V: std::convert::Into<i32>,
1379    {
1380        use std::iter::Iterator;
1381        self.percentages = v.into_iter().map(|i| i.into()).collect();
1382        self
1383    }
1384
1385    /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1386    ///
1387    /// # Example
1388    /// ```ignore,no_run
1389    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1390    /// let x = CanaryDeployment::new().set_verify(true);
1391    /// ```
1392    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1393        self.verify = v.into();
1394        self
1395    }
1396
1397    /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1398    ///
1399    /// # Example
1400    /// ```ignore,no_run
1401    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1402    /// use google_cloud_deploy_v1::model::Predeploy;
1403    /// let x = CanaryDeployment::new().set_predeploy(Predeploy::default()/* use setters */);
1404    /// ```
1405    pub fn set_predeploy<T>(mut self, v: T) -> Self
1406    where
1407        T: std::convert::Into<crate::model::Predeploy>,
1408    {
1409        self.predeploy = std::option::Option::Some(v.into());
1410        self
1411    }
1412
1413    /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1414    ///
1415    /// # Example
1416    /// ```ignore,no_run
1417    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1418    /// use google_cloud_deploy_v1::model::Predeploy;
1419    /// let x = CanaryDeployment::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1420    /// let x = CanaryDeployment::new().set_or_clear_predeploy(None::<Predeploy>);
1421    /// ```
1422    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1423    where
1424        T: std::convert::Into<crate::model::Predeploy>,
1425    {
1426        self.predeploy = v.map(|x| x.into());
1427        self
1428    }
1429
1430    /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1431    ///
1432    /// # Example
1433    /// ```ignore,no_run
1434    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1435    /// use google_cloud_deploy_v1::model::Postdeploy;
1436    /// let x = CanaryDeployment::new().set_postdeploy(Postdeploy::default()/* use setters */);
1437    /// ```
1438    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1439    where
1440        T: std::convert::Into<crate::model::Postdeploy>,
1441    {
1442        self.postdeploy = std::option::Option::Some(v.into());
1443        self
1444    }
1445
1446    /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1447    ///
1448    /// # Example
1449    /// ```ignore,no_run
1450    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1451    /// use google_cloud_deploy_v1::model::Postdeploy;
1452    /// let x = CanaryDeployment::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1453    /// let x = CanaryDeployment::new().set_or_clear_postdeploy(None::<Postdeploy>);
1454    /// ```
1455    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1456    where
1457        T: std::convert::Into<crate::model::Postdeploy>,
1458    {
1459        self.postdeploy = v.map(|x| x.into());
1460        self
1461    }
1462}
1463
1464impl wkt::message::Message for CanaryDeployment {
1465    fn typename() -> &'static str {
1466        "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1467    }
1468}
1469
1470/// CustomCanaryDeployment represents the custom canary deployment
1471/// configuration.
1472#[derive(Clone, Default, PartialEq)]
1473#[non_exhaustive]
1474pub struct CustomCanaryDeployment {
1475    /// Required. Configuration for each phase in the canary deployment in the
1476    /// order executed.
1477    pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1478
1479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1480}
1481
1482impl CustomCanaryDeployment {
1483    pub fn new() -> Self {
1484        std::default::Default::default()
1485    }
1486
1487    /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1488    ///
1489    /// # Example
1490    /// ```ignore,no_run
1491    /// # use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1492    /// use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1493    /// let x = CustomCanaryDeployment::new()
1494    ///     .set_phase_configs([
1495    ///         PhaseConfig::default()/* use setters */,
1496    ///         PhaseConfig::default()/* use (different) setters */,
1497    ///     ]);
1498    /// ```
1499    pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1500    where
1501        T: std::iter::IntoIterator<Item = V>,
1502        V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1503    {
1504        use std::iter::Iterator;
1505        self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1506        self
1507    }
1508}
1509
1510impl wkt::message::Message for CustomCanaryDeployment {
1511    fn typename() -> &'static str {
1512        "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1513    }
1514}
1515
1516/// Defines additional types related to [CustomCanaryDeployment].
1517pub mod custom_canary_deployment {
1518    #[allow(unused_imports)]
1519    use super::*;
1520
1521    /// PhaseConfig represents the configuration for a phase in the custom
1522    /// canary deployment.
1523    #[derive(Clone, Default, PartialEq)]
1524    #[non_exhaustive]
1525    pub struct PhaseConfig {
1526        /// Required. The ID to assign to the `Rollout` phase.
1527        /// This value must consist of lower-case letters, numbers, and hyphens,
1528        /// start with a letter and end with a letter or a number, and have a max
1529        /// length of 63 characters. In other words, it must match the following
1530        /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1531        pub phase_id: std::string::String,
1532
1533        /// Required. Percentage deployment for the phase.
1534        pub percentage: i32,
1535
1536        /// Optional. Skaffold profiles to use when rendering the manifest for this
1537        /// phase. These are in addition to the profiles list specified in the
1538        /// `DeliveryPipeline` stage.
1539        pub profiles: std::vec::Vec<std::string::String>,
1540
1541        /// Optional. Whether to run verify tests after the deployment via `skaffold
1542        /// verify`.
1543        pub verify: bool,
1544
1545        /// Optional. Configuration for the predeploy job of this phase. If this is
1546        /// not configured, there will be no predeploy job for this phase.
1547        pub predeploy: std::option::Option<crate::model::Predeploy>,
1548
1549        /// Optional. Configuration for the postdeploy job of this phase. If this is
1550        /// not configured, there will be no postdeploy job for this phase.
1551        pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1552
1553        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1554    }
1555
1556    impl PhaseConfig {
1557        pub fn new() -> Self {
1558            std::default::Default::default()
1559        }
1560
1561        /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1562        ///
1563        /// # Example
1564        /// ```ignore,no_run
1565        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1566        /// let x = PhaseConfig::new().set_phase_id("example");
1567        /// ```
1568        pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1569            self.phase_id = v.into();
1570            self
1571        }
1572
1573        /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1574        ///
1575        /// # Example
1576        /// ```ignore,no_run
1577        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1578        /// let x = PhaseConfig::new().set_percentage(42);
1579        /// ```
1580        pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1581            self.percentage = v.into();
1582            self
1583        }
1584
1585        /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1586        ///
1587        /// # Example
1588        /// ```ignore,no_run
1589        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1590        /// let x = PhaseConfig::new().set_profiles(["a", "b", "c"]);
1591        /// ```
1592        pub fn set_profiles<T, V>(mut self, v: T) -> Self
1593        where
1594            T: std::iter::IntoIterator<Item = V>,
1595            V: std::convert::Into<std::string::String>,
1596        {
1597            use std::iter::Iterator;
1598            self.profiles = v.into_iter().map(|i| i.into()).collect();
1599            self
1600        }
1601
1602        /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1603        ///
1604        /// # Example
1605        /// ```ignore,no_run
1606        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1607        /// let x = PhaseConfig::new().set_verify(true);
1608        /// ```
1609        pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1610            self.verify = v.into();
1611            self
1612        }
1613
1614        /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1615        ///
1616        /// # Example
1617        /// ```ignore,no_run
1618        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1619        /// use google_cloud_deploy_v1::model::Predeploy;
1620        /// let x = PhaseConfig::new().set_predeploy(Predeploy::default()/* use setters */);
1621        /// ```
1622        pub fn set_predeploy<T>(mut self, v: T) -> Self
1623        where
1624            T: std::convert::Into<crate::model::Predeploy>,
1625        {
1626            self.predeploy = std::option::Option::Some(v.into());
1627            self
1628        }
1629
1630        /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1631        ///
1632        /// # Example
1633        /// ```ignore,no_run
1634        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1635        /// use google_cloud_deploy_v1::model::Predeploy;
1636        /// let x = PhaseConfig::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1637        /// let x = PhaseConfig::new().set_or_clear_predeploy(None::<Predeploy>);
1638        /// ```
1639        pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1640        where
1641            T: std::convert::Into<crate::model::Predeploy>,
1642        {
1643            self.predeploy = v.map(|x| x.into());
1644            self
1645        }
1646
1647        /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1648        ///
1649        /// # Example
1650        /// ```ignore,no_run
1651        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1652        /// use google_cloud_deploy_v1::model::Postdeploy;
1653        /// let x = PhaseConfig::new().set_postdeploy(Postdeploy::default()/* use setters */);
1654        /// ```
1655        pub fn set_postdeploy<T>(mut self, v: T) -> Self
1656        where
1657            T: std::convert::Into<crate::model::Postdeploy>,
1658        {
1659            self.postdeploy = std::option::Option::Some(v.into());
1660            self
1661        }
1662
1663        /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1664        ///
1665        /// # Example
1666        /// ```ignore,no_run
1667        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1668        /// use google_cloud_deploy_v1::model::Postdeploy;
1669        /// let x = PhaseConfig::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1670        /// let x = PhaseConfig::new().set_or_clear_postdeploy(None::<Postdeploy>);
1671        /// ```
1672        pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1673        where
1674            T: std::convert::Into<crate::model::Postdeploy>,
1675        {
1676            self.postdeploy = v.map(|x| x.into());
1677            self
1678        }
1679    }
1680
1681    impl wkt::message::Message for PhaseConfig {
1682        fn typename() -> &'static str {
1683            "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1684        }
1685    }
1686}
1687
1688/// KubernetesConfig contains the Kubernetes runtime configuration.
1689#[derive(Clone, Default, PartialEq)]
1690#[non_exhaustive]
1691pub struct KubernetesConfig {
1692    /// The service definition configuration.
1693    pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1694
1695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1696}
1697
1698impl KubernetesConfig {
1699    pub fn new() -> Self {
1700        std::default::Default::default()
1701    }
1702
1703    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1704    ///
1705    /// Note that all the setters affecting `service_definition` are mutually
1706    /// exclusive.
1707    ///
1708    /// # Example
1709    /// ```ignore,no_run
1710    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1711    /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1712    /// let x = KubernetesConfig::new().set_service_definition(Some(
1713    ///     google_cloud_deploy_v1::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(GatewayServiceMesh::default().into())));
1714    /// ```
1715    pub fn set_service_definition<
1716        T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1717    >(
1718        mut self,
1719        v: T,
1720    ) -> Self {
1721        self.service_definition = v.into();
1722        self
1723    }
1724
1725    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1726    /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1727    /// holds a different branch.
1728    pub fn gateway_service_mesh(
1729        &self,
1730    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1731    {
1732        #[allow(unreachable_patterns)]
1733        self.service_definition.as_ref().and_then(|v| match v {
1734            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1735                std::option::Option::Some(v)
1736            }
1737            _ => std::option::Option::None,
1738        })
1739    }
1740
1741    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1742    /// to hold a `GatewayServiceMesh`.
1743    ///
1744    /// Note that all the setters affecting `service_definition` are
1745    /// mutually exclusive.
1746    ///
1747    /// # Example
1748    /// ```ignore,no_run
1749    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1750    /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1751    /// let x = KubernetesConfig::new().set_gateway_service_mesh(GatewayServiceMesh::default()/* use setters */);
1752    /// assert!(x.gateway_service_mesh().is_some());
1753    /// assert!(x.service_networking().is_none());
1754    /// ```
1755    pub fn set_gateway_service_mesh<
1756        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1757    >(
1758        mut self,
1759        v: T,
1760    ) -> Self {
1761        self.service_definition = std::option::Option::Some(
1762            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1763        );
1764        self
1765    }
1766
1767    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1768    /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1769    /// holds a different branch.
1770    pub fn service_networking(
1771        &self,
1772    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1773    {
1774        #[allow(unreachable_patterns)]
1775        self.service_definition.as_ref().and_then(|v| match v {
1776            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1777                std::option::Option::Some(v)
1778            }
1779            _ => std::option::Option::None,
1780        })
1781    }
1782
1783    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1784    /// to hold a `ServiceNetworking`.
1785    ///
1786    /// Note that all the setters affecting `service_definition` are
1787    /// mutually exclusive.
1788    ///
1789    /// # Example
1790    /// ```ignore,no_run
1791    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1792    /// use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
1793    /// let x = KubernetesConfig::new().set_service_networking(ServiceNetworking::default()/* use setters */);
1794    /// assert!(x.service_networking().is_some());
1795    /// assert!(x.gateway_service_mesh().is_none());
1796    /// ```
1797    pub fn set_service_networking<
1798        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1799    >(
1800        mut self,
1801        v: T,
1802    ) -> Self {
1803        self.service_definition = std::option::Option::Some(
1804            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1805        );
1806        self
1807    }
1808}
1809
1810impl wkt::message::Message for KubernetesConfig {
1811    fn typename() -> &'static str {
1812        "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1813    }
1814}
1815
1816/// Defines additional types related to [KubernetesConfig].
1817pub mod kubernetes_config {
1818    #[allow(unused_imports)]
1819    use super::*;
1820
1821    /// Information about the Kubernetes Gateway API service mesh configuration.
1822    #[derive(Clone, Default, PartialEq)]
1823    #[non_exhaustive]
1824    pub struct GatewayServiceMesh {
1825        /// Required. Name of the Gateway API HTTPRoute.
1826        pub http_route: std::string::String,
1827
1828        /// Required. Name of the Kubernetes Service.
1829        pub service: std::string::String,
1830
1831        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1832        /// the specified HTTPRoute and Service.
1833        pub deployment: std::string::String,
1834
1835        /// Optional. The time to wait for route updates to propagate. The maximum
1836        /// configurable time is 3 hours, in seconds format. If unspecified, there is
1837        /// no wait time.
1838        pub route_update_wait_time: std::option::Option<wkt::Duration>,
1839
1840        /// Optional. The amount of time to migrate traffic back from the canary
1841        /// Service to the original Service during the stable phase deployment. If
1842        /// specified, must be between 15s and 3600s. If unspecified, there is no
1843        /// cutback time.
1844        pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1845
1846        /// Optional. The label to use when selecting Pods for the Deployment and
1847        /// Service resources. This label must already be present in both resources.
1848        pub pod_selector_label: std::string::String,
1849
1850        /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1851        /// to be deployed to additional clusters. This option is available for
1852        /// multi-cluster service mesh set ups that require the route to exist in the
1853        /// clusters that call the service. If unspecified, the HTTPRoute will only
1854        /// be deployed to the Target cluster.
1855        pub route_destinations: std::option::Option<
1856            crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1857        >,
1858
1859        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1860    }
1861
1862    impl GatewayServiceMesh {
1863        pub fn new() -> Self {
1864            std::default::Default::default()
1865        }
1866
1867        /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1868        ///
1869        /// # Example
1870        /// ```ignore,no_run
1871        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1872        /// let x = GatewayServiceMesh::new().set_http_route("example");
1873        /// ```
1874        pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875            self.http_route = v.into();
1876            self
1877        }
1878
1879        /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1880        ///
1881        /// # Example
1882        /// ```ignore,no_run
1883        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1884        /// let x = GatewayServiceMesh::new().set_service("example");
1885        /// ```
1886        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1887            self.service = v.into();
1888            self
1889        }
1890
1891        /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1892        ///
1893        /// # Example
1894        /// ```ignore,no_run
1895        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1896        /// let x = GatewayServiceMesh::new().set_deployment("example");
1897        /// ```
1898        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1899            self.deployment = v.into();
1900            self
1901        }
1902
1903        /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1904        ///
1905        /// # Example
1906        /// ```ignore,no_run
1907        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1908        /// use wkt::Duration;
1909        /// let x = GatewayServiceMesh::new().set_route_update_wait_time(Duration::default()/* use setters */);
1910        /// ```
1911        pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1912        where
1913            T: std::convert::Into<wkt::Duration>,
1914        {
1915            self.route_update_wait_time = std::option::Option::Some(v.into());
1916            self
1917        }
1918
1919        /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1920        ///
1921        /// # Example
1922        /// ```ignore,no_run
1923        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1924        /// use wkt::Duration;
1925        /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(Some(Duration::default()/* use setters */));
1926        /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(None::<Duration>);
1927        /// ```
1928        pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1929        where
1930            T: std::convert::Into<wkt::Duration>,
1931        {
1932            self.route_update_wait_time = v.map(|x| x.into());
1933            self
1934        }
1935
1936        /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1937        ///
1938        /// # Example
1939        /// ```ignore,no_run
1940        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1941        /// use wkt::Duration;
1942        /// let x = GatewayServiceMesh::new().set_stable_cutback_duration(Duration::default()/* use setters */);
1943        /// ```
1944        pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1945        where
1946            T: std::convert::Into<wkt::Duration>,
1947        {
1948            self.stable_cutback_duration = std::option::Option::Some(v.into());
1949            self
1950        }
1951
1952        /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1953        ///
1954        /// # Example
1955        /// ```ignore,no_run
1956        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1957        /// use wkt::Duration;
1958        /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(Some(Duration::default()/* use setters */));
1959        /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(None::<Duration>);
1960        /// ```
1961        pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1962        where
1963            T: std::convert::Into<wkt::Duration>,
1964        {
1965            self.stable_cutback_duration = v.map(|x| x.into());
1966            self
1967        }
1968
1969        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1970        ///
1971        /// # Example
1972        /// ```ignore,no_run
1973        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1974        /// let x = GatewayServiceMesh::new().set_pod_selector_label("example");
1975        /// ```
1976        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1977            mut self,
1978            v: T,
1979        ) -> Self {
1980            self.pod_selector_label = v.into();
1981            self
1982        }
1983
1984        /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
1985        ///
1986        /// # Example
1987        /// ```ignore,no_run
1988        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1989        /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
1990        /// let x = GatewayServiceMesh::new().set_route_destinations(RouteDestinations::default()/* use setters */);
1991        /// ```
1992        pub fn set_route_destinations<T>(mut self, v: T) -> Self
1993        where
1994            T: std::convert::Into<
1995                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1996                >,
1997        {
1998            self.route_destinations = std::option::Option::Some(v.into());
1999            self
2000        }
2001
2002        /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2003        ///
2004        /// # Example
2005        /// ```ignore,no_run
2006        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2007        /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2008        /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(Some(RouteDestinations::default()/* use setters */));
2009        /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(None::<RouteDestinations>);
2010        /// ```
2011        pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
2012        where
2013            T: std::convert::Into<
2014                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2015                >,
2016        {
2017            self.route_destinations = v.map(|x| x.into());
2018            self
2019        }
2020    }
2021
2022    impl wkt::message::Message for GatewayServiceMesh {
2023        fn typename() -> &'static str {
2024            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
2025        }
2026    }
2027
2028    /// Defines additional types related to [GatewayServiceMesh].
2029    pub mod gateway_service_mesh {
2030        #[allow(unused_imports)]
2031        use super::*;
2032
2033        /// Information about route destinations for the Gateway API service mesh.
2034        #[derive(Clone, Default, PartialEq)]
2035        #[non_exhaustive]
2036        pub struct RouteDestinations {
2037            /// Required. The clusters where the Gateway API HTTPRoute resource will be
2038            /// deployed to. Valid entries include the associated entities IDs
2039            /// configured in the Target resource and "@self" to include the Target
2040            /// cluster.
2041            pub destination_ids: std::vec::Vec<std::string::String>,
2042
2043            /// Optional. Whether to propagate the Kubernetes Service to the route
2044            /// destination clusters. The Service will always be deployed to the Target
2045            /// cluster even if the HTTPRoute is not. This option may be used to
2046            /// facilitate successful DNS lookup in the route destination clusters. Can
2047            /// only be set to true if destinations are specified.
2048            pub propagate_service: bool,
2049
2050            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2051        }
2052
2053        impl RouteDestinations {
2054            pub fn new() -> Self {
2055                std::default::Default::default()
2056            }
2057
2058            /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
2059            ///
2060            /// # Example
2061            /// ```ignore,no_run
2062            /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2063            /// let x = RouteDestinations::new().set_destination_ids(["a", "b", "c"]);
2064            /// ```
2065            pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
2066            where
2067                T: std::iter::IntoIterator<Item = V>,
2068                V: std::convert::Into<std::string::String>,
2069            {
2070                use std::iter::Iterator;
2071                self.destination_ids = v.into_iter().map(|i| i.into()).collect();
2072                self
2073            }
2074
2075            /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
2076            ///
2077            /// # Example
2078            /// ```ignore,no_run
2079            /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2080            /// let x = RouteDestinations::new().set_propagate_service(true);
2081            /// ```
2082            pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2083                self.propagate_service = v.into();
2084                self
2085            }
2086        }
2087
2088        impl wkt::message::Message for RouteDestinations {
2089            fn typename() -> &'static str {
2090                "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
2091            }
2092        }
2093    }
2094
2095    /// Information about the Kubernetes Service networking configuration.
2096    #[derive(Clone, Default, PartialEq)]
2097    #[non_exhaustive]
2098    pub struct ServiceNetworking {
2099        /// Required. Name of the Kubernetes Service.
2100        pub service: std::string::String,
2101
2102        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
2103        /// the specified Service.
2104        pub deployment: std::string::String,
2105
2106        /// Optional. Whether to disable Pod overprovisioning. If Pod
2107        /// overprovisioning is disabled then Cloud Deploy will limit the number of
2108        /// total Pods used for the deployment strategy to the number of Pods the
2109        /// Deployment has on the cluster.
2110        pub disable_pod_overprovisioning: bool,
2111
2112        /// Optional. The label to use when selecting Pods for the Deployment
2113        /// resource. This label must already be present in the Deployment.
2114        pub pod_selector_label: std::string::String,
2115
2116        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2117    }
2118
2119    impl ServiceNetworking {
2120        pub fn new() -> Self {
2121            std::default::Default::default()
2122        }
2123
2124        /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
2125        ///
2126        /// # Example
2127        /// ```ignore,no_run
2128        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2129        /// let x = ServiceNetworking::new().set_service("example");
2130        /// ```
2131        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132            self.service = v.into();
2133            self
2134        }
2135
2136        /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
2137        ///
2138        /// # Example
2139        /// ```ignore,no_run
2140        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2141        /// let x = ServiceNetworking::new().set_deployment("example");
2142        /// ```
2143        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2144            self.deployment = v.into();
2145            self
2146        }
2147
2148        /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
2149        ///
2150        /// # Example
2151        /// ```ignore,no_run
2152        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2153        /// let x = ServiceNetworking::new().set_disable_pod_overprovisioning(true);
2154        /// ```
2155        pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
2156            mut self,
2157            v: T,
2158        ) -> Self {
2159            self.disable_pod_overprovisioning = v.into();
2160            self
2161        }
2162
2163        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
2164        ///
2165        /// # Example
2166        /// ```ignore,no_run
2167        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2168        /// let x = ServiceNetworking::new().set_pod_selector_label("example");
2169        /// ```
2170        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
2171            mut self,
2172            v: T,
2173        ) -> Self {
2174            self.pod_selector_label = v.into();
2175            self
2176        }
2177    }
2178
2179    impl wkt::message::Message for ServiceNetworking {
2180        fn typename() -> &'static str {
2181            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
2182        }
2183    }
2184
2185    /// The service definition configuration.
2186    #[derive(Clone, Debug, PartialEq)]
2187    #[non_exhaustive]
2188    pub enum ServiceDefinition {
2189        /// Optional. Kubernetes Gateway API service mesh configuration.
2190        GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
2191        /// Optional. Kubernetes Service networking configuration.
2192        ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
2193    }
2194}
2195
2196/// CloudRunConfig contains the Cloud Run runtime configuration.
2197#[derive(Clone, Default, PartialEq)]
2198#[non_exhaustive]
2199pub struct CloudRunConfig {
2200    /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
2201    /// Run Service on the user's behalf to facilitate traffic splitting. This is
2202    /// required to be true for CanaryDeployments, but optional for
2203    /// CustomCanaryDeployments.
2204    pub automatic_traffic_control: bool,
2205
2206    /// Optional. A list of tags that are added to the canary revision while the
2207    /// canary phase is in progress.
2208    pub canary_revision_tags: std::vec::Vec<std::string::String>,
2209
2210    /// Optional. A list of tags that are added to the prior revision while the
2211    /// canary phase is in progress.
2212    pub prior_revision_tags: std::vec::Vec<std::string::String>,
2213
2214    /// Optional. A list of tags that are added to the final stable revision when
2215    /// the stable phase is applied.
2216    pub stable_revision_tags: std::vec::Vec<std::string::String>,
2217
2218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2219}
2220
2221impl CloudRunConfig {
2222    pub fn new() -> Self {
2223        std::default::Default::default()
2224    }
2225
2226    /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
2227    ///
2228    /// # Example
2229    /// ```ignore,no_run
2230    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2231    /// let x = CloudRunConfig::new().set_automatic_traffic_control(true);
2232    /// ```
2233    pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2234        self.automatic_traffic_control = v.into();
2235        self
2236    }
2237
2238    /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
2239    ///
2240    /// # Example
2241    /// ```ignore,no_run
2242    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2243    /// let x = CloudRunConfig::new().set_canary_revision_tags(["a", "b", "c"]);
2244    /// ```
2245    pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
2246    where
2247        T: std::iter::IntoIterator<Item = V>,
2248        V: std::convert::Into<std::string::String>,
2249    {
2250        use std::iter::Iterator;
2251        self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
2252        self
2253    }
2254
2255    /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
2256    ///
2257    /// # Example
2258    /// ```ignore,no_run
2259    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2260    /// let x = CloudRunConfig::new().set_prior_revision_tags(["a", "b", "c"]);
2261    /// ```
2262    pub fn set_prior_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.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
2269        self
2270    }
2271
2272    /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
2273    ///
2274    /// # Example
2275    /// ```ignore,no_run
2276    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2277    /// let x = CloudRunConfig::new().set_stable_revision_tags(["a", "b", "c"]);
2278    /// ```
2279    pub fn set_stable_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.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
2286        self
2287    }
2288}
2289
2290impl wkt::message::Message for CloudRunConfig {
2291    fn typename() -> &'static str {
2292        "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
2293    }
2294}
2295
2296/// RuntimeConfig contains the runtime specific configurations for a deployment
2297/// strategy.
2298#[derive(Clone, Default, PartialEq)]
2299#[non_exhaustive]
2300pub struct RuntimeConfig {
2301    /// The runtime configuration details.
2302    pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
2303
2304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2305}
2306
2307impl RuntimeConfig {
2308    pub fn new() -> Self {
2309        std::default::Default::default()
2310    }
2311
2312    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
2313    ///
2314    /// Note that all the setters affecting `runtime_config` are mutually
2315    /// exclusive.
2316    ///
2317    /// # Example
2318    /// ```ignore,no_run
2319    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2320    /// use google_cloud_deploy_v1::model::KubernetesConfig;
2321    /// let x = RuntimeConfig::new().set_runtime_config(Some(
2322    ///     google_cloud_deploy_v1::model::runtime_config::RuntimeConfig::Kubernetes(KubernetesConfig::default().into())));
2323    /// ```
2324    pub fn set_runtime_config<
2325        T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
2326    >(
2327        mut self,
2328        v: T,
2329    ) -> Self {
2330        self.runtime_config = v.into();
2331        self
2332    }
2333
2334    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2335    /// if it holds a `Kubernetes`, `None` if the field is not set or
2336    /// holds a different branch.
2337    pub fn kubernetes(
2338        &self,
2339    ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
2340        #[allow(unreachable_patterns)]
2341        self.runtime_config.as_ref().and_then(|v| match v {
2342            crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
2343                std::option::Option::Some(v)
2344            }
2345            _ => std::option::Option::None,
2346        })
2347    }
2348
2349    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2350    /// to hold a `Kubernetes`.
2351    ///
2352    /// Note that all the setters affecting `runtime_config` are
2353    /// mutually exclusive.
2354    ///
2355    /// # Example
2356    /// ```ignore,no_run
2357    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2358    /// use google_cloud_deploy_v1::model::KubernetesConfig;
2359    /// let x = RuntimeConfig::new().set_kubernetes(KubernetesConfig::default()/* use setters */);
2360    /// assert!(x.kubernetes().is_some());
2361    /// assert!(x.cloud_run().is_none());
2362    /// ```
2363    pub fn set_kubernetes<
2364        T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
2365    >(
2366        mut self,
2367        v: T,
2368    ) -> Self {
2369        self.runtime_config = std::option::Option::Some(
2370            crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
2371        );
2372        self
2373    }
2374
2375    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2376    /// if it holds a `CloudRun`, `None` if the field is not set or
2377    /// holds a different branch.
2378    pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
2379        #[allow(unreachable_patterns)]
2380        self.runtime_config.as_ref().and_then(|v| match v {
2381            crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
2382                std::option::Option::Some(v)
2383            }
2384            _ => std::option::Option::None,
2385        })
2386    }
2387
2388    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2389    /// to hold a `CloudRun`.
2390    ///
2391    /// Note that all the setters affecting `runtime_config` are
2392    /// mutually exclusive.
2393    ///
2394    /// # Example
2395    /// ```ignore,no_run
2396    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2397    /// use google_cloud_deploy_v1::model::CloudRunConfig;
2398    /// let x = RuntimeConfig::new().set_cloud_run(CloudRunConfig::default()/* use setters */);
2399    /// assert!(x.cloud_run().is_some());
2400    /// assert!(x.kubernetes().is_none());
2401    /// ```
2402    pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
2403        mut self,
2404        v: T,
2405    ) -> Self {
2406        self.runtime_config = std::option::Option::Some(
2407            crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
2408        );
2409        self
2410    }
2411}
2412
2413impl wkt::message::Message for RuntimeConfig {
2414    fn typename() -> &'static str {
2415        "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
2416    }
2417}
2418
2419/// Defines additional types related to [RuntimeConfig].
2420pub mod runtime_config {
2421    #[allow(unused_imports)]
2422    use super::*;
2423
2424    /// The runtime configuration details.
2425    #[derive(Clone, Debug, PartialEq)]
2426    #[non_exhaustive]
2427    pub enum RuntimeConfig {
2428        /// Optional. Kubernetes runtime configuration.
2429        Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
2430        /// Optional. Cloud Run runtime configuration.
2431        CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
2432    }
2433}
2434
2435/// PipelineReadyCondition contains information around the status of the
2436/// Pipeline.
2437#[derive(Clone, Default, PartialEq)]
2438#[non_exhaustive]
2439pub struct PipelineReadyCondition {
2440    /// True if the Pipeline is in a valid state. Otherwise at least one condition
2441    /// in `PipelineCondition` is in an invalid state. Iterate over those
2442    /// conditions and see which condition(s) has status = false to find out what
2443    /// is wrong with the Pipeline.
2444    pub status: bool,
2445
2446    /// Last time the condition was updated.
2447    pub update_time: std::option::Option<wkt::Timestamp>,
2448
2449    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2450}
2451
2452impl PipelineReadyCondition {
2453    pub fn new() -> Self {
2454        std::default::Default::default()
2455    }
2456
2457    /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
2458    ///
2459    /// # Example
2460    /// ```ignore,no_run
2461    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2462    /// let x = PipelineReadyCondition::new().set_status(true);
2463    /// ```
2464    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2465        self.status = v.into();
2466        self
2467    }
2468
2469    /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2470    ///
2471    /// # Example
2472    /// ```ignore,no_run
2473    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2474    /// use wkt::Timestamp;
2475    /// let x = PipelineReadyCondition::new().set_update_time(Timestamp::default()/* use setters */);
2476    /// ```
2477    pub fn set_update_time<T>(mut self, v: T) -> Self
2478    where
2479        T: std::convert::Into<wkt::Timestamp>,
2480    {
2481        self.update_time = std::option::Option::Some(v.into());
2482        self
2483    }
2484
2485    /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2486    ///
2487    /// # Example
2488    /// ```ignore,no_run
2489    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2490    /// use wkt::Timestamp;
2491    /// let x = PipelineReadyCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2492    /// let x = PipelineReadyCondition::new().set_or_clear_update_time(None::<Timestamp>);
2493    /// ```
2494    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2495    where
2496        T: std::convert::Into<wkt::Timestamp>,
2497    {
2498        self.update_time = v.map(|x| x.into());
2499        self
2500    }
2501}
2502
2503impl wkt::message::Message for PipelineReadyCondition {
2504    fn typename() -> &'static str {
2505        "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
2506    }
2507}
2508
2509/// `TargetsPresentCondition` contains information on any Targets referenced in
2510/// the Delivery Pipeline that do not actually exist.
2511#[derive(Clone, Default, PartialEq)]
2512#[non_exhaustive]
2513pub struct TargetsPresentCondition {
2514    /// True if there aren't any missing Targets.
2515    pub status: bool,
2516
2517    /// The list of Target names that do not exist. For example,
2518    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
2519    pub missing_targets: std::vec::Vec<std::string::String>,
2520
2521    /// Last time the condition was updated.
2522    pub update_time: std::option::Option<wkt::Timestamp>,
2523
2524    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2525}
2526
2527impl TargetsPresentCondition {
2528    pub fn new() -> Self {
2529        std::default::Default::default()
2530    }
2531
2532    /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
2533    ///
2534    /// # Example
2535    /// ```ignore,no_run
2536    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2537    /// let x = TargetsPresentCondition::new().set_status(true);
2538    /// ```
2539    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2540        self.status = v.into();
2541        self
2542    }
2543
2544    /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
2545    ///
2546    /// # Example
2547    /// ```ignore,no_run
2548    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2549    /// let x = TargetsPresentCondition::new().set_missing_targets(["a", "b", "c"]);
2550    /// ```
2551    pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
2552    where
2553        T: std::iter::IntoIterator<Item = V>,
2554        V: std::convert::Into<std::string::String>,
2555    {
2556        use std::iter::Iterator;
2557        self.missing_targets = v.into_iter().map(|i| i.into()).collect();
2558        self
2559    }
2560
2561    /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2562    ///
2563    /// # Example
2564    /// ```ignore,no_run
2565    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2566    /// use wkt::Timestamp;
2567    /// let x = TargetsPresentCondition::new().set_update_time(Timestamp::default()/* use setters */);
2568    /// ```
2569    pub fn set_update_time<T>(mut self, v: T) -> Self
2570    where
2571        T: std::convert::Into<wkt::Timestamp>,
2572    {
2573        self.update_time = std::option::Option::Some(v.into());
2574        self
2575    }
2576
2577    /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2578    ///
2579    /// # Example
2580    /// ```ignore,no_run
2581    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2582    /// use wkt::Timestamp;
2583    /// let x = TargetsPresentCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2584    /// let x = TargetsPresentCondition::new().set_or_clear_update_time(None::<Timestamp>);
2585    /// ```
2586    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2587    where
2588        T: std::convert::Into<wkt::Timestamp>,
2589    {
2590        self.update_time = v.map(|x| x.into());
2591        self
2592    }
2593}
2594
2595impl wkt::message::Message for TargetsPresentCondition {
2596    fn typename() -> &'static str {
2597        "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
2598    }
2599}
2600
2601/// TargetsTypeCondition contains information on whether the Targets defined in
2602/// the Delivery Pipeline are of the same type.
2603#[derive(Clone, Default, PartialEq)]
2604#[non_exhaustive]
2605pub struct TargetsTypeCondition {
2606    /// True if the targets are all a comparable type. For example this is true if
2607    /// all targets are GKE clusters. This is false if some targets are Cloud Run
2608    /// targets and others are GKE clusters.
2609    pub status: bool,
2610
2611    /// Human readable error message.
2612    pub error_details: std::string::String,
2613
2614    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2615}
2616
2617impl TargetsTypeCondition {
2618    pub fn new() -> Self {
2619        std::default::Default::default()
2620    }
2621
2622    /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
2623    ///
2624    /// # Example
2625    /// ```ignore,no_run
2626    /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2627    /// let x = TargetsTypeCondition::new().set_status(true);
2628    /// ```
2629    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2630        self.status = v.into();
2631        self
2632    }
2633
2634    /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
2635    ///
2636    /// # Example
2637    /// ```ignore,no_run
2638    /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2639    /// let x = TargetsTypeCondition::new().set_error_details("example");
2640    /// ```
2641    pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2642        self.error_details = v.into();
2643        self
2644    }
2645}
2646
2647impl wkt::message::Message for TargetsTypeCondition {
2648    fn typename() -> &'static str {
2649        "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
2650    }
2651}
2652
2653/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
2654#[derive(Clone, Default, PartialEq)]
2655#[non_exhaustive]
2656pub struct PipelineCondition {
2657    /// Details around the Pipeline's overall status.
2658    pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
2659
2660    /// Details around targets enumerated in the pipeline.
2661    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
2662
2663    /// Details on the whether the targets enumerated in the pipeline are of the
2664    /// same type.
2665    pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
2666
2667    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2668}
2669
2670impl PipelineCondition {
2671    pub fn new() -> Self {
2672        std::default::Default::default()
2673    }
2674
2675    /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2676    ///
2677    /// # Example
2678    /// ```ignore,no_run
2679    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2680    /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2681    /// let x = PipelineCondition::new().set_pipeline_ready_condition(PipelineReadyCondition::default()/* use setters */);
2682    /// ```
2683    pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
2684    where
2685        T: std::convert::Into<crate::model::PipelineReadyCondition>,
2686    {
2687        self.pipeline_ready_condition = std::option::Option::Some(v.into());
2688        self
2689    }
2690
2691    /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2692    ///
2693    /// # Example
2694    /// ```ignore,no_run
2695    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2696    /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2697    /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(Some(PipelineReadyCondition::default()/* use setters */));
2698    /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(None::<PipelineReadyCondition>);
2699    /// ```
2700    pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
2701    where
2702        T: std::convert::Into<crate::model::PipelineReadyCondition>,
2703    {
2704        self.pipeline_ready_condition = v.map(|x| x.into());
2705        self
2706    }
2707
2708    /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2709    ///
2710    /// # Example
2711    /// ```ignore,no_run
2712    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2713    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2714    /// let x = PipelineCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
2715    /// ```
2716    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
2717    where
2718        T: std::convert::Into<crate::model::TargetsPresentCondition>,
2719    {
2720        self.targets_present_condition = std::option::Option::Some(v.into());
2721        self
2722    }
2723
2724    /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2725    ///
2726    /// # Example
2727    /// ```ignore,no_run
2728    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2729    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2730    /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
2731    /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
2732    /// ```
2733    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
2734    where
2735        T: std::convert::Into<crate::model::TargetsPresentCondition>,
2736    {
2737        self.targets_present_condition = v.map(|x| x.into());
2738        self
2739    }
2740
2741    /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2742    ///
2743    /// # Example
2744    /// ```ignore,no_run
2745    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2746    /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2747    /// let x = PipelineCondition::new().set_targets_type_condition(TargetsTypeCondition::default()/* use setters */);
2748    /// ```
2749    pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2750    where
2751        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2752    {
2753        self.targets_type_condition = std::option::Option::Some(v.into());
2754        self
2755    }
2756
2757    /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2758    ///
2759    /// # Example
2760    /// ```ignore,no_run
2761    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2762    /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2763    /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(Some(TargetsTypeCondition::default()/* use setters */));
2764    /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(None::<TargetsTypeCondition>);
2765    /// ```
2766    pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2767    where
2768        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2769    {
2770        self.targets_type_condition = v.map(|x| x.into());
2771        self
2772    }
2773}
2774
2775impl wkt::message::Message for PipelineCondition {
2776    fn typename() -> &'static str {
2777        "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2778    }
2779}
2780
2781/// The request object for `ListDeliveryPipelines`.
2782#[derive(Clone, Default, PartialEq)]
2783#[non_exhaustive]
2784pub struct ListDeliveryPipelinesRequest {
2785    /// Required. The parent, which owns this collection of pipelines. Format must
2786    /// be `projects/{project_id}/locations/{location_name}`.
2787    pub parent: std::string::String,
2788
2789    /// The maximum number of pipelines to return. The service may return
2790    /// fewer than this value. If unspecified, at most 50 pipelines will
2791    /// be returned. The maximum value is 1000; values above 1000 will be set
2792    /// to 1000.
2793    pub page_size: i32,
2794
2795    /// A page token, received from a previous `ListDeliveryPipelines` call.
2796    /// Provide this to retrieve the subsequent page.
2797    ///
2798    /// When paginating, all other provided parameters match
2799    /// the call that provided the page token.
2800    pub page_token: std::string::String,
2801
2802    /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2803    /// details.
2804    pub filter: std::string::String,
2805
2806    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2807    pub order_by: std::string::String,
2808
2809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2810}
2811
2812impl ListDeliveryPipelinesRequest {
2813    pub fn new() -> Self {
2814        std::default::Default::default()
2815    }
2816
2817    /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2818    ///
2819    /// # Example
2820    /// ```ignore,no_run
2821    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2822    /// let x = ListDeliveryPipelinesRequest::new().set_parent("example");
2823    /// ```
2824    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2825        self.parent = v.into();
2826        self
2827    }
2828
2829    /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2830    ///
2831    /// # Example
2832    /// ```ignore,no_run
2833    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2834    /// let x = ListDeliveryPipelinesRequest::new().set_page_size(42);
2835    /// ```
2836    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2837        self.page_size = v.into();
2838        self
2839    }
2840
2841    /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2842    ///
2843    /// # Example
2844    /// ```ignore,no_run
2845    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2846    /// let x = ListDeliveryPipelinesRequest::new().set_page_token("example");
2847    /// ```
2848    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2849        self.page_token = v.into();
2850        self
2851    }
2852
2853    /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2854    ///
2855    /// # Example
2856    /// ```ignore,no_run
2857    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2858    /// let x = ListDeliveryPipelinesRequest::new().set_filter("example");
2859    /// ```
2860    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2861        self.filter = v.into();
2862        self
2863    }
2864
2865    /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2866    ///
2867    /// # Example
2868    /// ```ignore,no_run
2869    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2870    /// let x = ListDeliveryPipelinesRequest::new().set_order_by("example");
2871    /// ```
2872    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2873        self.order_by = v.into();
2874        self
2875    }
2876}
2877
2878impl wkt::message::Message for ListDeliveryPipelinesRequest {
2879    fn typename() -> &'static str {
2880        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2881    }
2882}
2883
2884/// The response object from `ListDeliveryPipelines`.
2885#[derive(Clone, Default, PartialEq)]
2886#[non_exhaustive]
2887pub struct ListDeliveryPipelinesResponse {
2888    /// The `DeliveryPipeline` objects.
2889    pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2890
2891    /// A token, which can be sent as `page_token` to retrieve the next page.
2892    /// If this field is omitted, there are no subsequent pages.
2893    pub next_page_token: std::string::String,
2894
2895    /// Locations that could not be reached.
2896    pub unreachable: std::vec::Vec<std::string::String>,
2897
2898    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2899}
2900
2901impl ListDeliveryPipelinesResponse {
2902    pub fn new() -> Self {
2903        std::default::Default::default()
2904    }
2905
2906    /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2907    ///
2908    /// # Example
2909    /// ```ignore,no_run
2910    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2911    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
2912    /// let x = ListDeliveryPipelinesResponse::new()
2913    ///     .set_delivery_pipelines([
2914    ///         DeliveryPipeline::default()/* use setters */,
2915    ///         DeliveryPipeline::default()/* use (different) setters */,
2916    ///     ]);
2917    /// ```
2918    pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2919    where
2920        T: std::iter::IntoIterator<Item = V>,
2921        V: std::convert::Into<crate::model::DeliveryPipeline>,
2922    {
2923        use std::iter::Iterator;
2924        self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2925        self
2926    }
2927
2928    /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2929    ///
2930    /// # Example
2931    /// ```ignore,no_run
2932    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2933    /// let x = ListDeliveryPipelinesResponse::new().set_next_page_token("example");
2934    /// ```
2935    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2936        self.next_page_token = v.into();
2937        self
2938    }
2939
2940    /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2941    ///
2942    /// # Example
2943    /// ```ignore,no_run
2944    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2945    /// let x = ListDeliveryPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
2946    /// ```
2947    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2948    where
2949        T: std::iter::IntoIterator<Item = V>,
2950        V: std::convert::Into<std::string::String>,
2951    {
2952        use std::iter::Iterator;
2953        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2954        self
2955    }
2956}
2957
2958impl wkt::message::Message for ListDeliveryPipelinesResponse {
2959    fn typename() -> &'static str {
2960        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2961    }
2962}
2963
2964#[doc(hidden)]
2965impl gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2966    type PageItem = crate::model::DeliveryPipeline;
2967
2968    fn items(self) -> std::vec::Vec<Self::PageItem> {
2969        self.delivery_pipelines
2970    }
2971
2972    fn next_page_token(&self) -> std::string::String {
2973        use std::clone::Clone;
2974        self.next_page_token.clone()
2975    }
2976}
2977
2978/// The request object for `GetDeliveryPipeline`
2979#[derive(Clone, Default, PartialEq)]
2980#[non_exhaustive]
2981pub struct GetDeliveryPipelineRequest {
2982    /// Required. Name of the `DeliveryPipeline`. Format must be
2983    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
2984    pub name: std::string::String,
2985
2986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2987}
2988
2989impl GetDeliveryPipelineRequest {
2990    pub fn new() -> Self {
2991        std::default::Default::default()
2992    }
2993
2994    /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
2995    ///
2996    /// # Example
2997    /// ```ignore,no_run
2998    /// # use google_cloud_deploy_v1::model::GetDeliveryPipelineRequest;
2999    /// let x = GetDeliveryPipelineRequest::new().set_name("example");
3000    /// ```
3001    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3002        self.name = v.into();
3003        self
3004    }
3005}
3006
3007impl wkt::message::Message for GetDeliveryPipelineRequest {
3008    fn typename() -> &'static str {
3009        "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
3010    }
3011}
3012
3013/// The request object for `CreateDeliveryPipeline`.
3014#[derive(Clone, Default, PartialEq)]
3015#[non_exhaustive]
3016pub struct CreateDeliveryPipelineRequest {
3017    /// Required. The parent collection in which the `DeliveryPipeline` must be
3018    /// created. The format is `projects/{project_id}/locations/{location_name}`.
3019    pub parent: std::string::String,
3020
3021    /// Required. ID of the `DeliveryPipeline`.
3022    pub delivery_pipeline_id: std::string::String,
3023
3024    /// Required. The `DeliveryPipeline` to create.
3025    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3026
3027    /// Optional. A request ID to identify requests. Specify a unique request ID
3028    /// so that if you must retry your request, the server knows to ignore the
3029    /// request if it has already been completed. The server guarantees that for
3030    /// at least 60 minutes after the first request.
3031    ///
3032    /// For example, consider a situation where you make an initial request and the
3033    /// request times out. If you make the request again with the same request ID,
3034    /// the server can check if original operation with the same request ID was
3035    /// received, and if so, will ignore the second request. This prevents clients
3036    /// from accidentally creating duplicate commitments.
3037    ///
3038    /// The request ID must be a valid UUID with the exception that zero UUID is
3039    /// not supported (00000000-0000-0000-0000-000000000000).
3040    pub request_id: std::string::String,
3041
3042    /// Optional. If set to true, the request is validated and the user is provided
3043    /// with an expected result, but no actual change is made.
3044    pub validate_only: bool,
3045
3046    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3047}
3048
3049impl CreateDeliveryPipelineRequest {
3050    pub fn new() -> Self {
3051        std::default::Default::default()
3052    }
3053
3054    /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
3055    ///
3056    /// # Example
3057    /// ```ignore,no_run
3058    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3059    /// let x = CreateDeliveryPipelineRequest::new().set_parent("example");
3060    /// ```
3061    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3062        self.parent = v.into();
3063        self
3064    }
3065
3066    /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
3067    ///
3068    /// # Example
3069    /// ```ignore,no_run
3070    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3071    /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline_id("example");
3072    /// ```
3073    pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
3074        mut self,
3075        v: T,
3076    ) -> Self {
3077        self.delivery_pipeline_id = v.into();
3078        self
3079    }
3080
3081    /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3082    ///
3083    /// # Example
3084    /// ```ignore,no_run
3085    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3086    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3087    /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3088    /// ```
3089    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3090    where
3091        T: std::convert::Into<crate::model::DeliveryPipeline>,
3092    {
3093        self.delivery_pipeline = std::option::Option::Some(v.into());
3094        self
3095    }
3096
3097    /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3098    ///
3099    /// # Example
3100    /// ```ignore,no_run
3101    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3102    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3103    /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3104    /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3105    /// ```
3106    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3107    where
3108        T: std::convert::Into<crate::model::DeliveryPipeline>,
3109    {
3110        self.delivery_pipeline = v.map(|x| x.into());
3111        self
3112    }
3113
3114    /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
3115    ///
3116    /// # Example
3117    /// ```ignore,no_run
3118    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3119    /// let x = CreateDeliveryPipelineRequest::new().set_request_id("example");
3120    /// ```
3121    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3122        self.request_id = v.into();
3123        self
3124    }
3125
3126    /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
3127    ///
3128    /// # Example
3129    /// ```ignore,no_run
3130    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3131    /// let x = CreateDeliveryPipelineRequest::new().set_validate_only(true);
3132    /// ```
3133    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3134        self.validate_only = v.into();
3135        self
3136    }
3137}
3138
3139impl wkt::message::Message for CreateDeliveryPipelineRequest {
3140    fn typename() -> &'static str {
3141        "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
3142    }
3143}
3144
3145/// The request object for `UpdateDeliveryPipeline`.
3146#[derive(Clone, Default, PartialEq)]
3147#[non_exhaustive]
3148pub struct UpdateDeliveryPipelineRequest {
3149    /// Required. Field mask is used to specify the fields to be overwritten by the
3150    /// update in the `DeliveryPipeline` resource. The fields specified in the
3151    /// update_mask are relative to the resource, not the full request. A field
3152    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
3153    /// then all fields are overwritten.
3154    pub update_mask: std::option::Option<wkt::FieldMask>,
3155
3156    /// Required. The `DeliveryPipeline` to update.
3157    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3158
3159    /// Optional. A request ID to identify requests. Specify a unique request ID
3160    /// so that if you must retry your request, the server knows to ignore the
3161    /// request if it has already been completed. The server guarantees that for
3162    /// at least 60 minutes after the first request.
3163    ///
3164    /// For example, consider a situation where you make an initial request and the
3165    /// request times out. If you make the request again with the same request ID,
3166    /// the server can check if original operation with the same request ID was
3167    /// received, and if so, will ignore the second request. This prevents clients
3168    /// from accidentally creating duplicate commitments.
3169    ///
3170    /// The request ID must be a valid UUID with the exception that zero UUID is
3171    /// not supported (00000000-0000-0000-0000-000000000000).
3172    pub request_id: std::string::String,
3173
3174    /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
3175    /// will result in the creation of a new `DeliveryPipeline`.
3176    pub allow_missing: bool,
3177
3178    /// Optional. If set to true, the request is validated and the user is provided
3179    /// with an expected result, but no actual change is made.
3180    pub validate_only: bool,
3181
3182    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3183}
3184
3185impl UpdateDeliveryPipelineRequest {
3186    pub fn new() -> Self {
3187        std::default::Default::default()
3188    }
3189
3190    /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3191    ///
3192    /// # Example
3193    /// ```ignore,no_run
3194    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3195    /// use wkt::FieldMask;
3196    /// let x = UpdateDeliveryPipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3197    /// ```
3198    pub fn set_update_mask<T>(mut self, v: T) -> Self
3199    where
3200        T: std::convert::Into<wkt::FieldMask>,
3201    {
3202        self.update_mask = std::option::Option::Some(v.into());
3203        self
3204    }
3205
3206    /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3207    ///
3208    /// # Example
3209    /// ```ignore,no_run
3210    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3211    /// use wkt::FieldMask;
3212    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3213    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3214    /// ```
3215    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3216    where
3217        T: std::convert::Into<wkt::FieldMask>,
3218    {
3219        self.update_mask = v.map(|x| x.into());
3220        self
3221    }
3222
3223    /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3224    ///
3225    /// # Example
3226    /// ```ignore,no_run
3227    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3228    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3229    /// let x = UpdateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3230    /// ```
3231    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3232    where
3233        T: std::convert::Into<crate::model::DeliveryPipeline>,
3234    {
3235        self.delivery_pipeline = std::option::Option::Some(v.into());
3236        self
3237    }
3238
3239    /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3244    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3245    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3246    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3247    /// ```
3248    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3249    where
3250        T: std::convert::Into<crate::model::DeliveryPipeline>,
3251    {
3252        self.delivery_pipeline = v.map(|x| x.into());
3253        self
3254    }
3255
3256    /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
3257    ///
3258    /// # Example
3259    /// ```ignore,no_run
3260    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3261    /// let x = UpdateDeliveryPipelineRequest::new().set_request_id("example");
3262    /// ```
3263    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3264        self.request_id = v.into();
3265        self
3266    }
3267
3268    /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
3269    ///
3270    /// # Example
3271    /// ```ignore,no_run
3272    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3273    /// let x = UpdateDeliveryPipelineRequest::new().set_allow_missing(true);
3274    /// ```
3275    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3276        self.allow_missing = v.into();
3277        self
3278    }
3279
3280    /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
3281    ///
3282    /// # Example
3283    /// ```ignore,no_run
3284    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3285    /// let x = UpdateDeliveryPipelineRequest::new().set_validate_only(true);
3286    /// ```
3287    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3288        self.validate_only = v.into();
3289        self
3290    }
3291}
3292
3293impl wkt::message::Message for UpdateDeliveryPipelineRequest {
3294    fn typename() -> &'static str {
3295        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
3296    }
3297}
3298
3299/// The request object for `DeleteDeliveryPipeline`.
3300#[derive(Clone, Default, PartialEq)]
3301#[non_exhaustive]
3302pub struct DeleteDeliveryPipelineRequest {
3303    /// Required. The name of the `DeliveryPipeline` to delete. The format is
3304    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3305    pub name: std::string::String,
3306
3307    /// Optional. A request ID to identify requests. Specify a unique request ID
3308    /// so that if you must retry your request, the server knows to ignore the
3309    /// request if it has already been completed. The server guarantees that for
3310    /// at least 60 minutes after the first request.
3311    ///
3312    /// For example, consider a situation where you make an initial request and the
3313    /// request times out. If you make the request again with the same request ID,
3314    /// the server can check if original operation with the same request ID was
3315    /// received, and if so, will ignore the second request. This prevents clients
3316    /// from accidentally creating duplicate commitments.
3317    ///
3318    /// The request ID must be a valid UUID with the exception that zero UUID is
3319    /// not supported (00000000-0000-0000-0000-000000000000).
3320    pub request_id: std::string::String,
3321
3322    /// Optional. If set to true, then deleting an already deleted or non-existing
3323    /// `DeliveryPipeline` will succeed.
3324    pub allow_missing: bool,
3325
3326    /// Optional. If set, validate the request and preview the review, but do not
3327    /// actually post it.
3328    pub validate_only: bool,
3329
3330    /// Optional. If set to true, all child resources under this pipeline will also
3331    /// be deleted. Otherwise, the request will only work if the pipeline has no
3332    /// child resources.
3333    pub force: bool,
3334
3335    /// Optional. This checksum is computed by the server based on the value of
3336    /// other fields, and may be sent on update and delete requests to ensure the
3337    /// client has an up-to-date value before proceeding.
3338    pub etag: std::string::String,
3339
3340    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3341}
3342
3343impl DeleteDeliveryPipelineRequest {
3344    pub fn new() -> Self {
3345        std::default::Default::default()
3346    }
3347
3348    /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
3349    ///
3350    /// # Example
3351    /// ```ignore,no_run
3352    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3353    /// let x = DeleteDeliveryPipelineRequest::new().set_name("example");
3354    /// ```
3355    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3356        self.name = v.into();
3357        self
3358    }
3359
3360    /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
3361    ///
3362    /// # Example
3363    /// ```ignore,no_run
3364    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3365    /// let x = DeleteDeliveryPipelineRequest::new().set_request_id("example");
3366    /// ```
3367    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3368        self.request_id = v.into();
3369        self
3370    }
3371
3372    /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
3373    ///
3374    /// # Example
3375    /// ```ignore,no_run
3376    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3377    /// let x = DeleteDeliveryPipelineRequest::new().set_allow_missing(true);
3378    /// ```
3379    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3380        self.allow_missing = v.into();
3381        self
3382    }
3383
3384    /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
3385    ///
3386    /// # Example
3387    /// ```ignore,no_run
3388    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3389    /// let x = DeleteDeliveryPipelineRequest::new().set_validate_only(true);
3390    /// ```
3391    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3392        self.validate_only = v.into();
3393        self
3394    }
3395
3396    /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
3397    ///
3398    /// # Example
3399    /// ```ignore,no_run
3400    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3401    /// let x = DeleteDeliveryPipelineRequest::new().set_force(true);
3402    /// ```
3403    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3404        self.force = v.into();
3405        self
3406    }
3407
3408    /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
3409    ///
3410    /// # Example
3411    /// ```ignore,no_run
3412    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3413    /// let x = DeleteDeliveryPipelineRequest::new().set_etag("example");
3414    /// ```
3415    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3416        self.etag = v.into();
3417        self
3418    }
3419}
3420
3421impl wkt::message::Message for DeleteDeliveryPipelineRequest {
3422    fn typename() -> &'static str {
3423        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
3424    }
3425}
3426
3427/// Configs for the Rollback rollout.
3428#[derive(Clone, Default, PartialEq)]
3429#[non_exhaustive]
3430pub struct RollbackTargetConfig {
3431    /// Optional. The rollback `Rollout` to create.
3432    pub rollout: std::option::Option<crate::model::Rollout>,
3433
3434    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
3435    /// `Rollout` will start in the stable phase.
3436    pub starting_phase_id: std::string::String,
3437
3438    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3439}
3440
3441impl RollbackTargetConfig {
3442    pub fn new() -> Self {
3443        std::default::Default::default()
3444    }
3445
3446    /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3447    ///
3448    /// # Example
3449    /// ```ignore,no_run
3450    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3451    /// use google_cloud_deploy_v1::model::Rollout;
3452    /// let x = RollbackTargetConfig::new().set_rollout(Rollout::default()/* use setters */);
3453    /// ```
3454    pub fn set_rollout<T>(mut self, v: T) -> Self
3455    where
3456        T: std::convert::Into<crate::model::Rollout>,
3457    {
3458        self.rollout = std::option::Option::Some(v.into());
3459        self
3460    }
3461
3462    /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3463    ///
3464    /// # Example
3465    /// ```ignore,no_run
3466    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3467    /// use google_cloud_deploy_v1::model::Rollout;
3468    /// let x = RollbackTargetConfig::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
3469    /// let x = RollbackTargetConfig::new().set_or_clear_rollout(None::<Rollout>);
3470    /// ```
3471    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3472    where
3473        T: std::convert::Into<crate::model::Rollout>,
3474    {
3475        self.rollout = v.map(|x| x.into());
3476        self
3477    }
3478
3479    /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
3480    ///
3481    /// # Example
3482    /// ```ignore,no_run
3483    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3484    /// let x = RollbackTargetConfig::new().set_starting_phase_id("example");
3485    /// ```
3486    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
3487        mut self,
3488        v: T,
3489    ) -> Self {
3490        self.starting_phase_id = v.into();
3491        self
3492    }
3493}
3494
3495impl wkt::message::Message for RollbackTargetConfig {
3496    fn typename() -> &'static str {
3497        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
3498    }
3499}
3500
3501/// The request object for `RollbackTarget`.
3502#[derive(Clone, Default, PartialEq)]
3503#[non_exhaustive]
3504pub struct RollbackTargetRequest {
3505    /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
3506    /// created. The format is
3507    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3508    pub name: std::string::String,
3509
3510    /// Required. ID of the `Target` that is being rolled back.
3511    pub target_id: std::string::String,
3512
3513    /// Required. ID of the rollback `Rollout` to create.
3514    pub rollout_id: std::string::String,
3515
3516    /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
3517    /// previous successful `Rollout` to the specified target will be used to
3518    /// determine the `Release`.
3519    pub release_id: std::string::String,
3520
3521    /// Optional. If provided, this must be the latest `Rollout` that is on the
3522    /// `Target`.
3523    pub rollout_to_roll_back: std::string::String,
3524
3525    /// Optional. Configs for the rollback `Rollout`.
3526    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3527
3528    /// Optional. If set to true, the request is validated and the user is provided
3529    /// with a `RollbackTargetResponse`.
3530    pub validate_only: bool,
3531
3532    /// Optional. Deploy policies to override. Format is
3533    /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
3534    pub override_deploy_policy: std::vec::Vec<std::string::String>,
3535
3536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3537}
3538
3539impl RollbackTargetRequest {
3540    pub fn new() -> Self {
3541        std::default::Default::default()
3542    }
3543
3544    /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
3545    ///
3546    /// # Example
3547    /// ```ignore,no_run
3548    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3549    /// let x = RollbackTargetRequest::new().set_name("example");
3550    /// ```
3551    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3552        self.name = v.into();
3553        self
3554    }
3555
3556    /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
3557    ///
3558    /// # Example
3559    /// ```ignore,no_run
3560    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3561    /// let x = RollbackTargetRequest::new().set_target_id("example");
3562    /// ```
3563    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3564        self.target_id = v.into();
3565        self
3566    }
3567
3568    /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
3569    ///
3570    /// # Example
3571    /// ```ignore,no_run
3572    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3573    /// let x = RollbackTargetRequest::new().set_rollout_id("example");
3574    /// ```
3575    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3576        self.rollout_id = v.into();
3577        self
3578    }
3579
3580    /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
3581    ///
3582    /// # Example
3583    /// ```ignore,no_run
3584    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3585    /// let x = RollbackTargetRequest::new().set_release_id("example");
3586    /// ```
3587    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3588        self.release_id = v.into();
3589        self
3590    }
3591
3592    /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
3593    ///
3594    /// # Example
3595    /// ```ignore,no_run
3596    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3597    /// let x = RollbackTargetRequest::new().set_rollout_to_roll_back("example");
3598    /// ```
3599    pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
3600        mut self,
3601        v: T,
3602    ) -> Self {
3603        self.rollout_to_roll_back = v.into();
3604        self
3605    }
3606
3607    /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3608    ///
3609    /// # Example
3610    /// ```ignore,no_run
3611    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3612    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3613    /// let x = RollbackTargetRequest::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3614    /// ```
3615    pub fn set_rollback_config<T>(mut self, v: T) -> Self
3616    where
3617        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3618    {
3619        self.rollback_config = std::option::Option::Some(v.into());
3620        self
3621    }
3622
3623    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3624    ///
3625    /// # Example
3626    /// ```ignore,no_run
3627    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3628    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3629    /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3630    /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3631    /// ```
3632    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3633    where
3634        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3635    {
3636        self.rollback_config = v.map(|x| x.into());
3637        self
3638    }
3639
3640    /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
3641    ///
3642    /// # Example
3643    /// ```ignore,no_run
3644    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3645    /// let x = RollbackTargetRequest::new().set_validate_only(true);
3646    /// ```
3647    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3648        self.validate_only = v.into();
3649        self
3650    }
3651
3652    /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
3653    ///
3654    /// # Example
3655    /// ```ignore,no_run
3656    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3657    /// let x = RollbackTargetRequest::new().set_override_deploy_policy(["a", "b", "c"]);
3658    /// ```
3659    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3660    where
3661        T: std::iter::IntoIterator<Item = V>,
3662        V: std::convert::Into<std::string::String>,
3663    {
3664        use std::iter::Iterator;
3665        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3666        self
3667    }
3668}
3669
3670impl wkt::message::Message for RollbackTargetRequest {
3671    fn typename() -> &'static str {
3672        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
3673    }
3674}
3675
3676/// The response object from `RollbackTarget`.
3677#[derive(Clone, Default, PartialEq)]
3678#[non_exhaustive]
3679pub struct RollbackTargetResponse {
3680    /// The config of the rollback `Rollout` created or will be created.
3681    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3682
3683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3684}
3685
3686impl RollbackTargetResponse {
3687    pub fn new() -> Self {
3688        std::default::Default::default()
3689    }
3690
3691    /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3692    ///
3693    /// # Example
3694    /// ```ignore,no_run
3695    /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3696    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3697    /// let x = RollbackTargetResponse::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3698    /// ```
3699    pub fn set_rollback_config<T>(mut self, v: T) -> Self
3700    where
3701        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3702    {
3703        self.rollback_config = std::option::Option::Some(v.into());
3704        self
3705    }
3706
3707    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3708    ///
3709    /// # Example
3710    /// ```ignore,no_run
3711    /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3712    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3713    /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3714    /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3715    /// ```
3716    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3717    where
3718        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3719    {
3720        self.rollback_config = v.map(|x| x.into());
3721        self
3722    }
3723}
3724
3725impl wkt::message::Message for RollbackTargetResponse {
3726    fn typename() -> &'static str {
3727        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
3728    }
3729}
3730
3731/// A `Target` resource in the Cloud Deploy API.
3732///
3733/// A `Target` defines a location to which a Skaffold configuration
3734/// can be deployed.
3735#[derive(Clone, Default, PartialEq)]
3736#[non_exhaustive]
3737pub struct Target {
3738    /// Identifier. Name of the `Target`. Format is
3739    /// `projects/{project}/locations/{location}/targets/{target}`.
3740    /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
3741    pub name: std::string::String,
3742
3743    /// Output only. Resource id of the `Target`.
3744    pub target_id: std::string::String,
3745
3746    /// Output only. Unique identifier of the `Target`.
3747    pub uid: std::string::String,
3748
3749    /// Optional. Description of the `Target`. Max length is 255 characters.
3750    pub description: std::string::String,
3751
3752    /// Optional. User annotations. These attributes can only be set and used by
3753    /// the user, and not by Cloud Deploy. See
3754    /// <https://google.aip.dev/128#annotations> for more details such as format and
3755    /// size limitations.
3756    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3757
3758    /// Optional. Labels are attributes that can be set and used by both the
3759    /// user and by Cloud Deploy. Labels must meet the following constraints:
3760    ///
3761    /// * Keys and values can contain only lowercase letters, numeric characters,
3762    ///   underscores, and dashes.
3763    /// * All characters must use UTF-8 encoding, and international characters are
3764    ///   allowed.
3765    /// * Keys must start with a lowercase letter or international character.
3766    /// * Each resource is limited to a maximum of 64 labels.
3767    ///
3768    /// Both keys and values are additionally constrained to be <= 128 bytes.
3769    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3770
3771    /// Optional. Whether or not the `Target` requires approval.
3772    pub require_approval: bool,
3773
3774    /// Output only. Time at which the `Target` was created.
3775    pub create_time: std::option::Option<wkt::Timestamp>,
3776
3777    /// Output only. Most recent time at which the `Target` was updated.
3778    pub update_time: std::option::Option<wkt::Timestamp>,
3779
3780    /// Optional. Map of entity IDs to their associated entities. Associated
3781    /// entities allows specifying places other than the deployment target for
3782    /// specific features. For example, the Gateway API canary can be configured to
3783    /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
3784    /// using associated entities. An entity ID must consist of lower-case letters,
3785    /// numbers, and hyphens, start with a letter and end with a letter or a
3786    /// number, and have a max length of 63 characters. In other words, it must
3787    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3788    pub associated_entities:
3789        std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
3790
3791    /// Optional. This checksum is computed by the server based on the value of
3792    /// other fields, and may be sent on update and delete requests to ensure the
3793    /// client has an up-to-date value before proceeding.
3794    pub etag: std::string::String,
3795
3796    /// Optional. Configurations for all execution that relates to this `Target`.
3797    /// Each `ExecutionEnvironmentUsage` value may only be used in a single
3798    /// configuration; using the same value multiple times is an error.
3799    /// When one or more configurations are specified, they must include the
3800    /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
3801    /// When no configurations are specified, execution will use the default
3802    /// specified in `DefaultPool`.
3803    pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
3804
3805    /// Optional. The deploy parameters to use for this target.
3806    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
3807
3808    /// Destination to which the Skaffold configuration is applied during a
3809    /// rollout.
3810    pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
3811
3812    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3813}
3814
3815impl Target {
3816    pub fn new() -> Self {
3817        std::default::Default::default()
3818    }
3819
3820    /// Sets the value of [name][crate::model::Target::name].
3821    ///
3822    /// # Example
3823    /// ```ignore,no_run
3824    /// # use google_cloud_deploy_v1::model::Target;
3825    /// let x = Target::new().set_name("example");
3826    /// ```
3827    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3828        self.name = v.into();
3829        self
3830    }
3831
3832    /// Sets the value of [target_id][crate::model::Target::target_id].
3833    ///
3834    /// # Example
3835    /// ```ignore,no_run
3836    /// # use google_cloud_deploy_v1::model::Target;
3837    /// let x = Target::new().set_target_id("example");
3838    /// ```
3839    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3840        self.target_id = v.into();
3841        self
3842    }
3843
3844    /// Sets the value of [uid][crate::model::Target::uid].
3845    ///
3846    /// # Example
3847    /// ```ignore,no_run
3848    /// # use google_cloud_deploy_v1::model::Target;
3849    /// let x = Target::new().set_uid("example");
3850    /// ```
3851    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3852        self.uid = v.into();
3853        self
3854    }
3855
3856    /// Sets the value of [description][crate::model::Target::description].
3857    ///
3858    /// # Example
3859    /// ```ignore,no_run
3860    /// # use google_cloud_deploy_v1::model::Target;
3861    /// let x = Target::new().set_description("example");
3862    /// ```
3863    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3864        self.description = v.into();
3865        self
3866    }
3867
3868    /// Sets the value of [annotations][crate::model::Target::annotations].
3869    ///
3870    /// # Example
3871    /// ```ignore,no_run
3872    /// # use google_cloud_deploy_v1::model::Target;
3873    /// let x = Target::new().set_annotations([
3874    ///     ("key0", "abc"),
3875    ///     ("key1", "xyz"),
3876    /// ]);
3877    /// ```
3878    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3879    where
3880        T: std::iter::IntoIterator<Item = (K, V)>,
3881        K: std::convert::Into<std::string::String>,
3882        V: std::convert::Into<std::string::String>,
3883    {
3884        use std::iter::Iterator;
3885        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3886        self
3887    }
3888
3889    /// Sets the value of [labels][crate::model::Target::labels].
3890    ///
3891    /// # Example
3892    /// ```ignore,no_run
3893    /// # use google_cloud_deploy_v1::model::Target;
3894    /// let x = Target::new().set_labels([
3895    ///     ("key0", "abc"),
3896    ///     ("key1", "xyz"),
3897    /// ]);
3898    /// ```
3899    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3900    where
3901        T: std::iter::IntoIterator<Item = (K, V)>,
3902        K: std::convert::Into<std::string::String>,
3903        V: std::convert::Into<std::string::String>,
3904    {
3905        use std::iter::Iterator;
3906        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3907        self
3908    }
3909
3910    /// Sets the value of [require_approval][crate::model::Target::require_approval].
3911    ///
3912    /// # Example
3913    /// ```ignore,no_run
3914    /// # use google_cloud_deploy_v1::model::Target;
3915    /// let x = Target::new().set_require_approval(true);
3916    /// ```
3917    pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3918        self.require_approval = v.into();
3919        self
3920    }
3921
3922    /// Sets the value of [create_time][crate::model::Target::create_time].
3923    ///
3924    /// # Example
3925    /// ```ignore,no_run
3926    /// # use google_cloud_deploy_v1::model::Target;
3927    /// use wkt::Timestamp;
3928    /// let x = Target::new().set_create_time(Timestamp::default()/* use setters */);
3929    /// ```
3930    pub fn set_create_time<T>(mut self, v: T) -> Self
3931    where
3932        T: std::convert::Into<wkt::Timestamp>,
3933    {
3934        self.create_time = std::option::Option::Some(v.into());
3935        self
3936    }
3937
3938    /// Sets or clears the value of [create_time][crate::model::Target::create_time].
3939    ///
3940    /// # Example
3941    /// ```ignore,no_run
3942    /// # use google_cloud_deploy_v1::model::Target;
3943    /// use wkt::Timestamp;
3944    /// let x = Target::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3945    /// let x = Target::new().set_or_clear_create_time(None::<Timestamp>);
3946    /// ```
3947    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3948    where
3949        T: std::convert::Into<wkt::Timestamp>,
3950    {
3951        self.create_time = v.map(|x| x.into());
3952        self
3953    }
3954
3955    /// Sets the value of [update_time][crate::model::Target::update_time].
3956    ///
3957    /// # Example
3958    /// ```ignore,no_run
3959    /// # use google_cloud_deploy_v1::model::Target;
3960    /// use wkt::Timestamp;
3961    /// let x = Target::new().set_update_time(Timestamp::default()/* use setters */);
3962    /// ```
3963    pub fn set_update_time<T>(mut self, v: T) -> Self
3964    where
3965        T: std::convert::Into<wkt::Timestamp>,
3966    {
3967        self.update_time = std::option::Option::Some(v.into());
3968        self
3969    }
3970
3971    /// Sets or clears the value of [update_time][crate::model::Target::update_time].
3972    ///
3973    /// # Example
3974    /// ```ignore,no_run
3975    /// # use google_cloud_deploy_v1::model::Target;
3976    /// use wkt::Timestamp;
3977    /// let x = Target::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3978    /// let x = Target::new().set_or_clear_update_time(None::<Timestamp>);
3979    /// ```
3980    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3981    where
3982        T: std::convert::Into<wkt::Timestamp>,
3983    {
3984        self.update_time = v.map(|x| x.into());
3985        self
3986    }
3987
3988    /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
3989    ///
3990    /// # Example
3991    /// ```ignore,no_run
3992    /// # use google_cloud_deploy_v1::model::Target;
3993    /// use google_cloud_deploy_v1::model::AssociatedEntities;
3994    /// let x = Target::new().set_associated_entities([
3995    ///     ("key0", AssociatedEntities::default()/* use setters */),
3996    ///     ("key1", AssociatedEntities::default()/* use (different) setters */),
3997    /// ]);
3998    /// ```
3999    pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
4000    where
4001        T: std::iter::IntoIterator<Item = (K, V)>,
4002        K: std::convert::Into<std::string::String>,
4003        V: std::convert::Into<crate::model::AssociatedEntities>,
4004    {
4005        use std::iter::Iterator;
4006        self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4007        self
4008    }
4009
4010    /// Sets the value of [etag][crate::model::Target::etag].
4011    ///
4012    /// # Example
4013    /// ```ignore,no_run
4014    /// # use google_cloud_deploy_v1::model::Target;
4015    /// let x = Target::new().set_etag("example");
4016    /// ```
4017    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4018        self.etag = v.into();
4019        self
4020    }
4021
4022    /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
4023    ///
4024    /// # Example
4025    /// ```ignore,no_run
4026    /// # use google_cloud_deploy_v1::model::Target;
4027    /// use google_cloud_deploy_v1::model::ExecutionConfig;
4028    /// let x = Target::new()
4029    ///     .set_execution_configs([
4030    ///         ExecutionConfig::default()/* use setters */,
4031    ///         ExecutionConfig::default()/* use (different) setters */,
4032    ///     ]);
4033    /// ```
4034    pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
4035    where
4036        T: std::iter::IntoIterator<Item = V>,
4037        V: std::convert::Into<crate::model::ExecutionConfig>,
4038    {
4039        use std::iter::Iterator;
4040        self.execution_configs = v.into_iter().map(|i| i.into()).collect();
4041        self
4042    }
4043
4044    /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
4045    ///
4046    /// # Example
4047    /// ```ignore,no_run
4048    /// # use google_cloud_deploy_v1::model::Target;
4049    /// let x = Target::new().set_deploy_parameters([
4050    ///     ("key0", "abc"),
4051    ///     ("key1", "xyz"),
4052    /// ]);
4053    /// ```
4054    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
4055    where
4056        T: std::iter::IntoIterator<Item = (K, V)>,
4057        K: std::convert::Into<std::string::String>,
4058        V: std::convert::Into<std::string::String>,
4059    {
4060        use std::iter::Iterator;
4061        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4062        self
4063    }
4064
4065    /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
4066    ///
4067    /// Note that all the setters affecting `deployment_target` are mutually
4068    /// exclusive.
4069    ///
4070    /// # Example
4071    /// ```ignore,no_run
4072    /// # use google_cloud_deploy_v1::model::Target;
4073    /// use google_cloud_deploy_v1::model::GkeCluster;
4074    /// let x = Target::new().set_deployment_target(Some(
4075    ///     google_cloud_deploy_v1::model::target::DeploymentTarget::Gke(GkeCluster::default().into())));
4076    /// ```
4077    pub fn set_deployment_target<
4078        T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
4079    >(
4080        mut self,
4081        v: T,
4082    ) -> Self {
4083        self.deployment_target = v.into();
4084        self
4085    }
4086
4087    /// The value of [deployment_target][crate::model::Target::deployment_target]
4088    /// if it holds a `Gke`, `None` if the field is not set or
4089    /// holds a different branch.
4090    pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
4091        #[allow(unreachable_patterns)]
4092        self.deployment_target.as_ref().and_then(|v| match v {
4093            crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
4094            _ => std::option::Option::None,
4095        })
4096    }
4097
4098    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4099    /// to hold a `Gke`.
4100    ///
4101    /// Note that all the setters affecting `deployment_target` are
4102    /// mutually exclusive.
4103    ///
4104    /// # Example
4105    /// ```ignore,no_run
4106    /// # use google_cloud_deploy_v1::model::Target;
4107    /// use google_cloud_deploy_v1::model::GkeCluster;
4108    /// let x = Target::new().set_gke(GkeCluster::default()/* use setters */);
4109    /// assert!(x.gke().is_some());
4110    /// assert!(x.anthos_cluster().is_none());
4111    /// assert!(x.run().is_none());
4112    /// assert!(x.multi_target().is_none());
4113    /// assert!(x.custom_target().is_none());
4114    /// ```
4115    pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
4116        mut self,
4117        v: T,
4118    ) -> Self {
4119        self.deployment_target =
4120            std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
4121        self
4122    }
4123
4124    /// The value of [deployment_target][crate::model::Target::deployment_target]
4125    /// if it holds a `AnthosCluster`, `None` if the field is not set or
4126    /// holds a different branch.
4127    pub fn anthos_cluster(
4128        &self,
4129    ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
4130        #[allow(unreachable_patterns)]
4131        self.deployment_target.as_ref().and_then(|v| match v {
4132            crate::model::target::DeploymentTarget::AnthosCluster(v) => {
4133                std::option::Option::Some(v)
4134            }
4135            _ => std::option::Option::None,
4136        })
4137    }
4138
4139    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4140    /// to hold a `AnthosCluster`.
4141    ///
4142    /// Note that all the setters affecting `deployment_target` are
4143    /// mutually exclusive.
4144    ///
4145    /// # Example
4146    /// ```ignore,no_run
4147    /// # use google_cloud_deploy_v1::model::Target;
4148    /// use google_cloud_deploy_v1::model::AnthosCluster;
4149    /// let x = Target::new().set_anthos_cluster(AnthosCluster::default()/* use setters */);
4150    /// assert!(x.anthos_cluster().is_some());
4151    /// assert!(x.gke().is_none());
4152    /// assert!(x.run().is_none());
4153    /// assert!(x.multi_target().is_none());
4154    /// assert!(x.custom_target().is_none());
4155    /// ```
4156    pub fn set_anthos_cluster<
4157        T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
4158    >(
4159        mut self,
4160        v: T,
4161    ) -> Self {
4162        self.deployment_target = std::option::Option::Some(
4163            crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
4164        );
4165        self
4166    }
4167
4168    /// The value of [deployment_target][crate::model::Target::deployment_target]
4169    /// if it holds a `Run`, `None` if the field is not set or
4170    /// holds a different branch.
4171    pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
4172        #[allow(unreachable_patterns)]
4173        self.deployment_target.as_ref().and_then(|v| match v {
4174            crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
4175            _ => std::option::Option::None,
4176        })
4177    }
4178
4179    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4180    /// to hold a `Run`.
4181    ///
4182    /// Note that all the setters affecting `deployment_target` are
4183    /// mutually exclusive.
4184    ///
4185    /// # Example
4186    /// ```ignore,no_run
4187    /// # use google_cloud_deploy_v1::model::Target;
4188    /// use google_cloud_deploy_v1::model::CloudRunLocation;
4189    /// let x = Target::new().set_run(CloudRunLocation::default()/* use setters */);
4190    /// assert!(x.run().is_some());
4191    /// assert!(x.gke().is_none());
4192    /// assert!(x.anthos_cluster().is_none());
4193    /// assert!(x.multi_target().is_none());
4194    /// assert!(x.custom_target().is_none());
4195    /// ```
4196    pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
4197        mut self,
4198        v: T,
4199    ) -> Self {
4200        self.deployment_target =
4201            std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
4202        self
4203    }
4204
4205    /// The value of [deployment_target][crate::model::Target::deployment_target]
4206    /// if it holds a `MultiTarget`, `None` if the field is not set or
4207    /// holds a different branch.
4208    pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
4209        #[allow(unreachable_patterns)]
4210        self.deployment_target.as_ref().and_then(|v| match v {
4211            crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
4212            _ => std::option::Option::None,
4213        })
4214    }
4215
4216    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4217    /// to hold a `MultiTarget`.
4218    ///
4219    /// Note that all the setters affecting `deployment_target` are
4220    /// mutually exclusive.
4221    ///
4222    /// # Example
4223    /// ```ignore,no_run
4224    /// # use google_cloud_deploy_v1::model::Target;
4225    /// use google_cloud_deploy_v1::model::MultiTarget;
4226    /// let x = Target::new().set_multi_target(MultiTarget::default()/* use setters */);
4227    /// assert!(x.multi_target().is_some());
4228    /// assert!(x.gke().is_none());
4229    /// assert!(x.anthos_cluster().is_none());
4230    /// assert!(x.run().is_none());
4231    /// assert!(x.custom_target().is_none());
4232    /// ```
4233    pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
4234        mut self,
4235        v: T,
4236    ) -> Self {
4237        self.deployment_target = std::option::Option::Some(
4238            crate::model::target::DeploymentTarget::MultiTarget(v.into()),
4239        );
4240        self
4241    }
4242
4243    /// The value of [deployment_target][crate::model::Target::deployment_target]
4244    /// if it holds a `CustomTarget`, `None` if the field is not set or
4245    /// holds a different branch.
4246    pub fn custom_target(
4247        &self,
4248    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
4249        #[allow(unreachable_patterns)]
4250        self.deployment_target.as_ref().and_then(|v| match v {
4251            crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
4252            _ => std::option::Option::None,
4253        })
4254    }
4255
4256    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4257    /// to hold a `CustomTarget`.
4258    ///
4259    /// Note that all the setters affecting `deployment_target` are
4260    /// mutually exclusive.
4261    ///
4262    /// # Example
4263    /// ```ignore,no_run
4264    /// # use google_cloud_deploy_v1::model::Target;
4265    /// use google_cloud_deploy_v1::model::CustomTarget;
4266    /// let x = Target::new().set_custom_target(CustomTarget::default()/* use setters */);
4267    /// assert!(x.custom_target().is_some());
4268    /// assert!(x.gke().is_none());
4269    /// assert!(x.anthos_cluster().is_none());
4270    /// assert!(x.run().is_none());
4271    /// assert!(x.multi_target().is_none());
4272    /// ```
4273    pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
4274        mut self,
4275        v: T,
4276    ) -> Self {
4277        self.deployment_target = std::option::Option::Some(
4278            crate::model::target::DeploymentTarget::CustomTarget(v.into()),
4279        );
4280        self
4281    }
4282}
4283
4284impl wkt::message::Message for Target {
4285    fn typename() -> &'static str {
4286        "type.googleapis.com/google.cloud.deploy.v1.Target"
4287    }
4288}
4289
4290/// Defines additional types related to [Target].
4291pub mod target {
4292    #[allow(unused_imports)]
4293    use super::*;
4294
4295    /// Destination to which the Skaffold configuration is applied during a
4296    /// rollout.
4297    #[derive(Clone, Debug, PartialEq)]
4298    #[non_exhaustive]
4299    pub enum DeploymentTarget {
4300        /// Optional. Information specifying a GKE Cluster.
4301        Gke(std::boxed::Box<crate::model::GkeCluster>),
4302        /// Optional. Information specifying an Anthos Cluster.
4303        AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
4304        /// Optional. Information specifying a Cloud Run deployment target.
4305        Run(std::boxed::Box<crate::model::CloudRunLocation>),
4306        /// Optional. Information specifying a multiTarget.
4307        MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
4308        /// Optional. Information specifying a Custom Target.
4309        CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
4310    }
4311}
4312
4313/// Configuration of the environment to use when calling Skaffold.
4314#[derive(Clone, Default, PartialEq)]
4315#[non_exhaustive]
4316pub struct ExecutionConfig {
4317    /// Required. Usages when this configuration should be applied.
4318    pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
4319
4320    /// Optional. The resource name of the `WorkerPool`, with the format
4321    /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
4322    /// If this optional field is unspecified, the default Cloud Build pool will be
4323    /// used.
4324    pub worker_pool: std::string::String,
4325
4326    /// Optional. Google service account to use for execution. If unspecified,
4327    /// the project execution service account
4328    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
4329    pub service_account: std::string::String,
4330
4331    /// Optional. Cloud Storage location in which to store execution outputs. This
4332    /// can either be a bucket ("gs://my-bucket") or a path within a bucket
4333    /// ("gs://my-bucket/my-dir").
4334    /// If unspecified, a default bucket located in the same region will be used.
4335    pub artifact_storage: std::string::String,
4336
4337    /// Optional. Execution timeout for a Cloud Build Execution. This must be
4338    /// between 10m and 24h in seconds format. If unspecified, a default timeout of
4339    /// 1h is used.
4340    pub execution_timeout: std::option::Option<wkt::Duration>,
4341
4342    /// Optional. If true, additional logging will be enabled when running builds
4343    /// in this execution environment.
4344    pub verbose: bool,
4345
4346    /// Details of the environment.
4347    pub execution_environment:
4348        std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4349
4350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4351}
4352
4353impl ExecutionConfig {
4354    pub fn new() -> Self {
4355        std::default::Default::default()
4356    }
4357
4358    /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
4359    ///
4360    /// # Example
4361    /// ```ignore,no_run
4362    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4363    /// use google_cloud_deploy_v1::model::execution_config::ExecutionEnvironmentUsage;
4364    /// let x = ExecutionConfig::new().set_usages([
4365    ///     ExecutionEnvironmentUsage::Render,
4366    ///     ExecutionEnvironmentUsage::Deploy,
4367    ///     ExecutionEnvironmentUsage::Verify,
4368    /// ]);
4369    /// ```
4370    pub fn set_usages<T, V>(mut self, v: T) -> Self
4371    where
4372        T: std::iter::IntoIterator<Item = V>,
4373        V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
4374    {
4375        use std::iter::Iterator;
4376        self.usages = v.into_iter().map(|i| i.into()).collect();
4377        self
4378    }
4379
4380    /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
4381    ///
4382    /// # Example
4383    /// ```ignore,no_run
4384    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4385    /// let x = ExecutionConfig::new().set_worker_pool("example");
4386    /// ```
4387    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4388        self.worker_pool = v.into();
4389        self
4390    }
4391
4392    /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
4393    ///
4394    /// # Example
4395    /// ```ignore,no_run
4396    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4397    /// let x = ExecutionConfig::new().set_service_account("example");
4398    /// ```
4399    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4400        self.service_account = v.into();
4401        self
4402    }
4403
4404    /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
4405    ///
4406    /// # Example
4407    /// ```ignore,no_run
4408    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4409    /// let x = ExecutionConfig::new().set_artifact_storage("example");
4410    /// ```
4411    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4412        mut self,
4413        v: T,
4414    ) -> Self {
4415        self.artifact_storage = v.into();
4416        self
4417    }
4418
4419    /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4420    ///
4421    /// # Example
4422    /// ```ignore,no_run
4423    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4424    /// use wkt::Duration;
4425    /// let x = ExecutionConfig::new().set_execution_timeout(Duration::default()/* use setters */);
4426    /// ```
4427    pub fn set_execution_timeout<T>(mut self, v: T) -> Self
4428    where
4429        T: std::convert::Into<wkt::Duration>,
4430    {
4431        self.execution_timeout = std::option::Option::Some(v.into());
4432        self
4433    }
4434
4435    /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4436    ///
4437    /// # Example
4438    /// ```ignore,no_run
4439    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4440    /// use wkt::Duration;
4441    /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(Some(Duration::default()/* use setters */));
4442    /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(None::<Duration>);
4443    /// ```
4444    pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4445    where
4446        T: std::convert::Into<wkt::Duration>,
4447    {
4448        self.execution_timeout = v.map(|x| x.into());
4449        self
4450    }
4451
4452    /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
4453    ///
4454    /// # Example
4455    /// ```ignore,no_run
4456    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4457    /// let x = ExecutionConfig::new().set_verbose(true);
4458    /// ```
4459    pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4460        self.verbose = v.into();
4461        self
4462    }
4463
4464    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
4465    ///
4466    /// Note that all the setters affecting `execution_environment` are mutually
4467    /// exclusive.
4468    ///
4469    /// # Example
4470    /// ```ignore,no_run
4471    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4472    /// use google_cloud_deploy_v1::model::DefaultPool;
4473    /// let x = ExecutionConfig::new().set_execution_environment(Some(
4474    ///     google_cloud_deploy_v1::model::execution_config::ExecutionEnvironment::DefaultPool(DefaultPool::default().into())));
4475    /// ```
4476    pub fn set_execution_environment<
4477        T: std::convert::Into<
4478                std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4479            >,
4480    >(
4481        mut self,
4482        v: T,
4483    ) -> Self {
4484        self.execution_environment = v.into();
4485        self
4486    }
4487
4488    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4489    /// if it holds a `DefaultPool`, `None` if the field is not set or
4490    /// holds a different branch.
4491    pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
4492        #[allow(unreachable_patterns)]
4493        self.execution_environment.as_ref().and_then(|v| match v {
4494            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
4495                std::option::Option::Some(v)
4496            }
4497            _ => std::option::Option::None,
4498        })
4499    }
4500
4501    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4502    /// to hold a `DefaultPool`.
4503    ///
4504    /// Note that all the setters affecting `execution_environment` are
4505    /// mutually exclusive.
4506    ///
4507    /// # Example
4508    /// ```ignore,no_run
4509    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4510    /// use google_cloud_deploy_v1::model::DefaultPool;
4511    /// let x = ExecutionConfig::new().set_default_pool(DefaultPool::default()/* use setters */);
4512    /// assert!(x.default_pool().is_some());
4513    /// assert!(x.private_pool().is_none());
4514    /// ```
4515    pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
4516        mut self,
4517        v: T,
4518    ) -> Self {
4519        self.execution_environment = std::option::Option::Some(
4520            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
4521        );
4522        self
4523    }
4524
4525    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4526    /// if it holds a `PrivatePool`, `None` if the field is not set or
4527    /// holds a different branch.
4528    pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
4529        #[allow(unreachable_patterns)]
4530        self.execution_environment.as_ref().and_then(|v| match v {
4531            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
4532                std::option::Option::Some(v)
4533            }
4534            _ => std::option::Option::None,
4535        })
4536    }
4537
4538    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4539    /// to hold a `PrivatePool`.
4540    ///
4541    /// Note that all the setters affecting `execution_environment` are
4542    /// mutually exclusive.
4543    ///
4544    /// # Example
4545    /// ```ignore,no_run
4546    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4547    /// use google_cloud_deploy_v1::model::PrivatePool;
4548    /// let x = ExecutionConfig::new().set_private_pool(PrivatePool::default()/* use setters */);
4549    /// assert!(x.private_pool().is_some());
4550    /// assert!(x.default_pool().is_none());
4551    /// ```
4552    pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
4553        mut self,
4554        v: T,
4555    ) -> Self {
4556        self.execution_environment = std::option::Option::Some(
4557            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
4558        );
4559        self
4560    }
4561}
4562
4563impl wkt::message::Message for ExecutionConfig {
4564    fn typename() -> &'static str {
4565        "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
4566    }
4567}
4568
4569/// Defines additional types related to [ExecutionConfig].
4570pub mod execution_config {
4571    #[allow(unused_imports)]
4572    use super::*;
4573
4574    /// Possible usages of this configuration.
4575    ///
4576    /// # Working with unknown values
4577    ///
4578    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4579    /// additional enum variants at any time. Adding new variants is not considered
4580    /// a breaking change. Applications should write their code in anticipation of:
4581    ///
4582    /// - New values appearing in future releases of the client library, **and**
4583    /// - New values received dynamically, without application changes.
4584    ///
4585    /// Please consult the [Working with enums] section in the user guide for some
4586    /// guidelines.
4587    ///
4588    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4589    #[derive(Clone, Debug, PartialEq)]
4590    #[non_exhaustive]
4591    pub enum ExecutionEnvironmentUsage {
4592        /// Default value. This value is unused.
4593        Unspecified,
4594        /// Use for rendering.
4595        Render,
4596        /// Use for deploying and deployment hooks.
4597        Deploy,
4598        /// Use for deployment verification.
4599        Verify,
4600        /// Use for predeploy job execution.
4601        Predeploy,
4602        /// Use for postdeploy job execution.
4603        Postdeploy,
4604        /// If set, the enum was initialized with an unknown value.
4605        ///
4606        /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
4607        /// [ExecutionEnvironmentUsage::name].
4608        UnknownValue(execution_environment_usage::UnknownValue),
4609    }
4610
4611    #[doc(hidden)]
4612    pub mod execution_environment_usage {
4613        #[allow(unused_imports)]
4614        use super::*;
4615        #[derive(Clone, Debug, PartialEq)]
4616        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4617    }
4618
4619    impl ExecutionEnvironmentUsage {
4620        /// Gets the enum value.
4621        ///
4622        /// Returns `None` if the enum contains an unknown value deserialized from
4623        /// the string representation of enums.
4624        pub fn value(&self) -> std::option::Option<i32> {
4625            match self {
4626                Self::Unspecified => std::option::Option::Some(0),
4627                Self::Render => std::option::Option::Some(1),
4628                Self::Deploy => std::option::Option::Some(2),
4629                Self::Verify => std::option::Option::Some(3),
4630                Self::Predeploy => std::option::Option::Some(4),
4631                Self::Postdeploy => std::option::Option::Some(5),
4632                Self::UnknownValue(u) => u.0.value(),
4633            }
4634        }
4635
4636        /// Gets the enum value as a string.
4637        ///
4638        /// Returns `None` if the enum contains an unknown value deserialized from
4639        /// the integer representation of enums.
4640        pub fn name(&self) -> std::option::Option<&str> {
4641            match self {
4642                Self::Unspecified => {
4643                    std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
4644                }
4645                Self::Render => std::option::Option::Some("RENDER"),
4646                Self::Deploy => std::option::Option::Some("DEPLOY"),
4647                Self::Verify => std::option::Option::Some("VERIFY"),
4648                Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
4649                Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
4650                Self::UnknownValue(u) => u.0.name(),
4651            }
4652        }
4653    }
4654
4655    impl std::default::Default for ExecutionEnvironmentUsage {
4656        fn default() -> Self {
4657            use std::convert::From;
4658            Self::from(0)
4659        }
4660    }
4661
4662    impl std::fmt::Display for ExecutionEnvironmentUsage {
4663        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4664            wkt::internal::display_enum(f, self.name(), self.value())
4665        }
4666    }
4667
4668    impl std::convert::From<i32> for ExecutionEnvironmentUsage {
4669        fn from(value: i32) -> Self {
4670            match value {
4671                0 => Self::Unspecified,
4672                1 => Self::Render,
4673                2 => Self::Deploy,
4674                3 => Self::Verify,
4675                4 => Self::Predeploy,
4676                5 => Self::Postdeploy,
4677                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4678                    wkt::internal::UnknownEnumValue::Integer(value),
4679                )),
4680            }
4681        }
4682    }
4683
4684    impl std::convert::From<&str> for ExecutionEnvironmentUsage {
4685        fn from(value: &str) -> Self {
4686            use std::string::ToString;
4687            match value {
4688                "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
4689                "RENDER" => Self::Render,
4690                "DEPLOY" => Self::Deploy,
4691                "VERIFY" => Self::Verify,
4692                "PREDEPLOY" => Self::Predeploy,
4693                "POSTDEPLOY" => Self::Postdeploy,
4694                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4695                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4696                )),
4697            }
4698        }
4699    }
4700
4701    impl serde::ser::Serialize for ExecutionEnvironmentUsage {
4702        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4703        where
4704            S: serde::Serializer,
4705        {
4706            match self {
4707                Self::Unspecified => serializer.serialize_i32(0),
4708                Self::Render => serializer.serialize_i32(1),
4709                Self::Deploy => serializer.serialize_i32(2),
4710                Self::Verify => serializer.serialize_i32(3),
4711                Self::Predeploy => serializer.serialize_i32(4),
4712                Self::Postdeploy => serializer.serialize_i32(5),
4713                Self::UnknownValue(u) => u.0.serialize(serializer),
4714            }
4715        }
4716    }
4717
4718    impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
4719        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4720        where
4721            D: serde::Deserializer<'de>,
4722        {
4723            deserializer.deserialize_any(
4724                wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
4725                    ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
4726                ),
4727            )
4728        }
4729    }
4730
4731    /// Details of the environment.
4732    #[derive(Clone, Debug, PartialEq)]
4733    #[non_exhaustive]
4734    pub enum ExecutionEnvironment {
4735        /// Optional. Use default Cloud Build pool.
4736        DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
4737        /// Optional. Use private Cloud Build pool.
4738        PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
4739    }
4740}
4741
4742/// Execution using the default Cloud Build pool.
4743#[derive(Clone, Default, PartialEq)]
4744#[non_exhaustive]
4745pub struct DefaultPool {
4746    /// Optional. Google service account to use for execution. If unspecified,
4747    /// the project execution service account
4748    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4749    pub service_account: std::string::String,
4750
4751    /// Optional. Cloud Storage location where execution outputs should be stored.
4752    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4753    /// ("gs://my-bucket/my-dir").
4754    /// If unspecified, a default bucket located in the same region will be used.
4755    pub artifact_storage: std::string::String,
4756
4757    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4758}
4759
4760impl DefaultPool {
4761    pub fn new() -> Self {
4762        std::default::Default::default()
4763    }
4764
4765    /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
4766    ///
4767    /// # Example
4768    /// ```ignore,no_run
4769    /// # use google_cloud_deploy_v1::model::DefaultPool;
4770    /// let x = DefaultPool::new().set_service_account("example");
4771    /// ```
4772    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4773        self.service_account = v.into();
4774        self
4775    }
4776
4777    /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
4778    ///
4779    /// # Example
4780    /// ```ignore,no_run
4781    /// # use google_cloud_deploy_v1::model::DefaultPool;
4782    /// let x = DefaultPool::new().set_artifact_storage("example");
4783    /// ```
4784    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4785        mut self,
4786        v: T,
4787    ) -> Self {
4788        self.artifact_storage = v.into();
4789        self
4790    }
4791}
4792
4793impl wkt::message::Message for DefaultPool {
4794    fn typename() -> &'static str {
4795        "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
4796    }
4797}
4798
4799/// Execution using a private Cloud Build pool.
4800#[derive(Clone, Default, PartialEq)]
4801#[non_exhaustive]
4802pub struct PrivatePool {
4803    /// Required. Resource name of the Cloud Build worker pool to use. The format
4804    /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
4805    pub worker_pool: std::string::String,
4806
4807    /// Optional. Google service account to use for execution. If unspecified,
4808    /// the project execution service account
4809    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4810    pub service_account: std::string::String,
4811
4812    /// Optional. Cloud Storage location where execution outputs should be stored.
4813    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4814    /// ("gs://my-bucket/my-dir").
4815    /// If unspecified, a default bucket located in the same region will be used.
4816    pub artifact_storage: std::string::String,
4817
4818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4819}
4820
4821impl PrivatePool {
4822    pub fn new() -> Self {
4823        std::default::Default::default()
4824    }
4825
4826    /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
4827    ///
4828    /// # Example
4829    /// ```ignore,no_run
4830    /// # use google_cloud_deploy_v1::model::PrivatePool;
4831    /// let x = PrivatePool::new().set_worker_pool("example");
4832    /// ```
4833    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4834        self.worker_pool = v.into();
4835        self
4836    }
4837
4838    /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
4839    ///
4840    /// # Example
4841    /// ```ignore,no_run
4842    /// # use google_cloud_deploy_v1::model::PrivatePool;
4843    /// let x = PrivatePool::new().set_service_account("example");
4844    /// ```
4845    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4846        self.service_account = v.into();
4847        self
4848    }
4849
4850    /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
4851    ///
4852    /// # Example
4853    /// ```ignore,no_run
4854    /// # use google_cloud_deploy_v1::model::PrivatePool;
4855    /// let x = PrivatePool::new().set_artifact_storage("example");
4856    /// ```
4857    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4858        mut self,
4859        v: T,
4860    ) -> Self {
4861        self.artifact_storage = v.into();
4862        self
4863    }
4864}
4865
4866impl wkt::message::Message for PrivatePool {
4867    fn typename() -> &'static str {
4868        "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
4869    }
4870}
4871
4872/// Information specifying a GKE Cluster.
4873#[derive(Clone, Default, PartialEq)]
4874#[non_exhaustive]
4875pub struct GkeCluster {
4876    /// Optional. Information specifying a GKE Cluster. Format is
4877    /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
4878    pub cluster: std::string::String,
4879
4880    /// Optional. If true, `cluster` is accessed using the private IP address of
4881    /// the control plane endpoint. Otherwise, the default IP address of the
4882    /// control plane endpoint is used. The default IP address is the private IP
4883    /// address for clusters with private control-plane endpoints and the public IP
4884    /// address otherwise.
4885    ///
4886    /// Only specify this option when `cluster` is a [private GKE
4887    /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
4888    /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
4889    pub internal_ip: bool,
4890
4891    /// Optional. If set, used to configure a
4892    /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
4893    /// to the Kubernetes server.
4894    pub proxy_url: std::string::String,
4895
4896    /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
4897    /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
4898    pub dns_endpoint: bool,
4899
4900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4901}
4902
4903impl GkeCluster {
4904    pub fn new() -> Self {
4905        std::default::Default::default()
4906    }
4907
4908    /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
4909    ///
4910    /// # Example
4911    /// ```ignore,no_run
4912    /// # use google_cloud_deploy_v1::model::GkeCluster;
4913    /// let x = GkeCluster::new().set_cluster("example");
4914    /// ```
4915    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4916        self.cluster = v.into();
4917        self
4918    }
4919
4920    /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
4921    ///
4922    /// # Example
4923    /// ```ignore,no_run
4924    /// # use google_cloud_deploy_v1::model::GkeCluster;
4925    /// let x = GkeCluster::new().set_internal_ip(true);
4926    /// ```
4927    pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4928        self.internal_ip = v.into();
4929        self
4930    }
4931
4932    /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
4933    ///
4934    /// # Example
4935    /// ```ignore,no_run
4936    /// # use google_cloud_deploy_v1::model::GkeCluster;
4937    /// let x = GkeCluster::new().set_proxy_url("example");
4938    /// ```
4939    pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4940        self.proxy_url = v.into();
4941        self
4942    }
4943
4944    /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
4945    ///
4946    /// # Example
4947    /// ```ignore,no_run
4948    /// # use google_cloud_deploy_v1::model::GkeCluster;
4949    /// let x = GkeCluster::new().set_dns_endpoint(true);
4950    /// ```
4951    pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4952        self.dns_endpoint = v.into();
4953        self
4954    }
4955}
4956
4957impl wkt::message::Message for GkeCluster {
4958    fn typename() -> &'static str {
4959        "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
4960    }
4961}
4962
4963/// Information specifying an Anthos Cluster.
4964#[derive(Clone, Default, PartialEq)]
4965#[non_exhaustive]
4966pub struct AnthosCluster {
4967    /// Optional. Membership of the GKE Hub-registered cluster to which to apply
4968    /// the Skaffold configuration. Format is
4969    /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
4970    pub membership: std::string::String,
4971
4972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4973}
4974
4975impl AnthosCluster {
4976    pub fn new() -> Self {
4977        std::default::Default::default()
4978    }
4979
4980    /// Sets the value of [membership][crate::model::AnthosCluster::membership].
4981    ///
4982    /// # Example
4983    /// ```ignore,no_run
4984    /// # use google_cloud_deploy_v1::model::AnthosCluster;
4985    /// let x = AnthosCluster::new().set_membership("example");
4986    /// ```
4987    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4988        self.membership = v.into();
4989        self
4990    }
4991}
4992
4993impl wkt::message::Message for AnthosCluster {
4994    fn typename() -> &'static str {
4995        "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
4996    }
4997}
4998
4999/// Information specifying where to deploy a Cloud Run Service.
5000#[derive(Clone, Default, PartialEq)]
5001#[non_exhaustive]
5002pub struct CloudRunLocation {
5003    /// Required. The location for the Cloud Run Service. Format must be
5004    /// `projects/{project}/locations/{location}`.
5005    pub location: std::string::String,
5006
5007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5008}
5009
5010impl CloudRunLocation {
5011    pub fn new() -> Self {
5012        std::default::Default::default()
5013    }
5014
5015    /// Sets the value of [location][crate::model::CloudRunLocation::location].
5016    ///
5017    /// # Example
5018    /// ```ignore,no_run
5019    /// # use google_cloud_deploy_v1::model::CloudRunLocation;
5020    /// let x = CloudRunLocation::new().set_location("example");
5021    /// ```
5022    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5023        self.location = v.into();
5024        self
5025    }
5026}
5027
5028impl wkt::message::Message for CloudRunLocation {
5029    fn typename() -> &'static str {
5030        "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
5031    }
5032}
5033
5034/// Information specifying a multiTarget.
5035#[derive(Clone, Default, PartialEq)]
5036#[non_exhaustive]
5037pub struct MultiTarget {
5038    /// Required. The target_ids of this multiTarget.
5039    pub target_ids: std::vec::Vec<std::string::String>,
5040
5041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5042}
5043
5044impl MultiTarget {
5045    pub fn new() -> Self {
5046        std::default::Default::default()
5047    }
5048
5049    /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
5050    ///
5051    /// # Example
5052    /// ```ignore,no_run
5053    /// # use google_cloud_deploy_v1::model::MultiTarget;
5054    /// let x = MultiTarget::new().set_target_ids(["a", "b", "c"]);
5055    /// ```
5056    pub fn set_target_ids<T, V>(mut self, v: T) -> Self
5057    where
5058        T: std::iter::IntoIterator<Item = V>,
5059        V: std::convert::Into<std::string::String>,
5060    {
5061        use std::iter::Iterator;
5062        self.target_ids = v.into_iter().map(|i| i.into()).collect();
5063        self
5064    }
5065}
5066
5067impl wkt::message::Message for MultiTarget {
5068    fn typename() -> &'static str {
5069        "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
5070    }
5071}
5072
5073/// Information specifying a Custom Target.
5074#[derive(Clone, Default, PartialEq)]
5075#[non_exhaustive]
5076pub struct CustomTarget {
5077    /// Required. The name of the CustomTargetType. Format must be
5078    /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
5079    pub custom_target_type: std::string::String,
5080
5081    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5082}
5083
5084impl CustomTarget {
5085    pub fn new() -> Self {
5086        std::default::Default::default()
5087    }
5088
5089    /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
5090    ///
5091    /// # Example
5092    /// ```ignore,no_run
5093    /// # use google_cloud_deploy_v1::model::CustomTarget;
5094    /// let x = CustomTarget::new().set_custom_target_type("example");
5095    /// ```
5096    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
5097        mut self,
5098        v: T,
5099    ) -> Self {
5100        self.custom_target_type = v.into();
5101        self
5102    }
5103}
5104
5105impl wkt::message::Message for CustomTarget {
5106    fn typename() -> &'static str {
5107        "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
5108    }
5109}
5110
5111/// Information about entities associated with a `Target`.
5112#[derive(Clone, Default, PartialEq)]
5113#[non_exhaustive]
5114pub struct AssociatedEntities {
5115    /// Optional. Information specifying GKE clusters as associated entities.
5116    pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
5117
5118    /// Optional. Information specifying Anthos clusters as associated entities.
5119    pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
5120
5121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5122}
5123
5124impl AssociatedEntities {
5125    pub fn new() -> Self {
5126        std::default::Default::default()
5127    }
5128
5129    /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
5130    ///
5131    /// # Example
5132    /// ```ignore,no_run
5133    /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5134    /// use google_cloud_deploy_v1::model::GkeCluster;
5135    /// let x = AssociatedEntities::new()
5136    ///     .set_gke_clusters([
5137    ///         GkeCluster::default()/* use setters */,
5138    ///         GkeCluster::default()/* use (different) setters */,
5139    ///     ]);
5140    /// ```
5141    pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
5142    where
5143        T: std::iter::IntoIterator<Item = V>,
5144        V: std::convert::Into<crate::model::GkeCluster>,
5145    {
5146        use std::iter::Iterator;
5147        self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
5148        self
5149    }
5150
5151    /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
5152    ///
5153    /// # Example
5154    /// ```ignore,no_run
5155    /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5156    /// use google_cloud_deploy_v1::model::AnthosCluster;
5157    /// let x = AssociatedEntities::new()
5158    ///     .set_anthos_clusters([
5159    ///         AnthosCluster::default()/* use setters */,
5160    ///         AnthosCluster::default()/* use (different) setters */,
5161    ///     ]);
5162    /// ```
5163    pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
5164    where
5165        T: std::iter::IntoIterator<Item = V>,
5166        V: std::convert::Into<crate::model::AnthosCluster>,
5167    {
5168        use std::iter::Iterator;
5169        self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
5170        self
5171    }
5172}
5173
5174impl wkt::message::Message for AssociatedEntities {
5175    fn typename() -> &'static str {
5176        "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
5177    }
5178}
5179
5180/// The request object for `ListTargets`.
5181#[derive(Clone, Default, PartialEq)]
5182#[non_exhaustive]
5183pub struct ListTargetsRequest {
5184    /// Required. The parent, which owns this collection of targets. Format must be
5185    /// `projects/{project_id}/locations/{location_name}`.
5186    pub parent: std::string::String,
5187
5188    /// Optional. The maximum number of `Target` objects to return. The service may
5189    /// return fewer than this value. If unspecified, at most 50 `Target` objects
5190    /// will be returned. The maximum value is 1000; values above 1000 will be set
5191    /// to 1000.
5192    pub page_size: i32,
5193
5194    /// Optional. A page token, received from a previous `ListTargets` call.
5195    /// Provide this to retrieve the subsequent page.
5196    ///
5197    /// When paginating, all other provided parameters match
5198    /// the call that provided the page token.
5199    pub page_token: std::string::String,
5200
5201    /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
5202    /// more details.
5203    pub filter: std::string::String,
5204
5205    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
5206    /// more details.
5207    pub order_by: std::string::String,
5208
5209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5210}
5211
5212impl ListTargetsRequest {
5213    pub fn new() -> Self {
5214        std::default::Default::default()
5215    }
5216
5217    /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
5218    ///
5219    /// # Example
5220    /// ```ignore,no_run
5221    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5222    /// let x = ListTargetsRequest::new().set_parent("example");
5223    /// ```
5224    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5225        self.parent = v.into();
5226        self
5227    }
5228
5229    /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
5230    ///
5231    /// # Example
5232    /// ```ignore,no_run
5233    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5234    /// let x = ListTargetsRequest::new().set_page_size(42);
5235    /// ```
5236    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5237        self.page_size = v.into();
5238        self
5239    }
5240
5241    /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
5242    ///
5243    /// # Example
5244    /// ```ignore,no_run
5245    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5246    /// let x = ListTargetsRequest::new().set_page_token("example");
5247    /// ```
5248    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5249        self.page_token = v.into();
5250        self
5251    }
5252
5253    /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
5254    ///
5255    /// # Example
5256    /// ```ignore,no_run
5257    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5258    /// let x = ListTargetsRequest::new().set_filter("example");
5259    /// ```
5260    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5261        self.filter = v.into();
5262        self
5263    }
5264
5265    /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
5266    ///
5267    /// # Example
5268    /// ```ignore,no_run
5269    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5270    /// let x = ListTargetsRequest::new().set_order_by("example");
5271    /// ```
5272    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5273        self.order_by = v.into();
5274        self
5275    }
5276}
5277
5278impl wkt::message::Message for ListTargetsRequest {
5279    fn typename() -> &'static str {
5280        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
5281    }
5282}
5283
5284/// The response object from `ListTargets`.
5285#[derive(Clone, Default, PartialEq)]
5286#[non_exhaustive]
5287pub struct ListTargetsResponse {
5288    /// The `Target` objects.
5289    pub targets: std::vec::Vec<crate::model::Target>,
5290
5291    /// A token, which can be sent as `page_token` to retrieve the next page.
5292    /// If this field is omitted, there are no subsequent pages.
5293    pub next_page_token: std::string::String,
5294
5295    /// Locations that could not be reached.
5296    pub unreachable: std::vec::Vec<std::string::String>,
5297
5298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5299}
5300
5301impl ListTargetsResponse {
5302    pub fn new() -> Self {
5303        std::default::Default::default()
5304    }
5305
5306    /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
5307    ///
5308    /// # Example
5309    /// ```ignore,no_run
5310    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5311    /// use google_cloud_deploy_v1::model::Target;
5312    /// let x = ListTargetsResponse::new()
5313    ///     .set_targets([
5314    ///         Target::default()/* use setters */,
5315    ///         Target::default()/* use (different) setters */,
5316    ///     ]);
5317    /// ```
5318    pub fn set_targets<T, V>(mut self, v: T) -> Self
5319    where
5320        T: std::iter::IntoIterator<Item = V>,
5321        V: std::convert::Into<crate::model::Target>,
5322    {
5323        use std::iter::Iterator;
5324        self.targets = v.into_iter().map(|i| i.into()).collect();
5325        self
5326    }
5327
5328    /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
5329    ///
5330    /// # Example
5331    /// ```ignore,no_run
5332    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5333    /// let x = ListTargetsResponse::new().set_next_page_token("example");
5334    /// ```
5335    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5336        self.next_page_token = v.into();
5337        self
5338    }
5339
5340    /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
5341    ///
5342    /// # Example
5343    /// ```ignore,no_run
5344    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5345    /// let x = ListTargetsResponse::new().set_unreachable(["a", "b", "c"]);
5346    /// ```
5347    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5348    where
5349        T: std::iter::IntoIterator<Item = V>,
5350        V: std::convert::Into<std::string::String>,
5351    {
5352        use std::iter::Iterator;
5353        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5354        self
5355    }
5356}
5357
5358impl wkt::message::Message for ListTargetsResponse {
5359    fn typename() -> &'static str {
5360        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
5361    }
5362}
5363
5364#[doc(hidden)]
5365impl gax::paginator::internal::PageableResponse for ListTargetsResponse {
5366    type PageItem = crate::model::Target;
5367
5368    fn items(self) -> std::vec::Vec<Self::PageItem> {
5369        self.targets
5370    }
5371
5372    fn next_page_token(&self) -> std::string::String {
5373        use std::clone::Clone;
5374        self.next_page_token.clone()
5375    }
5376}
5377
5378/// The request object for `GetTarget`.
5379#[derive(Clone, Default, PartialEq)]
5380#[non_exhaustive]
5381pub struct GetTargetRequest {
5382    /// Required. Name of the `Target`. Format must be
5383    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5384    pub name: std::string::String,
5385
5386    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5387}
5388
5389impl GetTargetRequest {
5390    pub fn new() -> Self {
5391        std::default::Default::default()
5392    }
5393
5394    /// Sets the value of [name][crate::model::GetTargetRequest::name].
5395    ///
5396    /// # Example
5397    /// ```ignore,no_run
5398    /// # use google_cloud_deploy_v1::model::GetTargetRequest;
5399    /// let x = GetTargetRequest::new().set_name("example");
5400    /// ```
5401    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5402        self.name = v.into();
5403        self
5404    }
5405}
5406
5407impl wkt::message::Message for GetTargetRequest {
5408    fn typename() -> &'static str {
5409        "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
5410    }
5411}
5412
5413/// The request object for `CreateTarget`.
5414#[derive(Clone, Default, PartialEq)]
5415#[non_exhaustive]
5416pub struct CreateTargetRequest {
5417    /// Required. The parent collection in which the `Target` must be created.
5418    /// The format is
5419    /// `projects/{project_id}/locations/{location_name}`.
5420    pub parent: std::string::String,
5421
5422    /// Required. ID of the `Target`.
5423    pub target_id: std::string::String,
5424
5425    /// Required. The `Target` to create.
5426    pub target: std::option::Option<crate::model::Target>,
5427
5428    /// Optional. A request ID to identify requests. Specify a unique request ID
5429    /// so that if you must retry your request, the server knows to ignore the
5430    /// request if it has already been completed. The server guarantees that for
5431    /// at least 60 minutes after the first request.
5432    ///
5433    /// For example, consider a situation where you make an initial request and the
5434    /// request times out. If you make the request again with the same request ID,
5435    /// the server can check if original operation with the same request ID was
5436    /// received, and if so, will ignore the second request. This prevents clients
5437    /// from accidentally creating duplicate commitments.
5438    ///
5439    /// The request ID must be a valid UUID with the exception that zero UUID is
5440    /// not supported (00000000-0000-0000-0000-000000000000).
5441    pub request_id: std::string::String,
5442
5443    /// Optional. If set to true, the request is validated and the user is provided
5444    /// with an expected result, but no actual change is made.
5445    pub validate_only: bool,
5446
5447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5448}
5449
5450impl CreateTargetRequest {
5451    pub fn new() -> Self {
5452        std::default::Default::default()
5453    }
5454
5455    /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
5456    ///
5457    /// # Example
5458    /// ```ignore,no_run
5459    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5460    /// let x = CreateTargetRequest::new().set_parent("example");
5461    /// ```
5462    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5463        self.parent = v.into();
5464        self
5465    }
5466
5467    /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
5468    ///
5469    /// # Example
5470    /// ```ignore,no_run
5471    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5472    /// let x = CreateTargetRequest::new().set_target_id("example");
5473    /// ```
5474    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5475        self.target_id = v.into();
5476        self
5477    }
5478
5479    /// Sets the value of [target][crate::model::CreateTargetRequest::target].
5480    ///
5481    /// # Example
5482    /// ```ignore,no_run
5483    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5484    /// use google_cloud_deploy_v1::model::Target;
5485    /// let x = CreateTargetRequest::new().set_target(Target::default()/* use setters */);
5486    /// ```
5487    pub fn set_target<T>(mut self, v: T) -> Self
5488    where
5489        T: std::convert::Into<crate::model::Target>,
5490    {
5491        self.target = std::option::Option::Some(v.into());
5492        self
5493    }
5494
5495    /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
5496    ///
5497    /// # Example
5498    /// ```ignore,no_run
5499    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5500    /// use google_cloud_deploy_v1::model::Target;
5501    /// let x = CreateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5502    /// let x = CreateTargetRequest::new().set_or_clear_target(None::<Target>);
5503    /// ```
5504    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5505    where
5506        T: std::convert::Into<crate::model::Target>,
5507    {
5508        self.target = v.map(|x| x.into());
5509        self
5510    }
5511
5512    /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
5513    ///
5514    /// # Example
5515    /// ```ignore,no_run
5516    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5517    /// let x = CreateTargetRequest::new().set_request_id("example");
5518    /// ```
5519    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5520        self.request_id = v.into();
5521        self
5522    }
5523
5524    /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
5525    ///
5526    /// # Example
5527    /// ```ignore,no_run
5528    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5529    /// let x = CreateTargetRequest::new().set_validate_only(true);
5530    /// ```
5531    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5532        self.validate_only = v.into();
5533        self
5534    }
5535}
5536
5537impl wkt::message::Message for CreateTargetRequest {
5538    fn typename() -> &'static str {
5539        "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
5540    }
5541}
5542
5543/// The request object for `UpdateTarget`.
5544#[derive(Clone, Default, PartialEq)]
5545#[non_exhaustive]
5546pub struct UpdateTargetRequest {
5547    /// Required. Field mask is used to specify the fields to be overwritten by the
5548    /// update in the `Target` resource. The fields specified in the update_mask
5549    /// are relative to the resource, not the full request. A field will be
5550    /// overwritten if it's in the mask. If the user doesn't provide a mask then
5551    /// all fields are overwritten.
5552    pub update_mask: std::option::Option<wkt::FieldMask>,
5553
5554    /// Required. The `Target` to update.
5555    pub target: std::option::Option<crate::model::Target>,
5556
5557    /// Optional. A request ID to identify requests. Specify a unique request ID
5558    /// so that if you must retry your request, the server knows to ignore the
5559    /// request if it has already been completed. The server guarantees that for
5560    /// at least 60 minutes after the first request.
5561    ///
5562    /// For example, consider a situation where you make an initial request and the
5563    /// request times out. If you make the request again with the same request ID,
5564    /// the server can check if original operation with the same request ID was
5565    /// received, and if so, will ignore the second request. This prevents clients
5566    /// from accidentally creating duplicate commitments.
5567    ///
5568    /// The request ID must be a valid UUID with the exception that zero UUID is
5569    /// not supported (00000000-0000-0000-0000-000000000000).
5570    pub request_id: std::string::String,
5571
5572    /// Optional. If set to true, updating a `Target` that does not exist will
5573    /// result in the creation of a new `Target`.
5574    pub allow_missing: bool,
5575
5576    /// Optional. If set to true, the request is validated and the user is provided
5577    /// with an expected result, but no actual change is made.
5578    pub validate_only: bool,
5579
5580    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5581}
5582
5583impl UpdateTargetRequest {
5584    pub fn new() -> Self {
5585        std::default::Default::default()
5586    }
5587
5588    /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5589    ///
5590    /// # Example
5591    /// ```ignore,no_run
5592    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5593    /// use wkt::FieldMask;
5594    /// let x = UpdateTargetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5595    /// ```
5596    pub fn set_update_mask<T>(mut self, v: T) -> Self
5597    where
5598        T: std::convert::Into<wkt::FieldMask>,
5599    {
5600        self.update_mask = std::option::Option::Some(v.into());
5601        self
5602    }
5603
5604    /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5605    ///
5606    /// # Example
5607    /// ```ignore,no_run
5608    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5609    /// use wkt::FieldMask;
5610    /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5611    /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5612    /// ```
5613    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5614    where
5615        T: std::convert::Into<wkt::FieldMask>,
5616    {
5617        self.update_mask = v.map(|x| x.into());
5618        self
5619    }
5620
5621    /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
5622    ///
5623    /// # Example
5624    /// ```ignore,no_run
5625    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5626    /// use google_cloud_deploy_v1::model::Target;
5627    /// let x = UpdateTargetRequest::new().set_target(Target::default()/* use setters */);
5628    /// ```
5629    pub fn set_target<T>(mut self, v: T) -> Self
5630    where
5631        T: std::convert::Into<crate::model::Target>,
5632    {
5633        self.target = std::option::Option::Some(v.into());
5634        self
5635    }
5636
5637    /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
5638    ///
5639    /// # Example
5640    /// ```ignore,no_run
5641    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5642    /// use google_cloud_deploy_v1::model::Target;
5643    /// let x = UpdateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5644    /// let x = UpdateTargetRequest::new().set_or_clear_target(None::<Target>);
5645    /// ```
5646    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5647    where
5648        T: std::convert::Into<crate::model::Target>,
5649    {
5650        self.target = v.map(|x| x.into());
5651        self
5652    }
5653
5654    /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
5655    ///
5656    /// # Example
5657    /// ```ignore,no_run
5658    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5659    /// let x = UpdateTargetRequest::new().set_request_id("example");
5660    /// ```
5661    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5662        self.request_id = v.into();
5663        self
5664    }
5665
5666    /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
5667    ///
5668    /// # Example
5669    /// ```ignore,no_run
5670    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5671    /// let x = UpdateTargetRequest::new().set_allow_missing(true);
5672    /// ```
5673    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5674        self.allow_missing = v.into();
5675        self
5676    }
5677
5678    /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
5679    ///
5680    /// # Example
5681    /// ```ignore,no_run
5682    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5683    /// let x = UpdateTargetRequest::new().set_validate_only(true);
5684    /// ```
5685    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5686        self.validate_only = v.into();
5687        self
5688    }
5689}
5690
5691impl wkt::message::Message for UpdateTargetRequest {
5692    fn typename() -> &'static str {
5693        "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
5694    }
5695}
5696
5697/// The request object for `DeleteTarget`.
5698#[derive(Clone, Default, PartialEq)]
5699#[non_exhaustive]
5700pub struct DeleteTargetRequest {
5701    /// Required. The name of the `Target` to delete. The format is
5702    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5703    pub name: std::string::String,
5704
5705    /// Optional. A request ID to identify requests. Specify a unique request ID
5706    /// so that if you must retry your request, the server knows to ignore the
5707    /// request if it has already been completed. The server guarantees that for
5708    /// at least 60 minutes after the first request.
5709    ///
5710    /// For example, consider a situation where you make an initial request and the
5711    /// request times out. If you make the request again with the same request ID,
5712    /// the server can check if original operation with the same request ID was
5713    /// received, and if so, will ignore the second request. This prevents clients
5714    /// from accidentally creating duplicate commitments.
5715    ///
5716    /// The request ID must be a valid UUID with the exception that zero UUID is
5717    /// not supported (00000000-0000-0000-0000-000000000000).
5718    pub request_id: std::string::String,
5719
5720    /// Optional. If set to true, then deleting an already deleted or non-existing
5721    /// `Target` will succeed.
5722    pub allow_missing: bool,
5723
5724    /// Optional. If set, validate the request and preview the review, but do not
5725    /// actually post it.
5726    pub validate_only: bool,
5727
5728    /// Optional. This checksum is computed by the server based on the value of
5729    /// other fields, and may be sent on update and delete requests to ensure the
5730    /// client has an up-to-date value before proceeding.
5731    pub etag: std::string::String,
5732
5733    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5734}
5735
5736impl DeleteTargetRequest {
5737    pub fn new() -> Self {
5738        std::default::Default::default()
5739    }
5740
5741    /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
5742    ///
5743    /// # Example
5744    /// ```ignore,no_run
5745    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5746    /// let x = DeleteTargetRequest::new().set_name("example");
5747    /// ```
5748    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5749        self.name = v.into();
5750        self
5751    }
5752
5753    /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
5754    ///
5755    /// # Example
5756    /// ```ignore,no_run
5757    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5758    /// let x = DeleteTargetRequest::new().set_request_id("example");
5759    /// ```
5760    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5761        self.request_id = v.into();
5762        self
5763    }
5764
5765    /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
5766    ///
5767    /// # Example
5768    /// ```ignore,no_run
5769    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5770    /// let x = DeleteTargetRequest::new().set_allow_missing(true);
5771    /// ```
5772    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5773        self.allow_missing = v.into();
5774        self
5775    }
5776
5777    /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
5778    ///
5779    /// # Example
5780    /// ```ignore,no_run
5781    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5782    /// let x = DeleteTargetRequest::new().set_validate_only(true);
5783    /// ```
5784    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5785        self.validate_only = v.into();
5786        self
5787    }
5788
5789    /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
5790    ///
5791    /// # Example
5792    /// ```ignore,no_run
5793    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5794    /// let x = DeleteTargetRequest::new().set_etag("example");
5795    /// ```
5796    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5797        self.etag = v.into();
5798        self
5799    }
5800}
5801
5802impl wkt::message::Message for DeleteTargetRequest {
5803    fn typename() -> &'static str {
5804        "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
5805    }
5806}
5807
5808/// A `CustomTargetType` resource in the Cloud Deploy API.
5809///
5810/// A `CustomTargetType` defines a type of custom target that can be referenced
5811/// in a `Target` in order to facilitate deploying to other systems besides the
5812/// supported runtimes.
5813#[derive(Clone, Default, PartialEq)]
5814#[non_exhaustive]
5815pub struct CustomTargetType {
5816    /// Identifier. Name of the `CustomTargetType`. Format is
5817    /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
5818    /// The `customTargetType` component must match
5819    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5820    pub name: std::string::String,
5821
5822    /// Output only. Resource id of the `CustomTargetType`.
5823    pub custom_target_type_id: std::string::String,
5824
5825    /// Output only. Unique identifier of the `CustomTargetType`.
5826    pub uid: std::string::String,
5827
5828    /// Optional. Description of the `CustomTargetType`. Max length is 255
5829    /// characters.
5830    pub description: std::string::String,
5831
5832    /// Optional. User annotations. These attributes can only be set and used by
5833    /// the user, and not by Cloud Deploy. See
5834    /// <https://google.aip.dev/128#annotations> for more details such as format and
5835    /// size limitations.
5836    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5837
5838    /// Optional. Labels are attributes that can be set and used by both the
5839    /// user and by Cloud Deploy. Labels must meet the following constraints:
5840    ///
5841    /// * Keys and values can contain only lowercase letters, numeric characters,
5842    ///   underscores, and dashes.
5843    /// * All characters must use UTF-8 encoding, and international characters are
5844    ///   allowed.
5845    /// * Keys must start with a lowercase letter or international character.
5846    /// * Each resource is limited to a maximum of 64 labels.
5847    ///
5848    /// Both keys and values are additionally constrained to be <= 128 bytes.
5849    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5850
5851    /// Output only. Time at which the `CustomTargetType` was created.
5852    pub create_time: std::option::Option<wkt::Timestamp>,
5853
5854    /// Output only. Most recent time at which the `CustomTargetType` was updated.
5855    pub update_time: std::option::Option<wkt::Timestamp>,
5856
5857    /// Optional. This checksum is computed by the server based on the value of
5858    /// other fields, and may be sent on update and delete requests to ensure the
5859    /// client has an up-to-date value before proceeding.
5860    pub etag: std::string::String,
5861
5862    /// Defines the `CustomTargetType` renderer and deployer.
5863    pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
5864
5865    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5866}
5867
5868impl CustomTargetType {
5869    pub fn new() -> Self {
5870        std::default::Default::default()
5871    }
5872
5873    /// Sets the value of [name][crate::model::CustomTargetType::name].
5874    ///
5875    /// # Example
5876    /// ```ignore,no_run
5877    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5878    /// let x = CustomTargetType::new().set_name("example");
5879    /// ```
5880    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5881        self.name = v.into();
5882        self
5883    }
5884
5885    /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
5886    ///
5887    /// # Example
5888    /// ```ignore,no_run
5889    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5890    /// let x = CustomTargetType::new().set_custom_target_type_id("example");
5891    /// ```
5892    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5893        mut self,
5894        v: T,
5895    ) -> Self {
5896        self.custom_target_type_id = v.into();
5897        self
5898    }
5899
5900    /// Sets the value of [uid][crate::model::CustomTargetType::uid].
5901    ///
5902    /// # Example
5903    /// ```ignore,no_run
5904    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5905    /// let x = CustomTargetType::new().set_uid("example");
5906    /// ```
5907    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5908        self.uid = v.into();
5909        self
5910    }
5911
5912    /// Sets the value of [description][crate::model::CustomTargetType::description].
5913    ///
5914    /// # Example
5915    /// ```ignore,no_run
5916    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5917    /// let x = CustomTargetType::new().set_description("example");
5918    /// ```
5919    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920        self.description = v.into();
5921        self
5922    }
5923
5924    /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
5925    ///
5926    /// # Example
5927    /// ```ignore,no_run
5928    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5929    /// let x = CustomTargetType::new().set_annotations([
5930    ///     ("key0", "abc"),
5931    ///     ("key1", "xyz"),
5932    /// ]);
5933    /// ```
5934    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5935    where
5936        T: std::iter::IntoIterator<Item = (K, V)>,
5937        K: std::convert::Into<std::string::String>,
5938        V: std::convert::Into<std::string::String>,
5939    {
5940        use std::iter::Iterator;
5941        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5942        self
5943    }
5944
5945    /// Sets the value of [labels][crate::model::CustomTargetType::labels].
5946    ///
5947    /// # Example
5948    /// ```ignore,no_run
5949    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5950    /// let x = CustomTargetType::new().set_labels([
5951    ///     ("key0", "abc"),
5952    ///     ("key1", "xyz"),
5953    /// ]);
5954    /// ```
5955    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5956    where
5957        T: std::iter::IntoIterator<Item = (K, V)>,
5958        K: std::convert::Into<std::string::String>,
5959        V: std::convert::Into<std::string::String>,
5960    {
5961        use std::iter::Iterator;
5962        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5963        self
5964    }
5965
5966    /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
5967    ///
5968    /// # Example
5969    /// ```ignore,no_run
5970    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5971    /// use wkt::Timestamp;
5972    /// let x = CustomTargetType::new().set_create_time(Timestamp::default()/* use setters */);
5973    /// ```
5974    pub fn set_create_time<T>(mut self, v: T) -> Self
5975    where
5976        T: std::convert::Into<wkt::Timestamp>,
5977    {
5978        self.create_time = std::option::Option::Some(v.into());
5979        self
5980    }
5981
5982    /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
5983    ///
5984    /// # Example
5985    /// ```ignore,no_run
5986    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5987    /// use wkt::Timestamp;
5988    /// let x = CustomTargetType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5989    /// let x = CustomTargetType::new().set_or_clear_create_time(None::<Timestamp>);
5990    /// ```
5991    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5992    where
5993        T: std::convert::Into<wkt::Timestamp>,
5994    {
5995        self.create_time = v.map(|x| x.into());
5996        self
5997    }
5998
5999    /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
6000    ///
6001    /// # Example
6002    /// ```ignore,no_run
6003    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6004    /// use wkt::Timestamp;
6005    /// let x = CustomTargetType::new().set_update_time(Timestamp::default()/* use setters */);
6006    /// ```
6007    pub fn set_update_time<T>(mut self, v: T) -> Self
6008    where
6009        T: std::convert::Into<wkt::Timestamp>,
6010    {
6011        self.update_time = std::option::Option::Some(v.into());
6012        self
6013    }
6014
6015    /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
6016    ///
6017    /// # Example
6018    /// ```ignore,no_run
6019    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6020    /// use wkt::Timestamp;
6021    /// let x = CustomTargetType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6022    /// let x = CustomTargetType::new().set_or_clear_update_time(None::<Timestamp>);
6023    /// ```
6024    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6025    where
6026        T: std::convert::Into<wkt::Timestamp>,
6027    {
6028        self.update_time = v.map(|x| x.into());
6029        self
6030    }
6031
6032    /// Sets the value of [etag][crate::model::CustomTargetType::etag].
6033    ///
6034    /// # Example
6035    /// ```ignore,no_run
6036    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6037    /// let x = CustomTargetType::new().set_etag("example");
6038    /// ```
6039    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040        self.etag = v.into();
6041        self
6042    }
6043
6044    /// Sets the value of [definition][crate::model::CustomTargetType::definition].
6045    ///
6046    /// Note that all the setters affecting `definition` are mutually
6047    /// exclusive.
6048    ///
6049    /// # Example
6050    /// ```ignore,no_run
6051    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6052    /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6053    /// let x = CustomTargetType::new().set_definition(Some(
6054    ///     google_cloud_deploy_v1::model::custom_target_type::Definition::CustomActions(CustomTargetSkaffoldActions::default().into())));
6055    /// ```
6056    pub fn set_definition<
6057        T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
6058    >(
6059        mut self,
6060        v: T,
6061    ) -> Self {
6062        self.definition = v.into();
6063        self
6064    }
6065
6066    /// The value of [definition][crate::model::CustomTargetType::definition]
6067    /// if it holds a `CustomActions`, `None` if the field is not set or
6068    /// holds a different branch.
6069    pub fn custom_actions(
6070        &self,
6071    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
6072        #[allow(unreachable_patterns)]
6073        self.definition.as_ref().and_then(|v| match v {
6074            crate::model::custom_target_type::Definition::CustomActions(v) => {
6075                std::option::Option::Some(v)
6076            }
6077            _ => std::option::Option::None,
6078        })
6079    }
6080
6081    /// Sets the value of [definition][crate::model::CustomTargetType::definition]
6082    /// to hold a `CustomActions`.
6083    ///
6084    /// Note that all the setters affecting `definition` are
6085    /// mutually exclusive.
6086    ///
6087    /// # Example
6088    /// ```ignore,no_run
6089    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6090    /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6091    /// let x = CustomTargetType::new().set_custom_actions(CustomTargetSkaffoldActions::default()/* use setters */);
6092    /// assert!(x.custom_actions().is_some());
6093    /// ```
6094    pub fn set_custom_actions<
6095        T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
6096    >(
6097        mut self,
6098        v: T,
6099    ) -> Self {
6100        self.definition = std::option::Option::Some(
6101            crate::model::custom_target_type::Definition::CustomActions(v.into()),
6102        );
6103        self
6104    }
6105}
6106
6107impl wkt::message::Message for CustomTargetType {
6108    fn typename() -> &'static str {
6109        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
6110    }
6111}
6112
6113/// Defines additional types related to [CustomTargetType].
6114pub mod custom_target_type {
6115    #[allow(unused_imports)]
6116    use super::*;
6117
6118    /// Defines the `CustomTargetType` renderer and deployer.
6119    #[derive(Clone, Debug, PartialEq)]
6120    #[non_exhaustive]
6121    pub enum Definition {
6122        /// Optional. Configures render and deploy for the `CustomTargetType` using
6123        /// Skaffold custom actions.
6124        CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
6125    }
6126}
6127
6128/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
6129/// using Skaffold custom actions.
6130#[derive(Clone, Default, PartialEq)]
6131#[non_exhaustive]
6132pub struct CustomTargetSkaffoldActions {
6133    /// Optional. The Skaffold custom action responsible for render operations. If
6134    /// not provided then Cloud Deploy will perform the render operations via
6135    /// `skaffold render`.
6136    pub render_action: std::string::String,
6137
6138    /// Required. The Skaffold custom action responsible for deploy operations.
6139    pub deploy_action: std::string::String,
6140
6141    /// Optional. List of Skaffold modules Cloud Deploy will include in the
6142    /// Skaffold Config as required before performing diagnose.
6143    pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
6144
6145    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6146}
6147
6148impl CustomTargetSkaffoldActions {
6149    pub fn new() -> Self {
6150        std::default::Default::default()
6151    }
6152
6153    /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
6154    ///
6155    /// # Example
6156    /// ```ignore,no_run
6157    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6158    /// let x = CustomTargetSkaffoldActions::new().set_render_action("example");
6159    /// ```
6160    pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6161        self.render_action = v.into();
6162        self
6163    }
6164
6165    /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
6166    ///
6167    /// # Example
6168    /// ```ignore,no_run
6169    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6170    /// let x = CustomTargetSkaffoldActions::new().set_deploy_action("example");
6171    /// ```
6172    pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6173        self.deploy_action = v.into();
6174        self
6175    }
6176
6177    /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
6178    ///
6179    /// # Example
6180    /// ```ignore,no_run
6181    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6182    /// use google_cloud_deploy_v1::model::SkaffoldModules;
6183    /// let x = CustomTargetSkaffoldActions::new()
6184    ///     .set_include_skaffold_modules([
6185    ///         SkaffoldModules::default()/* use setters */,
6186    ///         SkaffoldModules::default()/* use (different) setters */,
6187    ///     ]);
6188    /// ```
6189    pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
6190    where
6191        T: std::iter::IntoIterator<Item = V>,
6192        V: std::convert::Into<crate::model::SkaffoldModules>,
6193    {
6194        use std::iter::Iterator;
6195        self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
6196        self
6197    }
6198}
6199
6200impl wkt::message::Message for CustomTargetSkaffoldActions {
6201    fn typename() -> &'static str {
6202        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
6203    }
6204}
6205
6206/// Skaffold Config modules and their remote source.
6207#[derive(Clone, Default, PartialEq)]
6208#[non_exhaustive]
6209pub struct SkaffoldModules {
6210    /// Optional. The Skaffold Config modules to use from the specified source.
6211    pub configs: std::vec::Vec<std::string::String>,
6212
6213    /// The source that contains the Skaffold Config modules.
6214    pub source: std::option::Option<crate::model::skaffold_modules::Source>,
6215
6216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6217}
6218
6219impl SkaffoldModules {
6220    pub fn new() -> Self {
6221        std::default::Default::default()
6222    }
6223
6224    /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
6225    ///
6226    /// # Example
6227    /// ```ignore,no_run
6228    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6229    /// let x = SkaffoldModules::new().set_configs(["a", "b", "c"]);
6230    /// ```
6231    pub fn set_configs<T, V>(mut self, v: T) -> Self
6232    where
6233        T: std::iter::IntoIterator<Item = V>,
6234        V: std::convert::Into<std::string::String>,
6235    {
6236        use std::iter::Iterator;
6237        self.configs = v.into_iter().map(|i| i.into()).collect();
6238        self
6239    }
6240
6241    /// Sets the value of [source][crate::model::SkaffoldModules::source].
6242    ///
6243    /// Note that all the setters affecting `source` are mutually
6244    /// exclusive.
6245    ///
6246    /// # Example
6247    /// ```ignore,no_run
6248    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6249    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6250    /// let x = SkaffoldModules::new().set_source(Some(
6251    ///     google_cloud_deploy_v1::model::skaffold_modules::Source::Git(SkaffoldGitSource::default().into())));
6252    /// ```
6253    pub fn set_source<
6254        T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
6255    >(
6256        mut self,
6257        v: T,
6258    ) -> Self {
6259        self.source = v.into();
6260        self
6261    }
6262
6263    /// The value of [source][crate::model::SkaffoldModules::source]
6264    /// if it holds a `Git`, `None` if the field is not set or
6265    /// holds a different branch.
6266    pub fn git(
6267        &self,
6268    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
6269    {
6270        #[allow(unreachable_patterns)]
6271        self.source.as_ref().and_then(|v| match v {
6272            crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
6273            _ => std::option::Option::None,
6274        })
6275    }
6276
6277    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6278    /// to hold a `Git`.
6279    ///
6280    /// Note that all the setters affecting `source` are
6281    /// mutually exclusive.
6282    ///
6283    /// # Example
6284    /// ```ignore,no_run
6285    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6286    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6287    /// let x = SkaffoldModules::new().set_git(SkaffoldGitSource::default()/* use setters */);
6288    /// assert!(x.git().is_some());
6289    /// assert!(x.google_cloud_storage().is_none());
6290    /// assert!(x.google_cloud_build_repo().is_none());
6291    /// ```
6292    pub fn set_git<
6293        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
6294    >(
6295        mut self,
6296        v: T,
6297    ) -> Self {
6298        self.source =
6299            std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
6300        self
6301    }
6302
6303    /// The value of [source][crate::model::SkaffoldModules::source]
6304    /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
6305    /// holds a different branch.
6306    pub fn google_cloud_storage(
6307        &self,
6308    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
6309    {
6310        #[allow(unreachable_patterns)]
6311        self.source.as_ref().and_then(|v| match v {
6312            crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
6313                std::option::Option::Some(v)
6314            }
6315            _ => std::option::Option::None,
6316        })
6317    }
6318
6319    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6320    /// to hold a `GoogleCloudStorage`.
6321    ///
6322    /// Note that all the setters affecting `source` are
6323    /// mutually exclusive.
6324    ///
6325    /// # Example
6326    /// ```ignore,no_run
6327    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6328    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6329    /// let x = SkaffoldModules::new().set_google_cloud_storage(SkaffoldGCSSource::default()/* use setters */);
6330    /// assert!(x.google_cloud_storage().is_some());
6331    /// assert!(x.git().is_none());
6332    /// assert!(x.google_cloud_build_repo().is_none());
6333    /// ```
6334    pub fn set_google_cloud_storage<
6335        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
6336    >(
6337        mut self,
6338        v: T,
6339    ) -> Self {
6340        self.source = std::option::Option::Some(
6341            crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
6342        );
6343        self
6344    }
6345
6346    /// The value of [source][crate::model::SkaffoldModules::source]
6347    /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
6348    /// holds a different branch.
6349    pub fn google_cloud_build_repo(
6350        &self,
6351    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
6352    {
6353        #[allow(unreachable_patterns)]
6354        self.source.as_ref().and_then(|v| match v {
6355            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
6356                std::option::Option::Some(v)
6357            }
6358            _ => std::option::Option::None,
6359        })
6360    }
6361
6362    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6363    /// to hold a `GoogleCloudBuildRepo`.
6364    ///
6365    /// Note that all the setters affecting `source` are
6366    /// mutually exclusive.
6367    ///
6368    /// # Example
6369    /// ```ignore,no_run
6370    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6371    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6372    /// let x = SkaffoldModules::new().set_google_cloud_build_repo(SkaffoldGCBRepoSource::default()/* use setters */);
6373    /// assert!(x.google_cloud_build_repo().is_some());
6374    /// assert!(x.git().is_none());
6375    /// assert!(x.google_cloud_storage().is_none());
6376    /// ```
6377    pub fn set_google_cloud_build_repo<
6378        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
6379    >(
6380        mut self,
6381        v: T,
6382    ) -> Self {
6383        self.source = std::option::Option::Some(
6384            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
6385        );
6386        self
6387    }
6388}
6389
6390impl wkt::message::Message for SkaffoldModules {
6391    fn typename() -> &'static str {
6392        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
6393    }
6394}
6395
6396/// Defines additional types related to [SkaffoldModules].
6397pub mod skaffold_modules {
6398    #[allow(unused_imports)]
6399    use super::*;
6400
6401    /// Git repository containing Skaffold Config modules.
6402    #[derive(Clone, Default, PartialEq)]
6403    #[non_exhaustive]
6404    pub struct SkaffoldGitSource {
6405        /// Required. Git repository the package should be cloned from.
6406        pub repo: std::string::String,
6407
6408        /// Optional. Relative path from the repository root to the Skaffold file.
6409        pub path: std::string::String,
6410
6411        /// Optional. Git branch or tag to use when cloning the repository.
6412        pub r#ref: std::string::String,
6413
6414        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6415    }
6416
6417    impl SkaffoldGitSource {
6418        pub fn new() -> Self {
6419            std::default::Default::default()
6420        }
6421
6422        /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
6423        ///
6424        /// # Example
6425        /// ```ignore,no_run
6426        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6427        /// let x = SkaffoldGitSource::new().set_repo("example");
6428        /// ```
6429        pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6430            self.repo = v.into();
6431            self
6432        }
6433
6434        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
6435        ///
6436        /// # Example
6437        /// ```ignore,no_run
6438        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6439        /// let x = SkaffoldGitSource::new().set_path("example");
6440        /// ```
6441        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6442            self.path = v.into();
6443            self
6444        }
6445
6446        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
6447        ///
6448        /// # Example
6449        /// ```ignore,no_run
6450        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6451        /// let x = SkaffoldGitSource::new().set_ref("example");
6452        /// ```
6453        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6454            self.r#ref = v.into();
6455            self
6456        }
6457    }
6458
6459    impl wkt::message::Message for SkaffoldGitSource {
6460        fn typename() -> &'static str {
6461            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
6462        }
6463    }
6464
6465    /// Cloud Storage bucket containing Skaffold Config modules.
6466    #[derive(Clone, Default, PartialEq)]
6467    #[non_exhaustive]
6468    pub struct SkaffoldGCSSource {
6469        /// Required. Cloud Storage source paths to copy recursively. For example,
6470        /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
6471        /// all files within the "dir/configs" directory in the bucket "my-bucket".
6472        pub source: std::string::String,
6473
6474        /// Optional. Relative path from the source to the Skaffold file.
6475        pub path: std::string::String,
6476
6477        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6478    }
6479
6480    impl SkaffoldGCSSource {
6481        pub fn new() -> Self {
6482            std::default::Default::default()
6483        }
6484
6485        /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
6486        ///
6487        /// # Example
6488        /// ```ignore,no_run
6489        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6490        /// let x = SkaffoldGCSSource::new().set_source("example");
6491        /// ```
6492        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6493            self.source = v.into();
6494            self
6495        }
6496
6497        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
6498        ///
6499        /// # Example
6500        /// ```ignore,no_run
6501        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6502        /// let x = SkaffoldGCSSource::new().set_path("example");
6503        /// ```
6504        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6505            self.path = v.into();
6506            self
6507        }
6508    }
6509
6510    impl wkt::message::Message for SkaffoldGCSSource {
6511        fn typename() -> &'static str {
6512            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
6513        }
6514    }
6515
6516    /// Cloud Build V2 Repository containing Skaffold Configs.
6517    #[derive(Clone, Default, PartialEq)]
6518    #[non_exhaustive]
6519    pub struct SkaffoldGCBRepoSource {
6520        /// Required. Name of the Cloud Build V2 Repository.
6521        /// Format is
6522        /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
6523        pub repository: std::string::String,
6524
6525        /// Optional. Relative path from the repository root to the Skaffold Config
6526        /// file.
6527        pub path: std::string::String,
6528
6529        /// Optional. Branch or tag to use when cloning the repository.
6530        pub r#ref: std::string::String,
6531
6532        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6533    }
6534
6535    impl SkaffoldGCBRepoSource {
6536        pub fn new() -> Self {
6537            std::default::Default::default()
6538        }
6539
6540        /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
6541        ///
6542        /// # Example
6543        /// ```ignore,no_run
6544        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6545        /// let x = SkaffoldGCBRepoSource::new().set_repository("example");
6546        /// ```
6547        pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6548            self.repository = v.into();
6549            self
6550        }
6551
6552        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
6553        ///
6554        /// # Example
6555        /// ```ignore,no_run
6556        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6557        /// let x = SkaffoldGCBRepoSource::new().set_path("example");
6558        /// ```
6559        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6560            self.path = v.into();
6561            self
6562        }
6563
6564        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
6565        ///
6566        /// # Example
6567        /// ```ignore,no_run
6568        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6569        /// let x = SkaffoldGCBRepoSource::new().set_ref("example");
6570        /// ```
6571        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6572            self.r#ref = v.into();
6573            self
6574        }
6575    }
6576
6577    impl wkt::message::Message for SkaffoldGCBRepoSource {
6578        fn typename() -> &'static str {
6579            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
6580        }
6581    }
6582
6583    /// The source that contains the Skaffold Config modules.
6584    #[derive(Clone, Debug, PartialEq)]
6585    #[non_exhaustive]
6586    pub enum Source {
6587        /// Optional. Remote git repository containing the Skaffold Config modules.
6588        Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
6589        /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
6590        GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
6591        /// Optional. Cloud Build V2 repository containing the Skaffold Config
6592        /// modules.
6593        GoogleCloudBuildRepo(
6594            std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
6595        ),
6596    }
6597}
6598
6599/// The request object for `ListCustomTargetTypes`.
6600#[derive(Clone, Default, PartialEq)]
6601#[non_exhaustive]
6602pub struct ListCustomTargetTypesRequest {
6603    /// Required. The parent that owns this collection of custom target types.
6604    /// Format must be `projects/{project_id}/locations/{location_name}`.
6605    pub parent: std::string::String,
6606
6607    /// Optional. The maximum number of `CustomTargetType` objects to return. The
6608    /// service may return fewer than this value. If unspecified, at most 50
6609    /// `CustomTargetType` objects will be returned. The maximum value is 1000;
6610    /// values above 1000 will be set to 1000.
6611    pub page_size: i32,
6612
6613    /// Optional. A page token, received from a previous `ListCustomTargetTypes`
6614    /// call. Provide this to retrieve the subsequent page.
6615    ///
6616    /// When paginating, all other provided parameters match
6617    /// the call that provided the page token.
6618    pub page_token: std::string::String,
6619
6620    /// Optional. Filter custom target types to be returned. See
6621    /// <https://google.aip.dev/160> for more details.
6622    pub filter: std::string::String,
6623
6624    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
6625    /// more details.
6626    pub order_by: std::string::String,
6627
6628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6629}
6630
6631impl ListCustomTargetTypesRequest {
6632    pub fn new() -> Self {
6633        std::default::Default::default()
6634    }
6635
6636    /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
6637    ///
6638    /// # Example
6639    /// ```ignore,no_run
6640    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6641    /// let x = ListCustomTargetTypesRequest::new().set_parent("example");
6642    /// ```
6643    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6644        self.parent = v.into();
6645        self
6646    }
6647
6648    /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
6649    ///
6650    /// # Example
6651    /// ```ignore,no_run
6652    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6653    /// let x = ListCustomTargetTypesRequest::new().set_page_size(42);
6654    /// ```
6655    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6656        self.page_size = v.into();
6657        self
6658    }
6659
6660    /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
6661    ///
6662    /// # Example
6663    /// ```ignore,no_run
6664    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6665    /// let x = ListCustomTargetTypesRequest::new().set_page_token("example");
6666    /// ```
6667    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6668        self.page_token = v.into();
6669        self
6670    }
6671
6672    /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
6673    ///
6674    /// # Example
6675    /// ```ignore,no_run
6676    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6677    /// let x = ListCustomTargetTypesRequest::new().set_filter("example");
6678    /// ```
6679    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6680        self.filter = v.into();
6681        self
6682    }
6683
6684    /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
6685    ///
6686    /// # Example
6687    /// ```ignore,no_run
6688    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6689    /// let x = ListCustomTargetTypesRequest::new().set_order_by("example");
6690    /// ```
6691    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6692        self.order_by = v.into();
6693        self
6694    }
6695}
6696
6697impl wkt::message::Message for ListCustomTargetTypesRequest {
6698    fn typename() -> &'static str {
6699        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
6700    }
6701}
6702
6703/// The response object from `ListCustomTargetTypes.`
6704#[derive(Clone, Default, PartialEq)]
6705#[non_exhaustive]
6706pub struct ListCustomTargetTypesResponse {
6707    /// The `CustomTargetType` objects.
6708    pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
6709
6710    /// A token, which can be sent as `page_token` to retrieve the next page.
6711    /// If this field is omitted, there are no subsequent pages.
6712    pub next_page_token: std::string::String,
6713
6714    /// Locations that could not be reached.
6715    pub unreachable: std::vec::Vec<std::string::String>,
6716
6717    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6718}
6719
6720impl ListCustomTargetTypesResponse {
6721    pub fn new() -> Self {
6722        std::default::Default::default()
6723    }
6724
6725    /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
6726    ///
6727    /// # Example
6728    /// ```ignore,no_run
6729    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6730    /// use google_cloud_deploy_v1::model::CustomTargetType;
6731    /// let x = ListCustomTargetTypesResponse::new()
6732    ///     .set_custom_target_types([
6733    ///         CustomTargetType::default()/* use setters */,
6734    ///         CustomTargetType::default()/* use (different) setters */,
6735    ///     ]);
6736    /// ```
6737    pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
6738    where
6739        T: std::iter::IntoIterator<Item = V>,
6740        V: std::convert::Into<crate::model::CustomTargetType>,
6741    {
6742        use std::iter::Iterator;
6743        self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
6744        self
6745    }
6746
6747    /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
6748    ///
6749    /// # Example
6750    /// ```ignore,no_run
6751    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6752    /// let x = ListCustomTargetTypesResponse::new().set_next_page_token("example");
6753    /// ```
6754    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6755        self.next_page_token = v.into();
6756        self
6757    }
6758
6759    /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
6760    ///
6761    /// # Example
6762    /// ```ignore,no_run
6763    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6764    /// let x = ListCustomTargetTypesResponse::new().set_unreachable(["a", "b", "c"]);
6765    /// ```
6766    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6767    where
6768        T: std::iter::IntoIterator<Item = V>,
6769        V: std::convert::Into<std::string::String>,
6770    {
6771        use std::iter::Iterator;
6772        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6773        self
6774    }
6775}
6776
6777impl wkt::message::Message for ListCustomTargetTypesResponse {
6778    fn typename() -> &'static str {
6779        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
6780    }
6781}
6782
6783#[doc(hidden)]
6784impl gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
6785    type PageItem = crate::model::CustomTargetType;
6786
6787    fn items(self) -> std::vec::Vec<Self::PageItem> {
6788        self.custom_target_types
6789    }
6790
6791    fn next_page_token(&self) -> std::string::String {
6792        use std::clone::Clone;
6793        self.next_page_token.clone()
6794    }
6795}
6796
6797/// The request object for `GetCustomTargetType`.
6798#[derive(Clone, Default, PartialEq)]
6799#[non_exhaustive]
6800pub struct GetCustomTargetTypeRequest {
6801    /// Required. Name of the `CustomTargetType`. Format must be
6802    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
6803    pub name: std::string::String,
6804
6805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6806}
6807
6808impl GetCustomTargetTypeRequest {
6809    pub fn new() -> Self {
6810        std::default::Default::default()
6811    }
6812
6813    /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
6814    ///
6815    /// # Example
6816    /// ```ignore,no_run
6817    /// # use google_cloud_deploy_v1::model::GetCustomTargetTypeRequest;
6818    /// let x = GetCustomTargetTypeRequest::new().set_name("example");
6819    /// ```
6820    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6821        self.name = v.into();
6822        self
6823    }
6824}
6825
6826impl wkt::message::Message for GetCustomTargetTypeRequest {
6827    fn typename() -> &'static str {
6828        "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
6829    }
6830}
6831
6832/// The request object for `CreateCustomTargetType`.
6833#[derive(Clone, Default, PartialEq)]
6834#[non_exhaustive]
6835pub struct CreateCustomTargetTypeRequest {
6836    /// Required. The parent collection in which the `CustomTargetType` must be
6837    /// created. The format is `projects/{project_id}/locations/{location_name}`.
6838    pub parent: std::string::String,
6839
6840    /// Required. ID of the `CustomTargetType`.
6841    pub custom_target_type_id: std::string::String,
6842
6843    /// Required. The `CustomTargetType` to create.
6844    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6845
6846    /// Optional. A request ID to identify requests. Specify a unique request ID
6847    /// so that if you must retry your request, the server knows to ignore the
6848    /// request if it has already been completed. The server guarantees that for
6849    /// at least 60 minutes after the first request.
6850    ///
6851    /// For example, consider a situation where you make an initial request and the
6852    /// request times out. If you make the request again with the same request ID,
6853    /// the server can check if original operation with the same request ID was
6854    /// received, and if so, will ignore the second request. This prevents clients
6855    /// from accidentally creating duplicate commitments.
6856    ///
6857    /// The request ID must be a valid UUID with the exception that zero UUID is
6858    /// not supported (00000000-0000-0000-0000-000000000000).
6859    pub request_id: std::string::String,
6860
6861    /// Optional. If set to true, the request is validated and the user is provided
6862    /// with an expected result, but no actual change is made.
6863    pub validate_only: bool,
6864
6865    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6866}
6867
6868impl CreateCustomTargetTypeRequest {
6869    pub fn new() -> Self {
6870        std::default::Default::default()
6871    }
6872
6873    /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
6874    ///
6875    /// # Example
6876    /// ```ignore,no_run
6877    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6878    /// let x = CreateCustomTargetTypeRequest::new().set_parent("example");
6879    /// ```
6880    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6881        self.parent = v.into();
6882        self
6883    }
6884
6885    /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
6886    ///
6887    /// # Example
6888    /// ```ignore,no_run
6889    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6890    /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type_id("example");
6891    /// ```
6892    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
6893        mut self,
6894        v: T,
6895    ) -> Self {
6896        self.custom_target_type_id = v.into();
6897        self
6898    }
6899
6900    /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6901    ///
6902    /// # Example
6903    /// ```ignore,no_run
6904    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6905    /// use google_cloud_deploy_v1::model::CustomTargetType;
6906    /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
6907    /// ```
6908    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
6909    where
6910        T: std::convert::Into<crate::model::CustomTargetType>,
6911    {
6912        self.custom_target_type = std::option::Option::Some(v.into());
6913        self
6914    }
6915
6916    /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6917    ///
6918    /// # Example
6919    /// ```ignore,no_run
6920    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6921    /// use google_cloud_deploy_v1::model::CustomTargetType;
6922    /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
6923    /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
6924    /// ```
6925    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
6926    where
6927        T: std::convert::Into<crate::model::CustomTargetType>,
6928    {
6929        self.custom_target_type = v.map(|x| x.into());
6930        self
6931    }
6932
6933    /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
6934    ///
6935    /// # Example
6936    /// ```ignore,no_run
6937    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6938    /// let x = CreateCustomTargetTypeRequest::new().set_request_id("example");
6939    /// ```
6940    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6941        self.request_id = v.into();
6942        self
6943    }
6944
6945    /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
6946    ///
6947    /// # Example
6948    /// ```ignore,no_run
6949    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6950    /// let x = CreateCustomTargetTypeRequest::new().set_validate_only(true);
6951    /// ```
6952    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6953        self.validate_only = v.into();
6954        self
6955    }
6956}
6957
6958impl wkt::message::Message for CreateCustomTargetTypeRequest {
6959    fn typename() -> &'static str {
6960        "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
6961    }
6962}
6963
6964/// The request object for `UpdateCustomTargetType`.
6965#[derive(Clone, Default, PartialEq)]
6966#[non_exhaustive]
6967pub struct UpdateCustomTargetTypeRequest {
6968    /// Required. Field mask is used to specify the fields to be overwritten by the
6969    /// update in the `CustomTargetType` resource. The fields specified in the
6970    /// update_mask are relative to the resource, not the full request. A field
6971    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
6972    /// then all fields are overwritten.
6973    pub update_mask: std::option::Option<wkt::FieldMask>,
6974
6975    /// Required. The `CustomTargetType` to update.
6976    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6977
6978    /// Optional. A request ID to identify requests. Specify a unique request ID
6979    /// so that if you must retry your request, the server knows to ignore the
6980    /// request if it has already been completed. The server guarantees that for
6981    /// at least 60 minutes after the first request.
6982    ///
6983    /// For example, consider a situation where you make an initial request and the
6984    /// request times out. If you make the request again with the same request ID,
6985    /// the server can check if original operation with the same request ID was
6986    /// received, and if so, will ignore the second request. This prevents clients
6987    /// from accidentally creating duplicate commitments.
6988    ///
6989    /// The request ID must be a valid UUID with the exception that zero UUID is
6990    /// not supported (00000000-0000-0000-0000-000000000000).
6991    pub request_id: std::string::String,
6992
6993    /// Optional. If set to true, updating a `CustomTargetType` that does not exist
6994    /// will result in the creation of a new `CustomTargetType`.
6995    pub allow_missing: bool,
6996
6997    /// Optional. If set to true, the request is validated and the user is provided
6998    /// with an expected result, but no actual change is made.
6999    pub validate_only: bool,
7000
7001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7002}
7003
7004impl UpdateCustomTargetTypeRequest {
7005    pub fn new() -> Self {
7006        std::default::Default::default()
7007    }
7008
7009    /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7010    ///
7011    /// # Example
7012    /// ```ignore,no_run
7013    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7014    /// use wkt::FieldMask;
7015    /// let x = UpdateCustomTargetTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7016    /// ```
7017    pub fn set_update_mask<T>(mut self, v: T) -> Self
7018    where
7019        T: std::convert::Into<wkt::FieldMask>,
7020    {
7021        self.update_mask = std::option::Option::Some(v.into());
7022        self
7023    }
7024
7025    /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7026    ///
7027    /// # Example
7028    /// ```ignore,no_run
7029    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7030    /// use wkt::FieldMask;
7031    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7032    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7033    /// ```
7034    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7035    where
7036        T: std::convert::Into<wkt::FieldMask>,
7037    {
7038        self.update_mask = v.map(|x| x.into());
7039        self
7040    }
7041
7042    /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7043    ///
7044    /// # Example
7045    /// ```ignore,no_run
7046    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7047    /// use google_cloud_deploy_v1::model::CustomTargetType;
7048    /// let x = UpdateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7049    /// ```
7050    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7051    where
7052        T: std::convert::Into<crate::model::CustomTargetType>,
7053    {
7054        self.custom_target_type = std::option::Option::Some(v.into());
7055        self
7056    }
7057
7058    /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7059    ///
7060    /// # Example
7061    /// ```ignore,no_run
7062    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7063    /// use google_cloud_deploy_v1::model::CustomTargetType;
7064    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7065    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7066    /// ```
7067    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7068    where
7069        T: std::convert::Into<crate::model::CustomTargetType>,
7070    {
7071        self.custom_target_type = v.map(|x| x.into());
7072        self
7073    }
7074
7075    /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
7076    ///
7077    /// # Example
7078    /// ```ignore,no_run
7079    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7080    /// let x = UpdateCustomTargetTypeRequest::new().set_request_id("example");
7081    /// ```
7082    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7083        self.request_id = v.into();
7084        self
7085    }
7086
7087    /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
7088    ///
7089    /// # Example
7090    /// ```ignore,no_run
7091    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7092    /// let x = UpdateCustomTargetTypeRequest::new().set_allow_missing(true);
7093    /// ```
7094    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7095        self.allow_missing = v.into();
7096        self
7097    }
7098
7099    /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
7100    ///
7101    /// # Example
7102    /// ```ignore,no_run
7103    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7104    /// let x = UpdateCustomTargetTypeRequest::new().set_validate_only(true);
7105    /// ```
7106    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7107        self.validate_only = v.into();
7108        self
7109    }
7110}
7111
7112impl wkt::message::Message for UpdateCustomTargetTypeRequest {
7113    fn typename() -> &'static str {
7114        "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
7115    }
7116}
7117
7118/// The request object for `DeleteCustomTargetType`.
7119#[derive(Clone, Default, PartialEq)]
7120#[non_exhaustive]
7121pub struct DeleteCustomTargetTypeRequest {
7122    /// Required. The name of the `CustomTargetType` to delete. Format must be
7123    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
7124    pub name: std::string::String,
7125
7126    /// Optional. A request ID to identify requests. Specify a unique request ID
7127    /// so that if you must retry your request, the server knows to ignore the
7128    /// request if it has already been completed. The server guarantees that for
7129    /// at least 60 minutes after the first request.
7130    ///
7131    /// For example, consider a situation where you make an initial request and the
7132    /// request times out. If you make the request again with the same request ID,
7133    /// the server can check if original operation with the same request ID was
7134    /// received, and if so, will ignore the second request. This prevents clients
7135    /// from accidentally creating duplicate commitments.
7136    ///
7137    /// The request ID must be a valid UUID with the exception that zero UUID is
7138    /// not supported (00000000-0000-0000-0000-000000000000).
7139    pub request_id: std::string::String,
7140
7141    /// Optional. If set to true, then deleting an already deleted or non-existing
7142    /// `CustomTargetType` will succeed.
7143    pub allow_missing: bool,
7144
7145    /// Optional. If set to true, the request is validated but no actual change is
7146    /// made.
7147    pub validate_only: bool,
7148
7149    /// Optional. This checksum is computed by the server based on the value of
7150    /// other fields, and may be sent on update and delete requests to ensure the
7151    /// client has an up-to-date value before proceeding.
7152    pub etag: std::string::String,
7153
7154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7155}
7156
7157impl DeleteCustomTargetTypeRequest {
7158    pub fn new() -> Self {
7159        std::default::Default::default()
7160    }
7161
7162    /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
7163    ///
7164    /// # Example
7165    /// ```ignore,no_run
7166    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7167    /// let x = DeleteCustomTargetTypeRequest::new().set_name("example");
7168    /// ```
7169    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7170        self.name = v.into();
7171        self
7172    }
7173
7174    /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
7175    ///
7176    /// # Example
7177    /// ```ignore,no_run
7178    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7179    /// let x = DeleteCustomTargetTypeRequest::new().set_request_id("example");
7180    /// ```
7181    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7182        self.request_id = v.into();
7183        self
7184    }
7185
7186    /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
7187    ///
7188    /// # Example
7189    /// ```ignore,no_run
7190    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7191    /// let x = DeleteCustomTargetTypeRequest::new().set_allow_missing(true);
7192    /// ```
7193    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7194        self.allow_missing = v.into();
7195        self
7196    }
7197
7198    /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
7199    ///
7200    /// # Example
7201    /// ```ignore,no_run
7202    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7203    /// let x = DeleteCustomTargetTypeRequest::new().set_validate_only(true);
7204    /// ```
7205    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7206        self.validate_only = v.into();
7207        self
7208    }
7209
7210    /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
7211    ///
7212    /// # Example
7213    /// ```ignore,no_run
7214    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7215    /// let x = DeleteCustomTargetTypeRequest::new().set_etag("example");
7216    /// ```
7217    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7218        self.etag = v.into();
7219        self
7220    }
7221}
7222
7223impl wkt::message::Message for DeleteCustomTargetTypeRequest {
7224    fn typename() -> &'static str {
7225        "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
7226    }
7227}
7228
7229/// A `DeployPolicy` resource in the Cloud Deploy API.
7230///
7231/// A `DeployPolicy` inhibits manual or automation-driven actions within a
7232/// Delivery Pipeline or Target.
7233#[derive(Clone, Default, PartialEq)]
7234#[non_exhaustive]
7235pub struct DeployPolicy {
7236    /// Output only. Name of the `DeployPolicy`. Format is
7237    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
7238    /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
7239    pub name: std::string::String,
7240
7241    /// Output only. Unique identifier of the `DeployPolicy`.
7242    pub uid: std::string::String,
7243
7244    /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
7245    pub description: std::string::String,
7246
7247    /// Optional. User annotations. These attributes can only be set and used by
7248    /// the user, and not by Cloud Deploy. Annotations must meet the following
7249    /// constraints:
7250    ///
7251    /// * Annotations are key/value pairs.
7252    /// * Valid annotation keys have two segments: an optional prefix and name,
7253    ///   separated by a slash (`/`).
7254    /// * The name segment is required and must be 63 characters or less,
7255    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
7256    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
7257    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
7258    ///   a series of DNS labels separated by dots(`.`), not longer than 253
7259    ///   characters in total, followed by a slash (`/`).
7260    ///
7261    /// See
7262    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
7263    /// for more details.
7264    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7265
7266    /// Labels are attributes that can be set and used by both the
7267    /// user and by Cloud Deploy. Labels must meet the following constraints:
7268    ///
7269    /// * Keys and values can contain only lowercase letters, numeric characters,
7270    ///   underscores, and dashes.
7271    /// * All characters must use UTF-8 encoding, and international characters are
7272    ///   allowed.
7273    /// * Keys must start with a lowercase letter or international character.
7274    /// * Each resource is limited to a maximum of 64 labels.
7275    ///
7276    /// Both keys and values are additionally constrained to be <= 128 bytes.
7277    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7278
7279    /// Output only. Time at which the deploy policy was created.
7280    pub create_time: std::option::Option<wkt::Timestamp>,
7281
7282    /// Output only. Most recent time at which the deploy policy was updated.
7283    pub update_time: std::option::Option<wkt::Timestamp>,
7284
7285    /// Optional. When suspended, the policy will not prevent actions from
7286    /// occurring, even if the action violates the policy.
7287    pub suspended: bool,
7288
7289    /// Required. Selected resources to which the policy will be applied. At least
7290    /// one selector is required. If one selector matches the resource the policy
7291    /// applies. For example, if there are two selectors and the action being
7292    /// attempted matches one of them, the policy will apply to that action.
7293    pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
7294
7295    /// Required. Rules to apply. At least one rule must be present.
7296    pub rules: std::vec::Vec<crate::model::PolicyRule>,
7297
7298    /// The weak etag of the `DeployPolicy` resource.
7299    /// This checksum is computed by the server based on the value of other
7300    /// fields, and may be sent on update and delete requests to ensure the
7301    /// client has an up-to-date value before proceeding.
7302    pub etag: std::string::String,
7303
7304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7305}
7306
7307impl DeployPolicy {
7308    pub fn new() -> Self {
7309        std::default::Default::default()
7310    }
7311
7312    /// Sets the value of [name][crate::model::DeployPolicy::name].
7313    ///
7314    /// # Example
7315    /// ```ignore,no_run
7316    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7317    /// let x = DeployPolicy::new().set_name("example");
7318    /// ```
7319    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7320        self.name = v.into();
7321        self
7322    }
7323
7324    /// Sets the value of [uid][crate::model::DeployPolicy::uid].
7325    ///
7326    /// # Example
7327    /// ```ignore,no_run
7328    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7329    /// let x = DeployPolicy::new().set_uid("example");
7330    /// ```
7331    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7332        self.uid = v.into();
7333        self
7334    }
7335
7336    /// Sets the value of [description][crate::model::DeployPolicy::description].
7337    ///
7338    /// # Example
7339    /// ```ignore,no_run
7340    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7341    /// let x = DeployPolicy::new().set_description("example");
7342    /// ```
7343    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7344        self.description = v.into();
7345        self
7346    }
7347
7348    /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
7349    ///
7350    /// # Example
7351    /// ```ignore,no_run
7352    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7353    /// let x = DeployPolicy::new().set_annotations([
7354    ///     ("key0", "abc"),
7355    ///     ("key1", "xyz"),
7356    /// ]);
7357    /// ```
7358    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7359    where
7360        T: std::iter::IntoIterator<Item = (K, V)>,
7361        K: std::convert::Into<std::string::String>,
7362        V: std::convert::Into<std::string::String>,
7363    {
7364        use std::iter::Iterator;
7365        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7366        self
7367    }
7368
7369    /// Sets the value of [labels][crate::model::DeployPolicy::labels].
7370    ///
7371    /// # Example
7372    /// ```ignore,no_run
7373    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7374    /// let x = DeployPolicy::new().set_labels([
7375    ///     ("key0", "abc"),
7376    ///     ("key1", "xyz"),
7377    /// ]);
7378    /// ```
7379    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7380    where
7381        T: std::iter::IntoIterator<Item = (K, V)>,
7382        K: std::convert::Into<std::string::String>,
7383        V: std::convert::Into<std::string::String>,
7384    {
7385        use std::iter::Iterator;
7386        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7387        self
7388    }
7389
7390    /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
7391    ///
7392    /// # Example
7393    /// ```ignore,no_run
7394    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7395    /// use wkt::Timestamp;
7396    /// let x = DeployPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7397    /// ```
7398    pub fn set_create_time<T>(mut self, v: T) -> Self
7399    where
7400        T: std::convert::Into<wkt::Timestamp>,
7401    {
7402        self.create_time = std::option::Option::Some(v.into());
7403        self
7404    }
7405
7406    /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
7407    ///
7408    /// # Example
7409    /// ```ignore,no_run
7410    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7411    /// use wkt::Timestamp;
7412    /// let x = DeployPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7413    /// let x = DeployPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7414    /// ```
7415    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7416    where
7417        T: std::convert::Into<wkt::Timestamp>,
7418    {
7419        self.create_time = v.map(|x| x.into());
7420        self
7421    }
7422
7423    /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
7424    ///
7425    /// # Example
7426    /// ```ignore,no_run
7427    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7428    /// use wkt::Timestamp;
7429    /// let x = DeployPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7430    /// ```
7431    pub fn set_update_time<T>(mut self, v: T) -> Self
7432    where
7433        T: std::convert::Into<wkt::Timestamp>,
7434    {
7435        self.update_time = std::option::Option::Some(v.into());
7436        self
7437    }
7438
7439    /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
7440    ///
7441    /// # Example
7442    /// ```ignore,no_run
7443    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7444    /// use wkt::Timestamp;
7445    /// let x = DeployPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7446    /// let x = DeployPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7447    /// ```
7448    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7449    where
7450        T: std::convert::Into<wkt::Timestamp>,
7451    {
7452        self.update_time = v.map(|x| x.into());
7453        self
7454    }
7455
7456    /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
7457    ///
7458    /// # Example
7459    /// ```ignore,no_run
7460    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7461    /// let x = DeployPolicy::new().set_suspended(true);
7462    /// ```
7463    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7464        self.suspended = v.into();
7465        self
7466    }
7467
7468    /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
7469    ///
7470    /// # Example
7471    /// ```ignore,no_run
7472    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7473    /// use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7474    /// let x = DeployPolicy::new()
7475    ///     .set_selectors([
7476    ///         DeployPolicyResourceSelector::default()/* use setters */,
7477    ///         DeployPolicyResourceSelector::default()/* use (different) setters */,
7478    ///     ]);
7479    /// ```
7480    pub fn set_selectors<T, V>(mut self, v: T) -> Self
7481    where
7482        T: std::iter::IntoIterator<Item = V>,
7483        V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
7484    {
7485        use std::iter::Iterator;
7486        self.selectors = v.into_iter().map(|i| i.into()).collect();
7487        self
7488    }
7489
7490    /// Sets the value of [rules][crate::model::DeployPolicy::rules].
7491    ///
7492    /// # Example
7493    /// ```ignore,no_run
7494    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7495    /// use google_cloud_deploy_v1::model::PolicyRule;
7496    /// let x = DeployPolicy::new()
7497    ///     .set_rules([
7498    ///         PolicyRule::default()/* use setters */,
7499    ///         PolicyRule::default()/* use (different) setters */,
7500    ///     ]);
7501    /// ```
7502    pub fn set_rules<T, V>(mut self, v: T) -> Self
7503    where
7504        T: std::iter::IntoIterator<Item = V>,
7505        V: std::convert::Into<crate::model::PolicyRule>,
7506    {
7507        use std::iter::Iterator;
7508        self.rules = v.into_iter().map(|i| i.into()).collect();
7509        self
7510    }
7511
7512    /// Sets the value of [etag][crate::model::DeployPolicy::etag].
7513    ///
7514    /// # Example
7515    /// ```ignore,no_run
7516    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7517    /// let x = DeployPolicy::new().set_etag("example");
7518    /// ```
7519    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7520        self.etag = v.into();
7521        self
7522    }
7523}
7524
7525impl wkt::message::Message for DeployPolicy {
7526    fn typename() -> &'static str {
7527        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
7528    }
7529}
7530
7531/// Defines additional types related to [DeployPolicy].
7532pub mod deploy_policy {
7533    #[allow(unused_imports)]
7534    use super::*;
7535
7536    /// What invoked the action. Filters enforcing the policy depending on what
7537    /// invoked the action.
7538    ///
7539    /// # Working with unknown values
7540    ///
7541    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7542    /// additional enum variants at any time. Adding new variants is not considered
7543    /// a breaking change. Applications should write their code in anticipation of:
7544    ///
7545    /// - New values appearing in future releases of the client library, **and**
7546    /// - New values received dynamically, without application changes.
7547    ///
7548    /// Please consult the [Working with enums] section in the user guide for some
7549    /// guidelines.
7550    ///
7551    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7552    #[derive(Clone, Debug, PartialEq)]
7553    #[non_exhaustive]
7554    pub enum Invoker {
7555        /// Unspecified.
7556        Unspecified,
7557        /// The action is user-driven. For example, creating a rollout manually via a
7558        /// gcloud create command.
7559        User,
7560        /// Automated action by Cloud Deploy.
7561        DeployAutomation,
7562        /// If set, the enum was initialized with an unknown value.
7563        ///
7564        /// Applications can examine the value using [Invoker::value] or
7565        /// [Invoker::name].
7566        UnknownValue(invoker::UnknownValue),
7567    }
7568
7569    #[doc(hidden)]
7570    pub mod invoker {
7571        #[allow(unused_imports)]
7572        use super::*;
7573        #[derive(Clone, Debug, PartialEq)]
7574        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7575    }
7576
7577    impl Invoker {
7578        /// Gets the enum value.
7579        ///
7580        /// Returns `None` if the enum contains an unknown value deserialized from
7581        /// the string representation of enums.
7582        pub fn value(&self) -> std::option::Option<i32> {
7583            match self {
7584                Self::Unspecified => std::option::Option::Some(0),
7585                Self::User => std::option::Option::Some(1),
7586                Self::DeployAutomation => std::option::Option::Some(2),
7587                Self::UnknownValue(u) => u.0.value(),
7588            }
7589        }
7590
7591        /// Gets the enum value as a string.
7592        ///
7593        /// Returns `None` if the enum contains an unknown value deserialized from
7594        /// the integer representation of enums.
7595        pub fn name(&self) -> std::option::Option<&str> {
7596            match self {
7597                Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
7598                Self::User => std::option::Option::Some("USER"),
7599                Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
7600                Self::UnknownValue(u) => u.0.name(),
7601            }
7602        }
7603    }
7604
7605    impl std::default::Default for Invoker {
7606        fn default() -> Self {
7607            use std::convert::From;
7608            Self::from(0)
7609        }
7610    }
7611
7612    impl std::fmt::Display for Invoker {
7613        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7614            wkt::internal::display_enum(f, self.name(), self.value())
7615        }
7616    }
7617
7618    impl std::convert::From<i32> for Invoker {
7619        fn from(value: i32) -> Self {
7620            match value {
7621                0 => Self::Unspecified,
7622                1 => Self::User,
7623                2 => Self::DeployAutomation,
7624                _ => Self::UnknownValue(invoker::UnknownValue(
7625                    wkt::internal::UnknownEnumValue::Integer(value),
7626                )),
7627            }
7628        }
7629    }
7630
7631    impl std::convert::From<&str> for Invoker {
7632        fn from(value: &str) -> Self {
7633            use std::string::ToString;
7634            match value {
7635                "INVOKER_UNSPECIFIED" => Self::Unspecified,
7636                "USER" => Self::User,
7637                "DEPLOY_AUTOMATION" => Self::DeployAutomation,
7638                _ => Self::UnknownValue(invoker::UnknownValue(
7639                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7640                )),
7641            }
7642        }
7643    }
7644
7645    impl serde::ser::Serialize for Invoker {
7646        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7647        where
7648            S: serde::Serializer,
7649        {
7650            match self {
7651                Self::Unspecified => serializer.serialize_i32(0),
7652                Self::User => serializer.serialize_i32(1),
7653                Self::DeployAutomation => serializer.serialize_i32(2),
7654                Self::UnknownValue(u) => u.0.serialize(serializer),
7655            }
7656        }
7657    }
7658
7659    impl<'de> serde::de::Deserialize<'de> for Invoker {
7660        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7661        where
7662            D: serde::Deserializer<'de>,
7663        {
7664            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
7665                ".google.cloud.deploy.v1.DeployPolicy.Invoker",
7666            ))
7667        }
7668    }
7669}
7670
7671/// Contains information on the resources to select for a deploy policy.
7672/// Attributes provided must all match the resource in order for policy
7673/// restrictions to apply. For example, if delivery pipelines attributes given
7674/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
7675/// match both that id and have that label in order to be subject to the policy.
7676#[derive(Clone, Default, PartialEq)]
7677#[non_exhaustive]
7678pub struct DeployPolicyResourceSelector {
7679    /// Optional. Contains attributes about a delivery pipeline.
7680    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
7681
7682    /// Optional. Contains attributes about a target.
7683    pub target: std::option::Option<crate::model::TargetAttribute>,
7684
7685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7686}
7687
7688impl DeployPolicyResourceSelector {
7689    pub fn new() -> Self {
7690        std::default::Default::default()
7691    }
7692
7693    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7694    ///
7695    /// # Example
7696    /// ```ignore,no_run
7697    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7698    /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7699    /// let x = DeployPolicyResourceSelector::new().set_delivery_pipeline(DeliveryPipelineAttribute::default()/* use setters */);
7700    /// ```
7701    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
7702    where
7703        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7704    {
7705        self.delivery_pipeline = std::option::Option::Some(v.into());
7706        self
7707    }
7708
7709    /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7710    ///
7711    /// # Example
7712    /// ```ignore,no_run
7713    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7714    /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7715    /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(Some(DeliveryPipelineAttribute::default()/* use setters */));
7716    /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(None::<DeliveryPipelineAttribute>);
7717    /// ```
7718    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
7719    where
7720        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7721    {
7722        self.delivery_pipeline = v.map(|x| x.into());
7723        self
7724    }
7725
7726    /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
7727    ///
7728    /// # Example
7729    /// ```ignore,no_run
7730    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7731    /// use google_cloud_deploy_v1::model::TargetAttribute;
7732    /// let x = DeployPolicyResourceSelector::new().set_target(TargetAttribute::default()/* use setters */);
7733    /// ```
7734    pub fn set_target<T>(mut self, v: T) -> Self
7735    where
7736        T: std::convert::Into<crate::model::TargetAttribute>,
7737    {
7738        self.target = std::option::Option::Some(v.into());
7739        self
7740    }
7741
7742    /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
7743    ///
7744    /// # Example
7745    /// ```ignore,no_run
7746    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7747    /// use google_cloud_deploy_v1::model::TargetAttribute;
7748    /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(Some(TargetAttribute::default()/* use setters */));
7749    /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(None::<TargetAttribute>);
7750    /// ```
7751    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7752    where
7753        T: std::convert::Into<crate::model::TargetAttribute>,
7754    {
7755        self.target = v.map(|x| x.into());
7756        self
7757    }
7758}
7759
7760impl wkt::message::Message for DeployPolicyResourceSelector {
7761    fn typename() -> &'static str {
7762        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
7763    }
7764}
7765
7766/// Contains criteria for selecting DeliveryPipelines.
7767#[derive(Clone, Default, PartialEq)]
7768#[non_exhaustive]
7769pub struct DeliveryPipelineAttribute {
7770    /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
7771    /// one of the following:
7772    ///
7773    /// * The last segment of a pipeline name
7774    /// * "*", all delivery pipelines in a location
7775    pub id: std::string::String,
7776
7777    /// DeliveryPipeline labels.
7778    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7779
7780    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7781}
7782
7783impl DeliveryPipelineAttribute {
7784    pub fn new() -> Self {
7785        std::default::Default::default()
7786    }
7787
7788    /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
7789    ///
7790    /// # Example
7791    /// ```ignore,no_run
7792    /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7793    /// let x = DeliveryPipelineAttribute::new().set_id("example");
7794    /// ```
7795    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7796        self.id = v.into();
7797        self
7798    }
7799
7800    /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
7801    ///
7802    /// # Example
7803    /// ```ignore,no_run
7804    /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7805    /// let x = DeliveryPipelineAttribute::new().set_labels([
7806    ///     ("key0", "abc"),
7807    ///     ("key1", "xyz"),
7808    /// ]);
7809    /// ```
7810    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7811    where
7812        T: std::iter::IntoIterator<Item = (K, V)>,
7813        K: std::convert::Into<std::string::String>,
7814        V: std::convert::Into<std::string::String>,
7815    {
7816        use std::iter::Iterator;
7817        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7818        self
7819    }
7820}
7821
7822impl wkt::message::Message for DeliveryPipelineAttribute {
7823    fn typename() -> &'static str {
7824        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
7825    }
7826}
7827
7828/// Contains criteria for selecting Targets. This could be used to select targets
7829/// for a Deploy Policy or for an Automation.
7830#[derive(Clone, Default, PartialEq)]
7831#[non_exhaustive]
7832pub struct TargetAttribute {
7833    /// Optional. ID of the `Target`. The value of this field could be one of the
7834    /// following:
7835    ///
7836    /// * The last segment of a target name
7837    /// * "*", all targets in a location
7838    pub id: std::string::String,
7839
7840    /// Target labels.
7841    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7842
7843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7844}
7845
7846impl TargetAttribute {
7847    pub fn new() -> Self {
7848        std::default::Default::default()
7849    }
7850
7851    /// Sets the value of [id][crate::model::TargetAttribute::id].
7852    ///
7853    /// # Example
7854    /// ```ignore,no_run
7855    /// # use google_cloud_deploy_v1::model::TargetAttribute;
7856    /// let x = TargetAttribute::new().set_id("example");
7857    /// ```
7858    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7859        self.id = v.into();
7860        self
7861    }
7862
7863    /// Sets the value of [labels][crate::model::TargetAttribute::labels].
7864    ///
7865    /// # Example
7866    /// ```ignore,no_run
7867    /// # use google_cloud_deploy_v1::model::TargetAttribute;
7868    /// let x = TargetAttribute::new().set_labels([
7869    ///     ("key0", "abc"),
7870    ///     ("key1", "xyz"),
7871    /// ]);
7872    /// ```
7873    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7874    where
7875        T: std::iter::IntoIterator<Item = (K, V)>,
7876        K: std::convert::Into<std::string::String>,
7877        V: std::convert::Into<std::string::String>,
7878    {
7879        use std::iter::Iterator;
7880        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7881        self
7882    }
7883}
7884
7885impl wkt::message::Message for TargetAttribute {
7886    fn typename() -> &'static str {
7887        "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
7888    }
7889}
7890
7891/// Deploy Policy rule.
7892#[derive(Clone, Default, PartialEq)]
7893#[non_exhaustive]
7894pub struct PolicyRule {
7895    pub rule: std::option::Option<crate::model::policy_rule::Rule>,
7896
7897    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7898}
7899
7900impl PolicyRule {
7901    pub fn new() -> Self {
7902        std::default::Default::default()
7903    }
7904
7905    /// Sets the value of [rule][crate::model::PolicyRule::rule].
7906    ///
7907    /// Note that all the setters affecting `rule` are mutually
7908    /// exclusive.
7909    ///
7910    /// # Example
7911    /// ```ignore,no_run
7912    /// # use google_cloud_deploy_v1::model::PolicyRule;
7913    /// use google_cloud_deploy_v1::model::RolloutRestriction;
7914    /// let x = PolicyRule::new().set_rule(Some(
7915    ///     google_cloud_deploy_v1::model::policy_rule::Rule::RolloutRestriction(RolloutRestriction::default().into())));
7916    /// ```
7917    pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
7918        mut self,
7919        v: T,
7920    ) -> Self {
7921        self.rule = v.into();
7922        self
7923    }
7924
7925    /// The value of [rule][crate::model::PolicyRule::rule]
7926    /// if it holds a `RolloutRestriction`, `None` if the field is not set or
7927    /// holds a different branch.
7928    pub fn rollout_restriction(
7929        &self,
7930    ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
7931        #[allow(unreachable_patterns)]
7932        self.rule.as_ref().and_then(|v| match v {
7933            crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
7934            _ => std::option::Option::None,
7935        })
7936    }
7937
7938    /// Sets the value of [rule][crate::model::PolicyRule::rule]
7939    /// to hold a `RolloutRestriction`.
7940    ///
7941    /// Note that all the setters affecting `rule` are
7942    /// mutually exclusive.
7943    ///
7944    /// # Example
7945    /// ```ignore,no_run
7946    /// # use google_cloud_deploy_v1::model::PolicyRule;
7947    /// use google_cloud_deploy_v1::model::RolloutRestriction;
7948    /// let x = PolicyRule::new().set_rollout_restriction(RolloutRestriction::default()/* use setters */);
7949    /// assert!(x.rollout_restriction().is_some());
7950    /// ```
7951    pub fn set_rollout_restriction<
7952        T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
7953    >(
7954        mut self,
7955        v: T,
7956    ) -> Self {
7957        self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
7958            v.into(),
7959        ));
7960        self
7961    }
7962}
7963
7964impl wkt::message::Message for PolicyRule {
7965    fn typename() -> &'static str {
7966        "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
7967    }
7968}
7969
7970/// Defines additional types related to [PolicyRule].
7971pub mod policy_rule {
7972    #[allow(unused_imports)]
7973    use super::*;
7974
7975    #[derive(Clone, Debug, PartialEq)]
7976    #[non_exhaustive]
7977    pub enum Rule {
7978        /// Optional. Rollout restrictions.
7979        RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
7980    }
7981}
7982
7983/// Rollout restrictions.
7984#[derive(Clone, Default, PartialEq)]
7985#[non_exhaustive]
7986pub struct RolloutRestriction {
7987    /// Required. Restriction rule ID. Required and must be unique within a
7988    /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
7989    pub id: std::string::String,
7990
7991    /// Optional. What invoked the action. If left empty, all invoker types will be
7992    /// restricted.
7993    pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
7994
7995    /// Optional. Rollout actions to be restricted as part of the policy. If left
7996    /// empty, all actions will be restricted.
7997    pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
7998
7999    /// Required. Time window within which actions are restricted.
8000    pub time_windows: std::option::Option<crate::model::TimeWindows>,
8001
8002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8003}
8004
8005impl RolloutRestriction {
8006    pub fn new() -> Self {
8007        std::default::Default::default()
8008    }
8009
8010    /// Sets the value of [id][crate::model::RolloutRestriction::id].
8011    ///
8012    /// # Example
8013    /// ```ignore,no_run
8014    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8015    /// let x = RolloutRestriction::new().set_id("example");
8016    /// ```
8017    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8018        self.id = v.into();
8019        self
8020    }
8021
8022    /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
8023    ///
8024    /// # Example
8025    /// ```ignore,no_run
8026    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8027    /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
8028    /// let x = RolloutRestriction::new().set_invokers([
8029    ///     Invoker::User,
8030    ///     Invoker::DeployAutomation,
8031    /// ]);
8032    /// ```
8033    pub fn set_invokers<T, V>(mut self, v: T) -> Self
8034    where
8035        T: std::iter::IntoIterator<Item = V>,
8036        V: std::convert::Into<crate::model::deploy_policy::Invoker>,
8037    {
8038        use std::iter::Iterator;
8039        self.invokers = v.into_iter().map(|i| i.into()).collect();
8040        self
8041    }
8042
8043    /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
8044    ///
8045    /// # Example
8046    /// ```ignore,no_run
8047    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8048    /// use google_cloud_deploy_v1::model::rollout_restriction::RolloutActions;
8049    /// let x = RolloutRestriction::new().set_actions([
8050    ///     RolloutActions::Advance,
8051    ///     RolloutActions::Approve,
8052    ///     RolloutActions::Cancel,
8053    /// ]);
8054    /// ```
8055    pub fn set_actions<T, V>(mut self, v: T) -> Self
8056    where
8057        T: std::iter::IntoIterator<Item = V>,
8058        V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
8059    {
8060        use std::iter::Iterator;
8061        self.actions = v.into_iter().map(|i| i.into()).collect();
8062        self
8063    }
8064
8065    /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8066    ///
8067    /// # Example
8068    /// ```ignore,no_run
8069    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8070    /// use google_cloud_deploy_v1::model::TimeWindows;
8071    /// let x = RolloutRestriction::new().set_time_windows(TimeWindows::default()/* use setters */);
8072    /// ```
8073    pub fn set_time_windows<T>(mut self, v: T) -> Self
8074    where
8075        T: std::convert::Into<crate::model::TimeWindows>,
8076    {
8077        self.time_windows = std::option::Option::Some(v.into());
8078        self
8079    }
8080
8081    /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8082    ///
8083    /// # Example
8084    /// ```ignore,no_run
8085    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8086    /// use google_cloud_deploy_v1::model::TimeWindows;
8087    /// let x = RolloutRestriction::new().set_or_clear_time_windows(Some(TimeWindows::default()/* use setters */));
8088    /// let x = RolloutRestriction::new().set_or_clear_time_windows(None::<TimeWindows>);
8089    /// ```
8090    pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
8091    where
8092        T: std::convert::Into<crate::model::TimeWindows>,
8093    {
8094        self.time_windows = v.map(|x| x.into());
8095        self
8096    }
8097}
8098
8099impl wkt::message::Message for RolloutRestriction {
8100    fn typename() -> &'static str {
8101        "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
8102    }
8103}
8104
8105/// Defines additional types related to [RolloutRestriction].
8106pub mod rollout_restriction {
8107    #[allow(unused_imports)]
8108    use super::*;
8109
8110    /// Rollout actions to be restricted as part of the policy.
8111    ///
8112    /// # Working with unknown values
8113    ///
8114    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8115    /// additional enum variants at any time. Adding new variants is not considered
8116    /// a breaking change. Applications should write their code in anticipation of:
8117    ///
8118    /// - New values appearing in future releases of the client library, **and**
8119    /// - New values received dynamically, without application changes.
8120    ///
8121    /// Please consult the [Working with enums] section in the user guide for some
8122    /// guidelines.
8123    ///
8124    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8125    #[derive(Clone, Debug, PartialEq)]
8126    #[non_exhaustive]
8127    pub enum RolloutActions {
8128        /// Unspecified.
8129        Unspecified,
8130        /// Advance the rollout to the next phase.
8131        Advance,
8132        /// Approve the rollout.
8133        Approve,
8134        /// Cancel the rollout.
8135        Cancel,
8136        /// Create a rollout.
8137        Create,
8138        /// Ignore a job result on the rollout.
8139        IgnoreJob,
8140        /// Retry a job for a rollout.
8141        RetryJob,
8142        /// Rollback a rollout.
8143        Rollback,
8144        /// Terminate a jobrun.
8145        TerminateJobrun,
8146        /// If set, the enum was initialized with an unknown value.
8147        ///
8148        /// Applications can examine the value using [RolloutActions::value] or
8149        /// [RolloutActions::name].
8150        UnknownValue(rollout_actions::UnknownValue),
8151    }
8152
8153    #[doc(hidden)]
8154    pub mod rollout_actions {
8155        #[allow(unused_imports)]
8156        use super::*;
8157        #[derive(Clone, Debug, PartialEq)]
8158        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8159    }
8160
8161    impl RolloutActions {
8162        /// Gets the enum value.
8163        ///
8164        /// Returns `None` if the enum contains an unknown value deserialized from
8165        /// the string representation of enums.
8166        pub fn value(&self) -> std::option::Option<i32> {
8167            match self {
8168                Self::Unspecified => std::option::Option::Some(0),
8169                Self::Advance => std::option::Option::Some(1),
8170                Self::Approve => std::option::Option::Some(2),
8171                Self::Cancel => std::option::Option::Some(3),
8172                Self::Create => std::option::Option::Some(4),
8173                Self::IgnoreJob => std::option::Option::Some(5),
8174                Self::RetryJob => std::option::Option::Some(6),
8175                Self::Rollback => std::option::Option::Some(7),
8176                Self::TerminateJobrun => std::option::Option::Some(8),
8177                Self::UnknownValue(u) => u.0.value(),
8178            }
8179        }
8180
8181        /// Gets the enum value as a string.
8182        ///
8183        /// Returns `None` if the enum contains an unknown value deserialized from
8184        /// the integer representation of enums.
8185        pub fn name(&self) -> std::option::Option<&str> {
8186            match self {
8187                Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
8188                Self::Advance => std::option::Option::Some("ADVANCE"),
8189                Self::Approve => std::option::Option::Some("APPROVE"),
8190                Self::Cancel => std::option::Option::Some("CANCEL"),
8191                Self::Create => std::option::Option::Some("CREATE"),
8192                Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
8193                Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
8194                Self::Rollback => std::option::Option::Some("ROLLBACK"),
8195                Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
8196                Self::UnknownValue(u) => u.0.name(),
8197            }
8198        }
8199    }
8200
8201    impl std::default::Default for RolloutActions {
8202        fn default() -> Self {
8203            use std::convert::From;
8204            Self::from(0)
8205        }
8206    }
8207
8208    impl std::fmt::Display for RolloutActions {
8209        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8210            wkt::internal::display_enum(f, self.name(), self.value())
8211        }
8212    }
8213
8214    impl std::convert::From<i32> for RolloutActions {
8215        fn from(value: i32) -> Self {
8216            match value {
8217                0 => Self::Unspecified,
8218                1 => Self::Advance,
8219                2 => Self::Approve,
8220                3 => Self::Cancel,
8221                4 => Self::Create,
8222                5 => Self::IgnoreJob,
8223                6 => Self::RetryJob,
8224                7 => Self::Rollback,
8225                8 => Self::TerminateJobrun,
8226                _ => Self::UnknownValue(rollout_actions::UnknownValue(
8227                    wkt::internal::UnknownEnumValue::Integer(value),
8228                )),
8229            }
8230        }
8231    }
8232
8233    impl std::convert::From<&str> for RolloutActions {
8234        fn from(value: &str) -> Self {
8235            use std::string::ToString;
8236            match value {
8237                "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
8238                "ADVANCE" => Self::Advance,
8239                "APPROVE" => Self::Approve,
8240                "CANCEL" => Self::Cancel,
8241                "CREATE" => Self::Create,
8242                "IGNORE_JOB" => Self::IgnoreJob,
8243                "RETRY_JOB" => Self::RetryJob,
8244                "ROLLBACK" => Self::Rollback,
8245                "TERMINATE_JOBRUN" => Self::TerminateJobrun,
8246                _ => Self::UnknownValue(rollout_actions::UnknownValue(
8247                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8248                )),
8249            }
8250        }
8251    }
8252
8253    impl serde::ser::Serialize for RolloutActions {
8254        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8255        where
8256            S: serde::Serializer,
8257        {
8258            match self {
8259                Self::Unspecified => serializer.serialize_i32(0),
8260                Self::Advance => serializer.serialize_i32(1),
8261                Self::Approve => serializer.serialize_i32(2),
8262                Self::Cancel => serializer.serialize_i32(3),
8263                Self::Create => serializer.serialize_i32(4),
8264                Self::IgnoreJob => serializer.serialize_i32(5),
8265                Self::RetryJob => serializer.serialize_i32(6),
8266                Self::Rollback => serializer.serialize_i32(7),
8267                Self::TerminateJobrun => serializer.serialize_i32(8),
8268                Self::UnknownValue(u) => u.0.serialize(serializer),
8269            }
8270        }
8271    }
8272
8273    impl<'de> serde::de::Deserialize<'de> for RolloutActions {
8274        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8275        where
8276            D: serde::Deserializer<'de>,
8277        {
8278            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
8279                ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
8280            ))
8281        }
8282    }
8283}
8284
8285/// Time windows within which actions are restricted. See the
8286/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
8287/// for more information on how to configure dates/times.
8288#[derive(Clone, Default, PartialEq)]
8289#[non_exhaustive]
8290pub struct TimeWindows {
8291    /// Required. The time zone in IANA format [IANA Time Zone
8292    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
8293    pub time_zone: std::string::String,
8294
8295    /// Optional. One-time windows within which actions are restricted.
8296    pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
8297
8298    /// Optional. Recurring weekly windows within which actions are restricted.
8299    pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
8300
8301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8302}
8303
8304impl TimeWindows {
8305    pub fn new() -> Self {
8306        std::default::Default::default()
8307    }
8308
8309    /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
8310    ///
8311    /// # Example
8312    /// ```ignore,no_run
8313    /// # use google_cloud_deploy_v1::model::TimeWindows;
8314    /// let x = TimeWindows::new().set_time_zone("example");
8315    /// ```
8316    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8317        self.time_zone = v.into();
8318        self
8319    }
8320
8321    /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
8322    ///
8323    /// # Example
8324    /// ```ignore,no_run
8325    /// # use google_cloud_deploy_v1::model::TimeWindows;
8326    /// use google_cloud_deploy_v1::model::OneTimeWindow;
8327    /// let x = TimeWindows::new()
8328    ///     .set_one_time_windows([
8329    ///         OneTimeWindow::default()/* use setters */,
8330    ///         OneTimeWindow::default()/* use (different) setters */,
8331    ///     ]);
8332    /// ```
8333    pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
8334    where
8335        T: std::iter::IntoIterator<Item = V>,
8336        V: std::convert::Into<crate::model::OneTimeWindow>,
8337    {
8338        use std::iter::Iterator;
8339        self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
8340        self
8341    }
8342
8343    /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
8344    ///
8345    /// # Example
8346    /// ```ignore,no_run
8347    /// # use google_cloud_deploy_v1::model::TimeWindows;
8348    /// use google_cloud_deploy_v1::model::WeeklyWindow;
8349    /// let x = TimeWindows::new()
8350    ///     .set_weekly_windows([
8351    ///         WeeklyWindow::default()/* use setters */,
8352    ///         WeeklyWindow::default()/* use (different) setters */,
8353    ///     ]);
8354    /// ```
8355    pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
8356    where
8357        T: std::iter::IntoIterator<Item = V>,
8358        V: std::convert::Into<crate::model::WeeklyWindow>,
8359    {
8360        use std::iter::Iterator;
8361        self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
8362        self
8363    }
8364}
8365
8366impl wkt::message::Message for TimeWindows {
8367    fn typename() -> &'static str {
8368        "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
8369    }
8370}
8371
8372/// One-time window within which actions are restricted. For example, blocking
8373/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
8374#[derive(Clone, Default, PartialEq)]
8375#[non_exhaustive]
8376pub struct OneTimeWindow {
8377    /// Required. Start date.
8378    pub start_date: std::option::Option<gtype::model::Date>,
8379
8380    /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
8381    pub start_time: std::option::Option<gtype::model::TimeOfDay>,
8382
8383    /// Required. End date.
8384    pub end_date: std::option::Option<gtype::model::Date>,
8385
8386    /// Required. End time (exclusive). You may use 24:00 for the end of the day.
8387    pub end_time: std::option::Option<gtype::model::TimeOfDay>,
8388
8389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8390}
8391
8392impl OneTimeWindow {
8393    pub fn new() -> Self {
8394        std::default::Default::default()
8395    }
8396
8397    /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
8398    ///
8399    /// # Example
8400    /// ```ignore,no_run
8401    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8402    /// use gtype::model::Date;
8403    /// let x = OneTimeWindow::new().set_start_date(Date::default()/* use setters */);
8404    /// ```
8405    pub fn set_start_date<T>(mut self, v: T) -> Self
8406    where
8407        T: std::convert::Into<gtype::model::Date>,
8408    {
8409        self.start_date = std::option::Option::Some(v.into());
8410        self
8411    }
8412
8413    /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
8414    ///
8415    /// # Example
8416    /// ```ignore,no_run
8417    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8418    /// use gtype::model::Date;
8419    /// let x = OneTimeWindow::new().set_or_clear_start_date(Some(Date::default()/* use setters */));
8420    /// let x = OneTimeWindow::new().set_or_clear_start_date(None::<Date>);
8421    /// ```
8422    pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
8423    where
8424        T: std::convert::Into<gtype::model::Date>,
8425    {
8426        self.start_date = v.map(|x| x.into());
8427        self
8428    }
8429
8430    /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
8431    ///
8432    /// # Example
8433    /// ```ignore,no_run
8434    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8435    /// use gtype::model::TimeOfDay;
8436    /// let x = OneTimeWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8437    /// ```
8438    pub fn set_start_time<T>(mut self, v: T) -> Self
8439    where
8440        T: std::convert::Into<gtype::model::TimeOfDay>,
8441    {
8442        self.start_time = std::option::Option::Some(v.into());
8443        self
8444    }
8445
8446    /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
8447    ///
8448    /// # Example
8449    /// ```ignore,no_run
8450    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8451    /// use gtype::model::TimeOfDay;
8452    /// let x = OneTimeWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8453    /// let x = OneTimeWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8454    /// ```
8455    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8456    where
8457        T: std::convert::Into<gtype::model::TimeOfDay>,
8458    {
8459        self.start_time = v.map(|x| x.into());
8460        self
8461    }
8462
8463    /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
8464    ///
8465    /// # Example
8466    /// ```ignore,no_run
8467    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8468    /// use gtype::model::Date;
8469    /// let x = OneTimeWindow::new().set_end_date(Date::default()/* use setters */);
8470    /// ```
8471    pub fn set_end_date<T>(mut self, v: T) -> Self
8472    where
8473        T: std::convert::Into<gtype::model::Date>,
8474    {
8475        self.end_date = std::option::Option::Some(v.into());
8476        self
8477    }
8478
8479    /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
8480    ///
8481    /// # Example
8482    /// ```ignore,no_run
8483    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8484    /// use gtype::model::Date;
8485    /// let x = OneTimeWindow::new().set_or_clear_end_date(Some(Date::default()/* use setters */));
8486    /// let x = OneTimeWindow::new().set_or_clear_end_date(None::<Date>);
8487    /// ```
8488    pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
8489    where
8490        T: std::convert::Into<gtype::model::Date>,
8491    {
8492        self.end_date = v.map(|x| x.into());
8493        self
8494    }
8495
8496    /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
8497    ///
8498    /// # Example
8499    /// ```ignore,no_run
8500    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8501    /// use gtype::model::TimeOfDay;
8502    /// let x = OneTimeWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8503    /// ```
8504    pub fn set_end_time<T>(mut self, v: T) -> Self
8505    where
8506        T: std::convert::Into<gtype::model::TimeOfDay>,
8507    {
8508        self.end_time = std::option::Option::Some(v.into());
8509        self
8510    }
8511
8512    /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
8513    ///
8514    /// # Example
8515    /// ```ignore,no_run
8516    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8517    /// use gtype::model::TimeOfDay;
8518    /// let x = OneTimeWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8519    /// let x = OneTimeWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8520    /// ```
8521    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8522    where
8523        T: std::convert::Into<gtype::model::TimeOfDay>,
8524    {
8525        self.end_time = v.map(|x| x.into());
8526        self
8527    }
8528}
8529
8530impl wkt::message::Message for OneTimeWindow {
8531    fn typename() -> &'static str {
8532        "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
8533    }
8534}
8535
8536/// Weekly windows. For example, blocking actions every Saturday and Sunday.
8537/// Another example would be blocking actions every weekday from 5pm to midnight.
8538#[derive(Clone, Default, PartialEq)]
8539#[non_exhaustive]
8540pub struct WeeklyWindow {
8541    /// Optional. Days of week. If left empty, all days of the week will be
8542    /// included.
8543    pub days_of_week: std::vec::Vec<gtype::model::DayOfWeek>,
8544
8545    /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
8546    /// If you specify start_time you must also specify end_time. If left empty,
8547    /// this will block for the entire day for the days specified in days_of_week.
8548    pub start_time: std::option::Option<gtype::model::TimeOfDay>,
8549
8550    /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
8551    /// specify end_time you must also specify start_time. If left empty, this will
8552    /// block for the entire day for the days specified in days_of_week.
8553    pub end_time: std::option::Option<gtype::model::TimeOfDay>,
8554
8555    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8556}
8557
8558impl WeeklyWindow {
8559    pub fn new() -> Self {
8560        std::default::Default::default()
8561    }
8562
8563    /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
8564    ///
8565    /// # Example
8566    /// ```ignore,no_run
8567    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8568    /// use gtype::model::DayOfWeek;
8569    /// let x = WeeklyWindow::new().set_days_of_week([
8570    ///     DayOfWeek::Monday,
8571    ///     DayOfWeek::Tuesday,
8572    ///     DayOfWeek::Wednesday,
8573    /// ]);
8574    /// ```
8575    pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
8576    where
8577        T: std::iter::IntoIterator<Item = V>,
8578        V: std::convert::Into<gtype::model::DayOfWeek>,
8579    {
8580        use std::iter::Iterator;
8581        self.days_of_week = v.into_iter().map(|i| i.into()).collect();
8582        self
8583    }
8584
8585    /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
8586    ///
8587    /// # Example
8588    /// ```ignore,no_run
8589    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8590    /// use gtype::model::TimeOfDay;
8591    /// let x = WeeklyWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8592    /// ```
8593    pub fn set_start_time<T>(mut self, v: T) -> Self
8594    where
8595        T: std::convert::Into<gtype::model::TimeOfDay>,
8596    {
8597        self.start_time = std::option::Option::Some(v.into());
8598        self
8599    }
8600
8601    /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
8602    ///
8603    /// # Example
8604    /// ```ignore,no_run
8605    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8606    /// use gtype::model::TimeOfDay;
8607    /// let x = WeeklyWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8608    /// let x = WeeklyWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8609    /// ```
8610    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8611    where
8612        T: std::convert::Into<gtype::model::TimeOfDay>,
8613    {
8614        self.start_time = v.map(|x| x.into());
8615        self
8616    }
8617
8618    /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
8619    ///
8620    /// # Example
8621    /// ```ignore,no_run
8622    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8623    /// use gtype::model::TimeOfDay;
8624    /// let x = WeeklyWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8625    /// ```
8626    pub fn set_end_time<T>(mut self, v: T) -> Self
8627    where
8628        T: std::convert::Into<gtype::model::TimeOfDay>,
8629    {
8630        self.end_time = std::option::Option::Some(v.into());
8631        self
8632    }
8633
8634    /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
8635    ///
8636    /// # Example
8637    /// ```ignore,no_run
8638    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8639    /// use gtype::model::TimeOfDay;
8640    /// let x = WeeklyWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8641    /// let x = WeeklyWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8642    /// ```
8643    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8644    where
8645        T: std::convert::Into<gtype::model::TimeOfDay>,
8646    {
8647        self.end_time = v.map(|x| x.into());
8648        self
8649    }
8650}
8651
8652impl wkt::message::Message for WeeklyWindow {
8653    fn typename() -> &'static str {
8654        "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
8655    }
8656}
8657
8658/// Returned from an action if one or more policies were
8659/// violated, and therefore the action was prevented. Contains information about
8660/// what policies were violated and why.
8661#[derive(Clone, Default, PartialEq)]
8662#[non_exhaustive]
8663pub struct PolicyViolation {
8664    /// Policy violation details.
8665    pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
8666
8667    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8668}
8669
8670impl PolicyViolation {
8671    pub fn new() -> Self {
8672        std::default::Default::default()
8673    }
8674
8675    /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
8676    ///
8677    /// # Example
8678    /// ```ignore,no_run
8679    /// # use google_cloud_deploy_v1::model::PolicyViolation;
8680    /// use google_cloud_deploy_v1::model::PolicyViolationDetails;
8681    /// let x = PolicyViolation::new()
8682    ///     .set_policy_violation_details([
8683    ///         PolicyViolationDetails::default()/* use setters */,
8684    ///         PolicyViolationDetails::default()/* use (different) setters */,
8685    ///     ]);
8686    /// ```
8687    pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
8688    where
8689        T: std::iter::IntoIterator<Item = V>,
8690        V: std::convert::Into<crate::model::PolicyViolationDetails>,
8691    {
8692        use std::iter::Iterator;
8693        self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
8694        self
8695    }
8696}
8697
8698impl wkt::message::Message for PolicyViolation {
8699    fn typename() -> &'static str {
8700        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
8701    }
8702}
8703
8704/// Policy violation details.
8705#[derive(Clone, Default, PartialEq)]
8706#[non_exhaustive]
8707pub struct PolicyViolationDetails {
8708    /// Name of the policy that was violated.
8709    /// Policy resource will be in the format of
8710    /// `projects/{project}/locations/{location}/policies/{policy}`.
8711    pub policy: std::string::String,
8712
8713    /// Id of the rule that triggered the policy violation.
8714    pub rule_id: std::string::String,
8715
8716    /// User readable message about why the request violated a policy. This is not
8717    /// intended for machine parsing.
8718    pub failure_message: std::string::String,
8719
8720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8721}
8722
8723impl PolicyViolationDetails {
8724    pub fn new() -> Self {
8725        std::default::Default::default()
8726    }
8727
8728    /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
8729    ///
8730    /// # Example
8731    /// ```ignore,no_run
8732    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8733    /// let x = PolicyViolationDetails::new().set_policy("example");
8734    /// ```
8735    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8736        self.policy = v.into();
8737        self
8738    }
8739
8740    /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
8741    ///
8742    /// # Example
8743    /// ```ignore,no_run
8744    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8745    /// let x = PolicyViolationDetails::new().set_rule_id("example");
8746    /// ```
8747    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8748        self.rule_id = v.into();
8749        self
8750    }
8751
8752    /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
8753    ///
8754    /// # Example
8755    /// ```ignore,no_run
8756    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8757    /// let x = PolicyViolationDetails::new().set_failure_message("example");
8758    /// ```
8759    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8760        self.failure_message = v.into();
8761        self
8762    }
8763}
8764
8765impl wkt::message::Message for PolicyViolationDetails {
8766    fn typename() -> &'static str {
8767        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
8768    }
8769}
8770
8771/// A `Release` resource in the Cloud Deploy API.
8772///
8773/// A `Release` defines a specific Skaffold configuration instance
8774/// that can be deployed.
8775#[derive(Clone, Default, PartialEq)]
8776#[non_exhaustive]
8777pub struct Release {
8778    /// Identifier. Name of the `Release`. Format is
8779    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
8780    /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8781    pub name: std::string::String,
8782
8783    /// Output only. Unique identifier of the `Release`.
8784    pub uid: std::string::String,
8785
8786    /// Optional. Description of the `Release`. Max length is 255 characters.
8787    pub description: std::string::String,
8788
8789    /// Optional. User annotations. These attributes can only be set and used by
8790    /// the user, and not by Cloud Deploy. See
8791    /// <https://google.aip.dev/128#annotations> for more details such as format and
8792    /// size limitations.
8793    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8794
8795    /// Labels are attributes that can be set and used by both the
8796    /// user and by Cloud Deploy. Labels must meet the following constraints:
8797    ///
8798    /// * Keys and values can contain only lowercase letters, numeric characters,
8799    ///   underscores, and dashes.
8800    /// * All characters must use UTF-8 encoding, and international characters are
8801    ///   allowed.
8802    /// * Keys must start with a lowercase letter or international character.
8803    /// * Each resource is limited to a maximum of 64 labels.
8804    ///
8805    /// Both keys and values are additionally constrained to be <= 128 bytes.
8806    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8807
8808    /// Output only. Indicates whether this is an abandoned release.
8809    pub abandoned: bool,
8810
8811    /// Output only. Time at which the `Release` was created.
8812    pub create_time: std::option::Option<wkt::Timestamp>,
8813
8814    /// Output only. Time at which the render began.
8815    pub render_start_time: std::option::Option<wkt::Timestamp>,
8816
8817    /// Output only. Time at which the render completed.
8818    pub render_end_time: std::option::Option<wkt::Timestamp>,
8819
8820    /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
8821    /// configuration.
8822    pub skaffold_config_uri: std::string::String,
8823
8824    /// Optional. Filepath of the Skaffold config inside of the config URI.
8825    pub skaffold_config_path: std::string::String,
8826
8827    /// Optional. List of artifacts to pass through to Skaffold command.
8828    pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
8829
8830    /// Output only. Snapshot of the parent pipeline taken at release creation
8831    /// time.
8832    pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
8833
8834    /// Output only. Snapshot of the targets taken at release creation time.
8835    pub target_snapshots: std::vec::Vec<crate::model::Target>,
8836
8837    /// Output only. Snapshot of the custom target types referenced by the targets
8838    /// taken at release creation time.
8839    pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
8840
8841    /// Output only. Current state of the render operation.
8842    pub render_state: crate::model::release::RenderState,
8843
8844    /// This checksum is computed by the server based on the value of other
8845    /// fields, and may be sent on update and delete requests to ensure the
8846    /// client has an up-to-date value before proceeding.
8847    pub etag: std::string::String,
8848
8849    /// Optional. The Skaffold version to use when operating on this release, such
8850    /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
8851    /// set of versions.
8852    ///
8853    /// If unset, the most recent supported Skaffold version will be used.
8854    pub skaffold_version: std::string::String,
8855
8856    /// Output only. Map from target ID to the target artifacts created
8857    /// during the render operation.
8858    pub target_artifacts:
8859        std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
8860
8861    /// Output only. Map from target ID to details of the render operation for that
8862    /// target.
8863    pub target_renders:
8864        std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
8865
8866    /// Output only. Information around the state of the Release.
8867    pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
8868
8869    /// Optional. The deploy parameters to use for all targets in this release.
8870    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
8871
8872    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8873}
8874
8875impl Release {
8876    pub fn new() -> Self {
8877        std::default::Default::default()
8878    }
8879
8880    /// Sets the value of [name][crate::model::Release::name].
8881    ///
8882    /// # Example
8883    /// ```ignore,no_run
8884    /// # use google_cloud_deploy_v1::model::Release;
8885    /// let x = Release::new().set_name("example");
8886    /// ```
8887    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8888        self.name = v.into();
8889        self
8890    }
8891
8892    /// Sets the value of [uid][crate::model::Release::uid].
8893    ///
8894    /// # Example
8895    /// ```ignore,no_run
8896    /// # use google_cloud_deploy_v1::model::Release;
8897    /// let x = Release::new().set_uid("example");
8898    /// ```
8899    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8900        self.uid = v.into();
8901        self
8902    }
8903
8904    /// Sets the value of [description][crate::model::Release::description].
8905    ///
8906    /// # Example
8907    /// ```ignore,no_run
8908    /// # use google_cloud_deploy_v1::model::Release;
8909    /// let x = Release::new().set_description("example");
8910    /// ```
8911    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8912        self.description = v.into();
8913        self
8914    }
8915
8916    /// Sets the value of [annotations][crate::model::Release::annotations].
8917    ///
8918    /// # Example
8919    /// ```ignore,no_run
8920    /// # use google_cloud_deploy_v1::model::Release;
8921    /// let x = Release::new().set_annotations([
8922    ///     ("key0", "abc"),
8923    ///     ("key1", "xyz"),
8924    /// ]);
8925    /// ```
8926    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
8927    where
8928        T: std::iter::IntoIterator<Item = (K, V)>,
8929        K: std::convert::Into<std::string::String>,
8930        V: std::convert::Into<std::string::String>,
8931    {
8932        use std::iter::Iterator;
8933        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8934        self
8935    }
8936
8937    /// Sets the value of [labels][crate::model::Release::labels].
8938    ///
8939    /// # Example
8940    /// ```ignore,no_run
8941    /// # use google_cloud_deploy_v1::model::Release;
8942    /// let x = Release::new().set_labels([
8943    ///     ("key0", "abc"),
8944    ///     ("key1", "xyz"),
8945    /// ]);
8946    /// ```
8947    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8948    where
8949        T: std::iter::IntoIterator<Item = (K, V)>,
8950        K: std::convert::Into<std::string::String>,
8951        V: std::convert::Into<std::string::String>,
8952    {
8953        use std::iter::Iterator;
8954        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8955        self
8956    }
8957
8958    /// Sets the value of [abandoned][crate::model::Release::abandoned].
8959    ///
8960    /// # Example
8961    /// ```ignore,no_run
8962    /// # use google_cloud_deploy_v1::model::Release;
8963    /// let x = Release::new().set_abandoned(true);
8964    /// ```
8965    pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8966        self.abandoned = v.into();
8967        self
8968    }
8969
8970    /// Sets the value of [create_time][crate::model::Release::create_time].
8971    ///
8972    /// # Example
8973    /// ```ignore,no_run
8974    /// # use google_cloud_deploy_v1::model::Release;
8975    /// use wkt::Timestamp;
8976    /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
8977    /// ```
8978    pub fn set_create_time<T>(mut self, v: T) -> Self
8979    where
8980        T: std::convert::Into<wkt::Timestamp>,
8981    {
8982        self.create_time = std::option::Option::Some(v.into());
8983        self
8984    }
8985
8986    /// Sets or clears the value of [create_time][crate::model::Release::create_time].
8987    ///
8988    /// # Example
8989    /// ```ignore,no_run
8990    /// # use google_cloud_deploy_v1::model::Release;
8991    /// use wkt::Timestamp;
8992    /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8993    /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
8994    /// ```
8995    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8996    where
8997        T: std::convert::Into<wkt::Timestamp>,
8998    {
8999        self.create_time = v.map(|x| x.into());
9000        self
9001    }
9002
9003    /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
9004    ///
9005    /// # Example
9006    /// ```ignore,no_run
9007    /// # use google_cloud_deploy_v1::model::Release;
9008    /// use wkt::Timestamp;
9009    /// let x = Release::new().set_render_start_time(Timestamp::default()/* use setters */);
9010    /// ```
9011    pub fn set_render_start_time<T>(mut self, v: T) -> Self
9012    where
9013        T: std::convert::Into<wkt::Timestamp>,
9014    {
9015        self.render_start_time = std::option::Option::Some(v.into());
9016        self
9017    }
9018
9019    /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
9020    ///
9021    /// # Example
9022    /// ```ignore,no_run
9023    /// # use google_cloud_deploy_v1::model::Release;
9024    /// use wkt::Timestamp;
9025    /// let x = Release::new().set_or_clear_render_start_time(Some(Timestamp::default()/* use setters */));
9026    /// let x = Release::new().set_or_clear_render_start_time(None::<Timestamp>);
9027    /// ```
9028    pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9029    where
9030        T: std::convert::Into<wkt::Timestamp>,
9031    {
9032        self.render_start_time = v.map(|x| x.into());
9033        self
9034    }
9035
9036    /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
9037    ///
9038    /// # Example
9039    /// ```ignore,no_run
9040    /// # use google_cloud_deploy_v1::model::Release;
9041    /// use wkt::Timestamp;
9042    /// let x = Release::new().set_render_end_time(Timestamp::default()/* use setters */);
9043    /// ```
9044    pub fn set_render_end_time<T>(mut self, v: T) -> Self
9045    where
9046        T: std::convert::Into<wkt::Timestamp>,
9047    {
9048        self.render_end_time = std::option::Option::Some(v.into());
9049        self
9050    }
9051
9052    /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
9053    ///
9054    /// # Example
9055    /// ```ignore,no_run
9056    /// # use google_cloud_deploy_v1::model::Release;
9057    /// use wkt::Timestamp;
9058    /// let x = Release::new().set_or_clear_render_end_time(Some(Timestamp::default()/* use setters */));
9059    /// let x = Release::new().set_or_clear_render_end_time(None::<Timestamp>);
9060    /// ```
9061    pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9062    where
9063        T: std::convert::Into<wkt::Timestamp>,
9064    {
9065        self.render_end_time = v.map(|x| x.into());
9066        self
9067    }
9068
9069    /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
9070    ///
9071    /// # Example
9072    /// ```ignore,no_run
9073    /// # use google_cloud_deploy_v1::model::Release;
9074    /// let x = Release::new().set_skaffold_config_uri("example");
9075    /// ```
9076    pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
9077        mut self,
9078        v: T,
9079    ) -> Self {
9080        self.skaffold_config_uri = v.into();
9081        self
9082    }
9083
9084    /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
9085    ///
9086    /// # Example
9087    /// ```ignore,no_run
9088    /// # use google_cloud_deploy_v1::model::Release;
9089    /// let x = Release::new().set_skaffold_config_path("example");
9090    /// ```
9091    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
9092        mut self,
9093        v: T,
9094    ) -> Self {
9095        self.skaffold_config_path = v.into();
9096        self
9097    }
9098
9099    /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
9100    ///
9101    /// # Example
9102    /// ```ignore,no_run
9103    /// # use google_cloud_deploy_v1::model::Release;
9104    /// use google_cloud_deploy_v1::model::BuildArtifact;
9105    /// let x = Release::new()
9106    ///     .set_build_artifacts([
9107    ///         BuildArtifact::default()/* use setters */,
9108    ///         BuildArtifact::default()/* use (different) setters */,
9109    ///     ]);
9110    /// ```
9111    pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
9112    where
9113        T: std::iter::IntoIterator<Item = V>,
9114        V: std::convert::Into<crate::model::BuildArtifact>,
9115    {
9116        use std::iter::Iterator;
9117        self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
9118        self
9119    }
9120
9121    /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9122    ///
9123    /// # Example
9124    /// ```ignore,no_run
9125    /// # use google_cloud_deploy_v1::model::Release;
9126    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9127    /// let x = Release::new().set_delivery_pipeline_snapshot(DeliveryPipeline::default()/* use setters */);
9128    /// ```
9129    pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
9130    where
9131        T: std::convert::Into<crate::model::DeliveryPipeline>,
9132    {
9133        self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
9134        self
9135    }
9136
9137    /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9138    ///
9139    /// # Example
9140    /// ```ignore,no_run
9141    /// # use google_cloud_deploy_v1::model::Release;
9142    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9143    /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(Some(DeliveryPipeline::default()/* use setters */));
9144    /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(None::<DeliveryPipeline>);
9145    /// ```
9146    pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9147    where
9148        T: std::convert::Into<crate::model::DeliveryPipeline>,
9149    {
9150        self.delivery_pipeline_snapshot = v.map(|x| x.into());
9151        self
9152    }
9153
9154    /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
9155    ///
9156    /// # Example
9157    /// ```ignore,no_run
9158    /// # use google_cloud_deploy_v1::model::Release;
9159    /// use google_cloud_deploy_v1::model::Target;
9160    /// let x = Release::new()
9161    ///     .set_target_snapshots([
9162    ///         Target::default()/* use setters */,
9163    ///         Target::default()/* use (different) setters */,
9164    ///     ]);
9165    /// ```
9166    pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
9167    where
9168        T: std::iter::IntoIterator<Item = V>,
9169        V: std::convert::Into<crate::model::Target>,
9170    {
9171        use std::iter::Iterator;
9172        self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
9173        self
9174    }
9175
9176    /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
9177    ///
9178    /// # Example
9179    /// ```ignore,no_run
9180    /// # use google_cloud_deploy_v1::model::Release;
9181    /// use google_cloud_deploy_v1::model::CustomTargetType;
9182    /// let x = Release::new()
9183    ///     .set_custom_target_type_snapshots([
9184    ///         CustomTargetType::default()/* use setters */,
9185    ///         CustomTargetType::default()/* use (different) setters */,
9186    ///     ]);
9187    /// ```
9188    pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
9189    where
9190        T: std::iter::IntoIterator<Item = V>,
9191        V: std::convert::Into<crate::model::CustomTargetType>,
9192    {
9193        use std::iter::Iterator;
9194        self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
9195        self
9196    }
9197
9198    /// Sets the value of [render_state][crate::model::Release::render_state].
9199    ///
9200    /// # Example
9201    /// ```ignore,no_run
9202    /// # use google_cloud_deploy_v1::model::Release;
9203    /// use google_cloud_deploy_v1::model::release::RenderState;
9204    /// let x0 = Release::new().set_render_state(RenderState::Succeeded);
9205    /// let x1 = Release::new().set_render_state(RenderState::Failed);
9206    /// let x2 = Release::new().set_render_state(RenderState::InProgress);
9207    /// ```
9208    pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
9209        mut self,
9210        v: T,
9211    ) -> Self {
9212        self.render_state = v.into();
9213        self
9214    }
9215
9216    /// Sets the value of [etag][crate::model::Release::etag].
9217    ///
9218    /// # Example
9219    /// ```ignore,no_run
9220    /// # use google_cloud_deploy_v1::model::Release;
9221    /// let x = Release::new().set_etag("example");
9222    /// ```
9223    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9224        self.etag = v.into();
9225        self
9226    }
9227
9228    /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
9229    ///
9230    /// # Example
9231    /// ```ignore,no_run
9232    /// # use google_cloud_deploy_v1::model::Release;
9233    /// let x = Release::new().set_skaffold_version("example");
9234    /// ```
9235    pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
9236        mut self,
9237        v: T,
9238    ) -> Self {
9239        self.skaffold_version = v.into();
9240        self
9241    }
9242
9243    /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
9244    ///
9245    /// # Example
9246    /// ```ignore,no_run
9247    /// # use google_cloud_deploy_v1::model::Release;
9248    /// use google_cloud_deploy_v1::model::TargetArtifact;
9249    /// let x = Release::new().set_target_artifacts([
9250    ///     ("key0", TargetArtifact::default()/* use setters */),
9251    ///     ("key1", TargetArtifact::default()/* use (different) setters */),
9252    /// ]);
9253    /// ```
9254    pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
9255    where
9256        T: std::iter::IntoIterator<Item = (K, V)>,
9257        K: std::convert::Into<std::string::String>,
9258        V: std::convert::Into<crate::model::TargetArtifact>,
9259    {
9260        use std::iter::Iterator;
9261        self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9262        self
9263    }
9264
9265    /// Sets the value of [target_renders][crate::model::Release::target_renders].
9266    ///
9267    /// # Example
9268    /// ```ignore,no_run
9269    /// # use google_cloud_deploy_v1::model::Release;
9270    /// use google_cloud_deploy_v1::model::release::TargetRender;
9271    /// let x = Release::new().set_target_renders([
9272    ///     ("key0", TargetRender::default()/* use setters */),
9273    ///     ("key1", TargetRender::default()/* use (different) setters */),
9274    /// ]);
9275    /// ```
9276    pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
9277    where
9278        T: std::iter::IntoIterator<Item = (K, V)>,
9279        K: std::convert::Into<std::string::String>,
9280        V: std::convert::Into<crate::model::release::TargetRender>,
9281    {
9282        use std::iter::Iterator;
9283        self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9284        self
9285    }
9286
9287    /// Sets the value of [condition][crate::model::Release::condition].
9288    ///
9289    /// # Example
9290    /// ```ignore,no_run
9291    /// # use google_cloud_deploy_v1::model::Release;
9292    /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9293    /// let x = Release::new().set_condition(ReleaseCondition::default()/* use setters */);
9294    /// ```
9295    pub fn set_condition<T>(mut self, v: T) -> Self
9296    where
9297        T: std::convert::Into<crate::model::release::ReleaseCondition>,
9298    {
9299        self.condition = std::option::Option::Some(v.into());
9300        self
9301    }
9302
9303    /// Sets or clears the value of [condition][crate::model::Release::condition].
9304    ///
9305    /// # Example
9306    /// ```ignore,no_run
9307    /// # use google_cloud_deploy_v1::model::Release;
9308    /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9309    /// let x = Release::new().set_or_clear_condition(Some(ReleaseCondition::default()/* use setters */));
9310    /// let x = Release::new().set_or_clear_condition(None::<ReleaseCondition>);
9311    /// ```
9312    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
9313    where
9314        T: std::convert::Into<crate::model::release::ReleaseCondition>,
9315    {
9316        self.condition = v.map(|x| x.into());
9317        self
9318    }
9319
9320    /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
9321    ///
9322    /// # Example
9323    /// ```ignore,no_run
9324    /// # use google_cloud_deploy_v1::model::Release;
9325    /// let x = Release::new().set_deploy_parameters([
9326    ///     ("key0", "abc"),
9327    ///     ("key1", "xyz"),
9328    /// ]);
9329    /// ```
9330    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
9331    where
9332        T: std::iter::IntoIterator<Item = (K, V)>,
9333        K: std::convert::Into<std::string::String>,
9334        V: std::convert::Into<std::string::String>,
9335    {
9336        use std::iter::Iterator;
9337        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9338        self
9339    }
9340}
9341
9342impl wkt::message::Message for Release {
9343    fn typename() -> &'static str {
9344        "type.googleapis.com/google.cloud.deploy.v1.Release"
9345    }
9346}
9347
9348/// Defines additional types related to [Release].
9349pub mod release {
9350    #[allow(unused_imports)]
9351    use super::*;
9352
9353    /// Details of rendering for a single target.
9354    #[derive(Clone, Default, PartialEq)]
9355    #[non_exhaustive]
9356    pub struct TargetRender {
9357        /// Output only. The resource name of the Cloud Build `Build` object that is
9358        /// used to render the manifest for this target. Format is
9359        /// `projects/{project}/locations/{location}/builds/{build}`.
9360        pub rendering_build: std::string::String,
9361
9362        /// Output only. Current state of the render operation for this Target.
9363        pub rendering_state: crate::model::release::target_render::TargetRenderState,
9364
9365        /// Output only. Metadata related to the `Release` render for this Target.
9366        pub metadata: std::option::Option<crate::model::RenderMetadata>,
9367
9368        /// Output only. Reason this render failed. This will always be unspecified
9369        /// while the render in progress.
9370        pub failure_cause: crate::model::release::target_render::FailureCause,
9371
9372        /// Output only. Additional information about the render failure, if
9373        /// available.
9374        pub failure_message: std::string::String,
9375
9376        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9377    }
9378
9379    impl TargetRender {
9380        pub fn new() -> Self {
9381            std::default::Default::default()
9382        }
9383
9384        /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
9385        ///
9386        /// # Example
9387        /// ```ignore,no_run
9388        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9389        /// let x = TargetRender::new().set_rendering_build("example");
9390        /// ```
9391        pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
9392            mut self,
9393            v: T,
9394        ) -> Self {
9395            self.rendering_build = v.into();
9396            self
9397        }
9398
9399        /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
9400        ///
9401        /// # Example
9402        /// ```ignore,no_run
9403        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9404        /// use google_cloud_deploy_v1::model::release::target_render::TargetRenderState;
9405        /// let x0 = TargetRender::new().set_rendering_state(TargetRenderState::Succeeded);
9406        /// let x1 = TargetRender::new().set_rendering_state(TargetRenderState::Failed);
9407        /// let x2 = TargetRender::new().set_rendering_state(TargetRenderState::InProgress);
9408        /// ```
9409        pub fn set_rendering_state<
9410            T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
9411        >(
9412            mut self,
9413            v: T,
9414        ) -> Self {
9415            self.rendering_state = v.into();
9416            self
9417        }
9418
9419        /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
9420        ///
9421        /// # Example
9422        /// ```ignore,no_run
9423        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9424        /// use google_cloud_deploy_v1::model::RenderMetadata;
9425        /// let x = TargetRender::new().set_metadata(RenderMetadata::default()/* use setters */);
9426        /// ```
9427        pub fn set_metadata<T>(mut self, v: T) -> Self
9428        where
9429            T: std::convert::Into<crate::model::RenderMetadata>,
9430        {
9431            self.metadata = std::option::Option::Some(v.into());
9432            self
9433        }
9434
9435        /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
9436        ///
9437        /// # Example
9438        /// ```ignore,no_run
9439        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9440        /// use google_cloud_deploy_v1::model::RenderMetadata;
9441        /// let x = TargetRender::new().set_or_clear_metadata(Some(RenderMetadata::default()/* use setters */));
9442        /// let x = TargetRender::new().set_or_clear_metadata(None::<RenderMetadata>);
9443        /// ```
9444        pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9445        where
9446            T: std::convert::Into<crate::model::RenderMetadata>,
9447        {
9448            self.metadata = v.map(|x| x.into());
9449            self
9450        }
9451
9452        /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
9453        ///
9454        /// # Example
9455        /// ```ignore,no_run
9456        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9457        /// use google_cloud_deploy_v1::model::release::target_render::FailureCause;
9458        /// let x0 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
9459        /// let x1 = TargetRender::new().set_failure_cause(FailureCause::ExecutionFailed);
9460        /// let x2 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildRequestFailed);
9461        /// ```
9462        pub fn set_failure_cause<
9463            T: std::convert::Into<crate::model::release::target_render::FailureCause>,
9464        >(
9465            mut self,
9466            v: T,
9467        ) -> Self {
9468            self.failure_cause = v.into();
9469            self
9470        }
9471
9472        /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
9473        ///
9474        /// # Example
9475        /// ```ignore,no_run
9476        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9477        /// let x = TargetRender::new().set_failure_message("example");
9478        /// ```
9479        pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
9480            mut self,
9481            v: T,
9482        ) -> Self {
9483            self.failure_message = v.into();
9484            self
9485        }
9486    }
9487
9488    impl wkt::message::Message for TargetRender {
9489        fn typename() -> &'static str {
9490            "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
9491        }
9492    }
9493
9494    /// Defines additional types related to [TargetRender].
9495    pub mod target_render {
9496        #[allow(unused_imports)]
9497        use super::*;
9498
9499        /// Valid states of the render operation.
9500        ///
9501        /// # Working with unknown values
9502        ///
9503        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9504        /// additional enum variants at any time. Adding new variants is not considered
9505        /// a breaking change. Applications should write their code in anticipation of:
9506        ///
9507        /// - New values appearing in future releases of the client library, **and**
9508        /// - New values received dynamically, without application changes.
9509        ///
9510        /// Please consult the [Working with enums] section in the user guide for some
9511        /// guidelines.
9512        ///
9513        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9514        #[derive(Clone, Debug, PartialEq)]
9515        #[non_exhaustive]
9516        pub enum TargetRenderState {
9517            /// The render operation state is unspecified.
9518            Unspecified,
9519            /// The render operation has completed successfully.
9520            Succeeded,
9521            /// The render operation has failed.
9522            Failed,
9523            /// The render operation is in progress.
9524            InProgress,
9525            /// If set, the enum was initialized with an unknown value.
9526            ///
9527            /// Applications can examine the value using [TargetRenderState::value] or
9528            /// [TargetRenderState::name].
9529            UnknownValue(target_render_state::UnknownValue),
9530        }
9531
9532        #[doc(hidden)]
9533        pub mod target_render_state {
9534            #[allow(unused_imports)]
9535            use super::*;
9536            #[derive(Clone, Debug, PartialEq)]
9537            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9538        }
9539
9540        impl TargetRenderState {
9541            /// Gets the enum value.
9542            ///
9543            /// Returns `None` if the enum contains an unknown value deserialized from
9544            /// the string representation of enums.
9545            pub fn value(&self) -> std::option::Option<i32> {
9546                match self {
9547                    Self::Unspecified => std::option::Option::Some(0),
9548                    Self::Succeeded => std::option::Option::Some(1),
9549                    Self::Failed => std::option::Option::Some(2),
9550                    Self::InProgress => std::option::Option::Some(3),
9551                    Self::UnknownValue(u) => u.0.value(),
9552                }
9553            }
9554
9555            /// Gets the enum value as a string.
9556            ///
9557            /// Returns `None` if the enum contains an unknown value deserialized from
9558            /// the integer representation of enums.
9559            pub fn name(&self) -> std::option::Option<&str> {
9560                match self {
9561                    Self::Unspecified => {
9562                        std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
9563                    }
9564                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9565                    Self::Failed => std::option::Option::Some("FAILED"),
9566                    Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9567                    Self::UnknownValue(u) => u.0.name(),
9568                }
9569            }
9570        }
9571
9572        impl std::default::Default for TargetRenderState {
9573            fn default() -> Self {
9574                use std::convert::From;
9575                Self::from(0)
9576            }
9577        }
9578
9579        impl std::fmt::Display for TargetRenderState {
9580            fn fmt(
9581                &self,
9582                f: &mut std::fmt::Formatter<'_>,
9583            ) -> std::result::Result<(), std::fmt::Error> {
9584                wkt::internal::display_enum(f, self.name(), self.value())
9585            }
9586        }
9587
9588        impl std::convert::From<i32> for TargetRenderState {
9589            fn from(value: i32) -> Self {
9590                match value {
9591                    0 => Self::Unspecified,
9592                    1 => Self::Succeeded,
9593                    2 => Self::Failed,
9594                    3 => Self::InProgress,
9595                    _ => Self::UnknownValue(target_render_state::UnknownValue(
9596                        wkt::internal::UnknownEnumValue::Integer(value),
9597                    )),
9598                }
9599            }
9600        }
9601
9602        impl std::convert::From<&str> for TargetRenderState {
9603            fn from(value: &str) -> Self {
9604                use std::string::ToString;
9605                match value {
9606                    "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
9607                    "SUCCEEDED" => Self::Succeeded,
9608                    "FAILED" => Self::Failed,
9609                    "IN_PROGRESS" => Self::InProgress,
9610                    _ => Self::UnknownValue(target_render_state::UnknownValue(
9611                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9612                    )),
9613                }
9614            }
9615        }
9616
9617        impl serde::ser::Serialize for TargetRenderState {
9618            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9619            where
9620                S: serde::Serializer,
9621            {
9622                match self {
9623                    Self::Unspecified => serializer.serialize_i32(0),
9624                    Self::Succeeded => serializer.serialize_i32(1),
9625                    Self::Failed => serializer.serialize_i32(2),
9626                    Self::InProgress => serializer.serialize_i32(3),
9627                    Self::UnknownValue(u) => u.0.serialize(serializer),
9628                }
9629            }
9630        }
9631
9632        impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
9633            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9634            where
9635                D: serde::Deserializer<'de>,
9636            {
9637                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
9638                    ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
9639                ))
9640            }
9641        }
9642
9643        /// Well-known rendering failures.
9644        ///
9645        /// # Working with unknown values
9646        ///
9647        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9648        /// additional enum variants at any time. Adding new variants is not considered
9649        /// a breaking change. Applications should write their code in anticipation of:
9650        ///
9651        /// - New values appearing in future releases of the client library, **and**
9652        /// - New values received dynamically, without application changes.
9653        ///
9654        /// Please consult the [Working with enums] section in the user guide for some
9655        /// guidelines.
9656        ///
9657        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9658        #[derive(Clone, Debug, PartialEq)]
9659        #[non_exhaustive]
9660        pub enum FailureCause {
9661            /// No reason for failure is specified.
9662            Unspecified,
9663            /// Cloud Build is not available, either because it is not enabled or
9664            /// because Cloud Deploy has insufficient permissions. See [required
9665            /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9666            CloudBuildUnavailable,
9667            /// The render operation did not complete successfully; check Cloud Build
9668            /// logs.
9669            ExecutionFailed,
9670            /// Cloud Build failed to fulfill Cloud Deploy's request. See
9671            /// failure_message for additional details.
9672            CloudBuildRequestFailed,
9673            /// The render operation did not complete successfully because the
9674            /// verification stanza required for verify was not found on the Skaffold
9675            /// configuration.
9676            VerificationConfigNotFound,
9677            /// The render operation did not complete successfully because the custom
9678            /// action(s) required for Rollout jobs were not found in the Skaffold
9679            /// configuration. See failure_message for additional details.
9680            CustomActionNotFound,
9681            /// Release failed during rendering because the release configuration is
9682            /// not supported with the specified deployment strategy.
9683            DeploymentStrategyNotSupported,
9684            /// The render operation had a feature configured that is not supported.
9685            RenderFeatureNotSupported,
9686            /// If set, the enum was initialized with an unknown value.
9687            ///
9688            /// Applications can examine the value using [FailureCause::value] or
9689            /// [FailureCause::name].
9690            UnknownValue(failure_cause::UnknownValue),
9691        }
9692
9693        #[doc(hidden)]
9694        pub mod failure_cause {
9695            #[allow(unused_imports)]
9696            use super::*;
9697            #[derive(Clone, Debug, PartialEq)]
9698            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9699        }
9700
9701        impl FailureCause {
9702            /// Gets the enum value.
9703            ///
9704            /// Returns `None` if the enum contains an unknown value deserialized from
9705            /// the string representation of enums.
9706            pub fn value(&self) -> std::option::Option<i32> {
9707                match self {
9708                    Self::Unspecified => std::option::Option::Some(0),
9709                    Self::CloudBuildUnavailable => std::option::Option::Some(1),
9710                    Self::ExecutionFailed => std::option::Option::Some(2),
9711                    Self::CloudBuildRequestFailed => std::option::Option::Some(3),
9712                    Self::VerificationConfigNotFound => std::option::Option::Some(4),
9713                    Self::CustomActionNotFound => std::option::Option::Some(5),
9714                    Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
9715                    Self::RenderFeatureNotSupported => std::option::Option::Some(7),
9716                    Self::UnknownValue(u) => u.0.value(),
9717                }
9718            }
9719
9720            /// Gets the enum value as a string.
9721            ///
9722            /// Returns `None` if the enum contains an unknown value deserialized from
9723            /// the integer representation of enums.
9724            pub fn name(&self) -> std::option::Option<&str> {
9725                match self {
9726                    Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9727                    Self::CloudBuildUnavailable => {
9728                        std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
9729                    }
9730                    Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9731                    Self::CloudBuildRequestFailed => {
9732                        std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9733                    }
9734                    Self::VerificationConfigNotFound => {
9735                        std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9736                    }
9737                    Self::CustomActionNotFound => {
9738                        std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
9739                    }
9740                    Self::DeploymentStrategyNotSupported => {
9741                        std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
9742                    }
9743                    Self::RenderFeatureNotSupported => {
9744                        std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
9745                    }
9746                    Self::UnknownValue(u) => u.0.name(),
9747                }
9748            }
9749        }
9750
9751        impl std::default::Default for FailureCause {
9752            fn default() -> Self {
9753                use std::convert::From;
9754                Self::from(0)
9755            }
9756        }
9757
9758        impl std::fmt::Display for FailureCause {
9759            fn fmt(
9760                &self,
9761                f: &mut std::fmt::Formatter<'_>,
9762            ) -> std::result::Result<(), std::fmt::Error> {
9763                wkt::internal::display_enum(f, self.name(), self.value())
9764            }
9765        }
9766
9767        impl std::convert::From<i32> for FailureCause {
9768            fn from(value: i32) -> Self {
9769                match value {
9770                    0 => Self::Unspecified,
9771                    1 => Self::CloudBuildUnavailable,
9772                    2 => Self::ExecutionFailed,
9773                    3 => Self::CloudBuildRequestFailed,
9774                    4 => Self::VerificationConfigNotFound,
9775                    5 => Self::CustomActionNotFound,
9776                    6 => Self::DeploymentStrategyNotSupported,
9777                    7 => Self::RenderFeatureNotSupported,
9778                    _ => Self::UnknownValue(failure_cause::UnknownValue(
9779                        wkt::internal::UnknownEnumValue::Integer(value),
9780                    )),
9781                }
9782            }
9783        }
9784
9785        impl std::convert::From<&str> for FailureCause {
9786            fn from(value: &str) -> Self {
9787                use std::string::ToString;
9788                match value {
9789                    "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9790                    "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9791                    "EXECUTION_FAILED" => Self::ExecutionFailed,
9792                    "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9793                    "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9794                    "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
9795                    "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
9796                    "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
9797                    _ => Self::UnknownValue(failure_cause::UnknownValue(
9798                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9799                    )),
9800                }
9801            }
9802        }
9803
9804        impl serde::ser::Serialize for FailureCause {
9805            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9806            where
9807                S: serde::Serializer,
9808            {
9809                match self {
9810                    Self::Unspecified => serializer.serialize_i32(0),
9811                    Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9812                    Self::ExecutionFailed => serializer.serialize_i32(2),
9813                    Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
9814                    Self::VerificationConfigNotFound => serializer.serialize_i32(4),
9815                    Self::CustomActionNotFound => serializer.serialize_i32(5),
9816                    Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
9817                    Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
9818                    Self::UnknownValue(u) => u.0.serialize(serializer),
9819                }
9820            }
9821        }
9822
9823        impl<'de> serde::de::Deserialize<'de> for FailureCause {
9824            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9825            where
9826                D: serde::Deserializer<'de>,
9827            {
9828                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9829                    ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
9830                ))
9831            }
9832        }
9833    }
9834
9835    /// ReleaseReadyCondition contains information around the status of the
9836    /// Release. If a release is not ready, you cannot create a rollout with the
9837    /// release.
9838    #[derive(Clone, Default, PartialEq)]
9839    #[non_exhaustive]
9840    pub struct ReleaseReadyCondition {
9841        /// True if the Release is in a valid state. Otherwise at least one condition
9842        /// in `ReleaseCondition` is in an invalid state. Iterate over those
9843        /// conditions and see which condition(s) has status = false to find out what
9844        /// is wrong with the Release.
9845        pub status: bool,
9846
9847        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9848    }
9849
9850    impl ReleaseReadyCondition {
9851        pub fn new() -> Self {
9852            std::default::Default::default()
9853        }
9854
9855        /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
9856        ///
9857        /// # Example
9858        /// ```ignore,no_run
9859        /// # use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
9860        /// let x = ReleaseReadyCondition::new().set_status(true);
9861        /// ```
9862        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9863            self.status = v.into();
9864            self
9865        }
9866    }
9867
9868    impl wkt::message::Message for ReleaseReadyCondition {
9869        fn typename() -> &'static str {
9870            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
9871        }
9872    }
9873
9874    /// SkaffoldSupportedCondition contains information about when support for the
9875    /// release's version of Skaffold ends.
9876    #[derive(Clone, Default, PartialEq)]
9877    #[non_exhaustive]
9878    pub struct SkaffoldSupportedCondition {
9879        /// True if the version of Skaffold used by this release is supported.
9880        pub status: bool,
9881
9882        /// The Skaffold support state for this release's version of Skaffold.
9883        pub skaffold_support_state: crate::model::SkaffoldSupportState,
9884
9885        /// The time at which this release's version of Skaffold will enter
9886        /// maintenance mode.
9887        pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
9888
9889        /// The time at which this release's version of Skaffold will no longer be
9890        /// supported.
9891        pub support_expiration_time: std::option::Option<wkt::Timestamp>,
9892
9893        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9894    }
9895
9896    impl SkaffoldSupportedCondition {
9897        pub fn new() -> Self {
9898            std::default::Default::default()
9899        }
9900
9901        /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
9902        ///
9903        /// # Example
9904        /// ```ignore,no_run
9905        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9906        /// let x = SkaffoldSupportedCondition::new().set_status(true);
9907        /// ```
9908        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9909            self.status = v.into();
9910            self
9911        }
9912
9913        /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
9914        ///
9915        /// # Example
9916        /// ```ignore,no_run
9917        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9918        /// use google_cloud_deploy_v1::model::SkaffoldSupportState;
9919        /// let x0 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Supported);
9920        /// let x1 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::MaintenanceMode);
9921        /// let x2 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Unsupported);
9922        /// ```
9923        pub fn set_skaffold_support_state<
9924            T: std::convert::Into<crate::model::SkaffoldSupportState>,
9925        >(
9926            mut self,
9927            v: T,
9928        ) -> Self {
9929            self.skaffold_support_state = v.into();
9930            self
9931        }
9932
9933        /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
9934        ///
9935        /// # Example
9936        /// ```ignore,no_run
9937        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9938        /// use wkt::Timestamp;
9939        /// let x = SkaffoldSupportedCondition::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
9940        /// ```
9941        pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
9942        where
9943            T: std::convert::Into<wkt::Timestamp>,
9944        {
9945            self.maintenance_mode_time = std::option::Option::Some(v.into());
9946            self
9947        }
9948
9949        /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
9950        ///
9951        /// # Example
9952        /// ```ignore,no_run
9953        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9954        /// use wkt::Timestamp;
9955        /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
9956        /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
9957        /// ```
9958        pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
9959        where
9960            T: std::convert::Into<wkt::Timestamp>,
9961        {
9962            self.maintenance_mode_time = v.map(|x| x.into());
9963            self
9964        }
9965
9966        /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
9967        ///
9968        /// # Example
9969        /// ```ignore,no_run
9970        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9971        /// use wkt::Timestamp;
9972        /// let x = SkaffoldSupportedCondition::new().set_support_expiration_time(Timestamp::default()/* use setters */);
9973        /// ```
9974        pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
9975        where
9976            T: std::convert::Into<wkt::Timestamp>,
9977        {
9978            self.support_expiration_time = std::option::Option::Some(v.into());
9979            self
9980        }
9981
9982        /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
9983        ///
9984        /// # Example
9985        /// ```ignore,no_run
9986        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9987        /// use wkt::Timestamp;
9988        /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
9989        /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(None::<Timestamp>);
9990        /// ```
9991        pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
9992        where
9993            T: std::convert::Into<wkt::Timestamp>,
9994        {
9995            self.support_expiration_time = v.map(|x| x.into());
9996            self
9997        }
9998    }
9999
10000    impl wkt::message::Message for SkaffoldSupportedCondition {
10001        fn typename() -> &'static str {
10002            "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
10003        }
10004    }
10005
10006    /// ReleaseCondition contains all conditions relevant to a Release.
10007    #[derive(Clone, Default, PartialEq)]
10008    #[non_exhaustive]
10009    pub struct ReleaseCondition {
10010        /// Details around the Releases's overall status.
10011        pub release_ready_condition:
10012            std::option::Option<crate::model::release::ReleaseReadyCondition>,
10013
10014        /// Details around the support state of the release's Skaffold
10015        /// version.
10016        pub skaffold_supported_condition:
10017            std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
10018
10019        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10020    }
10021
10022    impl ReleaseCondition {
10023        pub fn new() -> Self {
10024            std::default::Default::default()
10025        }
10026
10027        /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10028        ///
10029        /// # Example
10030        /// ```ignore,no_run
10031        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10032        /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10033        /// let x = ReleaseCondition::new().set_release_ready_condition(ReleaseReadyCondition::default()/* use setters */);
10034        /// ```
10035        pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
10036        where
10037            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10038        {
10039            self.release_ready_condition = std::option::Option::Some(v.into());
10040            self
10041        }
10042
10043        /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10044        ///
10045        /// # Example
10046        /// ```ignore,no_run
10047        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10048        /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10049        /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(Some(ReleaseReadyCondition::default()/* use setters */));
10050        /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(None::<ReleaseReadyCondition>);
10051        /// ```
10052        pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
10053        where
10054            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10055        {
10056            self.release_ready_condition = v.map(|x| x.into());
10057            self
10058        }
10059
10060        /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10061        ///
10062        /// # Example
10063        /// ```ignore,no_run
10064        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10065        /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10066        /// let x = ReleaseCondition::new().set_skaffold_supported_condition(SkaffoldSupportedCondition::default()/* use setters */);
10067        /// ```
10068        pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
10069        where
10070            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10071        {
10072            self.skaffold_supported_condition = std::option::Option::Some(v.into());
10073            self
10074        }
10075
10076        /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10077        ///
10078        /// # Example
10079        /// ```ignore,no_run
10080        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10081        /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10082        /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(Some(SkaffoldSupportedCondition::default()/* use setters */));
10083        /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(None::<SkaffoldSupportedCondition>);
10084        /// ```
10085        pub fn set_or_clear_skaffold_supported_condition<T>(
10086            mut self,
10087            v: std::option::Option<T>,
10088        ) -> Self
10089        where
10090            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10091        {
10092            self.skaffold_supported_condition = v.map(|x| x.into());
10093            self
10094        }
10095    }
10096
10097    impl wkt::message::Message for ReleaseCondition {
10098        fn typename() -> &'static str {
10099            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
10100        }
10101    }
10102
10103    /// Valid states of the render operation.
10104    ///
10105    /// # Working with unknown values
10106    ///
10107    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10108    /// additional enum variants at any time. Adding new variants is not considered
10109    /// a breaking change. Applications should write their code in anticipation of:
10110    ///
10111    /// - New values appearing in future releases of the client library, **and**
10112    /// - New values received dynamically, without application changes.
10113    ///
10114    /// Please consult the [Working with enums] section in the user guide for some
10115    /// guidelines.
10116    ///
10117    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10118    #[derive(Clone, Debug, PartialEq)]
10119    #[non_exhaustive]
10120    pub enum RenderState {
10121        /// The render state is unspecified.
10122        Unspecified,
10123        /// All rendering operations have completed successfully.
10124        Succeeded,
10125        /// All rendering operations have completed, and one or more have failed.
10126        Failed,
10127        /// Rendering has started and is not complete.
10128        InProgress,
10129        /// If set, the enum was initialized with an unknown value.
10130        ///
10131        /// Applications can examine the value using [RenderState::value] or
10132        /// [RenderState::name].
10133        UnknownValue(render_state::UnknownValue),
10134    }
10135
10136    #[doc(hidden)]
10137    pub mod render_state {
10138        #[allow(unused_imports)]
10139        use super::*;
10140        #[derive(Clone, Debug, PartialEq)]
10141        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10142    }
10143
10144    impl RenderState {
10145        /// Gets the enum value.
10146        ///
10147        /// Returns `None` if the enum contains an unknown value deserialized from
10148        /// the string representation of enums.
10149        pub fn value(&self) -> std::option::Option<i32> {
10150            match self {
10151                Self::Unspecified => std::option::Option::Some(0),
10152                Self::Succeeded => std::option::Option::Some(1),
10153                Self::Failed => std::option::Option::Some(2),
10154                Self::InProgress => std::option::Option::Some(3),
10155                Self::UnknownValue(u) => u.0.value(),
10156            }
10157        }
10158
10159        /// Gets the enum value as a string.
10160        ///
10161        /// Returns `None` if the enum contains an unknown value deserialized from
10162        /// the integer representation of enums.
10163        pub fn name(&self) -> std::option::Option<&str> {
10164            match self {
10165                Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
10166                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10167                Self::Failed => std::option::Option::Some("FAILED"),
10168                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10169                Self::UnknownValue(u) => u.0.name(),
10170            }
10171        }
10172    }
10173
10174    impl std::default::Default for RenderState {
10175        fn default() -> Self {
10176            use std::convert::From;
10177            Self::from(0)
10178        }
10179    }
10180
10181    impl std::fmt::Display for RenderState {
10182        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10183            wkt::internal::display_enum(f, self.name(), self.value())
10184        }
10185    }
10186
10187    impl std::convert::From<i32> for RenderState {
10188        fn from(value: i32) -> Self {
10189            match value {
10190                0 => Self::Unspecified,
10191                1 => Self::Succeeded,
10192                2 => Self::Failed,
10193                3 => Self::InProgress,
10194                _ => Self::UnknownValue(render_state::UnknownValue(
10195                    wkt::internal::UnknownEnumValue::Integer(value),
10196                )),
10197            }
10198        }
10199    }
10200
10201    impl std::convert::From<&str> for RenderState {
10202        fn from(value: &str) -> Self {
10203            use std::string::ToString;
10204            match value {
10205                "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
10206                "SUCCEEDED" => Self::Succeeded,
10207                "FAILED" => Self::Failed,
10208                "IN_PROGRESS" => Self::InProgress,
10209                _ => Self::UnknownValue(render_state::UnknownValue(
10210                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10211                )),
10212            }
10213        }
10214    }
10215
10216    impl serde::ser::Serialize for RenderState {
10217        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10218        where
10219            S: serde::Serializer,
10220        {
10221            match self {
10222                Self::Unspecified => serializer.serialize_i32(0),
10223                Self::Succeeded => serializer.serialize_i32(1),
10224                Self::Failed => serializer.serialize_i32(2),
10225                Self::InProgress => serializer.serialize_i32(3),
10226                Self::UnknownValue(u) => u.0.serialize(serializer),
10227            }
10228        }
10229    }
10230
10231    impl<'de> serde::de::Deserialize<'de> for RenderState {
10232        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10233        where
10234            D: serde::Deserializer<'de>,
10235        {
10236            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
10237                ".google.cloud.deploy.v1.Release.RenderState",
10238            ))
10239        }
10240    }
10241}
10242
10243/// The request object for `CreateDeployPolicy`.
10244#[derive(Clone, Default, PartialEq)]
10245#[non_exhaustive]
10246pub struct CreateDeployPolicyRequest {
10247    /// Required. The parent collection in which the `DeployPolicy` must be
10248    /// created. The format is `projects/{project_id}/locations/{location_name}`.
10249    pub parent: std::string::String,
10250
10251    /// Required. ID of the `DeployPolicy`.
10252    pub deploy_policy_id: std::string::String,
10253
10254    /// Required. The `DeployPolicy` to create.
10255    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10256
10257    /// Optional. A request ID to identify requests. Specify a unique request ID
10258    /// so that if you must retry your request, the server knows to ignore the
10259    /// request if it has already been completed. The server guarantees that for
10260    /// at least 60 minutes after the first request.
10261    ///
10262    /// For example, consider a situation where you make an initial request and the
10263    /// request times out. If you make the request again with the same request ID,
10264    /// the server can check if original operation with the same request ID was
10265    /// received, and if so, will ignore the second request. This prevents clients
10266    /// from accidentally creating duplicate commitments.
10267    ///
10268    /// The request ID must be a valid UUID with the exception that zero UUID is
10269    /// not supported (00000000-0000-0000-0000-000000000000).
10270    pub request_id: std::string::String,
10271
10272    /// Optional. If set to true, the request is validated and the user is provided
10273    /// with an expected result, but no actual change is made.
10274    pub validate_only: bool,
10275
10276    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10277}
10278
10279impl CreateDeployPolicyRequest {
10280    pub fn new() -> Self {
10281        std::default::Default::default()
10282    }
10283
10284    /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
10285    ///
10286    /// # Example
10287    /// ```ignore,no_run
10288    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10289    /// let x = CreateDeployPolicyRequest::new().set_parent("example");
10290    /// ```
10291    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10292        self.parent = v.into();
10293        self
10294    }
10295
10296    /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
10297    ///
10298    /// # Example
10299    /// ```ignore,no_run
10300    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10301    /// let x = CreateDeployPolicyRequest::new().set_deploy_policy_id("example");
10302    /// ```
10303    pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
10304        mut self,
10305        v: T,
10306    ) -> Self {
10307        self.deploy_policy_id = v.into();
10308        self
10309    }
10310
10311    /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10312    ///
10313    /// # Example
10314    /// ```ignore,no_run
10315    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10316    /// use google_cloud_deploy_v1::model::DeployPolicy;
10317    /// let x = CreateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10318    /// ```
10319    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10320    where
10321        T: std::convert::Into<crate::model::DeployPolicy>,
10322    {
10323        self.deploy_policy = std::option::Option::Some(v.into());
10324        self
10325    }
10326
10327    /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10328    ///
10329    /// # Example
10330    /// ```ignore,no_run
10331    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10332    /// use google_cloud_deploy_v1::model::DeployPolicy;
10333    /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10334    /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10335    /// ```
10336    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10337    where
10338        T: std::convert::Into<crate::model::DeployPolicy>,
10339    {
10340        self.deploy_policy = v.map(|x| x.into());
10341        self
10342    }
10343
10344    /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
10345    ///
10346    /// # Example
10347    /// ```ignore,no_run
10348    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10349    /// let x = CreateDeployPolicyRequest::new().set_request_id("example");
10350    /// ```
10351    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10352        self.request_id = v.into();
10353        self
10354    }
10355
10356    /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
10357    ///
10358    /// # Example
10359    /// ```ignore,no_run
10360    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10361    /// let x = CreateDeployPolicyRequest::new().set_validate_only(true);
10362    /// ```
10363    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10364        self.validate_only = v.into();
10365        self
10366    }
10367}
10368
10369impl wkt::message::Message for CreateDeployPolicyRequest {
10370    fn typename() -> &'static str {
10371        "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
10372    }
10373}
10374
10375/// The request object for `UpdateDeployPolicy`.
10376#[derive(Clone, Default, PartialEq)]
10377#[non_exhaustive]
10378pub struct UpdateDeployPolicyRequest {
10379    /// Required. Field mask is used to specify the fields to be overwritten by the
10380    /// update in the `DeployPolicy` resource. The fields specified in the
10381    /// update_mask are relative to the resource, not the full request. A field
10382    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
10383    /// then all fields are overwritten.
10384    pub update_mask: std::option::Option<wkt::FieldMask>,
10385
10386    /// Required. The `DeployPolicy` to update.
10387    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10388
10389    /// Optional. A request ID to identify requests. Specify a unique request ID
10390    /// so that if you must retry your request, the server knows to ignore the
10391    /// request if it has already been completed. The server guarantees that for
10392    /// at least 60 minutes after the first request.
10393    ///
10394    /// For example, consider a situation where you make an initial request and the
10395    /// request times out. If you make the request again with the same request ID,
10396    /// the server can check if original operation with the same request ID was
10397    /// received, and if so, will ignore the second request. This prevents clients
10398    /// from accidentally creating duplicate commitments.
10399    ///
10400    /// The request ID must be a valid UUID with the exception that zero UUID is
10401    /// not supported (00000000-0000-0000-0000-000000000000).
10402    pub request_id: std::string::String,
10403
10404    /// Optional. If set to true, updating a `DeployPolicy` that does not exist
10405    /// will result in the creation of a new `DeployPolicy`.
10406    pub allow_missing: bool,
10407
10408    /// Optional. If set to true, the request is validated and the user is provided
10409    /// with an expected result, but no actual change is made.
10410    pub validate_only: bool,
10411
10412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10413}
10414
10415impl UpdateDeployPolicyRequest {
10416    pub fn new() -> Self {
10417        std::default::Default::default()
10418    }
10419
10420    /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10421    ///
10422    /// # Example
10423    /// ```ignore,no_run
10424    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10425    /// use wkt::FieldMask;
10426    /// let x = UpdateDeployPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10427    /// ```
10428    pub fn set_update_mask<T>(mut self, v: T) -> Self
10429    where
10430        T: std::convert::Into<wkt::FieldMask>,
10431    {
10432        self.update_mask = std::option::Option::Some(v.into());
10433        self
10434    }
10435
10436    /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10437    ///
10438    /// # Example
10439    /// ```ignore,no_run
10440    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10441    /// use wkt::FieldMask;
10442    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10443    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10444    /// ```
10445    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10446    where
10447        T: std::convert::Into<wkt::FieldMask>,
10448    {
10449        self.update_mask = v.map(|x| x.into());
10450        self
10451    }
10452
10453    /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10454    ///
10455    /// # Example
10456    /// ```ignore,no_run
10457    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10458    /// use google_cloud_deploy_v1::model::DeployPolicy;
10459    /// let x = UpdateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10460    /// ```
10461    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10462    where
10463        T: std::convert::Into<crate::model::DeployPolicy>,
10464    {
10465        self.deploy_policy = std::option::Option::Some(v.into());
10466        self
10467    }
10468
10469    /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10470    ///
10471    /// # Example
10472    /// ```ignore,no_run
10473    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10474    /// use google_cloud_deploy_v1::model::DeployPolicy;
10475    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10476    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10477    /// ```
10478    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10479    where
10480        T: std::convert::Into<crate::model::DeployPolicy>,
10481    {
10482        self.deploy_policy = v.map(|x| x.into());
10483        self
10484    }
10485
10486    /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
10487    ///
10488    /// # Example
10489    /// ```ignore,no_run
10490    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10491    /// let x = UpdateDeployPolicyRequest::new().set_request_id("example");
10492    /// ```
10493    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10494        self.request_id = v.into();
10495        self
10496    }
10497
10498    /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
10499    ///
10500    /// # Example
10501    /// ```ignore,no_run
10502    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10503    /// let x = UpdateDeployPolicyRequest::new().set_allow_missing(true);
10504    /// ```
10505    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10506        self.allow_missing = v.into();
10507        self
10508    }
10509
10510    /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
10511    ///
10512    /// # Example
10513    /// ```ignore,no_run
10514    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10515    /// let x = UpdateDeployPolicyRequest::new().set_validate_only(true);
10516    /// ```
10517    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10518        self.validate_only = v.into();
10519        self
10520    }
10521}
10522
10523impl wkt::message::Message for UpdateDeployPolicyRequest {
10524    fn typename() -> &'static str {
10525        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
10526    }
10527}
10528
10529/// The request object for `DeleteDeployPolicy`.
10530#[derive(Clone, Default, PartialEq)]
10531#[non_exhaustive]
10532pub struct DeleteDeployPolicyRequest {
10533    /// Required. The name of the `DeployPolicy` to delete. The format is
10534    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10535    pub name: std::string::String,
10536
10537    /// Optional. A request ID to identify requests. Specify a unique request ID
10538    /// so that if you must retry your request, the server knows to ignore the
10539    /// request if it has already been completed. The server guarantees that for
10540    /// at least 60 minutes after the first request.
10541    ///
10542    /// For example, consider a situation where you make an initial request and the
10543    /// request times out. If you make the request again with the same request ID,
10544    /// the server can check if original operation with the same request ID was
10545    /// received, and if so, will ignore the second request. This prevents clients
10546    /// from accidentally creating duplicate commitments.
10547    ///
10548    /// The request ID must be a valid UUID with the exception that zero UUID is
10549    /// not supported (00000000-0000-0000-0000-000000000000).
10550    pub request_id: std::string::String,
10551
10552    /// Optional. If set to true, then deleting an already deleted or non-existing
10553    /// `DeployPolicy` will succeed.
10554    pub allow_missing: bool,
10555
10556    /// Optional. If set, validate the request and preview the review, but do not
10557    /// actually post it.
10558    pub validate_only: bool,
10559
10560    /// Optional. This checksum is computed by the server based on the value of
10561    /// other fields, and may be sent on update and delete requests to ensure the
10562    /// client has an up-to-date value before proceeding.
10563    pub etag: std::string::String,
10564
10565    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10566}
10567
10568impl DeleteDeployPolicyRequest {
10569    pub fn new() -> Self {
10570        std::default::Default::default()
10571    }
10572
10573    /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
10574    ///
10575    /// # Example
10576    /// ```ignore,no_run
10577    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10578    /// let x = DeleteDeployPolicyRequest::new().set_name("example");
10579    /// ```
10580    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10581        self.name = v.into();
10582        self
10583    }
10584
10585    /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
10586    ///
10587    /// # Example
10588    /// ```ignore,no_run
10589    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10590    /// let x = DeleteDeployPolicyRequest::new().set_request_id("example");
10591    /// ```
10592    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10593        self.request_id = v.into();
10594        self
10595    }
10596
10597    /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
10598    ///
10599    /// # Example
10600    /// ```ignore,no_run
10601    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10602    /// let x = DeleteDeployPolicyRequest::new().set_allow_missing(true);
10603    /// ```
10604    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10605        self.allow_missing = v.into();
10606        self
10607    }
10608
10609    /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
10610    ///
10611    /// # Example
10612    /// ```ignore,no_run
10613    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10614    /// let x = DeleteDeployPolicyRequest::new().set_validate_only(true);
10615    /// ```
10616    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10617        self.validate_only = v.into();
10618        self
10619    }
10620
10621    /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
10622    ///
10623    /// # Example
10624    /// ```ignore,no_run
10625    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10626    /// let x = DeleteDeployPolicyRequest::new().set_etag("example");
10627    /// ```
10628    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10629        self.etag = v.into();
10630        self
10631    }
10632}
10633
10634impl wkt::message::Message for DeleteDeployPolicyRequest {
10635    fn typename() -> &'static str {
10636        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
10637    }
10638}
10639
10640/// The request object for `ListDeployPolicies`.
10641#[derive(Clone, Default, PartialEq)]
10642#[non_exhaustive]
10643pub struct ListDeployPoliciesRequest {
10644    /// Required. The parent, which owns this collection of deploy policies. Format
10645    /// must be `projects/{project_id}/locations/{location_name}`.
10646    pub parent: std::string::String,
10647
10648    /// The maximum number of deploy policies to return. The service may return
10649    /// fewer than this value. If unspecified, at most 50 deploy policies will
10650    /// be returned. The maximum value is 1000; values above 1000 will be set
10651    /// to 1000.
10652    pub page_size: i32,
10653
10654    /// A page token, received from a previous `ListDeployPolicies` call.
10655    /// Provide this to retrieve the subsequent page.
10656    ///
10657    /// When paginating, all other provided parameters match
10658    /// the call that provided the page token.
10659    pub page_token: std::string::String,
10660
10661    /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
10662    /// more details. All fields can be used in the filter.
10663    pub filter: std::string::String,
10664
10665    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
10666    pub order_by: std::string::String,
10667
10668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10669}
10670
10671impl ListDeployPoliciesRequest {
10672    pub fn new() -> Self {
10673        std::default::Default::default()
10674    }
10675
10676    /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
10677    ///
10678    /// # Example
10679    /// ```ignore,no_run
10680    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10681    /// let x = ListDeployPoliciesRequest::new().set_parent("example");
10682    /// ```
10683    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10684        self.parent = v.into();
10685        self
10686    }
10687
10688    /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
10689    ///
10690    /// # Example
10691    /// ```ignore,no_run
10692    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10693    /// let x = ListDeployPoliciesRequest::new().set_page_size(42);
10694    /// ```
10695    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10696        self.page_size = v.into();
10697        self
10698    }
10699
10700    /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
10701    ///
10702    /// # Example
10703    /// ```ignore,no_run
10704    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10705    /// let x = ListDeployPoliciesRequest::new().set_page_token("example");
10706    /// ```
10707    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10708        self.page_token = v.into();
10709        self
10710    }
10711
10712    /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
10713    ///
10714    /// # Example
10715    /// ```ignore,no_run
10716    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10717    /// let x = ListDeployPoliciesRequest::new().set_filter("example");
10718    /// ```
10719    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10720        self.filter = v.into();
10721        self
10722    }
10723
10724    /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
10725    ///
10726    /// # Example
10727    /// ```ignore,no_run
10728    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10729    /// let x = ListDeployPoliciesRequest::new().set_order_by("example");
10730    /// ```
10731    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10732        self.order_by = v.into();
10733        self
10734    }
10735}
10736
10737impl wkt::message::Message for ListDeployPoliciesRequest {
10738    fn typename() -> &'static str {
10739        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
10740    }
10741}
10742
10743/// The response object from `ListDeployPolicies`.
10744#[derive(Clone, Default, PartialEq)]
10745#[non_exhaustive]
10746pub struct ListDeployPoliciesResponse {
10747    /// The `DeployPolicy` objects.
10748    pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
10749
10750    /// A token, which can be sent as `page_token` to retrieve the next page.
10751    /// If this field is omitted, there are no subsequent pages.
10752    pub next_page_token: std::string::String,
10753
10754    /// Locations that could not be reached.
10755    pub unreachable: std::vec::Vec<std::string::String>,
10756
10757    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10758}
10759
10760impl ListDeployPoliciesResponse {
10761    pub fn new() -> Self {
10762        std::default::Default::default()
10763    }
10764
10765    /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
10766    ///
10767    /// # Example
10768    /// ```ignore,no_run
10769    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10770    /// use google_cloud_deploy_v1::model::DeployPolicy;
10771    /// let x = ListDeployPoliciesResponse::new()
10772    ///     .set_deploy_policies([
10773    ///         DeployPolicy::default()/* use setters */,
10774    ///         DeployPolicy::default()/* use (different) setters */,
10775    ///     ]);
10776    /// ```
10777    pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
10778    where
10779        T: std::iter::IntoIterator<Item = V>,
10780        V: std::convert::Into<crate::model::DeployPolicy>,
10781    {
10782        use std::iter::Iterator;
10783        self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
10784        self
10785    }
10786
10787    /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
10788    ///
10789    /// # Example
10790    /// ```ignore,no_run
10791    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10792    /// let x = ListDeployPoliciesResponse::new().set_next_page_token("example");
10793    /// ```
10794    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10795        self.next_page_token = v.into();
10796        self
10797    }
10798
10799    /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
10800    ///
10801    /// # Example
10802    /// ```ignore,no_run
10803    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10804    /// let x = ListDeployPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10805    /// ```
10806    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10807    where
10808        T: std::iter::IntoIterator<Item = V>,
10809        V: std::convert::Into<std::string::String>,
10810    {
10811        use std::iter::Iterator;
10812        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10813        self
10814    }
10815}
10816
10817impl wkt::message::Message for ListDeployPoliciesResponse {
10818    fn typename() -> &'static str {
10819        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
10820    }
10821}
10822
10823#[doc(hidden)]
10824impl gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
10825    type PageItem = crate::model::DeployPolicy;
10826
10827    fn items(self) -> std::vec::Vec<Self::PageItem> {
10828        self.deploy_policies
10829    }
10830
10831    fn next_page_token(&self) -> std::string::String {
10832        use std::clone::Clone;
10833        self.next_page_token.clone()
10834    }
10835}
10836
10837/// The request object for `GetDeployPolicy`
10838#[derive(Clone, Default, PartialEq)]
10839#[non_exhaustive]
10840pub struct GetDeployPolicyRequest {
10841    /// Required. Name of the `DeployPolicy`. Format must be
10842    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10843    pub name: std::string::String,
10844
10845    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10846}
10847
10848impl GetDeployPolicyRequest {
10849    pub fn new() -> Self {
10850        std::default::Default::default()
10851    }
10852
10853    /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
10854    ///
10855    /// # Example
10856    /// ```ignore,no_run
10857    /// # use google_cloud_deploy_v1::model::GetDeployPolicyRequest;
10858    /// let x = GetDeployPolicyRequest::new().set_name("example");
10859    /// ```
10860    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10861        self.name = v.into();
10862        self
10863    }
10864}
10865
10866impl wkt::message::Message for GetDeployPolicyRequest {
10867    fn typename() -> &'static str {
10868        "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
10869    }
10870}
10871
10872/// Description of an a image to use during Skaffold rendering.
10873#[derive(Clone, Default, PartialEq)]
10874#[non_exhaustive]
10875pub struct BuildArtifact {
10876    /// Optional. Image name in Skaffold configuration.
10877    pub image: std::string::String,
10878
10879    /// Optional. Image tag to use. This will generally be the full path to an
10880    /// image, such as "gcr.io/my-project/busybox:1.2.3" or
10881    /// "gcr.io/my-project/busybox@sha256:abc123".
10882    pub tag: std::string::String,
10883
10884    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10885}
10886
10887impl BuildArtifact {
10888    pub fn new() -> Self {
10889        std::default::Default::default()
10890    }
10891
10892    /// Sets the value of [image][crate::model::BuildArtifact::image].
10893    ///
10894    /// # Example
10895    /// ```ignore,no_run
10896    /// # use google_cloud_deploy_v1::model::BuildArtifact;
10897    /// let x = BuildArtifact::new().set_image("example");
10898    /// ```
10899    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10900        self.image = v.into();
10901        self
10902    }
10903
10904    /// Sets the value of [tag][crate::model::BuildArtifact::tag].
10905    ///
10906    /// # Example
10907    /// ```ignore,no_run
10908    /// # use google_cloud_deploy_v1::model::BuildArtifact;
10909    /// let x = BuildArtifact::new().set_tag("example");
10910    /// ```
10911    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10912        self.tag = v.into();
10913        self
10914    }
10915}
10916
10917impl wkt::message::Message for BuildArtifact {
10918    fn typename() -> &'static str {
10919        "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
10920    }
10921}
10922
10923/// The artifacts produced by a target render operation.
10924#[derive(Clone, Default, PartialEq)]
10925#[non_exhaustive]
10926pub struct TargetArtifact {
10927    /// Output only. File path of the resolved Skaffold configuration for the
10928    /// stable phase, relative to the URI.
10929    pub skaffold_config_path: std::string::String,
10930
10931    /// Output only. File path of the rendered manifest relative to the URI for the
10932    /// stable phase.
10933    pub manifest_path: std::string::String,
10934
10935    /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
10936    pub phase_artifacts: std::collections::HashMap<
10937        std::string::String,
10938        crate::model::target_artifact::PhaseArtifact,
10939    >,
10940
10941    pub uri: std::option::Option<crate::model::target_artifact::Uri>,
10942
10943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10944}
10945
10946impl TargetArtifact {
10947    pub fn new() -> Self {
10948        std::default::Default::default()
10949    }
10950
10951    /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
10952    ///
10953    /// # Example
10954    /// ```ignore,no_run
10955    /// # use google_cloud_deploy_v1::model::TargetArtifact;
10956    /// let x = TargetArtifact::new().set_skaffold_config_path("example");
10957    /// ```
10958    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
10959        mut self,
10960        v: T,
10961    ) -> Self {
10962        self.skaffold_config_path = v.into();
10963        self
10964    }
10965
10966    /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
10967    ///
10968    /// # Example
10969    /// ```ignore,no_run
10970    /// # use google_cloud_deploy_v1::model::TargetArtifact;
10971    /// let x = TargetArtifact::new().set_manifest_path("example");
10972    /// ```
10973    pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10974        self.manifest_path = v.into();
10975        self
10976    }
10977
10978    /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
10979    ///
10980    /// # Example
10981    /// ```ignore,no_run
10982    /// # use google_cloud_deploy_v1::model::TargetArtifact;
10983    /// use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
10984    /// let x = TargetArtifact::new().set_phase_artifacts([
10985    ///     ("key0", PhaseArtifact::default()/* use setters */),
10986    ///     ("key1", PhaseArtifact::default()/* use (different) setters */),
10987    /// ]);
10988    /// ```
10989    pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
10990    where
10991        T: std::iter::IntoIterator<Item = (K, V)>,
10992        K: std::convert::Into<std::string::String>,
10993        V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
10994    {
10995        use std::iter::Iterator;
10996        self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10997        self
10998    }
10999
11000    /// Sets the value of [uri][crate::model::TargetArtifact::uri].
11001    ///
11002    /// Note that all the setters affecting `uri` are mutually
11003    /// exclusive.
11004    ///
11005    /// # Example
11006    /// ```ignore,no_run
11007    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11008    /// use google_cloud_deploy_v1::model::target_artifact::Uri;
11009    /// let x = TargetArtifact::new().set_uri(Some(Uri::ArtifactUri("example".to_string())));
11010    /// ```
11011    pub fn set_uri<
11012        T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
11013    >(
11014        mut self,
11015        v: T,
11016    ) -> Self {
11017        self.uri = v.into();
11018        self
11019    }
11020
11021    /// The value of [uri][crate::model::TargetArtifact::uri]
11022    /// if it holds a `ArtifactUri`, `None` if the field is not set or
11023    /// holds a different branch.
11024    pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
11025        #[allow(unreachable_patterns)]
11026        self.uri.as_ref().and_then(|v| match v {
11027            crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
11028            _ => std::option::Option::None,
11029        })
11030    }
11031
11032    /// Sets the value of [uri][crate::model::TargetArtifact::uri]
11033    /// to hold a `ArtifactUri`.
11034    ///
11035    /// Note that all the setters affecting `uri` are
11036    /// mutually exclusive.
11037    ///
11038    /// # Example
11039    /// ```ignore,no_run
11040    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11041    /// let x = TargetArtifact::new().set_artifact_uri("example");
11042    /// assert!(x.artifact_uri().is_some());
11043    /// ```
11044    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11045        self.uri =
11046            std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
11047        self
11048    }
11049}
11050
11051impl wkt::message::Message for TargetArtifact {
11052    fn typename() -> &'static str {
11053        "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
11054    }
11055}
11056
11057/// Defines additional types related to [TargetArtifact].
11058pub mod target_artifact {
11059    #[allow(unused_imports)]
11060    use super::*;
11061
11062    /// Contains the paths to the artifacts, relative to the URI, for a phase.
11063    #[derive(Clone, Default, PartialEq)]
11064    #[non_exhaustive]
11065    pub struct PhaseArtifact {
11066        /// Output only. File path of the resolved Skaffold configuration relative to
11067        /// the URI.
11068        pub skaffold_config_path: std::string::String,
11069
11070        /// Output only. File path of the rendered manifest relative to the URI.
11071        pub manifest_path: std::string::String,
11072
11073        /// Output only. File path of the directory of rendered job manifests
11074        /// relative to the URI. This is only set if it is applicable.
11075        pub job_manifests_path: std::string::String,
11076
11077        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11078    }
11079
11080    impl PhaseArtifact {
11081        pub fn new() -> Self {
11082            std::default::Default::default()
11083        }
11084
11085        /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
11086        ///
11087        /// # Example
11088        /// ```ignore,no_run
11089        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11090        /// let x = PhaseArtifact::new().set_skaffold_config_path("example");
11091        /// ```
11092        pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11093            mut self,
11094            v: T,
11095        ) -> Self {
11096            self.skaffold_config_path = v.into();
11097            self
11098        }
11099
11100        /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
11101        ///
11102        /// # Example
11103        /// ```ignore,no_run
11104        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11105        /// let x = PhaseArtifact::new().set_manifest_path("example");
11106        /// ```
11107        pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
11108            mut self,
11109            v: T,
11110        ) -> Self {
11111            self.manifest_path = v.into();
11112            self
11113        }
11114
11115        /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
11116        ///
11117        /// # Example
11118        /// ```ignore,no_run
11119        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11120        /// let x = PhaseArtifact::new().set_job_manifests_path("example");
11121        /// ```
11122        pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
11123            mut self,
11124            v: T,
11125        ) -> Self {
11126            self.job_manifests_path = v.into();
11127            self
11128        }
11129    }
11130
11131    impl wkt::message::Message for PhaseArtifact {
11132        fn typename() -> &'static str {
11133            "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
11134        }
11135    }
11136
11137    #[derive(Clone, Debug, PartialEq)]
11138    #[non_exhaustive]
11139    pub enum Uri {
11140        /// Output only. URI of a directory containing the artifacts. This contains
11141        /// deployment configuration used by Skaffold during a rollout, and all
11142        /// paths are relative to this location.
11143        ArtifactUri(std::string::String),
11144    }
11145}
11146
11147/// The artifacts produced by a deploy operation.
11148#[derive(Clone, Default, PartialEq)]
11149#[non_exhaustive]
11150pub struct DeployArtifact {
11151    /// Output only. URI of a directory containing the artifacts. All paths are
11152    /// relative to this location.
11153    pub artifact_uri: std::string::String,
11154
11155    /// Output only. File paths of the manifests applied during the deploy
11156    /// operation relative to the URI.
11157    pub manifest_paths: std::vec::Vec<std::string::String>,
11158
11159    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11160}
11161
11162impl DeployArtifact {
11163    pub fn new() -> Self {
11164        std::default::Default::default()
11165    }
11166
11167    /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
11168    ///
11169    /// # Example
11170    /// ```ignore,no_run
11171    /// # use google_cloud_deploy_v1::model::DeployArtifact;
11172    /// let x = DeployArtifact::new().set_artifact_uri("example");
11173    /// ```
11174    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11175        self.artifact_uri = v.into();
11176        self
11177    }
11178
11179    /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
11180    ///
11181    /// # Example
11182    /// ```ignore,no_run
11183    /// # use google_cloud_deploy_v1::model::DeployArtifact;
11184    /// let x = DeployArtifact::new().set_manifest_paths(["a", "b", "c"]);
11185    /// ```
11186    pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
11187    where
11188        T: std::iter::IntoIterator<Item = V>,
11189        V: std::convert::Into<std::string::String>,
11190    {
11191        use std::iter::Iterator;
11192        self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
11193        self
11194    }
11195}
11196
11197impl wkt::message::Message for DeployArtifact {
11198    fn typename() -> &'static str {
11199        "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
11200    }
11201}
11202
11203/// CloudRunRenderMetadata contains Cloud Run information associated with a
11204/// `Release` render.
11205#[derive(Clone, Default, PartialEq)]
11206#[non_exhaustive]
11207pub struct CloudRunRenderMetadata {
11208    /// Output only. The name of the Cloud Run Service in the rendered manifest.
11209    /// Format is `projects/{project}/locations/{location}/services/{service}`.
11210    pub service: std::string::String,
11211
11212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11213}
11214
11215impl CloudRunRenderMetadata {
11216    pub fn new() -> Self {
11217        std::default::Default::default()
11218    }
11219
11220    /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
11221    ///
11222    /// # Example
11223    /// ```ignore,no_run
11224    /// # use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11225    /// let x = CloudRunRenderMetadata::new().set_service("example");
11226    /// ```
11227    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11228        self.service = v.into();
11229        self
11230    }
11231}
11232
11233impl wkt::message::Message for CloudRunRenderMetadata {
11234    fn typename() -> &'static str {
11235        "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
11236    }
11237}
11238
11239/// RenderMetadata includes information associated with a `Release` render.
11240#[derive(Clone, Default, PartialEq)]
11241#[non_exhaustive]
11242pub struct RenderMetadata {
11243    /// Output only. Metadata associated with rendering for Cloud Run.
11244    pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
11245
11246    /// Output only. Custom metadata provided by user-defined render operation.
11247    pub custom: std::option::Option<crate::model::CustomMetadata>,
11248
11249    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11250}
11251
11252impl RenderMetadata {
11253    pub fn new() -> Self {
11254        std::default::Default::default()
11255    }
11256
11257    /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11258    ///
11259    /// # Example
11260    /// ```ignore,no_run
11261    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11262    /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11263    /// let x = RenderMetadata::new().set_cloud_run(CloudRunRenderMetadata::default()/* use setters */);
11264    /// ```
11265    pub fn set_cloud_run<T>(mut self, v: T) -> Self
11266    where
11267        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11268    {
11269        self.cloud_run = std::option::Option::Some(v.into());
11270        self
11271    }
11272
11273    /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11274    ///
11275    /// # Example
11276    /// ```ignore,no_run
11277    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11278    /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11279    /// let x = RenderMetadata::new().set_or_clear_cloud_run(Some(CloudRunRenderMetadata::default()/* use setters */));
11280    /// let x = RenderMetadata::new().set_or_clear_cloud_run(None::<CloudRunRenderMetadata>);
11281    /// ```
11282    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
11283    where
11284        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11285    {
11286        self.cloud_run = v.map(|x| x.into());
11287        self
11288    }
11289
11290    /// Sets the value of [custom][crate::model::RenderMetadata::custom].
11291    ///
11292    /// # Example
11293    /// ```ignore,no_run
11294    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11295    /// use google_cloud_deploy_v1::model::CustomMetadata;
11296    /// let x = RenderMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
11297    /// ```
11298    pub fn set_custom<T>(mut self, v: T) -> Self
11299    where
11300        T: std::convert::Into<crate::model::CustomMetadata>,
11301    {
11302        self.custom = std::option::Option::Some(v.into());
11303        self
11304    }
11305
11306    /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
11307    ///
11308    /// # Example
11309    /// ```ignore,no_run
11310    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11311    /// use google_cloud_deploy_v1::model::CustomMetadata;
11312    /// let x = RenderMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
11313    /// let x = RenderMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
11314    /// ```
11315    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
11316    where
11317        T: std::convert::Into<crate::model::CustomMetadata>,
11318    {
11319        self.custom = v.map(|x| x.into());
11320        self
11321    }
11322}
11323
11324impl wkt::message::Message for RenderMetadata {
11325    fn typename() -> &'static str {
11326        "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
11327    }
11328}
11329
11330/// The request object for `ListReleases`.
11331#[derive(Clone, Default, PartialEq)]
11332#[non_exhaustive]
11333pub struct ListReleasesRequest {
11334    /// Required. The `DeliveryPipeline` which owns this collection of `Release`
11335    /// objects.
11336    pub parent: std::string::String,
11337
11338    /// Optional. The maximum number of `Release` objects to return. The service
11339    /// may return fewer than this value. If unspecified, at most 50 `Release`
11340    /// objects will be returned. The maximum value is 1000; values above 1000 will
11341    /// be set to 1000.
11342    pub page_size: i32,
11343
11344    /// Optional. A page token, received from a previous `ListReleases` call.
11345    /// Provide this to retrieve the subsequent page.
11346    ///
11347    /// When paginating, all other provided parameters match
11348    /// the call that provided the page token.
11349    pub page_token: std::string::String,
11350
11351    /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
11352    /// for more details.
11353    pub filter: std::string::String,
11354
11355    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
11356    /// more details.
11357    pub order_by: std::string::String,
11358
11359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11360}
11361
11362impl ListReleasesRequest {
11363    pub fn new() -> Self {
11364        std::default::Default::default()
11365    }
11366
11367    /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
11368    ///
11369    /// # Example
11370    /// ```ignore,no_run
11371    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11372    /// let x = ListReleasesRequest::new().set_parent("example");
11373    /// ```
11374    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11375        self.parent = v.into();
11376        self
11377    }
11378
11379    /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
11380    ///
11381    /// # Example
11382    /// ```ignore,no_run
11383    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11384    /// let x = ListReleasesRequest::new().set_page_size(42);
11385    /// ```
11386    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11387        self.page_size = v.into();
11388        self
11389    }
11390
11391    /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
11392    ///
11393    /// # Example
11394    /// ```ignore,no_run
11395    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11396    /// let x = ListReleasesRequest::new().set_page_token("example");
11397    /// ```
11398    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11399        self.page_token = v.into();
11400        self
11401    }
11402
11403    /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
11404    ///
11405    /// # Example
11406    /// ```ignore,no_run
11407    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11408    /// let x = ListReleasesRequest::new().set_filter("example");
11409    /// ```
11410    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11411        self.filter = v.into();
11412        self
11413    }
11414
11415    /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
11416    ///
11417    /// # Example
11418    /// ```ignore,no_run
11419    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11420    /// let x = ListReleasesRequest::new().set_order_by("example");
11421    /// ```
11422    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11423        self.order_by = v.into();
11424        self
11425    }
11426}
11427
11428impl wkt::message::Message for ListReleasesRequest {
11429    fn typename() -> &'static str {
11430        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
11431    }
11432}
11433
11434/// The response object from `ListReleases`.
11435#[derive(Clone, Default, PartialEq)]
11436#[non_exhaustive]
11437pub struct ListReleasesResponse {
11438    /// The `Release` objects.
11439    pub releases: std::vec::Vec<crate::model::Release>,
11440
11441    /// A token, which can be sent as `page_token` to retrieve the next page.
11442    /// If this field is omitted, there are no subsequent pages.
11443    pub next_page_token: std::string::String,
11444
11445    /// Locations that could not be reached.
11446    pub unreachable: std::vec::Vec<std::string::String>,
11447
11448    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11449}
11450
11451impl ListReleasesResponse {
11452    pub fn new() -> Self {
11453        std::default::Default::default()
11454    }
11455
11456    /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
11457    ///
11458    /// # Example
11459    /// ```ignore,no_run
11460    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11461    /// use google_cloud_deploy_v1::model::Release;
11462    /// let x = ListReleasesResponse::new()
11463    ///     .set_releases([
11464    ///         Release::default()/* use setters */,
11465    ///         Release::default()/* use (different) setters */,
11466    ///     ]);
11467    /// ```
11468    pub fn set_releases<T, V>(mut self, v: T) -> Self
11469    where
11470        T: std::iter::IntoIterator<Item = V>,
11471        V: std::convert::Into<crate::model::Release>,
11472    {
11473        use std::iter::Iterator;
11474        self.releases = v.into_iter().map(|i| i.into()).collect();
11475        self
11476    }
11477
11478    /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
11479    ///
11480    /// # Example
11481    /// ```ignore,no_run
11482    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11483    /// let x = ListReleasesResponse::new().set_next_page_token("example");
11484    /// ```
11485    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11486        self.next_page_token = v.into();
11487        self
11488    }
11489
11490    /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
11491    ///
11492    /// # Example
11493    /// ```ignore,no_run
11494    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11495    /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
11496    /// ```
11497    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11498    where
11499        T: std::iter::IntoIterator<Item = V>,
11500        V: std::convert::Into<std::string::String>,
11501    {
11502        use std::iter::Iterator;
11503        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11504        self
11505    }
11506}
11507
11508impl wkt::message::Message for ListReleasesResponse {
11509    fn typename() -> &'static str {
11510        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
11511    }
11512}
11513
11514#[doc(hidden)]
11515impl gax::paginator::internal::PageableResponse for ListReleasesResponse {
11516    type PageItem = crate::model::Release;
11517
11518    fn items(self) -> std::vec::Vec<Self::PageItem> {
11519        self.releases
11520    }
11521
11522    fn next_page_token(&self) -> std::string::String {
11523        use std::clone::Clone;
11524        self.next_page_token.clone()
11525    }
11526}
11527
11528/// The request object for `GetRelease`.
11529#[derive(Clone, Default, PartialEq)]
11530#[non_exhaustive]
11531pub struct GetReleaseRequest {
11532    /// Required. Name of the `Release`. Format must be
11533    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11534    pub name: std::string::String,
11535
11536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11537}
11538
11539impl GetReleaseRequest {
11540    pub fn new() -> Self {
11541        std::default::Default::default()
11542    }
11543
11544    /// Sets the value of [name][crate::model::GetReleaseRequest::name].
11545    ///
11546    /// # Example
11547    /// ```ignore,no_run
11548    /// # use google_cloud_deploy_v1::model::GetReleaseRequest;
11549    /// let x = GetReleaseRequest::new().set_name("example");
11550    /// ```
11551    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11552        self.name = v.into();
11553        self
11554    }
11555}
11556
11557impl wkt::message::Message for GetReleaseRequest {
11558    fn typename() -> &'static str {
11559        "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
11560    }
11561}
11562
11563/// The request object for `CreateRelease`,
11564#[derive(Clone, Default, PartialEq)]
11565#[non_exhaustive]
11566pub struct CreateReleaseRequest {
11567    /// Required. The parent collection in which the `Release` is created.
11568    /// The format is
11569    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
11570    pub parent: std::string::String,
11571
11572    /// Required. ID of the `Release`.
11573    pub release_id: std::string::String,
11574
11575    /// Required. The `Release` to create.
11576    pub release: std::option::Option<crate::model::Release>,
11577
11578    /// Optional. A request ID to identify requests. Specify a unique request ID
11579    /// so that if you must retry your request, the server knows to ignore the
11580    /// request if it has already been completed. The server guarantees that for
11581    /// at least 60 minutes after the first request.
11582    ///
11583    /// For example, consider a situation where you make an initial request and the
11584    /// request times out. If you make the request again with the same request ID,
11585    /// the server can check if original operation with the same request ID was
11586    /// received, and if so, will ignore the second request. This prevents clients
11587    /// from accidentally creating duplicate commitments.
11588    ///
11589    /// The request ID must be a valid UUID with the exception that zero UUID is
11590    /// not supported (00000000-0000-0000-0000-000000000000).
11591    pub request_id: std::string::String,
11592
11593    /// Optional. If set to true, the request is validated and the user is provided
11594    /// with an expected result, but no actual change is made.
11595    pub validate_only: bool,
11596
11597    /// Optional. Deploy policies to override. Format is
11598    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11599    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11600
11601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11602}
11603
11604impl CreateReleaseRequest {
11605    pub fn new() -> Self {
11606        std::default::Default::default()
11607    }
11608
11609    /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
11610    ///
11611    /// # Example
11612    /// ```ignore,no_run
11613    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11614    /// let x = CreateReleaseRequest::new().set_parent("example");
11615    /// ```
11616    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11617        self.parent = v.into();
11618        self
11619    }
11620
11621    /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
11622    ///
11623    /// # Example
11624    /// ```ignore,no_run
11625    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11626    /// let x = CreateReleaseRequest::new().set_release_id("example");
11627    /// ```
11628    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11629        self.release_id = v.into();
11630        self
11631    }
11632
11633    /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
11634    ///
11635    /// # Example
11636    /// ```ignore,no_run
11637    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11638    /// use google_cloud_deploy_v1::model::Release;
11639    /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
11640    /// ```
11641    pub fn set_release<T>(mut self, v: T) -> Self
11642    where
11643        T: std::convert::Into<crate::model::Release>,
11644    {
11645        self.release = std::option::Option::Some(v.into());
11646        self
11647    }
11648
11649    /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
11650    ///
11651    /// # Example
11652    /// ```ignore,no_run
11653    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11654    /// use google_cloud_deploy_v1::model::Release;
11655    /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
11656    /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
11657    /// ```
11658    pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
11659    where
11660        T: std::convert::Into<crate::model::Release>,
11661    {
11662        self.release = v.map(|x| x.into());
11663        self
11664    }
11665
11666    /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
11667    ///
11668    /// # Example
11669    /// ```ignore,no_run
11670    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11671    /// let x = CreateReleaseRequest::new().set_request_id("example");
11672    /// ```
11673    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11674        self.request_id = v.into();
11675        self
11676    }
11677
11678    /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
11679    ///
11680    /// # Example
11681    /// ```ignore,no_run
11682    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11683    /// let x = CreateReleaseRequest::new().set_validate_only(true);
11684    /// ```
11685    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11686        self.validate_only = v.into();
11687        self
11688    }
11689
11690    /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
11691    ///
11692    /// # Example
11693    /// ```ignore,no_run
11694    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11695    /// let x = CreateReleaseRequest::new().set_override_deploy_policy(["a", "b", "c"]);
11696    /// ```
11697    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11698    where
11699        T: std::iter::IntoIterator<Item = V>,
11700        V: std::convert::Into<std::string::String>,
11701    {
11702        use std::iter::Iterator;
11703        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11704        self
11705    }
11706}
11707
11708impl wkt::message::Message for CreateReleaseRequest {
11709    fn typename() -> &'static str {
11710        "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
11711    }
11712}
11713
11714/// A `Rollout` resource in the Cloud Deploy API.
11715///
11716/// A `Rollout` contains information around a specific deployment to a `Target`.
11717#[derive(Clone, Default, PartialEq)]
11718#[non_exhaustive]
11719pub struct Rollout {
11720    /// Identifier. Name of the `Rollout`. Format is
11721    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11722    /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
11723    pub name: std::string::String,
11724
11725    /// Output only. Unique identifier of the `Rollout`.
11726    pub uid: std::string::String,
11727
11728    /// Optional. Description of the `Rollout` for user purposes. Max length is 255
11729    /// characters.
11730    pub description: std::string::String,
11731
11732    /// Optional. User annotations. These attributes can only be set and used by
11733    /// the user, and not by Cloud Deploy. See
11734    /// <https://google.aip.dev/128#annotations> for more details such as format and
11735    /// size limitations.
11736    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11737
11738    /// Labels are attributes that can be set and used by both the
11739    /// user and by Cloud Deploy. Labels must meet the following constraints:
11740    ///
11741    /// * Keys and values can contain only lowercase letters, numeric characters,
11742    ///   underscores, and dashes.
11743    /// * All characters must use UTF-8 encoding, and international characters are
11744    ///   allowed.
11745    /// * Keys must start with a lowercase letter or international character.
11746    /// * Each resource is limited to a maximum of 64 labels.
11747    ///
11748    /// Both keys and values are additionally constrained to be <= 128 bytes.
11749    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11750
11751    /// Output only. Time at which the `Rollout` was created.
11752    pub create_time: std::option::Option<wkt::Timestamp>,
11753
11754    /// Output only. Time at which the `Rollout` was approved.
11755    pub approve_time: std::option::Option<wkt::Timestamp>,
11756
11757    /// Output only. Time at which the `Rollout` was enqueued.
11758    pub enqueue_time: std::option::Option<wkt::Timestamp>,
11759
11760    /// Output only. Time at which the `Rollout` started deploying.
11761    pub deploy_start_time: std::option::Option<wkt::Timestamp>,
11762
11763    /// Output only. Time at which the `Rollout` finished deploying.
11764    pub deploy_end_time: std::option::Option<wkt::Timestamp>,
11765
11766    /// Required. The ID of Target to which this `Rollout` is deploying.
11767    pub target_id: std::string::String,
11768
11769    /// Output only. Approval state of the `Rollout`.
11770    pub approval_state: crate::model::rollout::ApprovalState,
11771
11772    /// Output only. Current state of the `Rollout`.
11773    pub state: crate::model::rollout::State,
11774
11775    /// Output only. Additional information about the rollout failure, if
11776    /// available.
11777    pub failure_reason: std::string::String,
11778
11779    /// Output only. The resource name of the Cloud Build `Build` object that is
11780    /// used to deploy the Rollout. Format is
11781    /// `projects/{project}/locations/{location}/builds/{build}`.
11782    pub deploying_build: std::string::String,
11783
11784    /// This checksum is computed by the server based on the value of other
11785    /// fields, and may be sent on update and delete requests to ensure the
11786    /// client has an up-to-date value before proceeding.
11787    pub etag: std::string::String,
11788
11789    /// Output only. The reason this rollout failed. This will always be
11790    /// unspecified while the rollout is in progress.
11791    pub deploy_failure_cause: crate::model::rollout::FailureCause,
11792
11793    /// Output only. The phases that represent the workflows of this `Rollout`.
11794    pub phases: std::vec::Vec<crate::model::Phase>,
11795
11796    /// Output only. Metadata contains information about the rollout.
11797    pub metadata: std::option::Option<crate::model::Metadata>,
11798
11799    /// Output only. Name of the `ControllerRollout`. Format is
11800    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11801    pub controller_rollout: std::string::String,
11802
11803    /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
11804    /// Empty if this `Rollout` wasn't created as a rollback.
11805    pub rollback_of_rollout: std::string::String,
11806
11807    /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
11808    pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
11809
11810    /// Output only. The AutomationRun actively repairing the rollout.
11811    pub active_repair_automation_run: std::string::String,
11812
11813    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11814}
11815
11816impl Rollout {
11817    pub fn new() -> Self {
11818        std::default::Default::default()
11819    }
11820
11821    /// Sets the value of [name][crate::model::Rollout::name].
11822    ///
11823    /// # Example
11824    /// ```ignore,no_run
11825    /// # use google_cloud_deploy_v1::model::Rollout;
11826    /// let x = Rollout::new().set_name("example");
11827    /// ```
11828    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11829        self.name = v.into();
11830        self
11831    }
11832
11833    /// Sets the value of [uid][crate::model::Rollout::uid].
11834    ///
11835    /// # Example
11836    /// ```ignore,no_run
11837    /// # use google_cloud_deploy_v1::model::Rollout;
11838    /// let x = Rollout::new().set_uid("example");
11839    /// ```
11840    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11841        self.uid = v.into();
11842        self
11843    }
11844
11845    /// Sets the value of [description][crate::model::Rollout::description].
11846    ///
11847    /// # Example
11848    /// ```ignore,no_run
11849    /// # use google_cloud_deploy_v1::model::Rollout;
11850    /// let x = Rollout::new().set_description("example");
11851    /// ```
11852    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11853        self.description = v.into();
11854        self
11855    }
11856
11857    /// Sets the value of [annotations][crate::model::Rollout::annotations].
11858    ///
11859    /// # Example
11860    /// ```ignore,no_run
11861    /// # use google_cloud_deploy_v1::model::Rollout;
11862    /// let x = Rollout::new().set_annotations([
11863    ///     ("key0", "abc"),
11864    ///     ("key1", "xyz"),
11865    /// ]);
11866    /// ```
11867    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11868    where
11869        T: std::iter::IntoIterator<Item = (K, V)>,
11870        K: std::convert::Into<std::string::String>,
11871        V: std::convert::Into<std::string::String>,
11872    {
11873        use std::iter::Iterator;
11874        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11875        self
11876    }
11877
11878    /// Sets the value of [labels][crate::model::Rollout::labels].
11879    ///
11880    /// # Example
11881    /// ```ignore,no_run
11882    /// # use google_cloud_deploy_v1::model::Rollout;
11883    /// let x = Rollout::new().set_labels([
11884    ///     ("key0", "abc"),
11885    ///     ("key1", "xyz"),
11886    /// ]);
11887    /// ```
11888    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11889    where
11890        T: std::iter::IntoIterator<Item = (K, V)>,
11891        K: std::convert::Into<std::string::String>,
11892        V: std::convert::Into<std::string::String>,
11893    {
11894        use std::iter::Iterator;
11895        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11896        self
11897    }
11898
11899    /// Sets the value of [create_time][crate::model::Rollout::create_time].
11900    ///
11901    /// # Example
11902    /// ```ignore,no_run
11903    /// # use google_cloud_deploy_v1::model::Rollout;
11904    /// use wkt::Timestamp;
11905    /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
11906    /// ```
11907    pub fn set_create_time<T>(mut self, v: T) -> Self
11908    where
11909        T: std::convert::Into<wkt::Timestamp>,
11910    {
11911        self.create_time = std::option::Option::Some(v.into());
11912        self
11913    }
11914
11915    /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
11916    ///
11917    /// # Example
11918    /// ```ignore,no_run
11919    /// # use google_cloud_deploy_v1::model::Rollout;
11920    /// use wkt::Timestamp;
11921    /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11922    /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
11923    /// ```
11924    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11925    where
11926        T: std::convert::Into<wkt::Timestamp>,
11927    {
11928        self.create_time = v.map(|x| x.into());
11929        self
11930    }
11931
11932    /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
11933    ///
11934    /// # Example
11935    /// ```ignore,no_run
11936    /// # use google_cloud_deploy_v1::model::Rollout;
11937    /// use wkt::Timestamp;
11938    /// let x = Rollout::new().set_approve_time(Timestamp::default()/* use setters */);
11939    /// ```
11940    pub fn set_approve_time<T>(mut self, v: T) -> Self
11941    where
11942        T: std::convert::Into<wkt::Timestamp>,
11943    {
11944        self.approve_time = std::option::Option::Some(v.into());
11945        self
11946    }
11947
11948    /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
11949    ///
11950    /// # Example
11951    /// ```ignore,no_run
11952    /// # use google_cloud_deploy_v1::model::Rollout;
11953    /// use wkt::Timestamp;
11954    /// let x = Rollout::new().set_or_clear_approve_time(Some(Timestamp::default()/* use setters */));
11955    /// let x = Rollout::new().set_or_clear_approve_time(None::<Timestamp>);
11956    /// ```
11957    pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
11958    where
11959        T: std::convert::Into<wkt::Timestamp>,
11960    {
11961        self.approve_time = v.map(|x| x.into());
11962        self
11963    }
11964
11965    /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
11966    ///
11967    /// # Example
11968    /// ```ignore,no_run
11969    /// # use google_cloud_deploy_v1::model::Rollout;
11970    /// use wkt::Timestamp;
11971    /// let x = Rollout::new().set_enqueue_time(Timestamp::default()/* use setters */);
11972    /// ```
11973    pub fn set_enqueue_time<T>(mut self, v: T) -> Self
11974    where
11975        T: std::convert::Into<wkt::Timestamp>,
11976    {
11977        self.enqueue_time = std::option::Option::Some(v.into());
11978        self
11979    }
11980
11981    /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
11982    ///
11983    /// # Example
11984    /// ```ignore,no_run
11985    /// # use google_cloud_deploy_v1::model::Rollout;
11986    /// use wkt::Timestamp;
11987    /// let x = Rollout::new().set_or_clear_enqueue_time(Some(Timestamp::default()/* use setters */));
11988    /// let x = Rollout::new().set_or_clear_enqueue_time(None::<Timestamp>);
11989    /// ```
11990    pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
11991    where
11992        T: std::convert::Into<wkt::Timestamp>,
11993    {
11994        self.enqueue_time = v.map(|x| x.into());
11995        self
11996    }
11997
11998    /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
11999    ///
12000    /// # Example
12001    /// ```ignore,no_run
12002    /// # use google_cloud_deploy_v1::model::Rollout;
12003    /// use wkt::Timestamp;
12004    /// let x = Rollout::new().set_deploy_start_time(Timestamp::default()/* use setters */);
12005    /// ```
12006    pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
12007    where
12008        T: std::convert::Into<wkt::Timestamp>,
12009    {
12010        self.deploy_start_time = std::option::Option::Some(v.into());
12011        self
12012    }
12013
12014    /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12015    ///
12016    /// # Example
12017    /// ```ignore,no_run
12018    /// # use google_cloud_deploy_v1::model::Rollout;
12019    /// use wkt::Timestamp;
12020    /// let x = Rollout::new().set_or_clear_deploy_start_time(Some(Timestamp::default()/* use setters */));
12021    /// let x = Rollout::new().set_or_clear_deploy_start_time(None::<Timestamp>);
12022    /// ```
12023    pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12024    where
12025        T: std::convert::Into<wkt::Timestamp>,
12026    {
12027        self.deploy_start_time = v.map(|x| x.into());
12028        self
12029    }
12030
12031    /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12032    ///
12033    /// # Example
12034    /// ```ignore,no_run
12035    /// # use google_cloud_deploy_v1::model::Rollout;
12036    /// use wkt::Timestamp;
12037    /// let x = Rollout::new().set_deploy_end_time(Timestamp::default()/* use setters */);
12038    /// ```
12039    pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
12040    where
12041        T: std::convert::Into<wkt::Timestamp>,
12042    {
12043        self.deploy_end_time = std::option::Option::Some(v.into());
12044        self
12045    }
12046
12047    /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12048    ///
12049    /// # Example
12050    /// ```ignore,no_run
12051    /// # use google_cloud_deploy_v1::model::Rollout;
12052    /// use wkt::Timestamp;
12053    /// let x = Rollout::new().set_or_clear_deploy_end_time(Some(Timestamp::default()/* use setters */));
12054    /// let x = Rollout::new().set_or_clear_deploy_end_time(None::<Timestamp>);
12055    /// ```
12056    pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12057    where
12058        T: std::convert::Into<wkt::Timestamp>,
12059    {
12060        self.deploy_end_time = v.map(|x| x.into());
12061        self
12062    }
12063
12064    /// Sets the value of [target_id][crate::model::Rollout::target_id].
12065    ///
12066    /// # Example
12067    /// ```ignore,no_run
12068    /// # use google_cloud_deploy_v1::model::Rollout;
12069    /// let x = Rollout::new().set_target_id("example");
12070    /// ```
12071    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12072        self.target_id = v.into();
12073        self
12074    }
12075
12076    /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
12077    ///
12078    /// # Example
12079    /// ```ignore,no_run
12080    /// # use google_cloud_deploy_v1::model::Rollout;
12081    /// use google_cloud_deploy_v1::model::rollout::ApprovalState;
12082    /// let x0 = Rollout::new().set_approval_state(ApprovalState::NeedsApproval);
12083    /// let x1 = Rollout::new().set_approval_state(ApprovalState::DoesNotNeedApproval);
12084    /// let x2 = Rollout::new().set_approval_state(ApprovalState::Approved);
12085    /// ```
12086    pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
12087        mut self,
12088        v: T,
12089    ) -> Self {
12090        self.approval_state = v.into();
12091        self
12092    }
12093
12094    /// Sets the value of [state][crate::model::Rollout::state].
12095    ///
12096    /// # Example
12097    /// ```ignore,no_run
12098    /// # use google_cloud_deploy_v1::model::Rollout;
12099    /// use google_cloud_deploy_v1::model::rollout::State;
12100    /// let x0 = Rollout::new().set_state(State::Succeeded);
12101    /// let x1 = Rollout::new().set_state(State::Failed);
12102    /// let x2 = Rollout::new().set_state(State::InProgress);
12103    /// ```
12104    pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
12105        self.state = v.into();
12106        self
12107    }
12108
12109    /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
12110    ///
12111    /// # Example
12112    /// ```ignore,no_run
12113    /// # use google_cloud_deploy_v1::model::Rollout;
12114    /// let x = Rollout::new().set_failure_reason("example");
12115    /// ```
12116    pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12117        self.failure_reason = v.into();
12118        self
12119    }
12120
12121    /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
12122    ///
12123    /// # Example
12124    /// ```ignore,no_run
12125    /// # use google_cloud_deploy_v1::model::Rollout;
12126    /// let x = Rollout::new().set_deploying_build("example");
12127    /// ```
12128    pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12129        self.deploying_build = v.into();
12130        self
12131    }
12132
12133    /// Sets the value of [etag][crate::model::Rollout::etag].
12134    ///
12135    /// # Example
12136    /// ```ignore,no_run
12137    /// # use google_cloud_deploy_v1::model::Rollout;
12138    /// let x = Rollout::new().set_etag("example");
12139    /// ```
12140    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12141        self.etag = v.into();
12142        self
12143    }
12144
12145    /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
12146    ///
12147    /// # Example
12148    /// ```ignore,no_run
12149    /// # use google_cloud_deploy_v1::model::Rollout;
12150    /// use google_cloud_deploy_v1::model::rollout::FailureCause;
12151    /// let x0 = Rollout::new().set_deploy_failure_cause(FailureCause::CloudBuildUnavailable);
12152    /// let x1 = Rollout::new().set_deploy_failure_cause(FailureCause::ExecutionFailed);
12153    /// let x2 = Rollout::new().set_deploy_failure_cause(FailureCause::DeadlineExceeded);
12154    /// ```
12155    pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
12156        mut self,
12157        v: T,
12158    ) -> Self {
12159        self.deploy_failure_cause = v.into();
12160        self
12161    }
12162
12163    /// Sets the value of [phases][crate::model::Rollout::phases].
12164    ///
12165    /// # Example
12166    /// ```ignore,no_run
12167    /// # use google_cloud_deploy_v1::model::Rollout;
12168    /// use google_cloud_deploy_v1::model::Phase;
12169    /// let x = Rollout::new()
12170    ///     .set_phases([
12171    ///         Phase::default()/* use setters */,
12172    ///         Phase::default()/* use (different) setters */,
12173    ///     ]);
12174    /// ```
12175    pub fn set_phases<T, V>(mut self, v: T) -> Self
12176    where
12177        T: std::iter::IntoIterator<Item = V>,
12178        V: std::convert::Into<crate::model::Phase>,
12179    {
12180        use std::iter::Iterator;
12181        self.phases = v.into_iter().map(|i| i.into()).collect();
12182        self
12183    }
12184
12185    /// Sets the value of [metadata][crate::model::Rollout::metadata].
12186    ///
12187    /// # Example
12188    /// ```ignore,no_run
12189    /// # use google_cloud_deploy_v1::model::Rollout;
12190    /// use google_cloud_deploy_v1::model::Metadata;
12191    /// let x = Rollout::new().set_metadata(Metadata::default()/* use setters */);
12192    /// ```
12193    pub fn set_metadata<T>(mut self, v: T) -> Self
12194    where
12195        T: std::convert::Into<crate::model::Metadata>,
12196    {
12197        self.metadata = std::option::Option::Some(v.into());
12198        self
12199    }
12200
12201    /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
12202    ///
12203    /// # Example
12204    /// ```ignore,no_run
12205    /// # use google_cloud_deploy_v1::model::Rollout;
12206    /// use google_cloud_deploy_v1::model::Metadata;
12207    /// let x = Rollout::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
12208    /// let x = Rollout::new().set_or_clear_metadata(None::<Metadata>);
12209    /// ```
12210    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12211    where
12212        T: std::convert::Into<crate::model::Metadata>,
12213    {
12214        self.metadata = v.map(|x| x.into());
12215        self
12216    }
12217
12218    /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
12219    ///
12220    /// # Example
12221    /// ```ignore,no_run
12222    /// # use google_cloud_deploy_v1::model::Rollout;
12223    /// let x = Rollout::new().set_controller_rollout("example");
12224    /// ```
12225    pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
12226        mut self,
12227        v: T,
12228    ) -> Self {
12229        self.controller_rollout = v.into();
12230        self
12231    }
12232
12233    /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
12234    ///
12235    /// # Example
12236    /// ```ignore,no_run
12237    /// # use google_cloud_deploy_v1::model::Rollout;
12238    /// let x = Rollout::new().set_rollback_of_rollout("example");
12239    /// ```
12240    pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
12241        mut self,
12242        v: T,
12243    ) -> Self {
12244        self.rollback_of_rollout = v.into();
12245        self
12246    }
12247
12248    /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
12249    ///
12250    /// # Example
12251    /// ```ignore,no_run
12252    /// # use google_cloud_deploy_v1::model::Rollout;
12253    /// let x = Rollout::new().set_rolled_back_by_rollouts(["a", "b", "c"]);
12254    /// ```
12255    pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
12256    where
12257        T: std::iter::IntoIterator<Item = V>,
12258        V: std::convert::Into<std::string::String>,
12259    {
12260        use std::iter::Iterator;
12261        self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
12262        self
12263    }
12264
12265    /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
12266    ///
12267    /// # Example
12268    /// ```ignore,no_run
12269    /// # use google_cloud_deploy_v1::model::Rollout;
12270    /// let x = Rollout::new().set_active_repair_automation_run("example");
12271    /// ```
12272    pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
12273        mut self,
12274        v: T,
12275    ) -> Self {
12276        self.active_repair_automation_run = v.into();
12277        self
12278    }
12279}
12280
12281impl wkt::message::Message for Rollout {
12282    fn typename() -> &'static str {
12283        "type.googleapis.com/google.cloud.deploy.v1.Rollout"
12284    }
12285}
12286
12287/// Defines additional types related to [Rollout].
12288pub mod rollout {
12289    #[allow(unused_imports)]
12290    use super::*;
12291
12292    /// Valid approval states of a `Rollout`.
12293    ///
12294    /// # Working with unknown values
12295    ///
12296    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12297    /// additional enum variants at any time. Adding new variants is not considered
12298    /// a breaking change. Applications should write their code in anticipation of:
12299    ///
12300    /// - New values appearing in future releases of the client library, **and**
12301    /// - New values received dynamically, without application changes.
12302    ///
12303    /// Please consult the [Working with enums] section in the user guide for some
12304    /// guidelines.
12305    ///
12306    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12307    #[derive(Clone, Debug, PartialEq)]
12308    #[non_exhaustive]
12309    pub enum ApprovalState {
12310        /// The `Rollout` has an unspecified approval state.
12311        Unspecified,
12312        /// The `Rollout` requires approval.
12313        NeedsApproval,
12314        /// The `Rollout` does not require approval.
12315        DoesNotNeedApproval,
12316        /// The `Rollout` has been approved.
12317        Approved,
12318        /// The `Rollout` has been rejected.
12319        Rejected,
12320        /// If set, the enum was initialized with an unknown value.
12321        ///
12322        /// Applications can examine the value using [ApprovalState::value] or
12323        /// [ApprovalState::name].
12324        UnknownValue(approval_state::UnknownValue),
12325    }
12326
12327    #[doc(hidden)]
12328    pub mod approval_state {
12329        #[allow(unused_imports)]
12330        use super::*;
12331        #[derive(Clone, Debug, PartialEq)]
12332        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12333    }
12334
12335    impl ApprovalState {
12336        /// Gets the enum value.
12337        ///
12338        /// Returns `None` if the enum contains an unknown value deserialized from
12339        /// the string representation of enums.
12340        pub fn value(&self) -> std::option::Option<i32> {
12341            match self {
12342                Self::Unspecified => std::option::Option::Some(0),
12343                Self::NeedsApproval => std::option::Option::Some(1),
12344                Self::DoesNotNeedApproval => std::option::Option::Some(2),
12345                Self::Approved => std::option::Option::Some(3),
12346                Self::Rejected => std::option::Option::Some(4),
12347                Self::UnknownValue(u) => u.0.value(),
12348            }
12349        }
12350
12351        /// Gets the enum value as a string.
12352        ///
12353        /// Returns `None` if the enum contains an unknown value deserialized from
12354        /// the integer representation of enums.
12355        pub fn name(&self) -> std::option::Option<&str> {
12356            match self {
12357                Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
12358                Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
12359                Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
12360                Self::Approved => std::option::Option::Some("APPROVED"),
12361                Self::Rejected => std::option::Option::Some("REJECTED"),
12362                Self::UnknownValue(u) => u.0.name(),
12363            }
12364        }
12365    }
12366
12367    impl std::default::Default for ApprovalState {
12368        fn default() -> Self {
12369            use std::convert::From;
12370            Self::from(0)
12371        }
12372    }
12373
12374    impl std::fmt::Display for ApprovalState {
12375        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12376            wkt::internal::display_enum(f, self.name(), self.value())
12377        }
12378    }
12379
12380    impl std::convert::From<i32> for ApprovalState {
12381        fn from(value: i32) -> Self {
12382            match value {
12383                0 => Self::Unspecified,
12384                1 => Self::NeedsApproval,
12385                2 => Self::DoesNotNeedApproval,
12386                3 => Self::Approved,
12387                4 => Self::Rejected,
12388                _ => Self::UnknownValue(approval_state::UnknownValue(
12389                    wkt::internal::UnknownEnumValue::Integer(value),
12390                )),
12391            }
12392        }
12393    }
12394
12395    impl std::convert::From<&str> for ApprovalState {
12396        fn from(value: &str) -> Self {
12397            use std::string::ToString;
12398            match value {
12399                "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
12400                "NEEDS_APPROVAL" => Self::NeedsApproval,
12401                "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
12402                "APPROVED" => Self::Approved,
12403                "REJECTED" => Self::Rejected,
12404                _ => Self::UnknownValue(approval_state::UnknownValue(
12405                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12406                )),
12407            }
12408        }
12409    }
12410
12411    impl serde::ser::Serialize for ApprovalState {
12412        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12413        where
12414            S: serde::Serializer,
12415        {
12416            match self {
12417                Self::Unspecified => serializer.serialize_i32(0),
12418                Self::NeedsApproval => serializer.serialize_i32(1),
12419                Self::DoesNotNeedApproval => serializer.serialize_i32(2),
12420                Self::Approved => serializer.serialize_i32(3),
12421                Self::Rejected => serializer.serialize_i32(4),
12422                Self::UnknownValue(u) => u.0.serialize(serializer),
12423            }
12424        }
12425    }
12426
12427    impl<'de> serde::de::Deserialize<'de> for ApprovalState {
12428        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12429        where
12430            D: serde::Deserializer<'de>,
12431        {
12432            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
12433                ".google.cloud.deploy.v1.Rollout.ApprovalState",
12434            ))
12435        }
12436    }
12437
12438    /// Valid states of a `Rollout`.
12439    ///
12440    /// # Working with unknown values
12441    ///
12442    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12443    /// additional enum variants at any time. Adding new variants is not considered
12444    /// a breaking change. Applications should write their code in anticipation of:
12445    ///
12446    /// - New values appearing in future releases of the client library, **and**
12447    /// - New values received dynamically, without application changes.
12448    ///
12449    /// Please consult the [Working with enums] section in the user guide for some
12450    /// guidelines.
12451    ///
12452    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12453    #[derive(Clone, Debug, PartialEq)]
12454    #[non_exhaustive]
12455    pub enum State {
12456        /// The `Rollout` has an unspecified state.
12457        Unspecified,
12458        /// The `Rollout` has completed successfully.
12459        Succeeded,
12460        /// The `Rollout` has failed.
12461        Failed,
12462        /// The `Rollout` is being deployed.
12463        InProgress,
12464        /// The `Rollout` needs approval.
12465        PendingApproval,
12466        /// An approver rejected the `Rollout`.
12467        ApprovalRejected,
12468        /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
12469        /// `Target`.
12470        Pending,
12471        /// The `Rollout` is waiting for the `Release` to be fully rendered.
12472        PendingRelease,
12473        /// The `Rollout` is in the process of being cancelled.
12474        Cancelling,
12475        /// The `Rollout` has been cancelled.
12476        Cancelled,
12477        /// The `Rollout` is halted.
12478        Halted,
12479        /// If set, the enum was initialized with an unknown value.
12480        ///
12481        /// Applications can examine the value using [State::value] or
12482        /// [State::name].
12483        UnknownValue(state::UnknownValue),
12484    }
12485
12486    #[doc(hidden)]
12487    pub mod state {
12488        #[allow(unused_imports)]
12489        use super::*;
12490        #[derive(Clone, Debug, PartialEq)]
12491        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12492    }
12493
12494    impl State {
12495        /// Gets the enum value.
12496        ///
12497        /// Returns `None` if the enum contains an unknown value deserialized from
12498        /// the string representation of enums.
12499        pub fn value(&self) -> std::option::Option<i32> {
12500            match self {
12501                Self::Unspecified => std::option::Option::Some(0),
12502                Self::Succeeded => std::option::Option::Some(1),
12503                Self::Failed => std::option::Option::Some(2),
12504                Self::InProgress => std::option::Option::Some(3),
12505                Self::PendingApproval => std::option::Option::Some(4),
12506                Self::ApprovalRejected => std::option::Option::Some(5),
12507                Self::Pending => std::option::Option::Some(6),
12508                Self::PendingRelease => std::option::Option::Some(7),
12509                Self::Cancelling => std::option::Option::Some(8),
12510                Self::Cancelled => std::option::Option::Some(9),
12511                Self::Halted => std::option::Option::Some(10),
12512                Self::UnknownValue(u) => u.0.value(),
12513            }
12514        }
12515
12516        /// Gets the enum value as a string.
12517        ///
12518        /// Returns `None` if the enum contains an unknown value deserialized from
12519        /// the integer representation of enums.
12520        pub fn name(&self) -> std::option::Option<&str> {
12521            match self {
12522                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12523                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12524                Self::Failed => std::option::Option::Some("FAILED"),
12525                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12526                Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
12527                Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
12528                Self::Pending => std::option::Option::Some("PENDING"),
12529                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
12530                Self::Cancelling => std::option::Option::Some("CANCELLING"),
12531                Self::Cancelled => std::option::Option::Some("CANCELLED"),
12532                Self::Halted => std::option::Option::Some("HALTED"),
12533                Self::UnknownValue(u) => u.0.name(),
12534            }
12535        }
12536    }
12537
12538    impl std::default::Default for State {
12539        fn default() -> Self {
12540            use std::convert::From;
12541            Self::from(0)
12542        }
12543    }
12544
12545    impl std::fmt::Display for State {
12546        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12547            wkt::internal::display_enum(f, self.name(), self.value())
12548        }
12549    }
12550
12551    impl std::convert::From<i32> for State {
12552        fn from(value: i32) -> Self {
12553            match value {
12554                0 => Self::Unspecified,
12555                1 => Self::Succeeded,
12556                2 => Self::Failed,
12557                3 => Self::InProgress,
12558                4 => Self::PendingApproval,
12559                5 => Self::ApprovalRejected,
12560                6 => Self::Pending,
12561                7 => Self::PendingRelease,
12562                8 => Self::Cancelling,
12563                9 => Self::Cancelled,
12564                10 => Self::Halted,
12565                _ => Self::UnknownValue(state::UnknownValue(
12566                    wkt::internal::UnknownEnumValue::Integer(value),
12567                )),
12568            }
12569        }
12570    }
12571
12572    impl std::convert::From<&str> for State {
12573        fn from(value: &str) -> Self {
12574            use std::string::ToString;
12575            match value {
12576                "STATE_UNSPECIFIED" => Self::Unspecified,
12577                "SUCCEEDED" => Self::Succeeded,
12578                "FAILED" => Self::Failed,
12579                "IN_PROGRESS" => Self::InProgress,
12580                "PENDING_APPROVAL" => Self::PendingApproval,
12581                "APPROVAL_REJECTED" => Self::ApprovalRejected,
12582                "PENDING" => Self::Pending,
12583                "PENDING_RELEASE" => Self::PendingRelease,
12584                "CANCELLING" => Self::Cancelling,
12585                "CANCELLED" => Self::Cancelled,
12586                "HALTED" => Self::Halted,
12587                _ => Self::UnknownValue(state::UnknownValue(
12588                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12589                )),
12590            }
12591        }
12592    }
12593
12594    impl serde::ser::Serialize for State {
12595        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12596        where
12597            S: serde::Serializer,
12598        {
12599            match self {
12600                Self::Unspecified => serializer.serialize_i32(0),
12601                Self::Succeeded => serializer.serialize_i32(1),
12602                Self::Failed => serializer.serialize_i32(2),
12603                Self::InProgress => serializer.serialize_i32(3),
12604                Self::PendingApproval => serializer.serialize_i32(4),
12605                Self::ApprovalRejected => serializer.serialize_i32(5),
12606                Self::Pending => serializer.serialize_i32(6),
12607                Self::PendingRelease => serializer.serialize_i32(7),
12608                Self::Cancelling => serializer.serialize_i32(8),
12609                Self::Cancelled => serializer.serialize_i32(9),
12610                Self::Halted => serializer.serialize_i32(10),
12611                Self::UnknownValue(u) => u.0.serialize(serializer),
12612            }
12613        }
12614    }
12615
12616    impl<'de> serde::de::Deserialize<'de> for State {
12617        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12618        where
12619            D: serde::Deserializer<'de>,
12620        {
12621            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12622                ".google.cloud.deploy.v1.Rollout.State",
12623            ))
12624        }
12625    }
12626
12627    /// Well-known rollout failures.
12628    ///
12629    /// # Working with unknown values
12630    ///
12631    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12632    /// additional enum variants at any time. Adding new variants is not considered
12633    /// a breaking change. Applications should write their code in anticipation of:
12634    ///
12635    /// - New values appearing in future releases of the client library, **and**
12636    /// - New values received dynamically, without application changes.
12637    ///
12638    /// Please consult the [Working with enums] section in the user guide for some
12639    /// guidelines.
12640    ///
12641    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12642    #[derive(Clone, Debug, PartialEq)]
12643    #[non_exhaustive]
12644    pub enum FailureCause {
12645        /// No reason for failure is specified.
12646        Unspecified,
12647        /// Cloud Build is not available, either because it is not enabled or because
12648        /// Cloud Deploy has insufficient permissions. See [required
12649        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12650        CloudBuildUnavailable,
12651        /// The deploy operation did not complete successfully; check Cloud Build
12652        /// logs.
12653        ExecutionFailed,
12654        /// Deployment did not complete within the allotted time.
12655        DeadlineExceeded,
12656        /// Release is in a failed state.
12657        ReleaseFailed,
12658        /// Release is abandoned.
12659        ReleaseAbandoned,
12660        /// No Skaffold verify configuration was found.
12661        VerificationConfigNotFound,
12662        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12663        /// for additional details.
12664        CloudBuildRequestFailed,
12665        /// A Rollout operation had a feature configured that is not supported.
12666        OperationFeatureNotSupported,
12667        /// If set, the enum was initialized with an unknown value.
12668        ///
12669        /// Applications can examine the value using [FailureCause::value] or
12670        /// [FailureCause::name].
12671        UnknownValue(failure_cause::UnknownValue),
12672    }
12673
12674    #[doc(hidden)]
12675    pub mod failure_cause {
12676        #[allow(unused_imports)]
12677        use super::*;
12678        #[derive(Clone, Debug, PartialEq)]
12679        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12680    }
12681
12682    impl FailureCause {
12683        /// Gets the enum value.
12684        ///
12685        /// Returns `None` if the enum contains an unknown value deserialized from
12686        /// the string representation of enums.
12687        pub fn value(&self) -> std::option::Option<i32> {
12688            match self {
12689                Self::Unspecified => std::option::Option::Some(0),
12690                Self::CloudBuildUnavailable => std::option::Option::Some(1),
12691                Self::ExecutionFailed => std::option::Option::Some(2),
12692                Self::DeadlineExceeded => std::option::Option::Some(3),
12693                Self::ReleaseFailed => std::option::Option::Some(4),
12694                Self::ReleaseAbandoned => std::option::Option::Some(5),
12695                Self::VerificationConfigNotFound => std::option::Option::Some(6),
12696                Self::CloudBuildRequestFailed => std::option::Option::Some(7),
12697                Self::OperationFeatureNotSupported => std::option::Option::Some(8),
12698                Self::UnknownValue(u) => u.0.value(),
12699            }
12700        }
12701
12702        /// Gets the enum value as a string.
12703        ///
12704        /// Returns `None` if the enum contains an unknown value deserialized from
12705        /// the integer representation of enums.
12706        pub fn name(&self) -> std::option::Option<&str> {
12707            match self {
12708                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12709                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12710                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12711                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12712                Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
12713                Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
12714                Self::VerificationConfigNotFound => {
12715                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12716                }
12717                Self::CloudBuildRequestFailed => {
12718                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12719                }
12720                Self::OperationFeatureNotSupported => {
12721                    std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
12722                }
12723                Self::UnknownValue(u) => u.0.name(),
12724            }
12725        }
12726    }
12727
12728    impl std::default::Default for FailureCause {
12729        fn default() -> Self {
12730            use std::convert::From;
12731            Self::from(0)
12732        }
12733    }
12734
12735    impl std::fmt::Display for FailureCause {
12736        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12737            wkt::internal::display_enum(f, self.name(), self.value())
12738        }
12739    }
12740
12741    impl std::convert::From<i32> for FailureCause {
12742        fn from(value: i32) -> Self {
12743            match value {
12744                0 => Self::Unspecified,
12745                1 => Self::CloudBuildUnavailable,
12746                2 => Self::ExecutionFailed,
12747                3 => Self::DeadlineExceeded,
12748                4 => Self::ReleaseFailed,
12749                5 => Self::ReleaseAbandoned,
12750                6 => Self::VerificationConfigNotFound,
12751                7 => Self::CloudBuildRequestFailed,
12752                8 => Self::OperationFeatureNotSupported,
12753                _ => Self::UnknownValue(failure_cause::UnknownValue(
12754                    wkt::internal::UnknownEnumValue::Integer(value),
12755                )),
12756            }
12757        }
12758    }
12759
12760    impl std::convert::From<&str> for FailureCause {
12761        fn from(value: &str) -> Self {
12762            use std::string::ToString;
12763            match value {
12764                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12765                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12766                "EXECUTION_FAILED" => Self::ExecutionFailed,
12767                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12768                "RELEASE_FAILED" => Self::ReleaseFailed,
12769                "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
12770                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12771                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12772                "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
12773                _ => Self::UnknownValue(failure_cause::UnknownValue(
12774                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12775                )),
12776            }
12777        }
12778    }
12779
12780    impl serde::ser::Serialize for FailureCause {
12781        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12782        where
12783            S: serde::Serializer,
12784        {
12785            match self {
12786                Self::Unspecified => serializer.serialize_i32(0),
12787                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12788                Self::ExecutionFailed => serializer.serialize_i32(2),
12789                Self::DeadlineExceeded => serializer.serialize_i32(3),
12790                Self::ReleaseFailed => serializer.serialize_i32(4),
12791                Self::ReleaseAbandoned => serializer.serialize_i32(5),
12792                Self::VerificationConfigNotFound => serializer.serialize_i32(6),
12793                Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
12794                Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
12795                Self::UnknownValue(u) => u.0.serialize(serializer),
12796            }
12797        }
12798    }
12799
12800    impl<'de> serde::de::Deserialize<'de> for FailureCause {
12801        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12802        where
12803            D: serde::Deserializer<'de>,
12804        {
12805            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12806                ".google.cloud.deploy.v1.Rollout.FailureCause",
12807            ))
12808        }
12809    }
12810}
12811
12812/// Metadata includes information associated with a `Rollout`.
12813#[derive(Clone, Default, PartialEq)]
12814#[non_exhaustive]
12815pub struct Metadata {
12816    /// Output only. The name of the Cloud Run Service that is associated with a
12817    /// `Rollout`.
12818    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12819
12820    /// Output only. AutomationRolloutMetadata contains the information about the
12821    /// interactions between Automation service and this rollout.
12822    pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
12823
12824    /// Output only. Custom metadata provided by user-defined `Rollout` operations.
12825    pub custom: std::option::Option<crate::model::CustomMetadata>,
12826
12827    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12828}
12829
12830impl Metadata {
12831    pub fn new() -> Self {
12832        std::default::Default::default()
12833    }
12834
12835    /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
12836    ///
12837    /// # Example
12838    /// ```ignore,no_run
12839    /// # use google_cloud_deploy_v1::model::Metadata;
12840    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12841    /// let x = Metadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12842    /// ```
12843    pub fn set_cloud_run<T>(mut self, v: T) -> Self
12844    where
12845        T: std::convert::Into<crate::model::CloudRunMetadata>,
12846    {
12847        self.cloud_run = std::option::Option::Some(v.into());
12848        self
12849    }
12850
12851    /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
12852    ///
12853    /// # Example
12854    /// ```ignore,no_run
12855    /// # use google_cloud_deploy_v1::model::Metadata;
12856    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12857    /// let x = Metadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12858    /// let x = Metadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12859    /// ```
12860    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12861    where
12862        T: std::convert::Into<crate::model::CloudRunMetadata>,
12863    {
12864        self.cloud_run = v.map(|x| x.into());
12865        self
12866    }
12867
12868    /// Sets the value of [automation][crate::model::Metadata::automation].
12869    ///
12870    /// # Example
12871    /// ```ignore,no_run
12872    /// # use google_cloud_deploy_v1::model::Metadata;
12873    /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12874    /// let x = Metadata::new().set_automation(AutomationRolloutMetadata::default()/* use setters */);
12875    /// ```
12876    pub fn set_automation<T>(mut self, v: T) -> Self
12877    where
12878        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12879    {
12880        self.automation = std::option::Option::Some(v.into());
12881        self
12882    }
12883
12884    /// Sets or clears the value of [automation][crate::model::Metadata::automation].
12885    ///
12886    /// # Example
12887    /// ```ignore,no_run
12888    /// # use google_cloud_deploy_v1::model::Metadata;
12889    /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12890    /// let x = Metadata::new().set_or_clear_automation(Some(AutomationRolloutMetadata::default()/* use setters */));
12891    /// let x = Metadata::new().set_or_clear_automation(None::<AutomationRolloutMetadata>);
12892    /// ```
12893    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
12894    where
12895        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12896    {
12897        self.automation = v.map(|x| x.into());
12898        self
12899    }
12900
12901    /// Sets the value of [custom][crate::model::Metadata::custom].
12902    ///
12903    /// # Example
12904    /// ```ignore,no_run
12905    /// # use google_cloud_deploy_v1::model::Metadata;
12906    /// use google_cloud_deploy_v1::model::CustomMetadata;
12907    /// let x = Metadata::new().set_custom(CustomMetadata::default()/* use setters */);
12908    /// ```
12909    pub fn set_custom<T>(mut self, v: T) -> Self
12910    where
12911        T: std::convert::Into<crate::model::CustomMetadata>,
12912    {
12913        self.custom = std::option::Option::Some(v.into());
12914        self
12915    }
12916
12917    /// Sets or clears the value of [custom][crate::model::Metadata::custom].
12918    ///
12919    /// # Example
12920    /// ```ignore,no_run
12921    /// # use google_cloud_deploy_v1::model::Metadata;
12922    /// use google_cloud_deploy_v1::model::CustomMetadata;
12923    /// let x = Metadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
12924    /// let x = Metadata::new().set_or_clear_custom(None::<CustomMetadata>);
12925    /// ```
12926    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
12927    where
12928        T: std::convert::Into<crate::model::CustomMetadata>,
12929    {
12930        self.custom = v.map(|x| x.into());
12931        self
12932    }
12933}
12934
12935impl wkt::message::Message for Metadata {
12936    fn typename() -> &'static str {
12937        "type.googleapis.com/google.cloud.deploy.v1.Metadata"
12938    }
12939}
12940
12941/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
12942/// the user.
12943#[derive(Clone, Default, PartialEq)]
12944#[non_exhaustive]
12945pub struct DeployJobRunMetadata {
12946    /// Output only. The name of the Cloud Run Service that is associated with a
12947    /// `DeployJobRun`.
12948    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12949
12950    /// Output only. Custom Target metadata associated with a `DeployJobRun`.
12951    pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
12952
12953    /// Output only. Custom metadata provided by user-defined deploy operation.
12954    pub custom: std::option::Option<crate::model::CustomMetadata>,
12955
12956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12957}
12958
12959impl DeployJobRunMetadata {
12960    pub fn new() -> Self {
12961        std::default::Default::default()
12962    }
12963
12964    /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
12965    ///
12966    /// # Example
12967    /// ```ignore,no_run
12968    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
12969    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12970    /// let x = DeployJobRunMetadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12971    /// ```
12972    pub fn set_cloud_run<T>(mut self, v: T) -> Self
12973    where
12974        T: std::convert::Into<crate::model::CloudRunMetadata>,
12975    {
12976        self.cloud_run = std::option::Option::Some(v.into());
12977        self
12978    }
12979
12980    /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
12981    ///
12982    /// # Example
12983    /// ```ignore,no_run
12984    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
12985    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12986    /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12987    /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12988    /// ```
12989    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12990    where
12991        T: std::convert::Into<crate::model::CloudRunMetadata>,
12992    {
12993        self.cloud_run = v.map(|x| x.into());
12994        self
12995    }
12996
12997    /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
12998    ///
12999    /// # Example
13000    /// ```ignore,no_run
13001    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13002    /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13003    /// let x = DeployJobRunMetadata::new().set_custom_target(CustomTargetDeployMetadata::default()/* use setters */);
13004    /// ```
13005    pub fn set_custom_target<T>(mut self, v: T) -> Self
13006    where
13007        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13008    {
13009        self.custom_target = std::option::Option::Some(v.into());
13010        self
13011    }
13012
13013    /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13014    ///
13015    /// # Example
13016    /// ```ignore,no_run
13017    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13018    /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13019    /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(Some(CustomTargetDeployMetadata::default()/* use setters */));
13020    /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(None::<CustomTargetDeployMetadata>);
13021    /// ```
13022    pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
13023    where
13024        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13025    {
13026        self.custom_target = v.map(|x| x.into());
13027        self
13028    }
13029
13030    /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
13031    ///
13032    /// # Example
13033    /// ```ignore,no_run
13034    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13035    /// use google_cloud_deploy_v1::model::CustomMetadata;
13036    /// let x = DeployJobRunMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
13037    /// ```
13038    pub fn set_custom<T>(mut self, v: T) -> Self
13039    where
13040        T: std::convert::Into<crate::model::CustomMetadata>,
13041    {
13042        self.custom = std::option::Option::Some(v.into());
13043        self
13044    }
13045
13046    /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
13047    ///
13048    /// # Example
13049    /// ```ignore,no_run
13050    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13051    /// use google_cloud_deploy_v1::model::CustomMetadata;
13052    /// let x = DeployJobRunMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13053    /// let x = DeployJobRunMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
13054    /// ```
13055    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13056    where
13057        T: std::convert::Into<crate::model::CustomMetadata>,
13058    {
13059        self.custom = v.map(|x| x.into());
13060        self
13061    }
13062}
13063
13064impl wkt::message::Message for DeployJobRunMetadata {
13065    fn typename() -> &'static str {
13066        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
13067    }
13068}
13069
13070/// CloudRunMetadata contains information from a Cloud Run deployment.
13071#[derive(Clone, Default, PartialEq)]
13072#[non_exhaustive]
13073pub struct CloudRunMetadata {
13074    /// Output only. The name of the Cloud Run Service that is associated with a
13075    /// `Rollout`. Format is
13076    /// `projects/{project}/locations/{location}/services/{service}`.
13077    pub service: std::string::String,
13078
13079    /// Output only. The Cloud Run Service urls that are associated with a
13080    /// `Rollout`.
13081    pub service_urls: std::vec::Vec<std::string::String>,
13082
13083    /// Output only. The Cloud Run Revision id associated with a `Rollout`.
13084    pub revision: std::string::String,
13085
13086    /// Output only. The name of the Cloud Run job that is associated with a
13087    /// `Rollout`. Format is
13088    /// `projects/{project}/locations/{location}/jobs/{job_name}`.
13089    pub job: std::string::String,
13090
13091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13092}
13093
13094impl CloudRunMetadata {
13095    pub fn new() -> Self {
13096        std::default::Default::default()
13097    }
13098
13099    /// Sets the value of [service][crate::model::CloudRunMetadata::service].
13100    ///
13101    /// # Example
13102    /// ```ignore,no_run
13103    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13104    /// let x = CloudRunMetadata::new().set_service("example");
13105    /// ```
13106    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13107        self.service = v.into();
13108        self
13109    }
13110
13111    /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
13112    ///
13113    /// # Example
13114    /// ```ignore,no_run
13115    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13116    /// let x = CloudRunMetadata::new().set_service_urls(["a", "b", "c"]);
13117    /// ```
13118    pub fn set_service_urls<T, V>(mut self, v: T) -> Self
13119    where
13120        T: std::iter::IntoIterator<Item = V>,
13121        V: std::convert::Into<std::string::String>,
13122    {
13123        use std::iter::Iterator;
13124        self.service_urls = v.into_iter().map(|i| i.into()).collect();
13125        self
13126    }
13127
13128    /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
13129    ///
13130    /// # Example
13131    /// ```ignore,no_run
13132    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13133    /// let x = CloudRunMetadata::new().set_revision("example");
13134    /// ```
13135    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13136        self.revision = v.into();
13137        self
13138    }
13139
13140    /// Sets the value of [job][crate::model::CloudRunMetadata::job].
13141    ///
13142    /// # Example
13143    /// ```ignore,no_run
13144    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13145    /// let x = CloudRunMetadata::new().set_job("example");
13146    /// ```
13147    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13148        self.job = v.into();
13149        self
13150    }
13151}
13152
13153impl wkt::message::Message for CloudRunMetadata {
13154    fn typename() -> &'static str {
13155        "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
13156    }
13157}
13158
13159/// CustomTargetDeployMetadata contains information from a Custom Target
13160/// deploy operation.
13161#[derive(Clone, Default, PartialEq)]
13162#[non_exhaustive]
13163pub struct CustomTargetDeployMetadata {
13164    /// Output only. Skip message provided in the results of a custom deploy
13165    /// operation.
13166    pub skip_message: std::string::String,
13167
13168    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13169}
13170
13171impl CustomTargetDeployMetadata {
13172    pub fn new() -> Self {
13173        std::default::Default::default()
13174    }
13175
13176    /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
13177    ///
13178    /// # Example
13179    /// ```ignore,no_run
13180    /// # use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13181    /// let x = CustomTargetDeployMetadata::new().set_skip_message("example");
13182    /// ```
13183    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13184        self.skip_message = v.into();
13185        self
13186    }
13187}
13188
13189impl wkt::message::Message for CustomTargetDeployMetadata {
13190    fn typename() -> &'static str {
13191        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
13192    }
13193}
13194
13195/// AutomationRolloutMetadata contains Automation-related actions that
13196/// were performed on a rollout.
13197#[derive(Clone, Default, PartialEq)]
13198#[non_exhaustive]
13199pub struct AutomationRolloutMetadata {
13200    /// Output only. The name of the AutomationRun initiated by a promote release
13201    /// rule.
13202    pub promote_automation_run: std::string::String,
13203
13204    /// Output only. The names of the AutomationRuns initiated by an advance
13205    /// rollout rule.
13206    pub advance_automation_runs: std::vec::Vec<std::string::String>,
13207
13208    /// Output only. The names of the AutomationRuns initiated by a repair rollout
13209    /// rule.
13210    pub repair_automation_runs: std::vec::Vec<std::string::String>,
13211
13212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13213}
13214
13215impl AutomationRolloutMetadata {
13216    pub fn new() -> Self {
13217        std::default::Default::default()
13218    }
13219
13220    /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
13221    ///
13222    /// # Example
13223    /// ```ignore,no_run
13224    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13225    /// let x = AutomationRolloutMetadata::new().set_promote_automation_run("example");
13226    /// ```
13227    pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
13228        mut self,
13229        v: T,
13230    ) -> Self {
13231        self.promote_automation_run = v.into();
13232        self
13233    }
13234
13235    /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
13236    ///
13237    /// # Example
13238    /// ```ignore,no_run
13239    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13240    /// let x = AutomationRolloutMetadata::new().set_advance_automation_runs(["a", "b", "c"]);
13241    /// ```
13242    pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
13243    where
13244        T: std::iter::IntoIterator<Item = V>,
13245        V: std::convert::Into<std::string::String>,
13246    {
13247        use std::iter::Iterator;
13248        self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
13249        self
13250    }
13251
13252    /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
13253    ///
13254    /// # Example
13255    /// ```ignore,no_run
13256    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13257    /// let x = AutomationRolloutMetadata::new().set_repair_automation_runs(["a", "b", "c"]);
13258    /// ```
13259    pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
13260    where
13261        T: std::iter::IntoIterator<Item = V>,
13262        V: std::convert::Into<std::string::String>,
13263    {
13264        use std::iter::Iterator;
13265        self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
13266        self
13267    }
13268}
13269
13270impl wkt::message::Message for AutomationRolloutMetadata {
13271    fn typename() -> &'static str {
13272        "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
13273    }
13274}
13275
13276/// CustomMetadata contains information from a user-defined operation.
13277#[derive(Clone, Default, PartialEq)]
13278#[non_exhaustive]
13279pub struct CustomMetadata {
13280    /// Output only. Key-value pairs provided by the user-defined operation.
13281    pub values: std::collections::HashMap<std::string::String, std::string::String>,
13282
13283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13284}
13285
13286impl CustomMetadata {
13287    pub fn new() -> Self {
13288        std::default::Default::default()
13289    }
13290
13291    /// Sets the value of [values][crate::model::CustomMetadata::values].
13292    ///
13293    /// # Example
13294    /// ```ignore,no_run
13295    /// # use google_cloud_deploy_v1::model::CustomMetadata;
13296    /// let x = CustomMetadata::new().set_values([
13297    ///     ("key0", "abc"),
13298    ///     ("key1", "xyz"),
13299    /// ]);
13300    /// ```
13301    pub fn set_values<T, K, V>(mut self, v: T) -> Self
13302    where
13303        T: std::iter::IntoIterator<Item = (K, V)>,
13304        K: std::convert::Into<std::string::String>,
13305        V: std::convert::Into<std::string::String>,
13306    {
13307        use std::iter::Iterator;
13308        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13309        self
13310    }
13311}
13312
13313impl wkt::message::Message for CustomMetadata {
13314    fn typename() -> &'static str {
13315        "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
13316    }
13317}
13318
13319/// Phase represents a collection of jobs that are logically grouped together
13320/// for a `Rollout`.
13321#[derive(Clone, Default, PartialEq)]
13322#[non_exhaustive]
13323pub struct Phase {
13324    /// Output only. The ID of the Phase.
13325    pub id: std::string::String,
13326
13327    /// Output only. Current state of the Phase.
13328    pub state: crate::model::phase::State,
13329
13330    /// Output only. Additional information on why the Phase was skipped, if
13331    /// available.
13332    pub skip_message: std::string::String,
13333
13334    /// The job composition of this Phase.
13335    pub jobs: std::option::Option<crate::model::phase::Jobs>,
13336
13337    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13338}
13339
13340impl Phase {
13341    pub fn new() -> Self {
13342        std::default::Default::default()
13343    }
13344
13345    /// Sets the value of [id][crate::model::Phase::id].
13346    ///
13347    /// # Example
13348    /// ```ignore,no_run
13349    /// # use google_cloud_deploy_v1::model::Phase;
13350    /// let x = Phase::new().set_id("example");
13351    /// ```
13352    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13353        self.id = v.into();
13354        self
13355    }
13356
13357    /// Sets the value of [state][crate::model::Phase::state].
13358    ///
13359    /// # Example
13360    /// ```ignore,no_run
13361    /// # use google_cloud_deploy_v1::model::Phase;
13362    /// use google_cloud_deploy_v1::model::phase::State;
13363    /// let x0 = Phase::new().set_state(State::Pending);
13364    /// let x1 = Phase::new().set_state(State::InProgress);
13365    /// let x2 = Phase::new().set_state(State::Succeeded);
13366    /// ```
13367    pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
13368        self.state = v.into();
13369        self
13370    }
13371
13372    /// Sets the value of [skip_message][crate::model::Phase::skip_message].
13373    ///
13374    /// # Example
13375    /// ```ignore,no_run
13376    /// # use google_cloud_deploy_v1::model::Phase;
13377    /// let x = Phase::new().set_skip_message("example");
13378    /// ```
13379    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13380        self.skip_message = v.into();
13381        self
13382    }
13383
13384    /// Sets the value of [jobs][crate::model::Phase::jobs].
13385    ///
13386    /// Note that all the setters affecting `jobs` are mutually
13387    /// exclusive.
13388    ///
13389    /// # Example
13390    /// ```ignore,no_run
13391    /// # use google_cloud_deploy_v1::model::Phase;
13392    /// use google_cloud_deploy_v1::model::DeploymentJobs;
13393    /// let x = Phase::new().set_jobs(Some(
13394    ///     google_cloud_deploy_v1::model::phase::Jobs::DeploymentJobs(DeploymentJobs::default().into())));
13395    /// ```
13396    pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
13397        mut self,
13398        v: T,
13399    ) -> Self {
13400        self.jobs = v.into();
13401        self
13402    }
13403
13404    /// The value of [jobs][crate::model::Phase::jobs]
13405    /// if it holds a `DeploymentJobs`, `None` if the field is not set or
13406    /// holds a different branch.
13407    pub fn deployment_jobs(
13408        &self,
13409    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
13410        #[allow(unreachable_patterns)]
13411        self.jobs.as_ref().and_then(|v| match v {
13412            crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
13413            _ => std::option::Option::None,
13414        })
13415    }
13416
13417    /// Sets the value of [jobs][crate::model::Phase::jobs]
13418    /// to hold a `DeploymentJobs`.
13419    ///
13420    /// Note that all the setters affecting `jobs` are
13421    /// mutually exclusive.
13422    ///
13423    /// # Example
13424    /// ```ignore,no_run
13425    /// # use google_cloud_deploy_v1::model::Phase;
13426    /// use google_cloud_deploy_v1::model::DeploymentJobs;
13427    /// let x = Phase::new().set_deployment_jobs(DeploymentJobs::default()/* use setters */);
13428    /// assert!(x.deployment_jobs().is_some());
13429    /// assert!(x.child_rollout_jobs().is_none());
13430    /// ```
13431    pub fn set_deployment_jobs<
13432        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
13433    >(
13434        mut self,
13435        v: T,
13436    ) -> Self {
13437        self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
13438        self
13439    }
13440
13441    /// The value of [jobs][crate::model::Phase::jobs]
13442    /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
13443    /// holds a different branch.
13444    pub fn child_rollout_jobs(
13445        &self,
13446    ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
13447        #[allow(unreachable_patterns)]
13448        self.jobs.as_ref().and_then(|v| match v {
13449            crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
13450            _ => std::option::Option::None,
13451        })
13452    }
13453
13454    /// Sets the value of [jobs][crate::model::Phase::jobs]
13455    /// to hold a `ChildRolloutJobs`.
13456    ///
13457    /// Note that all the setters affecting `jobs` are
13458    /// mutually exclusive.
13459    ///
13460    /// # Example
13461    /// ```ignore,no_run
13462    /// # use google_cloud_deploy_v1::model::Phase;
13463    /// use google_cloud_deploy_v1::model::ChildRolloutJobs;
13464    /// let x = Phase::new().set_child_rollout_jobs(ChildRolloutJobs::default()/* use setters */);
13465    /// assert!(x.child_rollout_jobs().is_some());
13466    /// assert!(x.deployment_jobs().is_none());
13467    /// ```
13468    pub fn set_child_rollout_jobs<
13469        T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
13470    >(
13471        mut self,
13472        v: T,
13473    ) -> Self {
13474        self.jobs =
13475            std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
13476        self
13477    }
13478}
13479
13480impl wkt::message::Message for Phase {
13481    fn typename() -> &'static str {
13482        "type.googleapis.com/google.cloud.deploy.v1.Phase"
13483    }
13484}
13485
13486/// Defines additional types related to [Phase].
13487pub mod phase {
13488    #[allow(unused_imports)]
13489    use super::*;
13490
13491    /// Valid states of a Phase.
13492    ///
13493    /// # Working with unknown values
13494    ///
13495    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13496    /// additional enum variants at any time. Adding new variants is not considered
13497    /// a breaking change. Applications should write their code in anticipation of:
13498    ///
13499    /// - New values appearing in future releases of the client library, **and**
13500    /// - New values received dynamically, without application changes.
13501    ///
13502    /// Please consult the [Working with enums] section in the user guide for some
13503    /// guidelines.
13504    ///
13505    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13506    #[derive(Clone, Debug, PartialEq)]
13507    #[non_exhaustive]
13508    pub enum State {
13509        /// The Phase has an unspecified state.
13510        Unspecified,
13511        /// The Phase is waiting for an earlier Phase(s) to complete.
13512        Pending,
13513        /// The Phase is in progress.
13514        InProgress,
13515        /// The Phase has succeeded.
13516        Succeeded,
13517        /// The Phase has failed.
13518        Failed,
13519        /// The Phase was aborted.
13520        Aborted,
13521        /// The Phase was skipped.
13522        Skipped,
13523        /// If set, the enum was initialized with an unknown value.
13524        ///
13525        /// Applications can examine the value using [State::value] or
13526        /// [State::name].
13527        UnknownValue(state::UnknownValue),
13528    }
13529
13530    #[doc(hidden)]
13531    pub mod state {
13532        #[allow(unused_imports)]
13533        use super::*;
13534        #[derive(Clone, Debug, PartialEq)]
13535        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13536    }
13537
13538    impl State {
13539        /// Gets the enum value.
13540        ///
13541        /// Returns `None` if the enum contains an unknown value deserialized from
13542        /// the string representation of enums.
13543        pub fn value(&self) -> std::option::Option<i32> {
13544            match self {
13545                Self::Unspecified => std::option::Option::Some(0),
13546                Self::Pending => std::option::Option::Some(1),
13547                Self::InProgress => std::option::Option::Some(2),
13548                Self::Succeeded => std::option::Option::Some(3),
13549                Self::Failed => std::option::Option::Some(4),
13550                Self::Aborted => std::option::Option::Some(5),
13551                Self::Skipped => std::option::Option::Some(6),
13552                Self::UnknownValue(u) => u.0.value(),
13553            }
13554        }
13555
13556        /// Gets the enum value as a string.
13557        ///
13558        /// Returns `None` if the enum contains an unknown value deserialized from
13559        /// the integer representation of enums.
13560        pub fn name(&self) -> std::option::Option<&str> {
13561            match self {
13562                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13563                Self::Pending => std::option::Option::Some("PENDING"),
13564                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
13565                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13566                Self::Failed => std::option::Option::Some("FAILED"),
13567                Self::Aborted => std::option::Option::Some("ABORTED"),
13568                Self::Skipped => std::option::Option::Some("SKIPPED"),
13569                Self::UnknownValue(u) => u.0.name(),
13570            }
13571        }
13572    }
13573
13574    impl std::default::Default for State {
13575        fn default() -> Self {
13576            use std::convert::From;
13577            Self::from(0)
13578        }
13579    }
13580
13581    impl std::fmt::Display for State {
13582        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13583            wkt::internal::display_enum(f, self.name(), self.value())
13584        }
13585    }
13586
13587    impl std::convert::From<i32> for State {
13588        fn from(value: i32) -> Self {
13589            match value {
13590                0 => Self::Unspecified,
13591                1 => Self::Pending,
13592                2 => Self::InProgress,
13593                3 => Self::Succeeded,
13594                4 => Self::Failed,
13595                5 => Self::Aborted,
13596                6 => Self::Skipped,
13597                _ => Self::UnknownValue(state::UnknownValue(
13598                    wkt::internal::UnknownEnumValue::Integer(value),
13599                )),
13600            }
13601        }
13602    }
13603
13604    impl std::convert::From<&str> for State {
13605        fn from(value: &str) -> Self {
13606            use std::string::ToString;
13607            match value {
13608                "STATE_UNSPECIFIED" => Self::Unspecified,
13609                "PENDING" => Self::Pending,
13610                "IN_PROGRESS" => Self::InProgress,
13611                "SUCCEEDED" => Self::Succeeded,
13612                "FAILED" => Self::Failed,
13613                "ABORTED" => Self::Aborted,
13614                "SKIPPED" => Self::Skipped,
13615                _ => Self::UnknownValue(state::UnknownValue(
13616                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13617                )),
13618            }
13619        }
13620    }
13621
13622    impl serde::ser::Serialize for State {
13623        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13624        where
13625            S: serde::Serializer,
13626        {
13627            match self {
13628                Self::Unspecified => serializer.serialize_i32(0),
13629                Self::Pending => serializer.serialize_i32(1),
13630                Self::InProgress => serializer.serialize_i32(2),
13631                Self::Succeeded => serializer.serialize_i32(3),
13632                Self::Failed => serializer.serialize_i32(4),
13633                Self::Aborted => serializer.serialize_i32(5),
13634                Self::Skipped => serializer.serialize_i32(6),
13635                Self::UnknownValue(u) => u.0.serialize(serializer),
13636            }
13637        }
13638    }
13639
13640    impl<'de> serde::de::Deserialize<'de> for State {
13641        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13642        where
13643            D: serde::Deserializer<'de>,
13644        {
13645            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13646                ".google.cloud.deploy.v1.Phase.State",
13647            ))
13648        }
13649    }
13650
13651    /// The job composition of this Phase.
13652    #[derive(Clone, Debug, PartialEq)]
13653    #[non_exhaustive]
13654    pub enum Jobs {
13655        /// Output only. Deployment job composition.
13656        DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
13657        /// Output only. ChildRollout job composition.
13658        ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
13659    }
13660}
13661
13662/// Deployment job composition.
13663#[derive(Clone, Default, PartialEq)]
13664#[non_exhaustive]
13665pub struct DeploymentJobs {
13666    /// Output only. The predeploy Job, which is the first job on the phase.
13667    pub predeploy_job: std::option::Option<crate::model::Job>,
13668
13669    /// Output only. The deploy Job. This is the deploy job in the phase.
13670    pub deploy_job: std::option::Option<crate::model::Job>,
13671
13672    /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
13673    pub verify_job: std::option::Option<crate::model::Job>,
13674
13675    /// Output only. The postdeploy Job, which is the last job on the phase.
13676    pub postdeploy_job: std::option::Option<crate::model::Job>,
13677
13678    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13679}
13680
13681impl DeploymentJobs {
13682    pub fn new() -> Self {
13683        std::default::Default::default()
13684    }
13685
13686    /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13687    ///
13688    /// # Example
13689    /// ```ignore,no_run
13690    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13691    /// use google_cloud_deploy_v1::model::Job;
13692    /// let x = DeploymentJobs::new().set_predeploy_job(Job::default()/* use setters */);
13693    /// ```
13694    pub fn set_predeploy_job<T>(mut self, v: T) -> Self
13695    where
13696        T: std::convert::Into<crate::model::Job>,
13697    {
13698        self.predeploy_job = std::option::Option::Some(v.into());
13699        self
13700    }
13701
13702    /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13703    ///
13704    /// # Example
13705    /// ```ignore,no_run
13706    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13707    /// use google_cloud_deploy_v1::model::Job;
13708    /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(Some(Job::default()/* use setters */));
13709    /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(None::<Job>);
13710    /// ```
13711    pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13712    where
13713        T: std::convert::Into<crate::model::Job>,
13714    {
13715        self.predeploy_job = v.map(|x| x.into());
13716        self
13717    }
13718
13719    /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13720    ///
13721    /// # Example
13722    /// ```ignore,no_run
13723    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13724    /// use google_cloud_deploy_v1::model::Job;
13725    /// let x = DeploymentJobs::new().set_deploy_job(Job::default()/* use setters */);
13726    /// ```
13727    pub fn set_deploy_job<T>(mut self, v: T) -> Self
13728    where
13729        T: std::convert::Into<crate::model::Job>,
13730    {
13731        self.deploy_job = std::option::Option::Some(v.into());
13732        self
13733    }
13734
13735    /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13736    ///
13737    /// # Example
13738    /// ```ignore,no_run
13739    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13740    /// use google_cloud_deploy_v1::model::Job;
13741    /// let x = DeploymentJobs::new().set_or_clear_deploy_job(Some(Job::default()/* use setters */));
13742    /// let x = DeploymentJobs::new().set_or_clear_deploy_job(None::<Job>);
13743    /// ```
13744    pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13745    where
13746        T: std::convert::Into<crate::model::Job>,
13747    {
13748        self.deploy_job = v.map(|x| x.into());
13749        self
13750    }
13751
13752    /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13753    ///
13754    /// # Example
13755    /// ```ignore,no_run
13756    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13757    /// use google_cloud_deploy_v1::model::Job;
13758    /// let x = DeploymentJobs::new().set_verify_job(Job::default()/* use setters */);
13759    /// ```
13760    pub fn set_verify_job<T>(mut self, v: T) -> Self
13761    where
13762        T: std::convert::Into<crate::model::Job>,
13763    {
13764        self.verify_job = std::option::Option::Some(v.into());
13765        self
13766    }
13767
13768    /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13769    ///
13770    /// # Example
13771    /// ```ignore,no_run
13772    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13773    /// use google_cloud_deploy_v1::model::Job;
13774    /// let x = DeploymentJobs::new().set_or_clear_verify_job(Some(Job::default()/* use setters */));
13775    /// let x = DeploymentJobs::new().set_or_clear_verify_job(None::<Job>);
13776    /// ```
13777    pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
13778    where
13779        T: std::convert::Into<crate::model::Job>,
13780    {
13781        self.verify_job = v.map(|x| x.into());
13782        self
13783    }
13784
13785    /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13786    ///
13787    /// # Example
13788    /// ```ignore,no_run
13789    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13790    /// use google_cloud_deploy_v1::model::Job;
13791    /// let x = DeploymentJobs::new().set_postdeploy_job(Job::default()/* use setters */);
13792    /// ```
13793    pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
13794    where
13795        T: std::convert::Into<crate::model::Job>,
13796    {
13797        self.postdeploy_job = std::option::Option::Some(v.into());
13798        self
13799    }
13800
13801    /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13802    ///
13803    /// # Example
13804    /// ```ignore,no_run
13805    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13806    /// use google_cloud_deploy_v1::model::Job;
13807    /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(Some(Job::default()/* use setters */));
13808    /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(None::<Job>);
13809    /// ```
13810    pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13811    where
13812        T: std::convert::Into<crate::model::Job>,
13813    {
13814        self.postdeploy_job = v.map(|x| x.into());
13815        self
13816    }
13817}
13818
13819impl wkt::message::Message for DeploymentJobs {
13820    fn typename() -> &'static str {
13821        "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
13822    }
13823}
13824
13825/// ChildRollouts job composition
13826#[derive(Clone, Default, PartialEq)]
13827#[non_exhaustive]
13828pub struct ChildRolloutJobs {
13829    /// Output only. List of CreateChildRolloutJobs
13830    pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
13831
13832    /// Output only. List of AdvanceChildRolloutJobs
13833    pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
13834
13835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13836}
13837
13838impl ChildRolloutJobs {
13839    pub fn new() -> Self {
13840        std::default::Default::default()
13841    }
13842
13843    /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
13844    ///
13845    /// # Example
13846    /// ```ignore,no_run
13847    /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13848    /// use google_cloud_deploy_v1::model::Job;
13849    /// let x = ChildRolloutJobs::new()
13850    ///     .set_create_rollout_jobs([
13851    ///         Job::default()/* use setters */,
13852    ///         Job::default()/* use (different) setters */,
13853    ///     ]);
13854    /// ```
13855    pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
13856    where
13857        T: std::iter::IntoIterator<Item = V>,
13858        V: std::convert::Into<crate::model::Job>,
13859    {
13860        use std::iter::Iterator;
13861        self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13862        self
13863    }
13864
13865    /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
13866    ///
13867    /// # Example
13868    /// ```ignore,no_run
13869    /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13870    /// use google_cloud_deploy_v1::model::Job;
13871    /// let x = ChildRolloutJobs::new()
13872    ///     .set_advance_rollout_jobs([
13873    ///         Job::default()/* use setters */,
13874    ///         Job::default()/* use (different) setters */,
13875    ///     ]);
13876    /// ```
13877    pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
13878    where
13879        T: std::iter::IntoIterator<Item = V>,
13880        V: std::convert::Into<crate::model::Job>,
13881    {
13882        use std::iter::Iterator;
13883        self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13884        self
13885    }
13886}
13887
13888impl wkt::message::Message for ChildRolloutJobs {
13889    fn typename() -> &'static str {
13890        "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
13891    }
13892}
13893
13894/// Job represents an operation for a `Rollout`.
13895#[derive(Clone, Default, PartialEq)]
13896#[non_exhaustive]
13897pub struct Job {
13898    /// Output only. The ID of the Job.
13899    pub id: std::string::String,
13900
13901    /// Output only. The current state of the Job.
13902    pub state: crate::model::job::State,
13903
13904    /// Output only. Additional information on why the Job was skipped, if
13905    /// available.
13906    pub skip_message: std::string::String,
13907
13908    /// Output only. The name of the `JobRun` responsible for the most recent
13909    /// invocation of this Job.
13910    pub job_run: std::string::String,
13911
13912    /// The type of Job.
13913    pub job_type: std::option::Option<crate::model::job::JobType>,
13914
13915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13916}
13917
13918impl Job {
13919    pub fn new() -> Self {
13920        std::default::Default::default()
13921    }
13922
13923    /// Sets the value of [id][crate::model::Job::id].
13924    ///
13925    /// # Example
13926    /// ```ignore,no_run
13927    /// # use google_cloud_deploy_v1::model::Job;
13928    /// let x = Job::new().set_id("example");
13929    /// ```
13930    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13931        self.id = v.into();
13932        self
13933    }
13934
13935    /// Sets the value of [state][crate::model::Job::state].
13936    ///
13937    /// # Example
13938    /// ```ignore,no_run
13939    /// # use google_cloud_deploy_v1::model::Job;
13940    /// use google_cloud_deploy_v1::model::job::State;
13941    /// let x0 = Job::new().set_state(State::Pending);
13942    /// let x1 = Job::new().set_state(State::Disabled);
13943    /// let x2 = Job::new().set_state(State::InProgress);
13944    /// ```
13945    pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
13946        self.state = v.into();
13947        self
13948    }
13949
13950    /// Sets the value of [skip_message][crate::model::Job::skip_message].
13951    ///
13952    /// # Example
13953    /// ```ignore,no_run
13954    /// # use google_cloud_deploy_v1::model::Job;
13955    /// let x = Job::new().set_skip_message("example");
13956    /// ```
13957    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13958        self.skip_message = v.into();
13959        self
13960    }
13961
13962    /// Sets the value of [job_run][crate::model::Job::job_run].
13963    ///
13964    /// # Example
13965    /// ```ignore,no_run
13966    /// # use google_cloud_deploy_v1::model::Job;
13967    /// let x = Job::new().set_job_run("example");
13968    /// ```
13969    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13970        self.job_run = v.into();
13971        self
13972    }
13973
13974    /// Sets the value of [job_type][crate::model::Job::job_type].
13975    ///
13976    /// Note that all the setters affecting `job_type` are mutually
13977    /// exclusive.
13978    ///
13979    /// # Example
13980    /// ```ignore,no_run
13981    /// # use google_cloud_deploy_v1::model::Job;
13982    /// use google_cloud_deploy_v1::model::DeployJob;
13983    /// let x = Job::new().set_job_type(Some(
13984    ///     google_cloud_deploy_v1::model::job::JobType::DeployJob(DeployJob::default().into())));
13985    /// ```
13986    pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
13987        mut self,
13988        v: T,
13989    ) -> Self {
13990        self.job_type = v.into();
13991        self
13992    }
13993
13994    /// The value of [job_type][crate::model::Job::job_type]
13995    /// if it holds a `DeployJob`, `None` if the field is not set or
13996    /// holds a different branch.
13997    pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
13998        #[allow(unreachable_patterns)]
13999        self.job_type.as_ref().and_then(|v| match v {
14000            crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
14001            _ => std::option::Option::None,
14002        })
14003    }
14004
14005    /// Sets the value of [job_type][crate::model::Job::job_type]
14006    /// to hold a `DeployJob`.
14007    ///
14008    /// Note that all the setters affecting `job_type` are
14009    /// mutually exclusive.
14010    ///
14011    /// # Example
14012    /// ```ignore,no_run
14013    /// # use google_cloud_deploy_v1::model::Job;
14014    /// use google_cloud_deploy_v1::model::DeployJob;
14015    /// let x = Job::new().set_deploy_job(DeployJob::default()/* use setters */);
14016    /// assert!(x.deploy_job().is_some());
14017    /// assert!(x.verify_job().is_none());
14018    /// assert!(x.predeploy_job().is_none());
14019    /// assert!(x.postdeploy_job().is_none());
14020    /// assert!(x.create_child_rollout_job().is_none());
14021    /// assert!(x.advance_child_rollout_job().is_none());
14022    /// ```
14023    pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
14024        mut self,
14025        v: T,
14026    ) -> Self {
14027        self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
14028        self
14029    }
14030
14031    /// The value of [job_type][crate::model::Job::job_type]
14032    /// if it holds a `VerifyJob`, `None` if the field is not set or
14033    /// holds a different branch.
14034    pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
14035        #[allow(unreachable_patterns)]
14036        self.job_type.as_ref().and_then(|v| match v {
14037            crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
14038            _ => std::option::Option::None,
14039        })
14040    }
14041
14042    /// Sets the value of [job_type][crate::model::Job::job_type]
14043    /// to hold a `VerifyJob`.
14044    ///
14045    /// Note that all the setters affecting `job_type` are
14046    /// mutually exclusive.
14047    ///
14048    /// # Example
14049    /// ```ignore,no_run
14050    /// # use google_cloud_deploy_v1::model::Job;
14051    /// use google_cloud_deploy_v1::model::VerifyJob;
14052    /// let x = Job::new().set_verify_job(VerifyJob::default()/* use setters */);
14053    /// assert!(x.verify_job().is_some());
14054    /// assert!(x.deploy_job().is_none());
14055    /// assert!(x.predeploy_job().is_none());
14056    /// assert!(x.postdeploy_job().is_none());
14057    /// assert!(x.create_child_rollout_job().is_none());
14058    /// assert!(x.advance_child_rollout_job().is_none());
14059    /// ```
14060    pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
14061        mut self,
14062        v: T,
14063    ) -> Self {
14064        self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
14065        self
14066    }
14067
14068    /// The value of [job_type][crate::model::Job::job_type]
14069    /// if it holds a `PredeployJob`, `None` if the field is not set or
14070    /// holds a different branch.
14071    pub fn predeploy_job(
14072        &self,
14073    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
14074        #[allow(unreachable_patterns)]
14075        self.job_type.as_ref().and_then(|v| match v {
14076            crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
14077            _ => std::option::Option::None,
14078        })
14079    }
14080
14081    /// Sets the value of [job_type][crate::model::Job::job_type]
14082    /// to hold a `PredeployJob`.
14083    ///
14084    /// Note that all the setters affecting `job_type` are
14085    /// mutually exclusive.
14086    ///
14087    /// # Example
14088    /// ```ignore,no_run
14089    /// # use google_cloud_deploy_v1::model::Job;
14090    /// use google_cloud_deploy_v1::model::PredeployJob;
14091    /// let x = Job::new().set_predeploy_job(PredeployJob::default()/* use setters */);
14092    /// assert!(x.predeploy_job().is_some());
14093    /// assert!(x.deploy_job().is_none());
14094    /// assert!(x.verify_job().is_none());
14095    /// assert!(x.postdeploy_job().is_none());
14096    /// assert!(x.create_child_rollout_job().is_none());
14097    /// assert!(x.advance_child_rollout_job().is_none());
14098    /// ```
14099    pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
14100        mut self,
14101        v: T,
14102    ) -> Self {
14103        self.job_type =
14104            std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
14105        self
14106    }
14107
14108    /// The value of [job_type][crate::model::Job::job_type]
14109    /// if it holds a `PostdeployJob`, `None` if the field is not set or
14110    /// holds a different branch.
14111    pub fn postdeploy_job(
14112        &self,
14113    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
14114        #[allow(unreachable_patterns)]
14115        self.job_type.as_ref().and_then(|v| match v {
14116            crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
14117            _ => std::option::Option::None,
14118        })
14119    }
14120
14121    /// Sets the value of [job_type][crate::model::Job::job_type]
14122    /// to hold a `PostdeployJob`.
14123    ///
14124    /// Note that all the setters affecting `job_type` are
14125    /// mutually exclusive.
14126    ///
14127    /// # Example
14128    /// ```ignore,no_run
14129    /// # use google_cloud_deploy_v1::model::Job;
14130    /// use google_cloud_deploy_v1::model::PostdeployJob;
14131    /// let x = Job::new().set_postdeploy_job(PostdeployJob::default()/* use setters */);
14132    /// assert!(x.postdeploy_job().is_some());
14133    /// assert!(x.deploy_job().is_none());
14134    /// assert!(x.verify_job().is_none());
14135    /// assert!(x.predeploy_job().is_none());
14136    /// assert!(x.create_child_rollout_job().is_none());
14137    /// assert!(x.advance_child_rollout_job().is_none());
14138    /// ```
14139    pub fn set_postdeploy_job<
14140        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
14141    >(
14142        mut self,
14143        v: T,
14144    ) -> Self {
14145        self.job_type =
14146            std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
14147        self
14148    }
14149
14150    /// The value of [job_type][crate::model::Job::job_type]
14151    /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
14152    /// holds a different branch.
14153    pub fn create_child_rollout_job(
14154        &self,
14155    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
14156        #[allow(unreachable_patterns)]
14157        self.job_type.as_ref().and_then(|v| match v {
14158            crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
14159            _ => std::option::Option::None,
14160        })
14161    }
14162
14163    /// Sets the value of [job_type][crate::model::Job::job_type]
14164    /// to hold a `CreateChildRolloutJob`.
14165    ///
14166    /// Note that all the setters affecting `job_type` are
14167    /// mutually exclusive.
14168    ///
14169    /// # Example
14170    /// ```ignore,no_run
14171    /// # use google_cloud_deploy_v1::model::Job;
14172    /// use google_cloud_deploy_v1::model::CreateChildRolloutJob;
14173    /// let x = Job::new().set_create_child_rollout_job(CreateChildRolloutJob::default()/* use setters */);
14174    /// assert!(x.create_child_rollout_job().is_some());
14175    /// assert!(x.deploy_job().is_none());
14176    /// assert!(x.verify_job().is_none());
14177    /// assert!(x.predeploy_job().is_none());
14178    /// assert!(x.postdeploy_job().is_none());
14179    /// assert!(x.advance_child_rollout_job().is_none());
14180    /// ```
14181    pub fn set_create_child_rollout_job<
14182        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
14183    >(
14184        mut self,
14185        v: T,
14186    ) -> Self {
14187        self.job_type =
14188            std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
14189        self
14190    }
14191
14192    /// The value of [job_type][crate::model::Job::job_type]
14193    /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
14194    /// holds a different branch.
14195    pub fn advance_child_rollout_job(
14196        &self,
14197    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
14198        #[allow(unreachable_patterns)]
14199        self.job_type.as_ref().and_then(|v| match v {
14200            crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
14201            _ => std::option::Option::None,
14202        })
14203    }
14204
14205    /// Sets the value of [job_type][crate::model::Job::job_type]
14206    /// to hold a `AdvanceChildRolloutJob`.
14207    ///
14208    /// Note that all the setters affecting `job_type` are
14209    /// mutually exclusive.
14210    ///
14211    /// # Example
14212    /// ```ignore,no_run
14213    /// # use google_cloud_deploy_v1::model::Job;
14214    /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJob;
14215    /// let x = Job::new().set_advance_child_rollout_job(AdvanceChildRolloutJob::default()/* use setters */);
14216    /// assert!(x.advance_child_rollout_job().is_some());
14217    /// assert!(x.deploy_job().is_none());
14218    /// assert!(x.verify_job().is_none());
14219    /// assert!(x.predeploy_job().is_none());
14220    /// assert!(x.postdeploy_job().is_none());
14221    /// assert!(x.create_child_rollout_job().is_none());
14222    /// ```
14223    pub fn set_advance_child_rollout_job<
14224        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
14225    >(
14226        mut self,
14227        v: T,
14228    ) -> Self {
14229        self.job_type =
14230            std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
14231        self
14232    }
14233}
14234
14235impl wkt::message::Message for Job {
14236    fn typename() -> &'static str {
14237        "type.googleapis.com/google.cloud.deploy.v1.Job"
14238    }
14239}
14240
14241/// Defines additional types related to [Job].
14242pub mod job {
14243    #[allow(unused_imports)]
14244    use super::*;
14245
14246    /// Valid states of a Job.
14247    ///
14248    /// # Working with unknown values
14249    ///
14250    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14251    /// additional enum variants at any time. Adding new variants is not considered
14252    /// a breaking change. Applications should write their code in anticipation of:
14253    ///
14254    /// - New values appearing in future releases of the client library, **and**
14255    /// - New values received dynamically, without application changes.
14256    ///
14257    /// Please consult the [Working with enums] section in the user guide for some
14258    /// guidelines.
14259    ///
14260    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14261    #[derive(Clone, Debug, PartialEq)]
14262    #[non_exhaustive]
14263    pub enum State {
14264        /// The Job has an unspecified state.
14265        Unspecified,
14266        /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
14267        Pending,
14268        /// The Job is disabled.
14269        Disabled,
14270        /// The Job is in progress.
14271        InProgress,
14272        /// The Job succeeded.
14273        Succeeded,
14274        /// The Job failed.
14275        Failed,
14276        /// The Job was aborted.
14277        Aborted,
14278        /// The Job was skipped.
14279        Skipped,
14280        /// The Job was ignored.
14281        Ignored,
14282        /// If set, the enum was initialized with an unknown value.
14283        ///
14284        /// Applications can examine the value using [State::value] or
14285        /// [State::name].
14286        UnknownValue(state::UnknownValue),
14287    }
14288
14289    #[doc(hidden)]
14290    pub mod state {
14291        #[allow(unused_imports)]
14292        use super::*;
14293        #[derive(Clone, Debug, PartialEq)]
14294        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14295    }
14296
14297    impl State {
14298        /// Gets the enum value.
14299        ///
14300        /// Returns `None` if the enum contains an unknown value deserialized from
14301        /// the string representation of enums.
14302        pub fn value(&self) -> std::option::Option<i32> {
14303            match self {
14304                Self::Unspecified => std::option::Option::Some(0),
14305                Self::Pending => std::option::Option::Some(1),
14306                Self::Disabled => std::option::Option::Some(2),
14307                Self::InProgress => std::option::Option::Some(3),
14308                Self::Succeeded => std::option::Option::Some(4),
14309                Self::Failed => std::option::Option::Some(5),
14310                Self::Aborted => std::option::Option::Some(6),
14311                Self::Skipped => std::option::Option::Some(7),
14312                Self::Ignored => std::option::Option::Some(8),
14313                Self::UnknownValue(u) => u.0.value(),
14314            }
14315        }
14316
14317        /// Gets the enum value as a string.
14318        ///
14319        /// Returns `None` if the enum contains an unknown value deserialized from
14320        /// the integer representation of enums.
14321        pub fn name(&self) -> std::option::Option<&str> {
14322            match self {
14323                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14324                Self::Pending => std::option::Option::Some("PENDING"),
14325                Self::Disabled => std::option::Option::Some("DISABLED"),
14326                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
14327                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14328                Self::Failed => std::option::Option::Some("FAILED"),
14329                Self::Aborted => std::option::Option::Some("ABORTED"),
14330                Self::Skipped => std::option::Option::Some("SKIPPED"),
14331                Self::Ignored => std::option::Option::Some("IGNORED"),
14332                Self::UnknownValue(u) => u.0.name(),
14333            }
14334        }
14335    }
14336
14337    impl std::default::Default for State {
14338        fn default() -> Self {
14339            use std::convert::From;
14340            Self::from(0)
14341        }
14342    }
14343
14344    impl std::fmt::Display for State {
14345        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14346            wkt::internal::display_enum(f, self.name(), self.value())
14347        }
14348    }
14349
14350    impl std::convert::From<i32> for State {
14351        fn from(value: i32) -> Self {
14352            match value {
14353                0 => Self::Unspecified,
14354                1 => Self::Pending,
14355                2 => Self::Disabled,
14356                3 => Self::InProgress,
14357                4 => Self::Succeeded,
14358                5 => Self::Failed,
14359                6 => Self::Aborted,
14360                7 => Self::Skipped,
14361                8 => Self::Ignored,
14362                _ => Self::UnknownValue(state::UnknownValue(
14363                    wkt::internal::UnknownEnumValue::Integer(value),
14364                )),
14365            }
14366        }
14367    }
14368
14369    impl std::convert::From<&str> for State {
14370        fn from(value: &str) -> Self {
14371            use std::string::ToString;
14372            match value {
14373                "STATE_UNSPECIFIED" => Self::Unspecified,
14374                "PENDING" => Self::Pending,
14375                "DISABLED" => Self::Disabled,
14376                "IN_PROGRESS" => Self::InProgress,
14377                "SUCCEEDED" => Self::Succeeded,
14378                "FAILED" => Self::Failed,
14379                "ABORTED" => Self::Aborted,
14380                "SKIPPED" => Self::Skipped,
14381                "IGNORED" => Self::Ignored,
14382                _ => Self::UnknownValue(state::UnknownValue(
14383                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14384                )),
14385            }
14386        }
14387    }
14388
14389    impl serde::ser::Serialize for State {
14390        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14391        where
14392            S: serde::Serializer,
14393        {
14394            match self {
14395                Self::Unspecified => serializer.serialize_i32(0),
14396                Self::Pending => serializer.serialize_i32(1),
14397                Self::Disabled => serializer.serialize_i32(2),
14398                Self::InProgress => serializer.serialize_i32(3),
14399                Self::Succeeded => serializer.serialize_i32(4),
14400                Self::Failed => serializer.serialize_i32(5),
14401                Self::Aborted => serializer.serialize_i32(6),
14402                Self::Skipped => serializer.serialize_i32(7),
14403                Self::Ignored => serializer.serialize_i32(8),
14404                Self::UnknownValue(u) => u.0.serialize(serializer),
14405            }
14406        }
14407    }
14408
14409    impl<'de> serde::de::Deserialize<'de> for State {
14410        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14411        where
14412            D: serde::Deserializer<'de>,
14413        {
14414            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14415                ".google.cloud.deploy.v1.Job.State",
14416            ))
14417        }
14418    }
14419
14420    /// The type of Job.
14421    #[derive(Clone, Debug, PartialEq)]
14422    #[non_exhaustive]
14423    pub enum JobType {
14424        /// Output only. A deploy Job.
14425        DeployJob(std::boxed::Box<crate::model::DeployJob>),
14426        /// Output only. A verify Job.
14427        VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
14428        /// Output only. A predeploy Job.
14429        PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
14430        /// Output only. A postdeploy Job.
14431        PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
14432        /// Output only. A createChildRollout Job.
14433        CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
14434        /// Output only. An advanceChildRollout Job.
14435        AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
14436    }
14437}
14438
14439/// A deploy Job.
14440#[derive(Clone, Default, PartialEq)]
14441#[non_exhaustive]
14442pub struct DeployJob {
14443    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14444}
14445
14446impl DeployJob {
14447    pub fn new() -> Self {
14448        std::default::Default::default()
14449    }
14450}
14451
14452impl wkt::message::Message for DeployJob {
14453    fn typename() -> &'static str {
14454        "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
14455    }
14456}
14457
14458/// A verify Job.
14459#[derive(Clone, Default, PartialEq)]
14460#[non_exhaustive]
14461pub struct VerifyJob {
14462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14463}
14464
14465impl VerifyJob {
14466    pub fn new() -> Self {
14467        std::default::Default::default()
14468    }
14469}
14470
14471impl wkt::message::Message for VerifyJob {
14472    fn typename() -> &'static str {
14473        "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
14474    }
14475}
14476
14477/// A predeploy Job.
14478#[derive(Clone, Default, PartialEq)]
14479#[non_exhaustive]
14480pub struct PredeployJob {
14481    /// Output only. The custom actions that the predeploy Job executes.
14482    pub actions: std::vec::Vec<std::string::String>,
14483
14484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14485}
14486
14487impl PredeployJob {
14488    pub fn new() -> Self {
14489        std::default::Default::default()
14490    }
14491
14492    /// Sets the value of [actions][crate::model::PredeployJob::actions].
14493    ///
14494    /// # Example
14495    /// ```ignore,no_run
14496    /// # use google_cloud_deploy_v1::model::PredeployJob;
14497    /// let x = PredeployJob::new().set_actions(["a", "b", "c"]);
14498    /// ```
14499    pub fn set_actions<T, V>(mut self, v: T) -> Self
14500    where
14501        T: std::iter::IntoIterator<Item = V>,
14502        V: std::convert::Into<std::string::String>,
14503    {
14504        use std::iter::Iterator;
14505        self.actions = v.into_iter().map(|i| i.into()).collect();
14506        self
14507    }
14508}
14509
14510impl wkt::message::Message for PredeployJob {
14511    fn typename() -> &'static str {
14512        "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
14513    }
14514}
14515
14516/// A postdeploy Job.
14517#[derive(Clone, Default, PartialEq)]
14518#[non_exhaustive]
14519pub struct PostdeployJob {
14520    /// Output only. The custom actions that the postdeploy Job executes.
14521    pub actions: std::vec::Vec<std::string::String>,
14522
14523    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14524}
14525
14526impl PostdeployJob {
14527    pub fn new() -> Self {
14528        std::default::Default::default()
14529    }
14530
14531    /// Sets the value of [actions][crate::model::PostdeployJob::actions].
14532    ///
14533    /// # Example
14534    /// ```ignore,no_run
14535    /// # use google_cloud_deploy_v1::model::PostdeployJob;
14536    /// let x = PostdeployJob::new().set_actions(["a", "b", "c"]);
14537    /// ```
14538    pub fn set_actions<T, V>(mut self, v: T) -> Self
14539    where
14540        T: std::iter::IntoIterator<Item = V>,
14541        V: std::convert::Into<std::string::String>,
14542    {
14543        use std::iter::Iterator;
14544        self.actions = v.into_iter().map(|i| i.into()).collect();
14545        self
14546    }
14547}
14548
14549impl wkt::message::Message for PostdeployJob {
14550    fn typename() -> &'static str {
14551        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
14552    }
14553}
14554
14555/// A createChildRollout Job.
14556#[derive(Clone, Default, PartialEq)]
14557#[non_exhaustive]
14558pub struct CreateChildRolloutJob {
14559    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14560}
14561
14562impl CreateChildRolloutJob {
14563    pub fn new() -> Self {
14564        std::default::Default::default()
14565    }
14566}
14567
14568impl wkt::message::Message for CreateChildRolloutJob {
14569    fn typename() -> &'static str {
14570        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
14571    }
14572}
14573
14574/// An advanceChildRollout Job.
14575#[derive(Clone, Default, PartialEq)]
14576#[non_exhaustive]
14577pub struct AdvanceChildRolloutJob {
14578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14579}
14580
14581impl AdvanceChildRolloutJob {
14582    pub fn new() -> Self {
14583        std::default::Default::default()
14584    }
14585}
14586
14587impl wkt::message::Message for AdvanceChildRolloutJob {
14588    fn typename() -> &'static str {
14589        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
14590    }
14591}
14592
14593/// ListRolloutsRequest is the request object used by `ListRollouts`.
14594#[derive(Clone, Default, PartialEq)]
14595#[non_exhaustive]
14596pub struct ListRolloutsRequest {
14597    /// Required. The `Release` which owns this collection of `Rollout` objects.
14598    pub parent: std::string::String,
14599
14600    /// Optional. The maximum number of `Rollout` objects to return. The service
14601    /// may return fewer than this value. If unspecified, at most 50 `Rollout`
14602    /// objects will be returned. The maximum value is 1000; values above 1000 will
14603    /// be set to 1000.
14604    pub page_size: i32,
14605
14606    /// Optional. A page token, received from a previous `ListRollouts` call.
14607    /// Provide this to retrieve the subsequent page.
14608    ///
14609    /// When paginating, all other provided parameters match
14610    /// the call that provided the page token.
14611    pub page_token: std::string::String,
14612
14613    /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
14614    /// for more details.
14615    pub filter: std::string::String,
14616
14617    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
14618    /// more details.
14619    pub order_by: std::string::String,
14620
14621    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14622}
14623
14624impl ListRolloutsRequest {
14625    pub fn new() -> Self {
14626        std::default::Default::default()
14627    }
14628
14629    /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
14630    ///
14631    /// # Example
14632    /// ```ignore,no_run
14633    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14634    /// let x = ListRolloutsRequest::new().set_parent("example");
14635    /// ```
14636    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14637        self.parent = v.into();
14638        self
14639    }
14640
14641    /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
14642    ///
14643    /// # Example
14644    /// ```ignore,no_run
14645    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14646    /// let x = ListRolloutsRequest::new().set_page_size(42);
14647    /// ```
14648    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14649        self.page_size = v.into();
14650        self
14651    }
14652
14653    /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
14654    ///
14655    /// # Example
14656    /// ```ignore,no_run
14657    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14658    /// let x = ListRolloutsRequest::new().set_page_token("example");
14659    /// ```
14660    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14661        self.page_token = v.into();
14662        self
14663    }
14664
14665    /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
14666    ///
14667    /// # Example
14668    /// ```ignore,no_run
14669    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14670    /// let x = ListRolloutsRequest::new().set_filter("example");
14671    /// ```
14672    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14673        self.filter = v.into();
14674        self
14675    }
14676
14677    /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
14678    ///
14679    /// # Example
14680    /// ```ignore,no_run
14681    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14682    /// let x = ListRolloutsRequest::new().set_order_by("example");
14683    /// ```
14684    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14685        self.order_by = v.into();
14686        self
14687    }
14688}
14689
14690impl wkt::message::Message for ListRolloutsRequest {
14691    fn typename() -> &'static str {
14692        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
14693    }
14694}
14695
14696/// ListRolloutsResponse is the response object returned by `ListRollouts`.
14697#[derive(Clone, Default, PartialEq)]
14698#[non_exhaustive]
14699pub struct ListRolloutsResponse {
14700    /// The `Rollout` objects.
14701    pub rollouts: std::vec::Vec<crate::model::Rollout>,
14702
14703    /// A token, which can be sent as `page_token` to retrieve the next page.
14704    /// If this field is omitted, there are no subsequent pages.
14705    pub next_page_token: std::string::String,
14706
14707    /// Locations that could not be reached.
14708    pub unreachable: std::vec::Vec<std::string::String>,
14709
14710    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14711}
14712
14713impl ListRolloutsResponse {
14714    pub fn new() -> Self {
14715        std::default::Default::default()
14716    }
14717
14718    /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
14719    ///
14720    /// # Example
14721    /// ```ignore,no_run
14722    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14723    /// use google_cloud_deploy_v1::model::Rollout;
14724    /// let x = ListRolloutsResponse::new()
14725    ///     .set_rollouts([
14726    ///         Rollout::default()/* use setters */,
14727    ///         Rollout::default()/* use (different) setters */,
14728    ///     ]);
14729    /// ```
14730    pub fn set_rollouts<T, V>(mut self, v: T) -> Self
14731    where
14732        T: std::iter::IntoIterator<Item = V>,
14733        V: std::convert::Into<crate::model::Rollout>,
14734    {
14735        use std::iter::Iterator;
14736        self.rollouts = v.into_iter().map(|i| i.into()).collect();
14737        self
14738    }
14739
14740    /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
14741    ///
14742    /// # Example
14743    /// ```ignore,no_run
14744    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14745    /// let x = ListRolloutsResponse::new().set_next_page_token("example");
14746    /// ```
14747    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14748        self.next_page_token = v.into();
14749        self
14750    }
14751
14752    /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
14753    ///
14754    /// # Example
14755    /// ```ignore,no_run
14756    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14757    /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
14758    /// ```
14759    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14760    where
14761        T: std::iter::IntoIterator<Item = V>,
14762        V: std::convert::Into<std::string::String>,
14763    {
14764        use std::iter::Iterator;
14765        self.unreachable = v.into_iter().map(|i| i.into()).collect();
14766        self
14767    }
14768}
14769
14770impl wkt::message::Message for ListRolloutsResponse {
14771    fn typename() -> &'static str {
14772        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
14773    }
14774}
14775
14776#[doc(hidden)]
14777impl gax::paginator::internal::PageableResponse for ListRolloutsResponse {
14778    type PageItem = crate::model::Rollout;
14779
14780    fn items(self) -> std::vec::Vec<Self::PageItem> {
14781        self.rollouts
14782    }
14783
14784    fn next_page_token(&self) -> std::string::String {
14785        use std::clone::Clone;
14786        self.next_page_token.clone()
14787    }
14788}
14789
14790/// GetRolloutRequest is the request object used by `GetRollout`.
14791#[derive(Clone, Default, PartialEq)]
14792#[non_exhaustive]
14793pub struct GetRolloutRequest {
14794    /// Required. Name of the `Rollout`. Format must be
14795    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
14796    pub name: std::string::String,
14797
14798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14799}
14800
14801impl GetRolloutRequest {
14802    pub fn new() -> Self {
14803        std::default::Default::default()
14804    }
14805
14806    /// Sets the value of [name][crate::model::GetRolloutRequest::name].
14807    ///
14808    /// # Example
14809    /// ```ignore,no_run
14810    /// # use google_cloud_deploy_v1::model::GetRolloutRequest;
14811    /// let x = GetRolloutRequest::new().set_name("example");
14812    /// ```
14813    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14814        self.name = v.into();
14815        self
14816    }
14817}
14818
14819impl wkt::message::Message for GetRolloutRequest {
14820    fn typename() -> &'static str {
14821        "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
14822    }
14823}
14824
14825/// CreateRolloutRequest is the request object used by `CreateRollout`.
14826#[derive(Clone, Default, PartialEq)]
14827#[non_exhaustive]
14828pub struct CreateRolloutRequest {
14829    /// Required. The parent collection in which the `Rollout` must be created.
14830    /// The format is
14831    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
14832    pub parent: std::string::String,
14833
14834    /// Required. ID of the `Rollout`.
14835    pub rollout_id: std::string::String,
14836
14837    /// Required. The `Rollout` to create.
14838    pub rollout: std::option::Option<crate::model::Rollout>,
14839
14840    /// Optional. A request ID to identify requests. Specify a unique request ID
14841    /// so that if you must retry your request, the server knows to ignore the
14842    /// request if it has already been completed. The server guarantees that for
14843    /// at least 60 minutes after the first request.
14844    ///
14845    /// For example, consider a situation where you make an initial request and the
14846    /// request times out. If you make the request again with the same request ID,
14847    /// the server can check if original operation with the same request ID was
14848    /// received, and if so, will ignore the second request. This prevents clients
14849    /// from accidentally creating duplicate commitments.
14850    ///
14851    /// The request ID must be a valid UUID with the exception that zero UUID is
14852    /// not supported (00000000-0000-0000-0000-000000000000).
14853    pub request_id: std::string::String,
14854
14855    /// Optional. If set to true, the request is validated and the user is provided
14856    /// with an expected result, but no actual change is made.
14857    pub validate_only: bool,
14858
14859    /// Optional. Deploy policies to override. Format is
14860    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
14861    pub override_deploy_policy: std::vec::Vec<std::string::String>,
14862
14863    /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
14864    /// will start at the first phase.
14865    pub starting_phase_id: std::string::String,
14866
14867    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14868}
14869
14870impl CreateRolloutRequest {
14871    pub fn new() -> Self {
14872        std::default::Default::default()
14873    }
14874
14875    /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
14876    ///
14877    /// # Example
14878    /// ```ignore,no_run
14879    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14880    /// let x = CreateRolloutRequest::new().set_parent("example");
14881    /// ```
14882    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14883        self.parent = v.into();
14884        self
14885    }
14886
14887    /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
14888    ///
14889    /// # Example
14890    /// ```ignore,no_run
14891    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14892    /// let x = CreateRolloutRequest::new().set_rollout_id("example");
14893    /// ```
14894    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14895        self.rollout_id = v.into();
14896        self
14897    }
14898
14899    /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
14900    ///
14901    /// # Example
14902    /// ```ignore,no_run
14903    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14904    /// use google_cloud_deploy_v1::model::Rollout;
14905    /// let x = CreateRolloutRequest::new().set_rollout(Rollout::default()/* use setters */);
14906    /// ```
14907    pub fn set_rollout<T>(mut self, v: T) -> Self
14908    where
14909        T: std::convert::Into<crate::model::Rollout>,
14910    {
14911        self.rollout = std::option::Option::Some(v.into());
14912        self
14913    }
14914
14915    /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
14916    ///
14917    /// # Example
14918    /// ```ignore,no_run
14919    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14920    /// use google_cloud_deploy_v1::model::Rollout;
14921    /// let x = CreateRolloutRequest::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
14922    /// let x = CreateRolloutRequest::new().set_or_clear_rollout(None::<Rollout>);
14923    /// ```
14924    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
14925    where
14926        T: std::convert::Into<crate::model::Rollout>,
14927    {
14928        self.rollout = v.map(|x| x.into());
14929        self
14930    }
14931
14932    /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
14933    ///
14934    /// # Example
14935    /// ```ignore,no_run
14936    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14937    /// let x = CreateRolloutRequest::new().set_request_id("example");
14938    /// ```
14939    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14940        self.request_id = v.into();
14941        self
14942    }
14943
14944    /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
14945    ///
14946    /// # Example
14947    /// ```ignore,no_run
14948    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14949    /// let x = CreateRolloutRequest::new().set_validate_only(true);
14950    /// ```
14951    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14952        self.validate_only = v.into();
14953        self
14954    }
14955
14956    /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
14957    ///
14958    /// # Example
14959    /// ```ignore,no_run
14960    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14961    /// let x = CreateRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
14962    /// ```
14963    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
14964    where
14965        T: std::iter::IntoIterator<Item = V>,
14966        V: std::convert::Into<std::string::String>,
14967    {
14968        use std::iter::Iterator;
14969        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
14970        self
14971    }
14972
14973    /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
14974    ///
14975    /// # Example
14976    /// ```ignore,no_run
14977    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14978    /// let x = CreateRolloutRequest::new().set_starting_phase_id("example");
14979    /// ```
14980    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
14981        mut self,
14982        v: T,
14983    ) -> Self {
14984        self.starting_phase_id = v.into();
14985        self
14986    }
14987}
14988
14989impl wkt::message::Message for CreateRolloutRequest {
14990    fn typename() -> &'static str {
14991        "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
14992    }
14993}
14994
14995/// Represents the metadata of the long-running operation.
14996#[derive(Clone, Default, PartialEq)]
14997#[non_exhaustive]
14998pub struct OperationMetadata {
14999    /// Output only. The time the operation was created.
15000    pub create_time: std::option::Option<wkt::Timestamp>,
15001
15002    /// Output only. The time the operation finished running.
15003    pub end_time: std::option::Option<wkt::Timestamp>,
15004
15005    /// Output only. Server-defined resource path for the target of the operation.
15006    pub target: std::string::String,
15007
15008    /// Output only. Name of the verb executed by the operation.
15009    pub verb: std::string::String,
15010
15011    /// Output only. Human-readable status of the operation, if any.
15012    pub status_message: std::string::String,
15013
15014    /// Output only. Identifies whether the user has requested cancellation
15015    /// of the operation. Operations that have successfully been cancelled
15016    /// have
15017    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
15018    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
15019    /// corresponding to `Code.CANCELLED`.
15020    ///
15021    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
15022    /// [google.rpc.Status.code]: rpc::model::Status::code
15023    pub requested_cancellation: bool,
15024
15025    /// Output only. API version used to start the operation.
15026    pub api_version: std::string::String,
15027
15028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15029}
15030
15031impl OperationMetadata {
15032    pub fn new() -> Self {
15033        std::default::Default::default()
15034    }
15035
15036    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
15037    ///
15038    /// # Example
15039    /// ```ignore,no_run
15040    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15041    /// use wkt::Timestamp;
15042    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15043    /// ```
15044    pub fn set_create_time<T>(mut self, v: T) -> Self
15045    where
15046        T: std::convert::Into<wkt::Timestamp>,
15047    {
15048        self.create_time = std::option::Option::Some(v.into());
15049        self
15050    }
15051
15052    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
15053    ///
15054    /// # Example
15055    /// ```ignore,no_run
15056    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15057    /// use wkt::Timestamp;
15058    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15059    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15060    /// ```
15061    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15062    where
15063        T: std::convert::Into<wkt::Timestamp>,
15064    {
15065        self.create_time = v.map(|x| x.into());
15066        self
15067    }
15068
15069    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
15070    ///
15071    /// # Example
15072    /// ```ignore,no_run
15073    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15074    /// use wkt::Timestamp;
15075    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15076    /// ```
15077    pub fn set_end_time<T>(mut self, v: T) -> Self
15078    where
15079        T: std::convert::Into<wkt::Timestamp>,
15080    {
15081        self.end_time = std::option::Option::Some(v.into());
15082        self
15083    }
15084
15085    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
15086    ///
15087    /// # Example
15088    /// ```ignore,no_run
15089    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15090    /// use wkt::Timestamp;
15091    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15092    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15093    /// ```
15094    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15095    where
15096        T: std::convert::Into<wkt::Timestamp>,
15097    {
15098        self.end_time = v.map(|x| x.into());
15099        self
15100    }
15101
15102    /// Sets the value of [target][crate::model::OperationMetadata::target].
15103    ///
15104    /// # Example
15105    /// ```ignore,no_run
15106    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15107    /// let x = OperationMetadata::new().set_target("example");
15108    /// ```
15109    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15110        self.target = v.into();
15111        self
15112    }
15113
15114    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
15115    ///
15116    /// # Example
15117    /// ```ignore,no_run
15118    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15119    /// let x = OperationMetadata::new().set_verb("example");
15120    /// ```
15121    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15122        self.verb = v.into();
15123        self
15124    }
15125
15126    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
15127    ///
15128    /// # Example
15129    /// ```ignore,no_run
15130    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15131    /// let x = OperationMetadata::new().set_status_message("example");
15132    /// ```
15133    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15134        self.status_message = v.into();
15135        self
15136    }
15137
15138    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
15139    ///
15140    /// # Example
15141    /// ```ignore,no_run
15142    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15143    /// let x = OperationMetadata::new().set_requested_cancellation(true);
15144    /// ```
15145    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15146        self.requested_cancellation = v.into();
15147        self
15148    }
15149
15150    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
15151    ///
15152    /// # Example
15153    /// ```ignore,no_run
15154    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15155    /// let x = OperationMetadata::new().set_api_version("example");
15156    /// ```
15157    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15158        self.api_version = v.into();
15159        self
15160    }
15161}
15162
15163impl wkt::message::Message for OperationMetadata {
15164    fn typename() -> &'static str {
15165        "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
15166    }
15167}
15168
15169/// The request object used by `ApproveRollout`.
15170#[derive(Clone, Default, PartialEq)]
15171#[non_exhaustive]
15172pub struct ApproveRolloutRequest {
15173    /// Required. Name of the Rollout. Format is
15174    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15175    pub name: std::string::String,
15176
15177    /// Required. True = approve; false = reject
15178    pub approved: bool,
15179
15180    /// Optional. Deploy policies to override. Format is
15181    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15182    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15183
15184    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15185}
15186
15187impl ApproveRolloutRequest {
15188    pub fn new() -> Self {
15189        std::default::Default::default()
15190    }
15191
15192    /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
15193    ///
15194    /// # Example
15195    /// ```ignore,no_run
15196    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15197    /// let x = ApproveRolloutRequest::new().set_name("example");
15198    /// ```
15199    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15200        self.name = v.into();
15201        self
15202    }
15203
15204    /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
15205    ///
15206    /// # Example
15207    /// ```ignore,no_run
15208    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15209    /// let x = ApproveRolloutRequest::new().set_approved(true);
15210    /// ```
15211    pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15212        self.approved = v.into();
15213        self
15214    }
15215
15216    /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
15217    ///
15218    /// # Example
15219    /// ```ignore,no_run
15220    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15221    /// let x = ApproveRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15222    /// ```
15223    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15224    where
15225        T: std::iter::IntoIterator<Item = V>,
15226        V: std::convert::Into<std::string::String>,
15227    {
15228        use std::iter::Iterator;
15229        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15230        self
15231    }
15232}
15233
15234impl wkt::message::Message for ApproveRolloutRequest {
15235    fn typename() -> &'static str {
15236        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
15237    }
15238}
15239
15240/// The response object from `ApproveRollout`.
15241#[derive(Clone, Default, PartialEq)]
15242#[non_exhaustive]
15243pub struct ApproveRolloutResponse {
15244    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15245}
15246
15247impl ApproveRolloutResponse {
15248    pub fn new() -> Self {
15249        std::default::Default::default()
15250    }
15251}
15252
15253impl wkt::message::Message for ApproveRolloutResponse {
15254    fn typename() -> &'static str {
15255        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
15256    }
15257}
15258
15259/// The request object used by `AdvanceRollout`.
15260#[derive(Clone, Default, PartialEq)]
15261#[non_exhaustive]
15262pub struct AdvanceRolloutRequest {
15263    /// Required. Name of the Rollout. Format is
15264    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15265    pub name: std::string::String,
15266
15267    /// Required. The phase ID to advance the `Rollout` to.
15268    pub phase_id: std::string::String,
15269
15270    /// Optional. Deploy policies to override. Format is
15271    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15272    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15273
15274    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15275}
15276
15277impl AdvanceRolloutRequest {
15278    pub fn new() -> Self {
15279        std::default::Default::default()
15280    }
15281
15282    /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
15283    ///
15284    /// # Example
15285    /// ```ignore,no_run
15286    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15287    /// let x = AdvanceRolloutRequest::new().set_name("example");
15288    /// ```
15289    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15290        self.name = v.into();
15291        self
15292    }
15293
15294    /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
15295    ///
15296    /// # Example
15297    /// ```ignore,no_run
15298    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15299    /// let x = AdvanceRolloutRequest::new().set_phase_id("example");
15300    /// ```
15301    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15302        self.phase_id = v.into();
15303        self
15304    }
15305
15306    /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
15307    ///
15308    /// # Example
15309    /// ```ignore,no_run
15310    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15311    /// let x = AdvanceRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15312    /// ```
15313    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15314    where
15315        T: std::iter::IntoIterator<Item = V>,
15316        V: std::convert::Into<std::string::String>,
15317    {
15318        use std::iter::Iterator;
15319        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15320        self
15321    }
15322}
15323
15324impl wkt::message::Message for AdvanceRolloutRequest {
15325    fn typename() -> &'static str {
15326        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
15327    }
15328}
15329
15330/// The response object from `AdvanceRollout`.
15331#[derive(Clone, Default, PartialEq)]
15332#[non_exhaustive]
15333pub struct AdvanceRolloutResponse {
15334    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15335}
15336
15337impl AdvanceRolloutResponse {
15338    pub fn new() -> Self {
15339        std::default::Default::default()
15340    }
15341}
15342
15343impl wkt::message::Message for AdvanceRolloutResponse {
15344    fn typename() -> &'static str {
15345        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
15346    }
15347}
15348
15349/// The request object used by `CancelRollout`.
15350#[derive(Clone, Default, PartialEq)]
15351#[non_exhaustive]
15352pub struct CancelRolloutRequest {
15353    /// Required. Name of the Rollout. Format is
15354    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15355    pub name: std::string::String,
15356
15357    /// Optional. Deploy policies to override. Format is
15358    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15359    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15360
15361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15362}
15363
15364impl CancelRolloutRequest {
15365    pub fn new() -> Self {
15366        std::default::Default::default()
15367    }
15368
15369    /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
15370    ///
15371    /// # Example
15372    /// ```ignore,no_run
15373    /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15374    /// let x = CancelRolloutRequest::new().set_name("example");
15375    /// ```
15376    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15377        self.name = v.into();
15378        self
15379    }
15380
15381    /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
15382    ///
15383    /// # Example
15384    /// ```ignore,no_run
15385    /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15386    /// let x = CancelRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15387    /// ```
15388    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15389    where
15390        T: std::iter::IntoIterator<Item = V>,
15391        V: std::convert::Into<std::string::String>,
15392    {
15393        use std::iter::Iterator;
15394        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15395        self
15396    }
15397}
15398
15399impl wkt::message::Message for CancelRolloutRequest {
15400    fn typename() -> &'static str {
15401        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
15402    }
15403}
15404
15405/// The response object from `CancelRollout`.
15406#[derive(Clone, Default, PartialEq)]
15407#[non_exhaustive]
15408pub struct CancelRolloutResponse {
15409    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15410}
15411
15412impl CancelRolloutResponse {
15413    pub fn new() -> Self {
15414        std::default::Default::default()
15415    }
15416}
15417
15418impl wkt::message::Message for CancelRolloutResponse {
15419    fn typename() -> &'static str {
15420        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
15421    }
15422}
15423
15424/// The request object used by `IgnoreJob`.
15425#[derive(Clone, Default, PartialEq)]
15426#[non_exhaustive]
15427pub struct IgnoreJobRequest {
15428    /// Required. Name of the Rollout. Format is
15429    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15430    pub rollout: std::string::String,
15431
15432    /// Required. The phase ID the Job to ignore belongs to.
15433    pub phase_id: std::string::String,
15434
15435    /// Required. The job ID for the Job to ignore.
15436    pub job_id: std::string::String,
15437
15438    /// Optional. Deploy policies to override. Format is
15439    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15440    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15441
15442    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15443}
15444
15445impl IgnoreJobRequest {
15446    pub fn new() -> Self {
15447        std::default::Default::default()
15448    }
15449
15450    /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
15451    ///
15452    /// # Example
15453    /// ```ignore,no_run
15454    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15455    /// let x = IgnoreJobRequest::new().set_rollout("example");
15456    /// ```
15457    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15458        self.rollout = v.into();
15459        self
15460    }
15461
15462    /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
15463    ///
15464    /// # Example
15465    /// ```ignore,no_run
15466    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15467    /// let x = IgnoreJobRequest::new().set_phase_id("example");
15468    /// ```
15469    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15470        self.phase_id = v.into();
15471        self
15472    }
15473
15474    /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
15475    ///
15476    /// # Example
15477    /// ```ignore,no_run
15478    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15479    /// let x = IgnoreJobRequest::new().set_job_id("example");
15480    /// ```
15481    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15482        self.job_id = v.into();
15483        self
15484    }
15485
15486    /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
15487    ///
15488    /// # Example
15489    /// ```ignore,no_run
15490    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15491    /// let x = IgnoreJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15492    /// ```
15493    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15494    where
15495        T: std::iter::IntoIterator<Item = V>,
15496        V: std::convert::Into<std::string::String>,
15497    {
15498        use std::iter::Iterator;
15499        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15500        self
15501    }
15502}
15503
15504impl wkt::message::Message for IgnoreJobRequest {
15505    fn typename() -> &'static str {
15506        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
15507    }
15508}
15509
15510/// The response object from `IgnoreJob`.
15511#[derive(Clone, Default, PartialEq)]
15512#[non_exhaustive]
15513pub struct IgnoreJobResponse {
15514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15515}
15516
15517impl IgnoreJobResponse {
15518    pub fn new() -> Self {
15519        std::default::Default::default()
15520    }
15521}
15522
15523impl wkt::message::Message for IgnoreJobResponse {
15524    fn typename() -> &'static str {
15525        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
15526    }
15527}
15528
15529/// RetryJobRequest is the request object used by `RetryJob`.
15530#[derive(Clone, Default, PartialEq)]
15531#[non_exhaustive]
15532pub struct RetryJobRequest {
15533    /// Required. Name of the Rollout. Format is
15534    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15535    pub rollout: std::string::String,
15536
15537    /// Required. The phase ID the Job to retry belongs to.
15538    pub phase_id: std::string::String,
15539
15540    /// Required. The job ID for the Job to retry.
15541    pub job_id: std::string::String,
15542
15543    /// Optional. Deploy policies to override. Format is
15544    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15545    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15546
15547    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15548}
15549
15550impl RetryJobRequest {
15551    pub fn new() -> Self {
15552        std::default::Default::default()
15553    }
15554
15555    /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
15556    ///
15557    /// # Example
15558    /// ```ignore,no_run
15559    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15560    /// let x = RetryJobRequest::new().set_rollout("example");
15561    /// ```
15562    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15563        self.rollout = v.into();
15564        self
15565    }
15566
15567    /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
15568    ///
15569    /// # Example
15570    /// ```ignore,no_run
15571    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15572    /// let x = RetryJobRequest::new().set_phase_id("example");
15573    /// ```
15574    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15575        self.phase_id = v.into();
15576        self
15577    }
15578
15579    /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
15580    ///
15581    /// # Example
15582    /// ```ignore,no_run
15583    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15584    /// let x = RetryJobRequest::new().set_job_id("example");
15585    /// ```
15586    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15587        self.job_id = v.into();
15588        self
15589    }
15590
15591    /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
15592    ///
15593    /// # Example
15594    /// ```ignore,no_run
15595    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15596    /// let x = RetryJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15597    /// ```
15598    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15599    where
15600        T: std::iter::IntoIterator<Item = V>,
15601        V: std::convert::Into<std::string::String>,
15602    {
15603        use std::iter::Iterator;
15604        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15605        self
15606    }
15607}
15608
15609impl wkt::message::Message for RetryJobRequest {
15610    fn typename() -> &'static str {
15611        "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
15612    }
15613}
15614
15615/// The response object from 'RetryJob'.
15616#[derive(Clone, Default, PartialEq)]
15617#[non_exhaustive]
15618pub struct RetryJobResponse {
15619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15620}
15621
15622impl RetryJobResponse {
15623    pub fn new() -> Self {
15624        std::default::Default::default()
15625    }
15626}
15627
15628impl wkt::message::Message for RetryJobResponse {
15629    fn typename() -> &'static str {
15630        "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
15631    }
15632}
15633
15634/// The request object used by `AbandonRelease`.
15635#[derive(Clone, Default, PartialEq)]
15636#[non_exhaustive]
15637pub struct AbandonReleaseRequest {
15638    /// Required. Name of the Release. Format is
15639    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
15640    pub name: std::string::String,
15641
15642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15643}
15644
15645impl AbandonReleaseRequest {
15646    pub fn new() -> Self {
15647        std::default::Default::default()
15648    }
15649
15650    /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
15651    ///
15652    /// # Example
15653    /// ```ignore,no_run
15654    /// # use google_cloud_deploy_v1::model::AbandonReleaseRequest;
15655    /// let x = AbandonReleaseRequest::new().set_name("example");
15656    /// ```
15657    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15658        self.name = v.into();
15659        self
15660    }
15661}
15662
15663impl wkt::message::Message for AbandonReleaseRequest {
15664    fn typename() -> &'static str {
15665        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
15666    }
15667}
15668
15669/// The response object for `AbandonRelease`.
15670#[derive(Clone, Default, PartialEq)]
15671#[non_exhaustive]
15672pub struct AbandonReleaseResponse {
15673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15674}
15675
15676impl AbandonReleaseResponse {
15677    pub fn new() -> Self {
15678        std::default::Default::default()
15679    }
15680}
15681
15682impl wkt::message::Message for AbandonReleaseResponse {
15683    fn typename() -> &'static str {
15684        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
15685    }
15686}
15687
15688/// A `JobRun` resource in the Cloud Deploy API.
15689///
15690/// A `JobRun` contains information of a single `Rollout` job evaluation.
15691#[derive(Clone, Default, PartialEq)]
15692#[non_exhaustive]
15693pub struct JobRun {
15694    /// Output only. Name of the `JobRun`. Format is
15695    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
15696    pub name: std::string::String,
15697
15698    /// Output only. Unique identifier of the `JobRun`.
15699    pub uid: std::string::String,
15700
15701    /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
15702    pub phase_id: std::string::String,
15703
15704    /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
15705    pub job_id: std::string::String,
15706
15707    /// Output only. Time at which the `JobRun` was created.
15708    pub create_time: std::option::Option<wkt::Timestamp>,
15709
15710    /// Output only. Time at which the `JobRun` was started.
15711    pub start_time: std::option::Option<wkt::Timestamp>,
15712
15713    /// Output only. Time at which the `JobRun` ended.
15714    pub end_time: std::option::Option<wkt::Timestamp>,
15715
15716    /// Output only. The current state of the `JobRun`.
15717    pub state: crate::model::job_run::State,
15718
15719    /// Output only. This checksum is computed by the server based on the value of
15720    /// other fields, and may be sent on update and delete requests to ensure the
15721    /// client has an up-to-date value before proceeding.
15722    pub etag: std::string::String,
15723
15724    /// The `JobRun` type and the information for that type.
15725    pub job_run: std::option::Option<crate::model::job_run::JobRun>,
15726
15727    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15728}
15729
15730impl JobRun {
15731    pub fn new() -> Self {
15732        std::default::Default::default()
15733    }
15734
15735    /// Sets the value of [name][crate::model::JobRun::name].
15736    ///
15737    /// # Example
15738    /// ```ignore,no_run
15739    /// # use google_cloud_deploy_v1::model::JobRun;
15740    /// let x = JobRun::new().set_name("example");
15741    /// ```
15742    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15743        self.name = v.into();
15744        self
15745    }
15746
15747    /// Sets the value of [uid][crate::model::JobRun::uid].
15748    ///
15749    /// # Example
15750    /// ```ignore,no_run
15751    /// # use google_cloud_deploy_v1::model::JobRun;
15752    /// let x = JobRun::new().set_uid("example");
15753    /// ```
15754    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15755        self.uid = v.into();
15756        self
15757    }
15758
15759    /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
15760    ///
15761    /// # Example
15762    /// ```ignore,no_run
15763    /// # use google_cloud_deploy_v1::model::JobRun;
15764    /// let x = JobRun::new().set_phase_id("example");
15765    /// ```
15766    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15767        self.phase_id = v.into();
15768        self
15769    }
15770
15771    /// Sets the value of [job_id][crate::model::JobRun::job_id].
15772    ///
15773    /// # Example
15774    /// ```ignore,no_run
15775    /// # use google_cloud_deploy_v1::model::JobRun;
15776    /// let x = JobRun::new().set_job_id("example");
15777    /// ```
15778    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15779        self.job_id = v.into();
15780        self
15781    }
15782
15783    /// Sets the value of [create_time][crate::model::JobRun::create_time].
15784    ///
15785    /// # Example
15786    /// ```ignore,no_run
15787    /// # use google_cloud_deploy_v1::model::JobRun;
15788    /// use wkt::Timestamp;
15789    /// let x = JobRun::new().set_create_time(Timestamp::default()/* use setters */);
15790    /// ```
15791    pub fn set_create_time<T>(mut self, v: T) -> Self
15792    where
15793        T: std::convert::Into<wkt::Timestamp>,
15794    {
15795        self.create_time = std::option::Option::Some(v.into());
15796        self
15797    }
15798
15799    /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
15800    ///
15801    /// # Example
15802    /// ```ignore,no_run
15803    /// # use google_cloud_deploy_v1::model::JobRun;
15804    /// use wkt::Timestamp;
15805    /// let x = JobRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15806    /// let x = JobRun::new().set_or_clear_create_time(None::<Timestamp>);
15807    /// ```
15808    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15809    where
15810        T: std::convert::Into<wkt::Timestamp>,
15811    {
15812        self.create_time = v.map(|x| x.into());
15813        self
15814    }
15815
15816    /// Sets the value of [start_time][crate::model::JobRun::start_time].
15817    ///
15818    /// # Example
15819    /// ```ignore,no_run
15820    /// # use google_cloud_deploy_v1::model::JobRun;
15821    /// use wkt::Timestamp;
15822    /// let x = JobRun::new().set_start_time(Timestamp::default()/* use setters */);
15823    /// ```
15824    pub fn set_start_time<T>(mut self, v: T) -> Self
15825    where
15826        T: std::convert::Into<wkt::Timestamp>,
15827    {
15828        self.start_time = std::option::Option::Some(v.into());
15829        self
15830    }
15831
15832    /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
15833    ///
15834    /// # Example
15835    /// ```ignore,no_run
15836    /// # use google_cloud_deploy_v1::model::JobRun;
15837    /// use wkt::Timestamp;
15838    /// let x = JobRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
15839    /// let x = JobRun::new().set_or_clear_start_time(None::<Timestamp>);
15840    /// ```
15841    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15842    where
15843        T: std::convert::Into<wkt::Timestamp>,
15844    {
15845        self.start_time = v.map(|x| x.into());
15846        self
15847    }
15848
15849    /// Sets the value of [end_time][crate::model::JobRun::end_time].
15850    ///
15851    /// # Example
15852    /// ```ignore,no_run
15853    /// # use google_cloud_deploy_v1::model::JobRun;
15854    /// use wkt::Timestamp;
15855    /// let x = JobRun::new().set_end_time(Timestamp::default()/* use setters */);
15856    /// ```
15857    pub fn set_end_time<T>(mut self, v: T) -> Self
15858    where
15859        T: std::convert::Into<wkt::Timestamp>,
15860    {
15861        self.end_time = std::option::Option::Some(v.into());
15862        self
15863    }
15864
15865    /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
15866    ///
15867    /// # Example
15868    /// ```ignore,no_run
15869    /// # use google_cloud_deploy_v1::model::JobRun;
15870    /// use wkt::Timestamp;
15871    /// let x = JobRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15872    /// let x = JobRun::new().set_or_clear_end_time(None::<Timestamp>);
15873    /// ```
15874    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15875    where
15876        T: std::convert::Into<wkt::Timestamp>,
15877    {
15878        self.end_time = v.map(|x| x.into());
15879        self
15880    }
15881
15882    /// Sets the value of [state][crate::model::JobRun::state].
15883    ///
15884    /// # Example
15885    /// ```ignore,no_run
15886    /// # use google_cloud_deploy_v1::model::JobRun;
15887    /// use google_cloud_deploy_v1::model::job_run::State;
15888    /// let x0 = JobRun::new().set_state(State::InProgress);
15889    /// let x1 = JobRun::new().set_state(State::Succeeded);
15890    /// let x2 = JobRun::new().set_state(State::Failed);
15891    /// ```
15892    pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
15893        self.state = v.into();
15894        self
15895    }
15896
15897    /// Sets the value of [etag][crate::model::JobRun::etag].
15898    ///
15899    /// # Example
15900    /// ```ignore,no_run
15901    /// # use google_cloud_deploy_v1::model::JobRun;
15902    /// let x = JobRun::new().set_etag("example");
15903    /// ```
15904    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15905        self.etag = v.into();
15906        self
15907    }
15908
15909    /// Sets the value of [job_run][crate::model::JobRun::job_run].
15910    ///
15911    /// Note that all the setters affecting `job_run` are mutually
15912    /// exclusive.
15913    ///
15914    /// # Example
15915    /// ```ignore,no_run
15916    /// # use google_cloud_deploy_v1::model::JobRun;
15917    /// use google_cloud_deploy_v1::model::DeployJobRun;
15918    /// let x = JobRun::new().set_job_run(Some(
15919    ///     google_cloud_deploy_v1::model::job_run::JobRun::DeployJobRun(DeployJobRun::default().into())));
15920    /// ```
15921    pub fn set_job_run<
15922        T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
15923    >(
15924        mut self,
15925        v: T,
15926    ) -> Self {
15927        self.job_run = v.into();
15928        self
15929    }
15930
15931    /// The value of [job_run][crate::model::JobRun::job_run]
15932    /// if it holds a `DeployJobRun`, `None` if the field is not set or
15933    /// holds a different branch.
15934    pub fn deploy_job_run(
15935        &self,
15936    ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
15937        #[allow(unreachable_patterns)]
15938        self.job_run.as_ref().and_then(|v| match v {
15939            crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
15940            _ => std::option::Option::None,
15941        })
15942    }
15943
15944    /// Sets the value of [job_run][crate::model::JobRun::job_run]
15945    /// to hold a `DeployJobRun`.
15946    ///
15947    /// Note that all the setters affecting `job_run` are
15948    /// mutually exclusive.
15949    ///
15950    /// # Example
15951    /// ```ignore,no_run
15952    /// # use google_cloud_deploy_v1::model::JobRun;
15953    /// use google_cloud_deploy_v1::model::DeployJobRun;
15954    /// let x = JobRun::new().set_deploy_job_run(DeployJobRun::default()/* use setters */);
15955    /// assert!(x.deploy_job_run().is_some());
15956    /// assert!(x.verify_job_run().is_none());
15957    /// assert!(x.predeploy_job_run().is_none());
15958    /// assert!(x.postdeploy_job_run().is_none());
15959    /// assert!(x.create_child_rollout_job_run().is_none());
15960    /// assert!(x.advance_child_rollout_job_run().is_none());
15961    /// ```
15962    pub fn set_deploy_job_run<
15963        T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
15964    >(
15965        mut self,
15966        v: T,
15967    ) -> Self {
15968        self.job_run =
15969            std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
15970        self
15971    }
15972
15973    /// The value of [job_run][crate::model::JobRun::job_run]
15974    /// if it holds a `VerifyJobRun`, `None` if the field is not set or
15975    /// holds a different branch.
15976    pub fn verify_job_run(
15977        &self,
15978    ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
15979        #[allow(unreachable_patterns)]
15980        self.job_run.as_ref().and_then(|v| match v {
15981            crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
15982            _ => std::option::Option::None,
15983        })
15984    }
15985
15986    /// Sets the value of [job_run][crate::model::JobRun::job_run]
15987    /// to hold a `VerifyJobRun`.
15988    ///
15989    /// Note that all the setters affecting `job_run` are
15990    /// mutually exclusive.
15991    ///
15992    /// # Example
15993    /// ```ignore,no_run
15994    /// # use google_cloud_deploy_v1::model::JobRun;
15995    /// use google_cloud_deploy_v1::model::VerifyJobRun;
15996    /// let x = JobRun::new().set_verify_job_run(VerifyJobRun::default()/* use setters */);
15997    /// assert!(x.verify_job_run().is_some());
15998    /// assert!(x.deploy_job_run().is_none());
15999    /// assert!(x.predeploy_job_run().is_none());
16000    /// assert!(x.postdeploy_job_run().is_none());
16001    /// assert!(x.create_child_rollout_job_run().is_none());
16002    /// assert!(x.advance_child_rollout_job_run().is_none());
16003    /// ```
16004    pub fn set_verify_job_run<
16005        T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
16006    >(
16007        mut self,
16008        v: T,
16009    ) -> Self {
16010        self.job_run =
16011            std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
16012        self
16013    }
16014
16015    /// The value of [job_run][crate::model::JobRun::job_run]
16016    /// if it holds a `PredeployJobRun`, `None` if the field is not set or
16017    /// holds a different branch.
16018    pub fn predeploy_job_run(
16019        &self,
16020    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
16021        #[allow(unreachable_patterns)]
16022        self.job_run.as_ref().and_then(|v| match v {
16023            crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
16024            _ => std::option::Option::None,
16025        })
16026    }
16027
16028    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16029    /// to hold a `PredeployJobRun`.
16030    ///
16031    /// Note that all the setters affecting `job_run` are
16032    /// mutually exclusive.
16033    ///
16034    /// # Example
16035    /// ```ignore,no_run
16036    /// # use google_cloud_deploy_v1::model::JobRun;
16037    /// use google_cloud_deploy_v1::model::PredeployJobRun;
16038    /// let x = JobRun::new().set_predeploy_job_run(PredeployJobRun::default()/* use setters */);
16039    /// assert!(x.predeploy_job_run().is_some());
16040    /// assert!(x.deploy_job_run().is_none());
16041    /// assert!(x.verify_job_run().is_none());
16042    /// assert!(x.postdeploy_job_run().is_none());
16043    /// assert!(x.create_child_rollout_job_run().is_none());
16044    /// assert!(x.advance_child_rollout_job_run().is_none());
16045    /// ```
16046    pub fn set_predeploy_job_run<
16047        T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
16048    >(
16049        mut self,
16050        v: T,
16051    ) -> Self {
16052        self.job_run =
16053            std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
16054        self
16055    }
16056
16057    /// The value of [job_run][crate::model::JobRun::job_run]
16058    /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
16059    /// holds a different branch.
16060    pub fn postdeploy_job_run(
16061        &self,
16062    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
16063        #[allow(unreachable_patterns)]
16064        self.job_run.as_ref().and_then(|v| match v {
16065            crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
16066            _ => std::option::Option::None,
16067        })
16068    }
16069
16070    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16071    /// to hold a `PostdeployJobRun`.
16072    ///
16073    /// Note that all the setters affecting `job_run` are
16074    /// mutually exclusive.
16075    ///
16076    /// # Example
16077    /// ```ignore,no_run
16078    /// # use google_cloud_deploy_v1::model::JobRun;
16079    /// use google_cloud_deploy_v1::model::PostdeployJobRun;
16080    /// let x = JobRun::new().set_postdeploy_job_run(PostdeployJobRun::default()/* use setters */);
16081    /// assert!(x.postdeploy_job_run().is_some());
16082    /// assert!(x.deploy_job_run().is_none());
16083    /// assert!(x.verify_job_run().is_none());
16084    /// assert!(x.predeploy_job_run().is_none());
16085    /// assert!(x.create_child_rollout_job_run().is_none());
16086    /// assert!(x.advance_child_rollout_job_run().is_none());
16087    /// ```
16088    pub fn set_postdeploy_job_run<
16089        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
16090    >(
16091        mut self,
16092        v: T,
16093    ) -> Self {
16094        self.job_run =
16095            std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
16096        self
16097    }
16098
16099    /// The value of [job_run][crate::model::JobRun::job_run]
16100    /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
16101    /// holds a different branch.
16102    pub fn create_child_rollout_job_run(
16103        &self,
16104    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
16105        #[allow(unreachable_patterns)]
16106        self.job_run.as_ref().and_then(|v| match v {
16107            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
16108                std::option::Option::Some(v)
16109            }
16110            _ => std::option::Option::None,
16111        })
16112    }
16113
16114    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16115    /// to hold a `CreateChildRolloutJobRun`.
16116    ///
16117    /// Note that all the setters affecting `job_run` are
16118    /// mutually exclusive.
16119    ///
16120    /// # Example
16121    /// ```ignore,no_run
16122    /// # use google_cloud_deploy_v1::model::JobRun;
16123    /// use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
16124    /// let x = JobRun::new().set_create_child_rollout_job_run(CreateChildRolloutJobRun::default()/* use setters */);
16125    /// assert!(x.create_child_rollout_job_run().is_some());
16126    /// assert!(x.deploy_job_run().is_none());
16127    /// assert!(x.verify_job_run().is_none());
16128    /// assert!(x.predeploy_job_run().is_none());
16129    /// assert!(x.postdeploy_job_run().is_none());
16130    /// assert!(x.advance_child_rollout_job_run().is_none());
16131    /// ```
16132    pub fn set_create_child_rollout_job_run<
16133        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
16134    >(
16135        mut self,
16136        v: T,
16137    ) -> Self {
16138        self.job_run = std::option::Option::Some(
16139            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
16140        );
16141        self
16142    }
16143
16144    /// The value of [job_run][crate::model::JobRun::job_run]
16145    /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
16146    /// holds a different branch.
16147    pub fn advance_child_rollout_job_run(
16148        &self,
16149    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
16150        #[allow(unreachable_patterns)]
16151        self.job_run.as_ref().and_then(|v| match v {
16152            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
16153                std::option::Option::Some(v)
16154            }
16155            _ => std::option::Option::None,
16156        })
16157    }
16158
16159    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16160    /// to hold a `AdvanceChildRolloutJobRun`.
16161    ///
16162    /// Note that all the setters affecting `job_run` are
16163    /// mutually exclusive.
16164    ///
16165    /// # Example
16166    /// ```ignore,no_run
16167    /// # use google_cloud_deploy_v1::model::JobRun;
16168    /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
16169    /// let x = JobRun::new().set_advance_child_rollout_job_run(AdvanceChildRolloutJobRun::default()/* use setters */);
16170    /// assert!(x.advance_child_rollout_job_run().is_some());
16171    /// assert!(x.deploy_job_run().is_none());
16172    /// assert!(x.verify_job_run().is_none());
16173    /// assert!(x.predeploy_job_run().is_none());
16174    /// assert!(x.postdeploy_job_run().is_none());
16175    /// assert!(x.create_child_rollout_job_run().is_none());
16176    /// ```
16177    pub fn set_advance_child_rollout_job_run<
16178        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
16179    >(
16180        mut self,
16181        v: T,
16182    ) -> Self {
16183        self.job_run = std::option::Option::Some(
16184            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
16185        );
16186        self
16187    }
16188}
16189
16190impl wkt::message::Message for JobRun {
16191    fn typename() -> &'static str {
16192        "type.googleapis.com/google.cloud.deploy.v1.JobRun"
16193    }
16194}
16195
16196/// Defines additional types related to [JobRun].
16197pub mod job_run {
16198    #[allow(unused_imports)]
16199    use super::*;
16200
16201    /// Valid states of a `JobRun`.
16202    ///
16203    /// # Working with unknown values
16204    ///
16205    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16206    /// additional enum variants at any time. Adding new variants is not considered
16207    /// a breaking change. Applications should write their code in anticipation of:
16208    ///
16209    /// - New values appearing in future releases of the client library, **and**
16210    /// - New values received dynamically, without application changes.
16211    ///
16212    /// Please consult the [Working with enums] section in the user guide for some
16213    /// guidelines.
16214    ///
16215    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16216    #[derive(Clone, Debug, PartialEq)]
16217    #[non_exhaustive]
16218    pub enum State {
16219        /// The `JobRun` has an unspecified state.
16220        Unspecified,
16221        /// The `JobRun` is in progress.
16222        InProgress,
16223        /// The `JobRun` has succeeded.
16224        Succeeded,
16225        /// The `JobRun` has failed.
16226        Failed,
16227        /// The `JobRun` is terminating.
16228        Terminating,
16229        /// The `JobRun` was terminated.
16230        Terminated,
16231        /// If set, the enum was initialized with an unknown value.
16232        ///
16233        /// Applications can examine the value using [State::value] or
16234        /// [State::name].
16235        UnknownValue(state::UnknownValue),
16236    }
16237
16238    #[doc(hidden)]
16239    pub mod state {
16240        #[allow(unused_imports)]
16241        use super::*;
16242        #[derive(Clone, Debug, PartialEq)]
16243        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16244    }
16245
16246    impl State {
16247        /// Gets the enum value.
16248        ///
16249        /// Returns `None` if the enum contains an unknown value deserialized from
16250        /// the string representation of enums.
16251        pub fn value(&self) -> std::option::Option<i32> {
16252            match self {
16253                Self::Unspecified => std::option::Option::Some(0),
16254                Self::InProgress => std::option::Option::Some(1),
16255                Self::Succeeded => std::option::Option::Some(2),
16256                Self::Failed => std::option::Option::Some(3),
16257                Self::Terminating => std::option::Option::Some(4),
16258                Self::Terminated => std::option::Option::Some(5),
16259                Self::UnknownValue(u) => u.0.value(),
16260            }
16261        }
16262
16263        /// Gets the enum value as a string.
16264        ///
16265        /// Returns `None` if the enum contains an unknown value deserialized from
16266        /// the integer representation of enums.
16267        pub fn name(&self) -> std::option::Option<&str> {
16268            match self {
16269                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16270                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16271                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16272                Self::Failed => std::option::Option::Some("FAILED"),
16273                Self::Terminating => std::option::Option::Some("TERMINATING"),
16274                Self::Terminated => std::option::Option::Some("TERMINATED"),
16275                Self::UnknownValue(u) => u.0.name(),
16276            }
16277        }
16278    }
16279
16280    impl std::default::Default for State {
16281        fn default() -> Self {
16282            use std::convert::From;
16283            Self::from(0)
16284        }
16285    }
16286
16287    impl std::fmt::Display for State {
16288        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16289            wkt::internal::display_enum(f, self.name(), self.value())
16290        }
16291    }
16292
16293    impl std::convert::From<i32> for State {
16294        fn from(value: i32) -> Self {
16295            match value {
16296                0 => Self::Unspecified,
16297                1 => Self::InProgress,
16298                2 => Self::Succeeded,
16299                3 => Self::Failed,
16300                4 => Self::Terminating,
16301                5 => Self::Terminated,
16302                _ => Self::UnknownValue(state::UnknownValue(
16303                    wkt::internal::UnknownEnumValue::Integer(value),
16304                )),
16305            }
16306        }
16307    }
16308
16309    impl std::convert::From<&str> for State {
16310        fn from(value: &str) -> Self {
16311            use std::string::ToString;
16312            match value {
16313                "STATE_UNSPECIFIED" => Self::Unspecified,
16314                "IN_PROGRESS" => Self::InProgress,
16315                "SUCCEEDED" => Self::Succeeded,
16316                "FAILED" => Self::Failed,
16317                "TERMINATING" => Self::Terminating,
16318                "TERMINATED" => Self::Terminated,
16319                _ => Self::UnknownValue(state::UnknownValue(
16320                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16321                )),
16322            }
16323        }
16324    }
16325
16326    impl serde::ser::Serialize for State {
16327        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16328        where
16329            S: serde::Serializer,
16330        {
16331            match self {
16332                Self::Unspecified => serializer.serialize_i32(0),
16333                Self::InProgress => serializer.serialize_i32(1),
16334                Self::Succeeded => serializer.serialize_i32(2),
16335                Self::Failed => serializer.serialize_i32(3),
16336                Self::Terminating => serializer.serialize_i32(4),
16337                Self::Terminated => serializer.serialize_i32(5),
16338                Self::UnknownValue(u) => u.0.serialize(serializer),
16339            }
16340        }
16341    }
16342
16343    impl<'de> serde::de::Deserialize<'de> for State {
16344        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16345        where
16346            D: serde::Deserializer<'de>,
16347        {
16348            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16349                ".google.cloud.deploy.v1.JobRun.State",
16350            ))
16351        }
16352    }
16353
16354    /// The `JobRun` type and the information for that type.
16355    #[derive(Clone, Debug, PartialEq)]
16356    #[non_exhaustive]
16357    pub enum JobRun {
16358        /// Output only. Information specific to a deploy `JobRun`.
16359        DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
16360        /// Output only. Information specific to a verify `JobRun`.
16361        VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
16362        /// Output only. Information specific to a predeploy `JobRun`.
16363        PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
16364        /// Output only. Information specific to a postdeploy `JobRun`.
16365        PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
16366        /// Output only. Information specific to a createChildRollout `JobRun`.
16367        CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
16368        /// Output only. Information specific to an advanceChildRollout `JobRun`
16369        AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
16370    }
16371}
16372
16373/// DeployJobRun contains information specific to a deploy `JobRun`.
16374#[derive(Clone, Default, PartialEq)]
16375#[non_exhaustive]
16376pub struct DeployJobRun {
16377    /// Output only. The resource name of the Cloud Build `Build` object that is
16378    /// used to deploy. Format is
16379    /// `projects/{project}/locations/{location}/builds/{build}`.
16380    pub build: std::string::String,
16381
16382    /// Output only. The reason the deploy failed. This will always be unspecified
16383    /// while the deploy is in progress or if it succeeded.
16384    pub failure_cause: crate::model::deploy_job_run::FailureCause,
16385
16386    /// Output only. Additional information about the deploy failure, if available.
16387    pub failure_message: std::string::String,
16388
16389    /// Output only. Metadata containing information about the deploy job run.
16390    pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
16391
16392    /// Output only. The artifact of a deploy job run, if available.
16393    pub artifact: std::option::Option<crate::model::DeployArtifact>,
16394
16395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16396}
16397
16398impl DeployJobRun {
16399    pub fn new() -> Self {
16400        std::default::Default::default()
16401    }
16402
16403    /// Sets the value of [build][crate::model::DeployJobRun::build].
16404    ///
16405    /// # Example
16406    /// ```ignore,no_run
16407    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16408    /// let x = DeployJobRun::new().set_build("example");
16409    /// ```
16410    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16411        self.build = v.into();
16412        self
16413    }
16414
16415    /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
16416    ///
16417    /// # Example
16418    /// ```ignore,no_run
16419    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16420    /// use google_cloud_deploy_v1::model::deploy_job_run::FailureCause;
16421    /// let x0 = DeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16422    /// let x1 = DeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16423    /// let x2 = DeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16424    /// ```
16425    pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
16426        mut self,
16427        v: T,
16428    ) -> Self {
16429        self.failure_cause = v.into();
16430        self
16431    }
16432
16433    /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
16434    ///
16435    /// # Example
16436    /// ```ignore,no_run
16437    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16438    /// let x = DeployJobRun::new().set_failure_message("example");
16439    /// ```
16440    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16441        self.failure_message = v.into();
16442        self
16443    }
16444
16445    /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
16446    ///
16447    /// # Example
16448    /// ```ignore,no_run
16449    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16450    /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16451    /// let x = DeployJobRun::new().set_metadata(DeployJobRunMetadata::default()/* use setters */);
16452    /// ```
16453    pub fn set_metadata<T>(mut self, v: T) -> Self
16454    where
16455        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16456    {
16457        self.metadata = std::option::Option::Some(v.into());
16458        self
16459    }
16460
16461    /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
16462    ///
16463    /// # Example
16464    /// ```ignore,no_run
16465    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16466    /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16467    /// let x = DeployJobRun::new().set_or_clear_metadata(Some(DeployJobRunMetadata::default()/* use setters */));
16468    /// let x = DeployJobRun::new().set_or_clear_metadata(None::<DeployJobRunMetadata>);
16469    /// ```
16470    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16471    where
16472        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16473    {
16474        self.metadata = v.map(|x| x.into());
16475        self
16476    }
16477
16478    /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
16479    ///
16480    /// # Example
16481    /// ```ignore,no_run
16482    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16483    /// use google_cloud_deploy_v1::model::DeployArtifact;
16484    /// let x = DeployJobRun::new().set_artifact(DeployArtifact::default()/* use setters */);
16485    /// ```
16486    pub fn set_artifact<T>(mut self, v: T) -> Self
16487    where
16488        T: std::convert::Into<crate::model::DeployArtifact>,
16489    {
16490        self.artifact = std::option::Option::Some(v.into());
16491        self
16492    }
16493
16494    /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
16495    ///
16496    /// # Example
16497    /// ```ignore,no_run
16498    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16499    /// use google_cloud_deploy_v1::model::DeployArtifact;
16500    /// let x = DeployJobRun::new().set_or_clear_artifact(Some(DeployArtifact::default()/* use setters */));
16501    /// let x = DeployJobRun::new().set_or_clear_artifact(None::<DeployArtifact>);
16502    /// ```
16503    pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
16504    where
16505        T: std::convert::Into<crate::model::DeployArtifact>,
16506    {
16507        self.artifact = v.map(|x| x.into());
16508        self
16509    }
16510}
16511
16512impl wkt::message::Message for DeployJobRun {
16513    fn typename() -> &'static str {
16514        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
16515    }
16516}
16517
16518/// Defines additional types related to [DeployJobRun].
16519pub mod deploy_job_run {
16520    #[allow(unused_imports)]
16521    use super::*;
16522
16523    /// Well-known deploy failures.
16524    ///
16525    /// # Working with unknown values
16526    ///
16527    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16528    /// additional enum variants at any time. Adding new variants is not considered
16529    /// a breaking change. Applications should write their code in anticipation of:
16530    ///
16531    /// - New values appearing in future releases of the client library, **and**
16532    /// - New values received dynamically, without application changes.
16533    ///
16534    /// Please consult the [Working with enums] section in the user guide for some
16535    /// guidelines.
16536    ///
16537    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16538    #[derive(Clone, Debug, PartialEq)]
16539    #[non_exhaustive]
16540    pub enum FailureCause {
16541        /// No reason for failure is specified.
16542        Unspecified,
16543        /// Cloud Build is not available, either because it is not enabled or because
16544        /// Cloud Deploy has insufficient permissions. See [Required
16545        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16546        CloudBuildUnavailable,
16547        /// The deploy operation did not complete successfully; check Cloud Build
16548        /// logs.
16549        ExecutionFailed,
16550        /// The deploy job run did not complete within the allotted time.
16551        DeadlineExceeded,
16552        /// There were missing resources in the runtime environment required for a
16553        /// canary deployment. Check the Cloud Build logs for more information.
16554        MissingResourcesForCanary,
16555        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16556        /// for additional details.
16557        CloudBuildRequestFailed,
16558        /// The deploy operation had a feature configured that is not supported.
16559        DeployFeatureNotSupported,
16560        /// If set, the enum was initialized with an unknown value.
16561        ///
16562        /// Applications can examine the value using [FailureCause::value] or
16563        /// [FailureCause::name].
16564        UnknownValue(failure_cause::UnknownValue),
16565    }
16566
16567    #[doc(hidden)]
16568    pub mod failure_cause {
16569        #[allow(unused_imports)]
16570        use super::*;
16571        #[derive(Clone, Debug, PartialEq)]
16572        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16573    }
16574
16575    impl FailureCause {
16576        /// Gets the enum value.
16577        ///
16578        /// Returns `None` if the enum contains an unknown value deserialized from
16579        /// the string representation of enums.
16580        pub fn value(&self) -> std::option::Option<i32> {
16581            match self {
16582                Self::Unspecified => std::option::Option::Some(0),
16583                Self::CloudBuildUnavailable => std::option::Option::Some(1),
16584                Self::ExecutionFailed => std::option::Option::Some(2),
16585                Self::DeadlineExceeded => std::option::Option::Some(3),
16586                Self::MissingResourcesForCanary => std::option::Option::Some(4),
16587                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16588                Self::DeployFeatureNotSupported => std::option::Option::Some(6),
16589                Self::UnknownValue(u) => u.0.value(),
16590            }
16591        }
16592
16593        /// Gets the enum value as a string.
16594        ///
16595        /// Returns `None` if the enum contains an unknown value deserialized from
16596        /// the integer representation of enums.
16597        pub fn name(&self) -> std::option::Option<&str> {
16598            match self {
16599                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16600                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16601                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16602                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16603                Self::MissingResourcesForCanary => {
16604                    std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
16605                }
16606                Self::CloudBuildRequestFailed => {
16607                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16608                }
16609                Self::DeployFeatureNotSupported => {
16610                    std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
16611                }
16612                Self::UnknownValue(u) => u.0.name(),
16613            }
16614        }
16615    }
16616
16617    impl std::default::Default for FailureCause {
16618        fn default() -> Self {
16619            use std::convert::From;
16620            Self::from(0)
16621        }
16622    }
16623
16624    impl std::fmt::Display for FailureCause {
16625        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16626            wkt::internal::display_enum(f, self.name(), self.value())
16627        }
16628    }
16629
16630    impl std::convert::From<i32> for FailureCause {
16631        fn from(value: i32) -> Self {
16632            match value {
16633                0 => Self::Unspecified,
16634                1 => Self::CloudBuildUnavailable,
16635                2 => Self::ExecutionFailed,
16636                3 => Self::DeadlineExceeded,
16637                4 => Self::MissingResourcesForCanary,
16638                5 => Self::CloudBuildRequestFailed,
16639                6 => Self::DeployFeatureNotSupported,
16640                _ => Self::UnknownValue(failure_cause::UnknownValue(
16641                    wkt::internal::UnknownEnumValue::Integer(value),
16642                )),
16643            }
16644        }
16645    }
16646
16647    impl std::convert::From<&str> for FailureCause {
16648        fn from(value: &str) -> Self {
16649            use std::string::ToString;
16650            match value {
16651                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16652                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16653                "EXECUTION_FAILED" => Self::ExecutionFailed,
16654                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16655                "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
16656                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16657                "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
16658                _ => Self::UnknownValue(failure_cause::UnknownValue(
16659                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16660                )),
16661            }
16662        }
16663    }
16664
16665    impl serde::ser::Serialize for FailureCause {
16666        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16667        where
16668            S: serde::Serializer,
16669        {
16670            match self {
16671                Self::Unspecified => serializer.serialize_i32(0),
16672                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16673                Self::ExecutionFailed => serializer.serialize_i32(2),
16674                Self::DeadlineExceeded => serializer.serialize_i32(3),
16675                Self::MissingResourcesForCanary => serializer.serialize_i32(4),
16676                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16677                Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
16678                Self::UnknownValue(u) => u.0.serialize(serializer),
16679            }
16680        }
16681    }
16682
16683    impl<'de> serde::de::Deserialize<'de> for FailureCause {
16684        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16685        where
16686            D: serde::Deserializer<'de>,
16687        {
16688            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16689                ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
16690            ))
16691        }
16692    }
16693}
16694
16695/// VerifyJobRun contains information specific to a verify `JobRun`.
16696#[derive(Clone, Default, PartialEq)]
16697#[non_exhaustive]
16698pub struct VerifyJobRun {
16699    /// Output only. The resource name of the Cloud Build `Build` object that is
16700    /// used to verify. Format is
16701    /// `projects/{project}/locations/{location}/builds/{build}`.
16702    pub build: std::string::String,
16703
16704    /// Output only. URI of a directory containing the verify artifacts. This
16705    /// contains the Skaffold event log.
16706    pub artifact_uri: std::string::String,
16707
16708    /// Output only. File path of the Skaffold event log relative to the artifact
16709    /// URI.
16710    pub event_log_path: std::string::String,
16711
16712    /// Output only. The reason the verify failed. This will always be unspecified
16713    /// while the verify is in progress or if it succeeded.
16714    pub failure_cause: crate::model::verify_job_run::FailureCause,
16715
16716    /// Output only. Additional information about the verify failure, if available.
16717    pub failure_message: std::string::String,
16718
16719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16720}
16721
16722impl VerifyJobRun {
16723    pub fn new() -> Self {
16724        std::default::Default::default()
16725    }
16726
16727    /// Sets the value of [build][crate::model::VerifyJobRun::build].
16728    ///
16729    /// # Example
16730    /// ```ignore,no_run
16731    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16732    /// let x = VerifyJobRun::new().set_build("example");
16733    /// ```
16734    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16735        self.build = v.into();
16736        self
16737    }
16738
16739    /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
16740    ///
16741    /// # Example
16742    /// ```ignore,no_run
16743    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16744    /// let x = VerifyJobRun::new().set_artifact_uri("example");
16745    /// ```
16746    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16747        self.artifact_uri = v.into();
16748        self
16749    }
16750
16751    /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
16752    ///
16753    /// # Example
16754    /// ```ignore,no_run
16755    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16756    /// let x = VerifyJobRun::new().set_event_log_path("example");
16757    /// ```
16758    pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16759        self.event_log_path = v.into();
16760        self
16761    }
16762
16763    /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
16764    ///
16765    /// # Example
16766    /// ```ignore,no_run
16767    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16768    /// use google_cloud_deploy_v1::model::verify_job_run::FailureCause;
16769    /// let x0 = VerifyJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16770    /// let x1 = VerifyJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16771    /// let x2 = VerifyJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16772    /// ```
16773    pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
16774        mut self,
16775        v: T,
16776    ) -> Self {
16777        self.failure_cause = v.into();
16778        self
16779    }
16780
16781    /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
16782    ///
16783    /// # Example
16784    /// ```ignore,no_run
16785    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16786    /// let x = VerifyJobRun::new().set_failure_message("example");
16787    /// ```
16788    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16789        self.failure_message = v.into();
16790        self
16791    }
16792}
16793
16794impl wkt::message::Message for VerifyJobRun {
16795    fn typename() -> &'static str {
16796        "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
16797    }
16798}
16799
16800/// Defines additional types related to [VerifyJobRun].
16801pub mod verify_job_run {
16802    #[allow(unused_imports)]
16803    use super::*;
16804
16805    /// Well-known verify failures.
16806    ///
16807    /// # Working with unknown values
16808    ///
16809    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16810    /// additional enum variants at any time. Adding new variants is not considered
16811    /// a breaking change. Applications should write their code in anticipation of:
16812    ///
16813    /// - New values appearing in future releases of the client library, **and**
16814    /// - New values received dynamically, without application changes.
16815    ///
16816    /// Please consult the [Working with enums] section in the user guide for some
16817    /// guidelines.
16818    ///
16819    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16820    #[derive(Clone, Debug, PartialEq)]
16821    #[non_exhaustive]
16822    pub enum FailureCause {
16823        /// No reason for failure is specified.
16824        Unspecified,
16825        /// Cloud Build is not available, either because it is not enabled or because
16826        /// Cloud Deploy has insufficient permissions. See [required
16827        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16828        CloudBuildUnavailable,
16829        /// The verify operation did not complete successfully; check Cloud Build
16830        /// logs.
16831        ExecutionFailed,
16832        /// The verify job run did not complete within the allotted time.
16833        DeadlineExceeded,
16834        /// No Skaffold verify configuration was found.
16835        VerificationConfigNotFound,
16836        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16837        /// for additional details.
16838        CloudBuildRequestFailed,
16839        /// If set, the enum was initialized with an unknown value.
16840        ///
16841        /// Applications can examine the value using [FailureCause::value] or
16842        /// [FailureCause::name].
16843        UnknownValue(failure_cause::UnknownValue),
16844    }
16845
16846    #[doc(hidden)]
16847    pub mod failure_cause {
16848        #[allow(unused_imports)]
16849        use super::*;
16850        #[derive(Clone, Debug, PartialEq)]
16851        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16852    }
16853
16854    impl FailureCause {
16855        /// Gets the enum value.
16856        ///
16857        /// Returns `None` if the enum contains an unknown value deserialized from
16858        /// the string representation of enums.
16859        pub fn value(&self) -> std::option::Option<i32> {
16860            match self {
16861                Self::Unspecified => std::option::Option::Some(0),
16862                Self::CloudBuildUnavailable => std::option::Option::Some(1),
16863                Self::ExecutionFailed => std::option::Option::Some(2),
16864                Self::DeadlineExceeded => std::option::Option::Some(3),
16865                Self::VerificationConfigNotFound => std::option::Option::Some(4),
16866                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16867                Self::UnknownValue(u) => u.0.value(),
16868            }
16869        }
16870
16871        /// Gets the enum value as a string.
16872        ///
16873        /// Returns `None` if the enum contains an unknown value deserialized from
16874        /// the integer representation of enums.
16875        pub fn name(&self) -> std::option::Option<&str> {
16876            match self {
16877                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16878                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16879                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16880                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16881                Self::VerificationConfigNotFound => {
16882                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
16883                }
16884                Self::CloudBuildRequestFailed => {
16885                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16886                }
16887                Self::UnknownValue(u) => u.0.name(),
16888            }
16889        }
16890    }
16891
16892    impl std::default::Default for FailureCause {
16893        fn default() -> Self {
16894            use std::convert::From;
16895            Self::from(0)
16896        }
16897    }
16898
16899    impl std::fmt::Display for FailureCause {
16900        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16901            wkt::internal::display_enum(f, self.name(), self.value())
16902        }
16903    }
16904
16905    impl std::convert::From<i32> for FailureCause {
16906        fn from(value: i32) -> Self {
16907            match value {
16908                0 => Self::Unspecified,
16909                1 => Self::CloudBuildUnavailable,
16910                2 => Self::ExecutionFailed,
16911                3 => Self::DeadlineExceeded,
16912                4 => Self::VerificationConfigNotFound,
16913                5 => Self::CloudBuildRequestFailed,
16914                _ => Self::UnknownValue(failure_cause::UnknownValue(
16915                    wkt::internal::UnknownEnumValue::Integer(value),
16916                )),
16917            }
16918        }
16919    }
16920
16921    impl std::convert::From<&str> for FailureCause {
16922        fn from(value: &str) -> Self {
16923            use std::string::ToString;
16924            match value {
16925                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16926                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16927                "EXECUTION_FAILED" => Self::ExecutionFailed,
16928                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16929                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
16930                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16931                _ => Self::UnknownValue(failure_cause::UnknownValue(
16932                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16933                )),
16934            }
16935        }
16936    }
16937
16938    impl serde::ser::Serialize for FailureCause {
16939        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16940        where
16941            S: serde::Serializer,
16942        {
16943            match self {
16944                Self::Unspecified => serializer.serialize_i32(0),
16945                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16946                Self::ExecutionFailed => serializer.serialize_i32(2),
16947                Self::DeadlineExceeded => serializer.serialize_i32(3),
16948                Self::VerificationConfigNotFound => serializer.serialize_i32(4),
16949                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16950                Self::UnknownValue(u) => u.0.serialize(serializer),
16951            }
16952        }
16953    }
16954
16955    impl<'de> serde::de::Deserialize<'de> for FailureCause {
16956        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16957        where
16958            D: serde::Deserializer<'de>,
16959        {
16960            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16961                ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
16962            ))
16963        }
16964    }
16965}
16966
16967/// PredeployJobRun contains information specific to a predeploy `JobRun`.
16968#[derive(Clone, Default, PartialEq)]
16969#[non_exhaustive]
16970pub struct PredeployJobRun {
16971    /// Output only. The resource name of the Cloud Build `Build` object that is
16972    /// used to execute the custom actions associated with the predeploy Job.
16973    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
16974    pub build: std::string::String,
16975
16976    /// Output only. The reason the predeploy failed. This will always be
16977    /// unspecified while the predeploy is in progress or if it succeeded.
16978    pub failure_cause: crate::model::predeploy_job_run::FailureCause,
16979
16980    /// Output only. Additional information about the predeploy failure, if
16981    /// available.
16982    pub failure_message: std::string::String,
16983
16984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16985}
16986
16987impl PredeployJobRun {
16988    pub fn new() -> Self {
16989        std::default::Default::default()
16990    }
16991
16992    /// Sets the value of [build][crate::model::PredeployJobRun::build].
16993    ///
16994    /// # Example
16995    /// ```ignore,no_run
16996    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
16997    /// let x = PredeployJobRun::new().set_build("example");
16998    /// ```
16999    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17000        self.build = v.into();
17001        self
17002    }
17003
17004    /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
17005    ///
17006    /// # Example
17007    /// ```ignore,no_run
17008    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17009    /// use google_cloud_deploy_v1::model::predeploy_job_run::FailureCause;
17010    /// let x0 = PredeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17011    /// let x1 = PredeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17012    /// let x2 = PredeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17013    /// ```
17014    pub fn set_failure_cause<
17015        T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
17016    >(
17017        mut self,
17018        v: T,
17019    ) -> Self {
17020        self.failure_cause = v.into();
17021        self
17022    }
17023
17024    /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
17025    ///
17026    /// # Example
17027    /// ```ignore,no_run
17028    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17029    /// let x = PredeployJobRun::new().set_failure_message("example");
17030    /// ```
17031    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17032        self.failure_message = v.into();
17033        self
17034    }
17035}
17036
17037impl wkt::message::Message for PredeployJobRun {
17038    fn typename() -> &'static str {
17039        "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
17040    }
17041}
17042
17043/// Defines additional types related to [PredeployJobRun].
17044pub mod predeploy_job_run {
17045    #[allow(unused_imports)]
17046    use super::*;
17047
17048    /// Well-known predeploy failures.
17049    ///
17050    /// # Working with unknown values
17051    ///
17052    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17053    /// additional enum variants at any time. Adding new variants is not considered
17054    /// a breaking change. Applications should write their code in anticipation of:
17055    ///
17056    /// - New values appearing in future releases of the client library, **and**
17057    /// - New values received dynamically, without application changes.
17058    ///
17059    /// Please consult the [Working with enums] section in the user guide for some
17060    /// guidelines.
17061    ///
17062    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17063    #[derive(Clone, Debug, PartialEq)]
17064    #[non_exhaustive]
17065    pub enum FailureCause {
17066        /// No reason for failure is specified.
17067        Unspecified,
17068        /// Cloud Build is not available, either because it is not enabled or because
17069        /// Cloud Deploy has insufficient permissions. See [required
17070        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17071        CloudBuildUnavailable,
17072        /// The predeploy operation did not complete successfully; check Cloud Build
17073        /// logs.
17074        ExecutionFailed,
17075        /// The predeploy job run did not complete within the allotted time.
17076        DeadlineExceeded,
17077        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17078        /// for additional details.
17079        CloudBuildRequestFailed,
17080        /// If set, the enum was initialized with an unknown value.
17081        ///
17082        /// Applications can examine the value using [FailureCause::value] or
17083        /// [FailureCause::name].
17084        UnknownValue(failure_cause::UnknownValue),
17085    }
17086
17087    #[doc(hidden)]
17088    pub mod failure_cause {
17089        #[allow(unused_imports)]
17090        use super::*;
17091        #[derive(Clone, Debug, PartialEq)]
17092        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17093    }
17094
17095    impl FailureCause {
17096        /// Gets the enum value.
17097        ///
17098        /// Returns `None` if the enum contains an unknown value deserialized from
17099        /// the string representation of enums.
17100        pub fn value(&self) -> std::option::Option<i32> {
17101            match self {
17102                Self::Unspecified => std::option::Option::Some(0),
17103                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17104                Self::ExecutionFailed => std::option::Option::Some(2),
17105                Self::DeadlineExceeded => std::option::Option::Some(3),
17106                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17107                Self::UnknownValue(u) => u.0.value(),
17108            }
17109        }
17110
17111        /// Gets the enum value as a string.
17112        ///
17113        /// Returns `None` if the enum contains an unknown value deserialized from
17114        /// the integer representation of enums.
17115        pub fn name(&self) -> std::option::Option<&str> {
17116            match self {
17117                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17118                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17119                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17120                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17121                Self::CloudBuildRequestFailed => {
17122                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17123                }
17124                Self::UnknownValue(u) => u.0.name(),
17125            }
17126        }
17127    }
17128
17129    impl std::default::Default for FailureCause {
17130        fn default() -> Self {
17131            use std::convert::From;
17132            Self::from(0)
17133        }
17134    }
17135
17136    impl std::fmt::Display for FailureCause {
17137        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17138            wkt::internal::display_enum(f, self.name(), self.value())
17139        }
17140    }
17141
17142    impl std::convert::From<i32> for FailureCause {
17143        fn from(value: i32) -> Self {
17144            match value {
17145                0 => Self::Unspecified,
17146                1 => Self::CloudBuildUnavailable,
17147                2 => Self::ExecutionFailed,
17148                3 => Self::DeadlineExceeded,
17149                4 => Self::CloudBuildRequestFailed,
17150                _ => Self::UnknownValue(failure_cause::UnknownValue(
17151                    wkt::internal::UnknownEnumValue::Integer(value),
17152                )),
17153            }
17154        }
17155    }
17156
17157    impl std::convert::From<&str> for FailureCause {
17158        fn from(value: &str) -> Self {
17159            use std::string::ToString;
17160            match value {
17161                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17162                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17163                "EXECUTION_FAILED" => Self::ExecutionFailed,
17164                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17165                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17166                _ => Self::UnknownValue(failure_cause::UnknownValue(
17167                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17168                )),
17169            }
17170        }
17171    }
17172
17173    impl serde::ser::Serialize for FailureCause {
17174        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17175        where
17176            S: serde::Serializer,
17177        {
17178            match self {
17179                Self::Unspecified => serializer.serialize_i32(0),
17180                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17181                Self::ExecutionFailed => serializer.serialize_i32(2),
17182                Self::DeadlineExceeded => serializer.serialize_i32(3),
17183                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17184                Self::UnknownValue(u) => u.0.serialize(serializer),
17185            }
17186        }
17187    }
17188
17189    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17190        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17191        where
17192            D: serde::Deserializer<'de>,
17193        {
17194            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17195                ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
17196            ))
17197        }
17198    }
17199}
17200
17201/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
17202#[derive(Clone, Default, PartialEq)]
17203#[non_exhaustive]
17204pub struct PostdeployJobRun {
17205    /// Output only. The resource name of the Cloud Build `Build` object that is
17206    /// used to execute the custom actions associated with the postdeploy Job.
17207    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17208    pub build: std::string::String,
17209
17210    /// Output only. The reason the postdeploy failed. This will always be
17211    /// unspecified while the postdeploy is in progress or if it succeeded.
17212    pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
17213
17214    /// Output only. Additional information about the postdeploy failure, if
17215    /// available.
17216    pub failure_message: std::string::String,
17217
17218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17219}
17220
17221impl PostdeployJobRun {
17222    pub fn new() -> Self {
17223        std::default::Default::default()
17224    }
17225
17226    /// Sets the value of [build][crate::model::PostdeployJobRun::build].
17227    ///
17228    /// # Example
17229    /// ```ignore,no_run
17230    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17231    /// let x = PostdeployJobRun::new().set_build("example");
17232    /// ```
17233    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17234        self.build = v.into();
17235        self
17236    }
17237
17238    /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
17239    ///
17240    /// # Example
17241    /// ```ignore,no_run
17242    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17243    /// use google_cloud_deploy_v1::model::postdeploy_job_run::FailureCause;
17244    /// let x0 = PostdeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17245    /// let x1 = PostdeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17246    /// let x2 = PostdeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17247    /// ```
17248    pub fn set_failure_cause<
17249        T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
17250    >(
17251        mut self,
17252        v: T,
17253    ) -> Self {
17254        self.failure_cause = v.into();
17255        self
17256    }
17257
17258    /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
17259    ///
17260    /// # Example
17261    /// ```ignore,no_run
17262    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17263    /// let x = PostdeployJobRun::new().set_failure_message("example");
17264    /// ```
17265    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17266        self.failure_message = v.into();
17267        self
17268    }
17269}
17270
17271impl wkt::message::Message for PostdeployJobRun {
17272    fn typename() -> &'static str {
17273        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
17274    }
17275}
17276
17277/// Defines additional types related to [PostdeployJobRun].
17278pub mod postdeploy_job_run {
17279    #[allow(unused_imports)]
17280    use super::*;
17281
17282    /// Well-known postdeploy failures.
17283    ///
17284    /// # Working with unknown values
17285    ///
17286    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17287    /// additional enum variants at any time. Adding new variants is not considered
17288    /// a breaking change. Applications should write their code in anticipation of:
17289    ///
17290    /// - New values appearing in future releases of the client library, **and**
17291    /// - New values received dynamically, without application changes.
17292    ///
17293    /// Please consult the [Working with enums] section in the user guide for some
17294    /// guidelines.
17295    ///
17296    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17297    #[derive(Clone, Debug, PartialEq)]
17298    #[non_exhaustive]
17299    pub enum FailureCause {
17300        /// No reason for failure is specified.
17301        Unspecified,
17302        /// Cloud Build is not available, either because it is not enabled or because
17303        /// Cloud Deploy has insufficient permissions. See [required
17304        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17305        CloudBuildUnavailable,
17306        /// The postdeploy operation did not complete successfully; check Cloud Build
17307        /// logs.
17308        ExecutionFailed,
17309        /// The postdeploy job run did not complete within the allotted time.
17310        DeadlineExceeded,
17311        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17312        /// for additional details.
17313        CloudBuildRequestFailed,
17314        /// If set, the enum was initialized with an unknown value.
17315        ///
17316        /// Applications can examine the value using [FailureCause::value] or
17317        /// [FailureCause::name].
17318        UnknownValue(failure_cause::UnknownValue),
17319    }
17320
17321    #[doc(hidden)]
17322    pub mod failure_cause {
17323        #[allow(unused_imports)]
17324        use super::*;
17325        #[derive(Clone, Debug, PartialEq)]
17326        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17327    }
17328
17329    impl FailureCause {
17330        /// Gets the enum value.
17331        ///
17332        /// Returns `None` if the enum contains an unknown value deserialized from
17333        /// the string representation of enums.
17334        pub fn value(&self) -> std::option::Option<i32> {
17335            match self {
17336                Self::Unspecified => std::option::Option::Some(0),
17337                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17338                Self::ExecutionFailed => std::option::Option::Some(2),
17339                Self::DeadlineExceeded => std::option::Option::Some(3),
17340                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17341                Self::UnknownValue(u) => u.0.value(),
17342            }
17343        }
17344
17345        /// Gets the enum value as a string.
17346        ///
17347        /// Returns `None` if the enum contains an unknown value deserialized from
17348        /// the integer representation of enums.
17349        pub fn name(&self) -> std::option::Option<&str> {
17350            match self {
17351                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17352                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17353                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17354                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17355                Self::CloudBuildRequestFailed => {
17356                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17357                }
17358                Self::UnknownValue(u) => u.0.name(),
17359            }
17360        }
17361    }
17362
17363    impl std::default::Default for FailureCause {
17364        fn default() -> Self {
17365            use std::convert::From;
17366            Self::from(0)
17367        }
17368    }
17369
17370    impl std::fmt::Display for FailureCause {
17371        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17372            wkt::internal::display_enum(f, self.name(), self.value())
17373        }
17374    }
17375
17376    impl std::convert::From<i32> for FailureCause {
17377        fn from(value: i32) -> Self {
17378            match value {
17379                0 => Self::Unspecified,
17380                1 => Self::CloudBuildUnavailable,
17381                2 => Self::ExecutionFailed,
17382                3 => Self::DeadlineExceeded,
17383                4 => Self::CloudBuildRequestFailed,
17384                _ => Self::UnknownValue(failure_cause::UnknownValue(
17385                    wkt::internal::UnknownEnumValue::Integer(value),
17386                )),
17387            }
17388        }
17389    }
17390
17391    impl std::convert::From<&str> for FailureCause {
17392        fn from(value: &str) -> Self {
17393            use std::string::ToString;
17394            match value {
17395                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17396                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17397                "EXECUTION_FAILED" => Self::ExecutionFailed,
17398                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17399                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17400                _ => Self::UnknownValue(failure_cause::UnknownValue(
17401                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17402                )),
17403            }
17404        }
17405    }
17406
17407    impl serde::ser::Serialize for FailureCause {
17408        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17409        where
17410            S: serde::Serializer,
17411        {
17412            match self {
17413                Self::Unspecified => serializer.serialize_i32(0),
17414                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17415                Self::ExecutionFailed => serializer.serialize_i32(2),
17416                Self::DeadlineExceeded => serializer.serialize_i32(3),
17417                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17418                Self::UnknownValue(u) => u.0.serialize(serializer),
17419            }
17420        }
17421    }
17422
17423    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17424        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17425        where
17426            D: serde::Deserializer<'de>,
17427        {
17428            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17429                ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
17430            ))
17431        }
17432    }
17433}
17434
17435/// CreateChildRolloutJobRun contains information specific to a
17436/// createChildRollout `JobRun`.
17437#[derive(Clone, Default, PartialEq)]
17438#[non_exhaustive]
17439pub struct CreateChildRolloutJobRun {
17440    /// Output only. Name of the `ChildRollout`. Format is
17441    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17442    pub rollout: std::string::String,
17443
17444    /// Output only. The ID of the childRollout Phase initiated by this JobRun.
17445    pub rollout_phase_id: std::string::String,
17446
17447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17448}
17449
17450impl CreateChildRolloutJobRun {
17451    pub fn new() -> Self {
17452        std::default::Default::default()
17453    }
17454
17455    /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
17456    ///
17457    /// # Example
17458    /// ```ignore,no_run
17459    /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17460    /// let x = CreateChildRolloutJobRun::new().set_rollout("example");
17461    /// ```
17462    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17463        self.rollout = v.into();
17464        self
17465    }
17466
17467    /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
17468    ///
17469    /// # Example
17470    /// ```ignore,no_run
17471    /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17472    /// let x = CreateChildRolloutJobRun::new().set_rollout_phase_id("example");
17473    /// ```
17474    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17475        mut self,
17476        v: T,
17477    ) -> Self {
17478        self.rollout_phase_id = v.into();
17479        self
17480    }
17481}
17482
17483impl wkt::message::Message for CreateChildRolloutJobRun {
17484    fn typename() -> &'static str {
17485        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
17486    }
17487}
17488
17489/// AdvanceChildRolloutJobRun contains information specific to a
17490/// advanceChildRollout `JobRun`.
17491#[derive(Clone, Default, PartialEq)]
17492#[non_exhaustive]
17493pub struct AdvanceChildRolloutJobRun {
17494    /// Output only. Name of the `ChildRollout`. Format is
17495    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17496    pub rollout: std::string::String,
17497
17498    /// Output only. the ID of the ChildRollout's Phase.
17499    pub rollout_phase_id: std::string::String,
17500
17501    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17502}
17503
17504impl AdvanceChildRolloutJobRun {
17505    pub fn new() -> Self {
17506        std::default::Default::default()
17507    }
17508
17509    /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
17510    ///
17511    /// # Example
17512    /// ```ignore,no_run
17513    /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17514    /// let x = AdvanceChildRolloutJobRun::new().set_rollout("example");
17515    /// ```
17516    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17517        self.rollout = v.into();
17518        self
17519    }
17520
17521    /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
17522    ///
17523    /// # Example
17524    /// ```ignore,no_run
17525    /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17526    /// let x = AdvanceChildRolloutJobRun::new().set_rollout_phase_id("example");
17527    /// ```
17528    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17529        mut self,
17530        v: T,
17531    ) -> Self {
17532        self.rollout_phase_id = v.into();
17533        self
17534    }
17535}
17536
17537impl wkt::message::Message for AdvanceChildRolloutJobRun {
17538    fn typename() -> &'static str {
17539        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
17540    }
17541}
17542
17543/// ListJobRunsRequest is the request object used by `ListJobRuns`.
17544#[derive(Clone, Default, PartialEq)]
17545#[non_exhaustive]
17546pub struct ListJobRunsRequest {
17547    /// Required. The `Rollout` which owns this collection of `JobRun` objects.
17548    pub parent: std::string::String,
17549
17550    /// Optional. The maximum number of `JobRun` objects to return. The service may
17551    /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
17552    /// will be returned. The maximum value is 1000; values above 1000 will be set
17553    /// to 1000.
17554    pub page_size: i32,
17555
17556    /// Optional. A page token, received from a previous `ListJobRuns` call.
17557    /// Provide this to retrieve the subsequent page.
17558    ///
17559    /// When paginating, all other provided parameters match the call that provided
17560    /// the page token.
17561    pub page_token: std::string::String,
17562
17563    /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
17564    /// more details.
17565    pub filter: std::string::String,
17566
17567    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
17568    /// more details.
17569    pub order_by: std::string::String,
17570
17571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17572}
17573
17574impl ListJobRunsRequest {
17575    pub fn new() -> Self {
17576        std::default::Default::default()
17577    }
17578
17579    /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
17580    ///
17581    /// # Example
17582    /// ```ignore,no_run
17583    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17584    /// let x = ListJobRunsRequest::new().set_parent("example");
17585    /// ```
17586    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17587        self.parent = v.into();
17588        self
17589    }
17590
17591    /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
17592    ///
17593    /// # Example
17594    /// ```ignore,no_run
17595    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17596    /// let x = ListJobRunsRequest::new().set_page_size(42);
17597    /// ```
17598    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17599        self.page_size = v.into();
17600        self
17601    }
17602
17603    /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
17604    ///
17605    /// # Example
17606    /// ```ignore,no_run
17607    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17608    /// let x = ListJobRunsRequest::new().set_page_token("example");
17609    /// ```
17610    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17611        self.page_token = v.into();
17612        self
17613    }
17614
17615    /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
17616    ///
17617    /// # Example
17618    /// ```ignore,no_run
17619    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17620    /// let x = ListJobRunsRequest::new().set_filter("example");
17621    /// ```
17622    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17623        self.filter = v.into();
17624        self
17625    }
17626
17627    /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
17628    ///
17629    /// # Example
17630    /// ```ignore,no_run
17631    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17632    /// let x = ListJobRunsRequest::new().set_order_by("example");
17633    /// ```
17634    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17635        self.order_by = v.into();
17636        self
17637    }
17638}
17639
17640impl wkt::message::Message for ListJobRunsRequest {
17641    fn typename() -> &'static str {
17642        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
17643    }
17644}
17645
17646/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
17647#[derive(Clone, Default, PartialEq)]
17648#[non_exhaustive]
17649pub struct ListJobRunsResponse {
17650    /// The `JobRun` objects.
17651    pub job_runs: std::vec::Vec<crate::model::JobRun>,
17652
17653    /// A token, which can be sent as `page_token` to retrieve the next page. If
17654    /// this field is omitted, there are no subsequent pages.
17655    pub next_page_token: std::string::String,
17656
17657    /// Locations that could not be reached
17658    pub unreachable: std::vec::Vec<std::string::String>,
17659
17660    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17661}
17662
17663impl ListJobRunsResponse {
17664    pub fn new() -> Self {
17665        std::default::Default::default()
17666    }
17667
17668    /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
17669    ///
17670    /// # Example
17671    /// ```ignore,no_run
17672    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17673    /// use google_cloud_deploy_v1::model::JobRun;
17674    /// let x = ListJobRunsResponse::new()
17675    ///     .set_job_runs([
17676    ///         JobRun::default()/* use setters */,
17677    ///         JobRun::default()/* use (different) setters */,
17678    ///     ]);
17679    /// ```
17680    pub fn set_job_runs<T, V>(mut self, v: T) -> Self
17681    where
17682        T: std::iter::IntoIterator<Item = V>,
17683        V: std::convert::Into<crate::model::JobRun>,
17684    {
17685        use std::iter::Iterator;
17686        self.job_runs = v.into_iter().map(|i| i.into()).collect();
17687        self
17688    }
17689
17690    /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
17691    ///
17692    /// # Example
17693    /// ```ignore,no_run
17694    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17695    /// let x = ListJobRunsResponse::new().set_next_page_token("example");
17696    /// ```
17697    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17698        self.next_page_token = v.into();
17699        self
17700    }
17701
17702    /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
17703    ///
17704    /// # Example
17705    /// ```ignore,no_run
17706    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17707    /// let x = ListJobRunsResponse::new().set_unreachable(["a", "b", "c"]);
17708    /// ```
17709    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17710    where
17711        T: std::iter::IntoIterator<Item = V>,
17712        V: std::convert::Into<std::string::String>,
17713    {
17714        use std::iter::Iterator;
17715        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17716        self
17717    }
17718}
17719
17720impl wkt::message::Message for ListJobRunsResponse {
17721    fn typename() -> &'static str {
17722        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
17723    }
17724}
17725
17726#[doc(hidden)]
17727impl gax::paginator::internal::PageableResponse for ListJobRunsResponse {
17728    type PageItem = crate::model::JobRun;
17729
17730    fn items(self) -> std::vec::Vec<Self::PageItem> {
17731        self.job_runs
17732    }
17733
17734    fn next_page_token(&self) -> std::string::String {
17735        use std::clone::Clone;
17736        self.next_page_token.clone()
17737    }
17738}
17739
17740/// GetJobRunRequest is the request object used by `GetJobRun`.
17741#[derive(Clone, Default, PartialEq)]
17742#[non_exhaustive]
17743pub struct GetJobRunRequest {
17744    /// Required. Name of the `JobRun`. Format must be
17745    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
17746    pub name: std::string::String,
17747
17748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17749}
17750
17751impl GetJobRunRequest {
17752    pub fn new() -> Self {
17753        std::default::Default::default()
17754    }
17755
17756    /// Sets the value of [name][crate::model::GetJobRunRequest::name].
17757    ///
17758    /// # Example
17759    /// ```ignore,no_run
17760    /// # use google_cloud_deploy_v1::model::GetJobRunRequest;
17761    /// let x = GetJobRunRequest::new().set_name("example");
17762    /// ```
17763    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17764        self.name = v.into();
17765        self
17766    }
17767}
17768
17769impl wkt::message::Message for GetJobRunRequest {
17770    fn typename() -> &'static str {
17771        "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
17772    }
17773}
17774
17775/// The request object used by `TerminateJobRun`.
17776#[derive(Clone, Default, PartialEq)]
17777#[non_exhaustive]
17778pub struct TerminateJobRunRequest {
17779    /// Required. Name of the `JobRun`. Format must be
17780    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
17781    pub name: std::string::String,
17782
17783    /// Optional. Deploy policies to override. Format is
17784    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
17785    pub override_deploy_policy: std::vec::Vec<std::string::String>,
17786
17787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17788}
17789
17790impl TerminateJobRunRequest {
17791    pub fn new() -> Self {
17792        std::default::Default::default()
17793    }
17794
17795    /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
17796    ///
17797    /// # Example
17798    /// ```ignore,no_run
17799    /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17800    /// let x = TerminateJobRunRequest::new().set_name("example");
17801    /// ```
17802    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17803        self.name = v.into();
17804        self
17805    }
17806
17807    /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
17808    ///
17809    /// # Example
17810    /// ```ignore,no_run
17811    /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17812    /// let x = TerminateJobRunRequest::new().set_override_deploy_policy(["a", "b", "c"]);
17813    /// ```
17814    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
17815    where
17816        T: std::iter::IntoIterator<Item = V>,
17817        V: std::convert::Into<std::string::String>,
17818    {
17819        use std::iter::Iterator;
17820        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
17821        self
17822    }
17823}
17824
17825impl wkt::message::Message for TerminateJobRunRequest {
17826    fn typename() -> &'static str {
17827        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
17828    }
17829}
17830
17831/// The response object from `TerminateJobRun`.
17832#[derive(Clone, Default, PartialEq)]
17833#[non_exhaustive]
17834pub struct TerminateJobRunResponse {
17835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17836}
17837
17838impl TerminateJobRunResponse {
17839    pub fn new() -> Self {
17840        std::default::Default::default()
17841    }
17842}
17843
17844impl wkt::message::Message for TerminateJobRunResponse {
17845    fn typename() -> &'static str {
17846        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
17847    }
17848}
17849
17850/// Service-wide configuration.
17851#[derive(Clone, Default, PartialEq)]
17852#[non_exhaustive]
17853pub struct Config {
17854    /// Name of the configuration.
17855    pub name: std::string::String,
17856
17857    /// All supported versions of Skaffold.
17858    pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
17859
17860    /// Default Skaffold version that is assigned when a Release is created without
17861    /// specifying a Skaffold version.
17862    pub default_skaffold_version: std::string::String,
17863
17864    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17865}
17866
17867impl Config {
17868    pub fn new() -> Self {
17869        std::default::Default::default()
17870    }
17871
17872    /// Sets the value of [name][crate::model::Config::name].
17873    ///
17874    /// # Example
17875    /// ```ignore,no_run
17876    /// # use google_cloud_deploy_v1::model::Config;
17877    /// let x = Config::new().set_name("example");
17878    /// ```
17879    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17880        self.name = v.into();
17881        self
17882    }
17883
17884    /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
17885    ///
17886    /// # Example
17887    /// ```ignore,no_run
17888    /// # use google_cloud_deploy_v1::model::Config;
17889    /// use google_cloud_deploy_v1::model::SkaffoldVersion;
17890    /// let x = Config::new()
17891    ///     .set_supported_versions([
17892    ///         SkaffoldVersion::default()/* use setters */,
17893    ///         SkaffoldVersion::default()/* use (different) setters */,
17894    ///     ]);
17895    /// ```
17896    pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
17897    where
17898        T: std::iter::IntoIterator<Item = V>,
17899        V: std::convert::Into<crate::model::SkaffoldVersion>,
17900    {
17901        use std::iter::Iterator;
17902        self.supported_versions = v.into_iter().map(|i| i.into()).collect();
17903        self
17904    }
17905
17906    /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
17907    ///
17908    /// # Example
17909    /// ```ignore,no_run
17910    /// # use google_cloud_deploy_v1::model::Config;
17911    /// let x = Config::new().set_default_skaffold_version("example");
17912    /// ```
17913    pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
17914        mut self,
17915        v: T,
17916    ) -> Self {
17917        self.default_skaffold_version = v.into();
17918        self
17919    }
17920}
17921
17922impl wkt::message::Message for Config {
17923    fn typename() -> &'static str {
17924        "type.googleapis.com/google.cloud.deploy.v1.Config"
17925    }
17926}
17927
17928/// Details of a supported Skaffold version.
17929#[derive(Clone, Default, PartialEq)]
17930#[non_exhaustive]
17931pub struct SkaffoldVersion {
17932    /// Release version number. For example, "1.20.3".
17933    pub version: std::string::String,
17934
17935    /// The time at which this version of Skaffold will enter maintenance mode.
17936    pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
17937
17938    /// The time at which this version of Skaffold will no longer be supported.
17939    pub support_expiration_time: std::option::Option<wkt::Timestamp>,
17940
17941    /// Date when this version is expected to no longer be supported.
17942    pub support_end_date: std::option::Option<gtype::model::Date>,
17943
17944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17945}
17946
17947impl SkaffoldVersion {
17948    pub fn new() -> Self {
17949        std::default::Default::default()
17950    }
17951
17952    /// Sets the value of [version][crate::model::SkaffoldVersion::version].
17953    ///
17954    /// # Example
17955    /// ```ignore,no_run
17956    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17957    /// let x = SkaffoldVersion::new().set_version("example");
17958    /// ```
17959    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17960        self.version = v.into();
17961        self
17962    }
17963
17964    /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
17965    ///
17966    /// # Example
17967    /// ```ignore,no_run
17968    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17969    /// use wkt::Timestamp;
17970    /// let x = SkaffoldVersion::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
17971    /// ```
17972    pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
17973    where
17974        T: std::convert::Into<wkt::Timestamp>,
17975    {
17976        self.maintenance_mode_time = std::option::Option::Some(v.into());
17977        self
17978    }
17979
17980    /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
17981    ///
17982    /// # Example
17983    /// ```ignore,no_run
17984    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17985    /// use wkt::Timestamp;
17986    /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
17987    /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
17988    /// ```
17989    pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
17990    where
17991        T: std::convert::Into<wkt::Timestamp>,
17992    {
17993        self.maintenance_mode_time = v.map(|x| x.into());
17994        self
17995    }
17996
17997    /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
17998    ///
17999    /// # Example
18000    /// ```ignore,no_run
18001    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18002    /// use wkt::Timestamp;
18003    /// let x = SkaffoldVersion::new().set_support_expiration_time(Timestamp::default()/* use setters */);
18004    /// ```
18005    pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
18006    where
18007        T: std::convert::Into<wkt::Timestamp>,
18008    {
18009        self.support_expiration_time = std::option::Option::Some(v.into());
18010        self
18011    }
18012
18013    /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18014    ///
18015    /// # Example
18016    /// ```ignore,no_run
18017    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18018    /// use wkt::Timestamp;
18019    /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
18020    /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(None::<Timestamp>);
18021    /// ```
18022    pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18023    where
18024        T: std::convert::Into<wkt::Timestamp>,
18025    {
18026        self.support_expiration_time = v.map(|x| x.into());
18027        self
18028    }
18029
18030    /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18031    ///
18032    /// # Example
18033    /// ```ignore,no_run
18034    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18035    /// use gtype::model::Date;
18036    /// let x = SkaffoldVersion::new().set_support_end_date(Date::default()/* use setters */);
18037    /// ```
18038    pub fn set_support_end_date<T>(mut self, v: T) -> Self
18039    where
18040        T: std::convert::Into<gtype::model::Date>,
18041    {
18042        self.support_end_date = std::option::Option::Some(v.into());
18043        self
18044    }
18045
18046    /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18047    ///
18048    /// # Example
18049    /// ```ignore,no_run
18050    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18051    /// use gtype::model::Date;
18052    /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(Some(Date::default()/* use setters */));
18053    /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(None::<Date>);
18054    /// ```
18055    pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
18056    where
18057        T: std::convert::Into<gtype::model::Date>,
18058    {
18059        self.support_end_date = v.map(|x| x.into());
18060        self
18061    }
18062}
18063
18064impl wkt::message::Message for SkaffoldVersion {
18065    fn typename() -> &'static str {
18066        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
18067    }
18068}
18069
18070/// Request to get a configuration.
18071#[derive(Clone, Default, PartialEq)]
18072#[non_exhaustive]
18073pub struct GetConfigRequest {
18074    /// Required. Name of requested configuration.
18075    pub name: std::string::String,
18076
18077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18078}
18079
18080impl GetConfigRequest {
18081    pub fn new() -> Self {
18082        std::default::Default::default()
18083    }
18084
18085    /// Sets the value of [name][crate::model::GetConfigRequest::name].
18086    ///
18087    /// # Example
18088    /// ```ignore,no_run
18089    /// # use google_cloud_deploy_v1::model::GetConfigRequest;
18090    /// let x = GetConfigRequest::new().set_name("example");
18091    /// ```
18092    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18093        self.name = v.into();
18094        self
18095    }
18096}
18097
18098impl wkt::message::Message for GetConfigRequest {
18099    fn typename() -> &'static str {
18100        "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
18101    }
18102}
18103
18104/// An `Automation` resource in the Cloud Deploy API.
18105///
18106/// An `Automation` enables the automation of manually driven actions for
18107/// a Delivery Pipeline, which includes Release promotion among Targets,
18108/// Rollout repair and Rollout deployment strategy advancement. The intention
18109/// of Automation is to reduce manual intervention in the continuous delivery
18110/// process.
18111#[derive(Clone, Default, PartialEq)]
18112#[non_exhaustive]
18113pub struct Automation {
18114    /// Output only. Name of the `Automation`. Format is
18115    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
18116    pub name: std::string::String,
18117
18118    /// Output only. Unique identifier of the `Automation`.
18119    pub uid: std::string::String,
18120
18121    /// Optional. Description of the `Automation`. Max length is 255 characters.
18122    pub description: std::string::String,
18123
18124    /// Output only. Time at which the automation was created.
18125    pub create_time: std::option::Option<wkt::Timestamp>,
18126
18127    /// Output only. Time at which the automation was updated.
18128    pub update_time: std::option::Option<wkt::Timestamp>,
18129
18130    /// Optional. User annotations. These attributes can only be set and used by
18131    /// the user, and not by Cloud Deploy. Annotations must meet the following
18132    /// constraints:
18133    ///
18134    /// * Annotations are key/value pairs.
18135    /// * Valid annotation keys have two segments: an optional prefix and name,
18136    ///   separated by a slash (`/`).
18137    /// * The name segment is required and must be 63 characters or less,
18138    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
18139    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
18140    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
18141    ///   a series of DNS labels separated by dots(`.`), not longer than 253
18142    ///   characters in total, followed by a slash (`/`).
18143    ///
18144    /// See
18145    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
18146    /// for more details.
18147    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18148
18149    /// Optional. Labels are attributes that can be set and used by both the
18150    /// user and by Cloud Deploy. Labels must meet the following constraints:
18151    ///
18152    /// * Keys and values can contain only lowercase letters, numeric characters,
18153    ///   underscores, and dashes.
18154    /// * All characters must use UTF-8 encoding, and international characters are
18155    ///   allowed.
18156    /// * Keys must start with a lowercase letter or international character.
18157    /// * Each resource is limited to a maximum of 64 labels.
18158    ///
18159    /// Both keys and values are additionally constrained to be <= 63 characters.
18160    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18161
18162    /// Optional. The weak etag of the `Automation` resource.
18163    /// This checksum is computed by the server based on the value of other
18164    /// fields, and may be sent on update and delete requests to ensure the
18165    /// client has an up-to-date value before proceeding.
18166    pub etag: std::string::String,
18167
18168    /// Optional. When Suspended, automation is deactivated from execution.
18169    pub suspended: bool,
18170
18171    /// Required. Email address of the user-managed IAM service account that
18172    /// creates Cloud Deploy release and rollout resources.
18173    pub service_account: std::string::String,
18174
18175    /// Required. Selected resources to which the automation will be applied.
18176    pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
18177
18178    /// Required. List of Automation rules associated with the Automation resource.
18179    /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
18180    /// Note: the order of the rules here is not the same as the order of
18181    /// execution.
18182    pub rules: std::vec::Vec<crate::model::AutomationRule>,
18183
18184    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18185}
18186
18187impl Automation {
18188    pub fn new() -> Self {
18189        std::default::Default::default()
18190    }
18191
18192    /// Sets the value of [name][crate::model::Automation::name].
18193    ///
18194    /// # Example
18195    /// ```ignore,no_run
18196    /// # use google_cloud_deploy_v1::model::Automation;
18197    /// let x = Automation::new().set_name("example");
18198    /// ```
18199    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18200        self.name = v.into();
18201        self
18202    }
18203
18204    /// Sets the value of [uid][crate::model::Automation::uid].
18205    ///
18206    /// # Example
18207    /// ```ignore,no_run
18208    /// # use google_cloud_deploy_v1::model::Automation;
18209    /// let x = Automation::new().set_uid("example");
18210    /// ```
18211    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18212        self.uid = v.into();
18213        self
18214    }
18215
18216    /// Sets the value of [description][crate::model::Automation::description].
18217    ///
18218    /// # Example
18219    /// ```ignore,no_run
18220    /// # use google_cloud_deploy_v1::model::Automation;
18221    /// let x = Automation::new().set_description("example");
18222    /// ```
18223    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18224        self.description = v.into();
18225        self
18226    }
18227
18228    /// Sets the value of [create_time][crate::model::Automation::create_time].
18229    ///
18230    /// # Example
18231    /// ```ignore,no_run
18232    /// # use google_cloud_deploy_v1::model::Automation;
18233    /// use wkt::Timestamp;
18234    /// let x = Automation::new().set_create_time(Timestamp::default()/* use setters */);
18235    /// ```
18236    pub fn set_create_time<T>(mut self, v: T) -> Self
18237    where
18238        T: std::convert::Into<wkt::Timestamp>,
18239    {
18240        self.create_time = std::option::Option::Some(v.into());
18241        self
18242    }
18243
18244    /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
18245    ///
18246    /// # Example
18247    /// ```ignore,no_run
18248    /// # use google_cloud_deploy_v1::model::Automation;
18249    /// use wkt::Timestamp;
18250    /// let x = Automation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18251    /// let x = Automation::new().set_or_clear_create_time(None::<Timestamp>);
18252    /// ```
18253    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18254    where
18255        T: std::convert::Into<wkt::Timestamp>,
18256    {
18257        self.create_time = v.map(|x| x.into());
18258        self
18259    }
18260
18261    /// Sets the value of [update_time][crate::model::Automation::update_time].
18262    ///
18263    /// # Example
18264    /// ```ignore,no_run
18265    /// # use google_cloud_deploy_v1::model::Automation;
18266    /// use wkt::Timestamp;
18267    /// let x = Automation::new().set_update_time(Timestamp::default()/* use setters */);
18268    /// ```
18269    pub fn set_update_time<T>(mut self, v: T) -> Self
18270    where
18271        T: std::convert::Into<wkt::Timestamp>,
18272    {
18273        self.update_time = std::option::Option::Some(v.into());
18274        self
18275    }
18276
18277    /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
18278    ///
18279    /// # Example
18280    /// ```ignore,no_run
18281    /// # use google_cloud_deploy_v1::model::Automation;
18282    /// use wkt::Timestamp;
18283    /// let x = Automation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18284    /// let x = Automation::new().set_or_clear_update_time(None::<Timestamp>);
18285    /// ```
18286    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18287    where
18288        T: std::convert::Into<wkt::Timestamp>,
18289    {
18290        self.update_time = v.map(|x| x.into());
18291        self
18292    }
18293
18294    /// Sets the value of [annotations][crate::model::Automation::annotations].
18295    ///
18296    /// # Example
18297    /// ```ignore,no_run
18298    /// # use google_cloud_deploy_v1::model::Automation;
18299    /// let x = Automation::new().set_annotations([
18300    ///     ("key0", "abc"),
18301    ///     ("key1", "xyz"),
18302    /// ]);
18303    /// ```
18304    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18305    where
18306        T: std::iter::IntoIterator<Item = (K, V)>,
18307        K: std::convert::Into<std::string::String>,
18308        V: std::convert::Into<std::string::String>,
18309    {
18310        use std::iter::Iterator;
18311        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18312        self
18313    }
18314
18315    /// Sets the value of [labels][crate::model::Automation::labels].
18316    ///
18317    /// # Example
18318    /// ```ignore,no_run
18319    /// # use google_cloud_deploy_v1::model::Automation;
18320    /// let x = Automation::new().set_labels([
18321    ///     ("key0", "abc"),
18322    ///     ("key1", "xyz"),
18323    /// ]);
18324    /// ```
18325    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18326    where
18327        T: std::iter::IntoIterator<Item = (K, V)>,
18328        K: std::convert::Into<std::string::String>,
18329        V: std::convert::Into<std::string::String>,
18330    {
18331        use std::iter::Iterator;
18332        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18333        self
18334    }
18335
18336    /// Sets the value of [etag][crate::model::Automation::etag].
18337    ///
18338    /// # Example
18339    /// ```ignore,no_run
18340    /// # use google_cloud_deploy_v1::model::Automation;
18341    /// let x = Automation::new().set_etag("example");
18342    /// ```
18343    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18344        self.etag = v.into();
18345        self
18346    }
18347
18348    /// Sets the value of [suspended][crate::model::Automation::suspended].
18349    ///
18350    /// # Example
18351    /// ```ignore,no_run
18352    /// # use google_cloud_deploy_v1::model::Automation;
18353    /// let x = Automation::new().set_suspended(true);
18354    /// ```
18355    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18356        self.suspended = v.into();
18357        self
18358    }
18359
18360    /// Sets the value of [service_account][crate::model::Automation::service_account].
18361    ///
18362    /// # Example
18363    /// ```ignore,no_run
18364    /// # use google_cloud_deploy_v1::model::Automation;
18365    /// let x = Automation::new().set_service_account("example");
18366    /// ```
18367    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18368        self.service_account = v.into();
18369        self
18370    }
18371
18372    /// Sets the value of [selector][crate::model::Automation::selector].
18373    ///
18374    /// # Example
18375    /// ```ignore,no_run
18376    /// # use google_cloud_deploy_v1::model::Automation;
18377    /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18378    /// let x = Automation::new().set_selector(AutomationResourceSelector::default()/* use setters */);
18379    /// ```
18380    pub fn set_selector<T>(mut self, v: T) -> Self
18381    where
18382        T: std::convert::Into<crate::model::AutomationResourceSelector>,
18383    {
18384        self.selector = std::option::Option::Some(v.into());
18385        self
18386    }
18387
18388    /// Sets or clears the value of [selector][crate::model::Automation::selector].
18389    ///
18390    /// # Example
18391    /// ```ignore,no_run
18392    /// # use google_cloud_deploy_v1::model::Automation;
18393    /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18394    /// let x = Automation::new().set_or_clear_selector(Some(AutomationResourceSelector::default()/* use setters */));
18395    /// let x = Automation::new().set_or_clear_selector(None::<AutomationResourceSelector>);
18396    /// ```
18397    pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
18398    where
18399        T: std::convert::Into<crate::model::AutomationResourceSelector>,
18400    {
18401        self.selector = v.map(|x| x.into());
18402        self
18403    }
18404
18405    /// Sets the value of [rules][crate::model::Automation::rules].
18406    ///
18407    /// # Example
18408    /// ```ignore,no_run
18409    /// # use google_cloud_deploy_v1::model::Automation;
18410    /// use google_cloud_deploy_v1::model::AutomationRule;
18411    /// let x = Automation::new()
18412    ///     .set_rules([
18413    ///         AutomationRule::default()/* use setters */,
18414    ///         AutomationRule::default()/* use (different) setters */,
18415    ///     ]);
18416    /// ```
18417    pub fn set_rules<T, V>(mut self, v: T) -> Self
18418    where
18419        T: std::iter::IntoIterator<Item = V>,
18420        V: std::convert::Into<crate::model::AutomationRule>,
18421    {
18422        use std::iter::Iterator;
18423        self.rules = v.into_iter().map(|i| i.into()).collect();
18424        self
18425    }
18426}
18427
18428impl wkt::message::Message for Automation {
18429    fn typename() -> &'static str {
18430        "type.googleapis.com/google.cloud.deploy.v1.Automation"
18431    }
18432}
18433
18434/// AutomationResourceSelector contains the information to select the resources
18435/// to which an Automation is going to be applied.
18436#[derive(Clone, Default, PartialEq)]
18437#[non_exhaustive]
18438pub struct AutomationResourceSelector {
18439    /// Optional. Contains attributes about a target.
18440    pub targets: std::vec::Vec<crate::model::TargetAttribute>,
18441
18442    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18443}
18444
18445impl AutomationResourceSelector {
18446    pub fn new() -> Self {
18447        std::default::Default::default()
18448    }
18449
18450    /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
18451    ///
18452    /// # Example
18453    /// ```ignore,no_run
18454    /// # use google_cloud_deploy_v1::model::AutomationResourceSelector;
18455    /// use google_cloud_deploy_v1::model::TargetAttribute;
18456    /// let x = AutomationResourceSelector::new()
18457    ///     .set_targets([
18458    ///         TargetAttribute::default()/* use setters */,
18459    ///         TargetAttribute::default()/* use (different) setters */,
18460    ///     ]);
18461    /// ```
18462    pub fn set_targets<T, V>(mut self, v: T) -> Self
18463    where
18464        T: std::iter::IntoIterator<Item = V>,
18465        V: std::convert::Into<crate::model::TargetAttribute>,
18466    {
18467        use std::iter::Iterator;
18468        self.targets = v.into_iter().map(|i| i.into()).collect();
18469        self
18470    }
18471}
18472
18473impl wkt::message::Message for AutomationResourceSelector {
18474    fn typename() -> &'static str {
18475        "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
18476    }
18477}
18478
18479/// `AutomationRule` defines the automation activities.
18480#[derive(Clone, Default, PartialEq)]
18481#[non_exhaustive]
18482pub struct AutomationRule {
18483    /// The configuration of the Automation rule.
18484    pub rule: std::option::Option<crate::model::automation_rule::Rule>,
18485
18486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18487}
18488
18489impl AutomationRule {
18490    pub fn new() -> Self {
18491        std::default::Default::default()
18492    }
18493
18494    /// Sets the value of [rule][crate::model::AutomationRule::rule].
18495    ///
18496    /// Note that all the setters affecting `rule` are mutually
18497    /// exclusive.
18498    ///
18499    /// # Example
18500    /// ```ignore,no_run
18501    /// # use google_cloud_deploy_v1::model::AutomationRule;
18502    /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18503    /// let x = AutomationRule::new().set_rule(Some(
18504    ///     google_cloud_deploy_v1::model::automation_rule::Rule::PromoteReleaseRule(PromoteReleaseRule::default().into())));
18505    /// ```
18506    pub fn set_rule<
18507        T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
18508    >(
18509        mut self,
18510        v: T,
18511    ) -> Self {
18512        self.rule = v.into();
18513        self
18514    }
18515
18516    /// The value of [rule][crate::model::AutomationRule::rule]
18517    /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
18518    /// holds a different branch.
18519    pub fn promote_release_rule(
18520        &self,
18521    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
18522        #[allow(unreachable_patterns)]
18523        self.rule.as_ref().and_then(|v| match v {
18524            crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
18525                std::option::Option::Some(v)
18526            }
18527            _ => std::option::Option::None,
18528        })
18529    }
18530
18531    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18532    /// to hold a `PromoteReleaseRule`.
18533    ///
18534    /// Note that all the setters affecting `rule` are
18535    /// mutually exclusive.
18536    ///
18537    /// # Example
18538    /// ```ignore,no_run
18539    /// # use google_cloud_deploy_v1::model::AutomationRule;
18540    /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18541    /// let x = AutomationRule::new().set_promote_release_rule(PromoteReleaseRule::default()/* use setters */);
18542    /// assert!(x.promote_release_rule().is_some());
18543    /// assert!(x.advance_rollout_rule().is_none());
18544    /// assert!(x.repair_rollout_rule().is_none());
18545    /// assert!(x.timed_promote_release_rule().is_none());
18546    /// ```
18547    pub fn set_promote_release_rule<
18548        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
18549    >(
18550        mut self,
18551        v: T,
18552    ) -> Self {
18553        self.rule = std::option::Option::Some(
18554            crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
18555        );
18556        self
18557    }
18558
18559    /// The value of [rule][crate::model::AutomationRule::rule]
18560    /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
18561    /// holds a different branch.
18562    pub fn advance_rollout_rule(
18563        &self,
18564    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
18565        #[allow(unreachable_patterns)]
18566        self.rule.as_ref().and_then(|v| match v {
18567            crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
18568                std::option::Option::Some(v)
18569            }
18570            _ => std::option::Option::None,
18571        })
18572    }
18573
18574    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18575    /// to hold a `AdvanceRolloutRule`.
18576    ///
18577    /// Note that all the setters affecting `rule` are
18578    /// mutually exclusive.
18579    ///
18580    /// # Example
18581    /// ```ignore,no_run
18582    /// # use google_cloud_deploy_v1::model::AutomationRule;
18583    /// use google_cloud_deploy_v1::model::AdvanceRolloutRule;
18584    /// let x = AutomationRule::new().set_advance_rollout_rule(AdvanceRolloutRule::default()/* use setters */);
18585    /// assert!(x.advance_rollout_rule().is_some());
18586    /// assert!(x.promote_release_rule().is_none());
18587    /// assert!(x.repair_rollout_rule().is_none());
18588    /// assert!(x.timed_promote_release_rule().is_none());
18589    /// ```
18590    pub fn set_advance_rollout_rule<
18591        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
18592    >(
18593        mut self,
18594        v: T,
18595    ) -> Self {
18596        self.rule = std::option::Option::Some(
18597            crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
18598        );
18599        self
18600    }
18601
18602    /// The value of [rule][crate::model::AutomationRule::rule]
18603    /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
18604    /// holds a different branch.
18605    pub fn repair_rollout_rule(
18606        &self,
18607    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
18608        #[allow(unreachable_patterns)]
18609        self.rule.as_ref().and_then(|v| match v {
18610            crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
18611                std::option::Option::Some(v)
18612            }
18613            _ => std::option::Option::None,
18614        })
18615    }
18616
18617    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18618    /// to hold a `RepairRolloutRule`.
18619    ///
18620    /// Note that all the setters affecting `rule` are
18621    /// mutually exclusive.
18622    ///
18623    /// # Example
18624    /// ```ignore,no_run
18625    /// # use google_cloud_deploy_v1::model::AutomationRule;
18626    /// use google_cloud_deploy_v1::model::RepairRolloutRule;
18627    /// let x = AutomationRule::new().set_repair_rollout_rule(RepairRolloutRule::default()/* use setters */);
18628    /// assert!(x.repair_rollout_rule().is_some());
18629    /// assert!(x.promote_release_rule().is_none());
18630    /// assert!(x.advance_rollout_rule().is_none());
18631    /// assert!(x.timed_promote_release_rule().is_none());
18632    /// ```
18633    pub fn set_repair_rollout_rule<
18634        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
18635    >(
18636        mut self,
18637        v: T,
18638    ) -> Self {
18639        self.rule = std::option::Option::Some(
18640            crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
18641        );
18642        self
18643    }
18644
18645    /// The value of [rule][crate::model::AutomationRule::rule]
18646    /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
18647    /// holds a different branch.
18648    pub fn timed_promote_release_rule(
18649        &self,
18650    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
18651        #[allow(unreachable_patterns)]
18652        self.rule.as_ref().and_then(|v| match v {
18653            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
18654                std::option::Option::Some(v)
18655            }
18656            _ => std::option::Option::None,
18657        })
18658    }
18659
18660    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18661    /// to hold a `TimedPromoteReleaseRule`.
18662    ///
18663    /// Note that all the setters affecting `rule` are
18664    /// mutually exclusive.
18665    ///
18666    /// # Example
18667    /// ```ignore,no_run
18668    /// # use google_cloud_deploy_v1::model::AutomationRule;
18669    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18670    /// let x = AutomationRule::new().set_timed_promote_release_rule(TimedPromoteReleaseRule::default()/* use setters */);
18671    /// assert!(x.timed_promote_release_rule().is_some());
18672    /// assert!(x.promote_release_rule().is_none());
18673    /// assert!(x.advance_rollout_rule().is_none());
18674    /// assert!(x.repair_rollout_rule().is_none());
18675    /// ```
18676    pub fn set_timed_promote_release_rule<
18677        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
18678    >(
18679        mut self,
18680        v: T,
18681    ) -> Self {
18682        self.rule = std::option::Option::Some(
18683            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
18684        );
18685        self
18686    }
18687}
18688
18689impl wkt::message::Message for AutomationRule {
18690    fn typename() -> &'static str {
18691        "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
18692    }
18693}
18694
18695/// Defines additional types related to [AutomationRule].
18696pub mod automation_rule {
18697    #[allow(unused_imports)]
18698    use super::*;
18699
18700    /// The configuration of the Automation rule.
18701    #[derive(Clone, Debug, PartialEq)]
18702    #[non_exhaustive]
18703    pub enum Rule {
18704        /// Optional. `PromoteReleaseRule` will automatically promote a release from
18705        /// the current target to a specified target.
18706        PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
18707        /// Optional. The `AdvanceRolloutRule` will automatically advance a
18708        /// successful Rollout.
18709        AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
18710        /// Optional. The `RepairRolloutRule` will automatically repair a failed
18711        /// rollout.
18712        RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
18713        /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
18714        /// release from the current target(s) to the specified target(s) on a
18715        /// configured schedule.
18716        TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
18717    }
18718}
18719
18720/// The `TimedPromoteReleaseRule` will automatically promote a release from the
18721/// current target(s) to the specified target(s) on a configured schedule.
18722#[derive(Clone, Default, PartialEq)]
18723#[non_exhaustive]
18724pub struct TimedPromoteReleaseRule {
18725    /// Required. ID of the rule. This ID must be unique in the `Automation`
18726    /// resource to which this rule belongs. The format is
18727    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
18728    pub id: std::string::String,
18729
18730    /// Optional. The ID of the stage in the pipeline to which this `Release` is
18731    /// deploying. If unspecified, default it to the next stage in the promotion
18732    /// flow. The value of this field could be one of the following:
18733    ///
18734    /// * The last segment of a target name
18735    /// * "@next", the next target in the promotion sequence
18736    pub destination_target_id: std::string::String,
18737
18738    /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
18739    /// 9am.
18740    pub schedule: std::string::String,
18741
18742    /// Required. The time zone in IANA format [IANA Time Zone
18743    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
18744    pub time_zone: std::string::String,
18745
18746    /// Output only. Information around the state of the Automation rule.
18747    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18748
18749    /// Optional. The starting phase of the rollout created by this rule. Default
18750    /// to the first phase.
18751    pub destination_phase: std::string::String,
18752
18753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18754}
18755
18756impl TimedPromoteReleaseRule {
18757    pub fn new() -> Self {
18758        std::default::Default::default()
18759    }
18760
18761    /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
18762    ///
18763    /// # Example
18764    /// ```ignore,no_run
18765    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18766    /// let x = TimedPromoteReleaseRule::new().set_id("example");
18767    /// ```
18768    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18769        self.id = v.into();
18770        self
18771    }
18772
18773    /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
18774    ///
18775    /// # Example
18776    /// ```ignore,no_run
18777    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18778    /// let x = TimedPromoteReleaseRule::new().set_destination_target_id("example");
18779    /// ```
18780    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18781        mut self,
18782        v: T,
18783    ) -> Self {
18784        self.destination_target_id = v.into();
18785        self
18786    }
18787
18788    /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
18789    ///
18790    /// # Example
18791    /// ```ignore,no_run
18792    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18793    /// let x = TimedPromoteReleaseRule::new().set_schedule("example");
18794    /// ```
18795    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18796        self.schedule = v.into();
18797        self
18798    }
18799
18800    /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
18801    ///
18802    /// # Example
18803    /// ```ignore,no_run
18804    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18805    /// let x = TimedPromoteReleaseRule::new().set_time_zone("example");
18806    /// ```
18807    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18808        self.time_zone = v.into();
18809        self
18810    }
18811
18812    /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18813    ///
18814    /// # Example
18815    /// ```ignore,no_run
18816    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18817    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18818    /// let x = TimedPromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18819    /// ```
18820    pub fn set_condition<T>(mut self, v: T) -> Self
18821    where
18822        T: std::convert::Into<crate::model::AutomationRuleCondition>,
18823    {
18824        self.condition = std::option::Option::Some(v.into());
18825        self
18826    }
18827
18828    /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18829    ///
18830    /// # Example
18831    /// ```ignore,no_run
18832    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18833    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18834    /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18835    /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18836    /// ```
18837    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18838    where
18839        T: std::convert::Into<crate::model::AutomationRuleCondition>,
18840    {
18841        self.condition = v.map(|x| x.into());
18842        self
18843    }
18844
18845    /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
18846    ///
18847    /// # Example
18848    /// ```ignore,no_run
18849    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18850    /// let x = TimedPromoteReleaseRule::new().set_destination_phase("example");
18851    /// ```
18852    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
18853        mut self,
18854        v: T,
18855    ) -> Self {
18856        self.destination_phase = v.into();
18857        self
18858    }
18859}
18860
18861impl wkt::message::Message for TimedPromoteReleaseRule {
18862    fn typename() -> &'static str {
18863        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
18864    }
18865}
18866
18867/// The `PromoteRelease` rule will automatically promote a release from the
18868/// current target to a specified target.
18869#[derive(Clone, Default, PartialEq)]
18870#[non_exhaustive]
18871pub struct PromoteReleaseRule {
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. How long the release need to be paused until being promoted to
18878    /// the next target.
18879    pub wait: std::option::Option<wkt::Duration>,
18880
18881    /// Optional. The ID of the stage in the pipeline to which this `Release` is
18882    /// deploying. If unspecified, default it to the next stage in the promotion
18883    /// flow. The value of this field could be one of the following:
18884    ///
18885    /// * The last segment of a target name
18886    /// * "@next", the next target in the promotion sequence
18887    pub destination_target_id: std::string::String,
18888
18889    /// Output only. Information around the state of the Automation rule.
18890    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18891
18892    /// Optional. The starting phase of the rollout created by this operation.
18893    /// Default to the first phase.
18894    pub destination_phase: std::string::String,
18895
18896    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18897}
18898
18899impl PromoteReleaseRule {
18900    pub fn new() -> Self {
18901        std::default::Default::default()
18902    }
18903
18904    /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
18905    ///
18906    /// # Example
18907    /// ```ignore,no_run
18908    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18909    /// let x = PromoteReleaseRule::new().set_id("example");
18910    /// ```
18911    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18912        self.id = v.into();
18913        self
18914    }
18915
18916    /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
18917    ///
18918    /// # Example
18919    /// ```ignore,no_run
18920    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18921    /// use wkt::Duration;
18922    /// let x = PromoteReleaseRule::new().set_wait(Duration::default()/* use setters */);
18923    /// ```
18924    pub fn set_wait<T>(mut self, v: T) -> Self
18925    where
18926        T: std::convert::Into<wkt::Duration>,
18927    {
18928        self.wait = std::option::Option::Some(v.into());
18929        self
18930    }
18931
18932    /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
18933    ///
18934    /// # Example
18935    /// ```ignore,no_run
18936    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18937    /// use wkt::Duration;
18938    /// let x = PromoteReleaseRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
18939    /// let x = PromoteReleaseRule::new().set_or_clear_wait(None::<Duration>);
18940    /// ```
18941    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
18942    where
18943        T: std::convert::Into<wkt::Duration>,
18944    {
18945        self.wait = v.map(|x| x.into());
18946        self
18947    }
18948
18949    /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
18950    ///
18951    /// # Example
18952    /// ```ignore,no_run
18953    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18954    /// let x = PromoteReleaseRule::new().set_destination_target_id("example");
18955    /// ```
18956    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18957        mut self,
18958        v: T,
18959    ) -> Self {
18960        self.destination_target_id = v.into();
18961        self
18962    }
18963
18964    /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
18965    ///
18966    /// # Example
18967    /// ```ignore,no_run
18968    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18969    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18970    /// let x = PromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18971    /// ```
18972    pub fn set_condition<T>(mut self, v: T) -> Self
18973    where
18974        T: std::convert::Into<crate::model::AutomationRuleCondition>,
18975    {
18976        self.condition = std::option::Option::Some(v.into());
18977        self
18978    }
18979
18980    /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
18981    ///
18982    /// # Example
18983    /// ```ignore,no_run
18984    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18985    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18986    /// let x = PromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18987    /// let x = PromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18988    /// ```
18989    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18990    where
18991        T: std::convert::Into<crate::model::AutomationRuleCondition>,
18992    {
18993        self.condition = v.map(|x| x.into());
18994        self
18995    }
18996
18997    /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
18998    ///
18999    /// # Example
19000    /// ```ignore,no_run
19001    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19002    /// let x = PromoteReleaseRule::new().set_destination_phase("example");
19003    /// ```
19004    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19005        mut self,
19006        v: T,
19007    ) -> Self {
19008        self.destination_phase = v.into();
19009        self
19010    }
19011}
19012
19013impl wkt::message::Message for PromoteReleaseRule {
19014    fn typename() -> &'static str {
19015        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
19016    }
19017}
19018
19019/// The `AdvanceRollout` automation rule will automatically advance a successful
19020/// Rollout to the next phase.
19021#[derive(Clone, Default, PartialEq)]
19022#[non_exhaustive]
19023pub struct AdvanceRolloutRule {
19024    /// Required. ID of the rule. This id must be unique in the `Automation`
19025    /// resource to which this rule belongs. The format is
19026    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19027    pub id: std::string::String,
19028
19029    /// Optional. Proceeds only after phase name matched any one in the list.
19030    /// This value must consist of lower-case letters, numbers, and hyphens,
19031    /// start with a letter and end with a letter or a number, and have a max
19032    /// length of 63 characters. In other words, it must match the following
19033    /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19034    pub source_phases: std::vec::Vec<std::string::String>,
19035
19036    /// Optional. How long to wait after a rollout is finished.
19037    pub wait: std::option::Option<wkt::Duration>,
19038
19039    /// Output only. Information around the state of the Automation rule.
19040    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19041
19042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19043}
19044
19045impl AdvanceRolloutRule {
19046    pub fn new() -> Self {
19047        std::default::Default::default()
19048    }
19049
19050    /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
19051    ///
19052    /// # Example
19053    /// ```ignore,no_run
19054    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19055    /// let x = AdvanceRolloutRule::new().set_id("example");
19056    /// ```
19057    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19058        self.id = v.into();
19059        self
19060    }
19061
19062    /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
19063    ///
19064    /// # Example
19065    /// ```ignore,no_run
19066    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19067    /// let x = AdvanceRolloutRule::new().set_source_phases(["a", "b", "c"]);
19068    /// ```
19069    pub fn set_source_phases<T, V>(mut self, v: T) -> Self
19070    where
19071        T: std::iter::IntoIterator<Item = V>,
19072        V: std::convert::Into<std::string::String>,
19073    {
19074        use std::iter::Iterator;
19075        self.source_phases = v.into_iter().map(|i| i.into()).collect();
19076        self
19077    }
19078
19079    /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
19080    ///
19081    /// # Example
19082    /// ```ignore,no_run
19083    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19084    /// use wkt::Duration;
19085    /// let x = AdvanceRolloutRule::new().set_wait(Duration::default()/* use setters */);
19086    /// ```
19087    pub fn set_wait<T>(mut self, v: T) -> Self
19088    where
19089        T: std::convert::Into<wkt::Duration>,
19090    {
19091        self.wait = std::option::Option::Some(v.into());
19092        self
19093    }
19094
19095    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
19096    ///
19097    /// # Example
19098    /// ```ignore,no_run
19099    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19100    /// use wkt::Duration;
19101    /// let x = AdvanceRolloutRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19102    /// let x = AdvanceRolloutRule::new().set_or_clear_wait(None::<Duration>);
19103    /// ```
19104    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19105    where
19106        T: std::convert::Into<wkt::Duration>,
19107    {
19108        self.wait = v.map(|x| x.into());
19109        self
19110    }
19111
19112    /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
19113    ///
19114    /// # Example
19115    /// ```ignore,no_run
19116    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19117    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19118    /// let x = AdvanceRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19119    /// ```
19120    pub fn set_condition<T>(mut self, v: T) -> Self
19121    where
19122        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19123    {
19124        self.condition = std::option::Option::Some(v.into());
19125        self
19126    }
19127
19128    /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
19129    ///
19130    /// # Example
19131    /// ```ignore,no_run
19132    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19133    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19134    /// let x = AdvanceRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19135    /// let x = AdvanceRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19136    /// ```
19137    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19138    where
19139        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19140    {
19141        self.condition = v.map(|x| x.into());
19142        self
19143    }
19144}
19145
19146impl wkt::message::Message for AdvanceRolloutRule {
19147    fn typename() -> &'static str {
19148        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
19149    }
19150}
19151
19152/// The `RepairRolloutRule` automation rule will automatically repair a failed
19153/// `Rollout`.
19154#[derive(Clone, Default, PartialEq)]
19155#[non_exhaustive]
19156pub struct RepairRolloutRule {
19157    /// Required. ID of the rule. This id must be unique in the `Automation`
19158    /// resource to which this rule belongs. The format is
19159    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19160    pub id: std::string::String,
19161
19162    /// Optional. Phases within which jobs are subject to automatic repair actions
19163    /// on failure. Proceeds only after phase name matched any one in the list, or
19164    /// for all phases if unspecified. This value must consist of lower-case
19165    /// letters, numbers, and hyphens, start with a letter and end with a letter or
19166    /// a number, and have a max length of 63 characters. In other words, it must
19167    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19168    pub phases: std::vec::Vec<std::string::String>,
19169
19170    /// Optional. Jobs to repair. Proceeds only after job name matched any one in
19171    /// the list, or for all jobs if unspecified or empty. The phase that includes
19172    /// the job must match the phase ID specified in `source_phase`. This value
19173    /// must consist of lower-case letters, numbers, and hyphens, start with a
19174    /// letter and end with a letter or a number, and have a max length of 63
19175    /// characters. In other words, it must match the following regex:
19176    /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19177    pub jobs: std::vec::Vec<std::string::String>,
19178
19179    /// Output only. Information around the state of the 'Automation' rule.
19180    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19181
19182    /// Required. Defines the types of automatic repair phases for failed jobs.
19183    pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
19184
19185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19186}
19187
19188impl RepairRolloutRule {
19189    pub fn new() -> Self {
19190        std::default::Default::default()
19191    }
19192
19193    /// Sets the value of [id][crate::model::RepairRolloutRule::id].
19194    ///
19195    /// # Example
19196    /// ```ignore,no_run
19197    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19198    /// let x = RepairRolloutRule::new().set_id("example");
19199    /// ```
19200    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19201        self.id = v.into();
19202        self
19203    }
19204
19205    /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
19206    ///
19207    /// # Example
19208    /// ```ignore,no_run
19209    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19210    /// let x = RepairRolloutRule::new().set_phases(["a", "b", "c"]);
19211    /// ```
19212    pub fn set_phases<T, V>(mut self, v: T) -> Self
19213    where
19214        T: std::iter::IntoIterator<Item = V>,
19215        V: std::convert::Into<std::string::String>,
19216    {
19217        use std::iter::Iterator;
19218        self.phases = v.into_iter().map(|i| i.into()).collect();
19219        self
19220    }
19221
19222    /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
19223    ///
19224    /// # Example
19225    /// ```ignore,no_run
19226    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19227    /// let x = RepairRolloutRule::new().set_jobs(["a", "b", "c"]);
19228    /// ```
19229    pub fn set_jobs<T, V>(mut self, v: T) -> Self
19230    where
19231        T: std::iter::IntoIterator<Item = V>,
19232        V: std::convert::Into<std::string::String>,
19233    {
19234        use std::iter::Iterator;
19235        self.jobs = v.into_iter().map(|i| i.into()).collect();
19236        self
19237    }
19238
19239    /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
19240    ///
19241    /// # Example
19242    /// ```ignore,no_run
19243    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19244    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19245    /// let x = RepairRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19246    /// ```
19247    pub fn set_condition<T>(mut self, v: T) -> Self
19248    where
19249        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19250    {
19251        self.condition = std::option::Option::Some(v.into());
19252        self
19253    }
19254
19255    /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
19256    ///
19257    /// # Example
19258    /// ```ignore,no_run
19259    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19260    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19261    /// let x = RepairRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19262    /// let x = RepairRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19263    /// ```
19264    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19265    where
19266        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19267    {
19268        self.condition = v.map(|x| x.into());
19269        self
19270    }
19271
19272    /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
19273    ///
19274    /// # Example
19275    /// ```ignore,no_run
19276    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19277    /// use google_cloud_deploy_v1::model::RepairPhaseConfig;
19278    /// let x = RepairRolloutRule::new()
19279    ///     .set_repair_phases([
19280    ///         RepairPhaseConfig::default()/* use setters */,
19281    ///         RepairPhaseConfig::default()/* use (different) setters */,
19282    ///     ]);
19283    /// ```
19284    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
19285    where
19286        T: std::iter::IntoIterator<Item = V>,
19287        V: std::convert::Into<crate::model::RepairPhaseConfig>,
19288    {
19289        use std::iter::Iterator;
19290        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
19291        self
19292    }
19293}
19294
19295impl wkt::message::Message for RepairRolloutRule {
19296    fn typename() -> &'static str {
19297        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
19298    }
19299}
19300
19301/// Configuration of the repair phase.
19302#[derive(Clone, Default, PartialEq)]
19303#[non_exhaustive]
19304pub struct RepairPhaseConfig {
19305    /// The repair phase to perform.
19306    pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
19307
19308    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19309}
19310
19311impl RepairPhaseConfig {
19312    pub fn new() -> Self {
19313        std::default::Default::default()
19314    }
19315
19316    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
19317    ///
19318    /// Note that all the setters affecting `repair_phase` are mutually
19319    /// exclusive.
19320    ///
19321    /// # Example
19322    /// ```ignore,no_run
19323    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19324    /// use google_cloud_deploy_v1::model::Retry;
19325    /// let x = RepairPhaseConfig::new().set_repair_phase(Some(
19326    ///     google_cloud_deploy_v1::model::repair_phase_config::RepairPhase::Retry(Retry::default().into())));
19327    /// ```
19328    pub fn set_repair_phase<
19329        T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
19330    >(
19331        mut self,
19332        v: T,
19333    ) -> Self {
19334        self.repair_phase = v.into();
19335        self
19336    }
19337
19338    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19339    /// if it holds a `Retry`, `None` if the field is not set or
19340    /// holds a different branch.
19341    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
19342        #[allow(unreachable_patterns)]
19343        self.repair_phase.as_ref().and_then(|v| match v {
19344            crate::model::repair_phase_config::RepairPhase::Retry(v) => {
19345                std::option::Option::Some(v)
19346            }
19347            _ => std::option::Option::None,
19348        })
19349    }
19350
19351    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19352    /// to hold a `Retry`.
19353    ///
19354    /// Note that all the setters affecting `repair_phase` are
19355    /// mutually exclusive.
19356    ///
19357    /// # Example
19358    /// ```ignore,no_run
19359    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19360    /// use google_cloud_deploy_v1::model::Retry;
19361    /// let x = RepairPhaseConfig::new().set_retry(Retry::default()/* use setters */);
19362    /// assert!(x.retry().is_some());
19363    /// assert!(x.rollback().is_none());
19364    /// ```
19365    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
19366        mut self,
19367        v: T,
19368    ) -> Self {
19369        self.repair_phase = std::option::Option::Some(
19370            crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
19371        );
19372        self
19373    }
19374
19375    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19376    /// if it holds a `Rollback`, `None` if the field is not set or
19377    /// holds a different branch.
19378    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
19379        #[allow(unreachable_patterns)]
19380        self.repair_phase.as_ref().and_then(|v| match v {
19381            crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
19382                std::option::Option::Some(v)
19383            }
19384            _ => std::option::Option::None,
19385        })
19386    }
19387
19388    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19389    /// to hold a `Rollback`.
19390    ///
19391    /// Note that all the setters affecting `repair_phase` are
19392    /// mutually exclusive.
19393    ///
19394    /// # Example
19395    /// ```ignore,no_run
19396    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19397    /// use google_cloud_deploy_v1::model::Rollback;
19398    /// let x = RepairPhaseConfig::new().set_rollback(Rollback::default()/* use setters */);
19399    /// assert!(x.rollback().is_some());
19400    /// assert!(x.retry().is_none());
19401    /// ```
19402    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
19403        mut self,
19404        v: T,
19405    ) -> Self {
19406        self.repair_phase = std::option::Option::Some(
19407            crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
19408        );
19409        self
19410    }
19411}
19412
19413impl wkt::message::Message for RepairPhaseConfig {
19414    fn typename() -> &'static str {
19415        "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
19416    }
19417}
19418
19419/// Defines additional types related to [RepairPhaseConfig].
19420pub mod repair_phase_config {
19421    #[allow(unused_imports)]
19422    use super::*;
19423
19424    /// The repair phase to perform.
19425    #[derive(Clone, Debug, PartialEq)]
19426    #[non_exhaustive]
19427    pub enum RepairPhase {
19428        /// Optional. Retries a failed job.
19429        Retry(std::boxed::Box<crate::model::Retry>),
19430        /// Optional. Rolls back a `Rollout`.
19431        Rollback(std::boxed::Box<crate::model::Rollback>),
19432    }
19433}
19434
19435/// Retries the failed job.
19436#[derive(Clone, Default, PartialEq)]
19437#[non_exhaustive]
19438pub struct Retry {
19439    /// Required. Total number of retries. Retry is skipped if set to 0; The
19440    /// minimum value is 1, and the maximum value is 10.
19441    pub attempts: i64,
19442
19443    /// Optional. How long to wait for the first retry. Default is 0, and the
19444    /// maximum value is 14d.
19445    pub wait: std::option::Option<wkt::Duration>,
19446
19447    /// Optional. The pattern of how wait time will be increased. Default is
19448    /// linear. Backoff mode will be ignored if `wait` is 0.
19449    pub backoff_mode: crate::model::BackoffMode,
19450
19451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19452}
19453
19454impl Retry {
19455    pub fn new() -> Self {
19456        std::default::Default::default()
19457    }
19458
19459    /// Sets the value of [attempts][crate::model::Retry::attempts].
19460    ///
19461    /// # Example
19462    /// ```ignore,no_run
19463    /// # use google_cloud_deploy_v1::model::Retry;
19464    /// let x = Retry::new().set_attempts(42);
19465    /// ```
19466    pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19467        self.attempts = v.into();
19468        self
19469    }
19470
19471    /// Sets the value of [wait][crate::model::Retry::wait].
19472    ///
19473    /// # Example
19474    /// ```ignore,no_run
19475    /// # use google_cloud_deploy_v1::model::Retry;
19476    /// use wkt::Duration;
19477    /// let x = Retry::new().set_wait(Duration::default()/* use setters */);
19478    /// ```
19479    pub fn set_wait<T>(mut self, v: T) -> Self
19480    where
19481        T: std::convert::Into<wkt::Duration>,
19482    {
19483        self.wait = std::option::Option::Some(v.into());
19484        self
19485    }
19486
19487    /// Sets or clears the value of [wait][crate::model::Retry::wait].
19488    ///
19489    /// # Example
19490    /// ```ignore,no_run
19491    /// # use google_cloud_deploy_v1::model::Retry;
19492    /// use wkt::Duration;
19493    /// let x = Retry::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19494    /// let x = Retry::new().set_or_clear_wait(None::<Duration>);
19495    /// ```
19496    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19497    where
19498        T: std::convert::Into<wkt::Duration>,
19499    {
19500        self.wait = v.map(|x| x.into());
19501        self
19502    }
19503
19504    /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
19505    ///
19506    /// # Example
19507    /// ```ignore,no_run
19508    /// # use google_cloud_deploy_v1::model::Retry;
19509    /// use google_cloud_deploy_v1::model::BackoffMode;
19510    /// let x0 = Retry::new().set_backoff_mode(BackoffMode::Linear);
19511    /// let x1 = Retry::new().set_backoff_mode(BackoffMode::Exponential);
19512    /// ```
19513    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
19514        mut self,
19515        v: T,
19516    ) -> Self {
19517        self.backoff_mode = v.into();
19518        self
19519    }
19520}
19521
19522impl wkt::message::Message for Retry {
19523    fn typename() -> &'static str {
19524        "type.googleapis.com/google.cloud.deploy.v1.Retry"
19525    }
19526}
19527
19528/// Rolls back a `Rollout`.
19529#[derive(Clone, Default, PartialEq)]
19530#[non_exhaustive]
19531pub struct Rollback {
19532    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
19533    /// `Rollout` will start in the stable phase.
19534    pub destination_phase: std::string::String,
19535
19536    /// Optional. If pending rollout exists on the target, the rollback operation
19537    /// will be aborted.
19538    pub disable_rollback_if_rollout_pending: bool,
19539
19540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19541}
19542
19543impl Rollback {
19544    pub fn new() -> Self {
19545        std::default::Default::default()
19546    }
19547
19548    /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
19549    ///
19550    /// # Example
19551    /// ```ignore,no_run
19552    /// # use google_cloud_deploy_v1::model::Rollback;
19553    /// let x = Rollback::new().set_destination_phase("example");
19554    /// ```
19555    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19556        mut self,
19557        v: T,
19558    ) -> Self {
19559        self.destination_phase = v.into();
19560        self
19561    }
19562
19563    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
19564    ///
19565    /// # Example
19566    /// ```ignore,no_run
19567    /// # use google_cloud_deploy_v1::model::Rollback;
19568    /// let x = Rollback::new().set_disable_rollback_if_rollout_pending(true);
19569    /// ```
19570    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
19571        mut self,
19572        v: T,
19573    ) -> Self {
19574        self.disable_rollback_if_rollout_pending = v.into();
19575        self
19576    }
19577}
19578
19579impl wkt::message::Message for Rollback {
19580    fn typename() -> &'static str {
19581        "type.googleapis.com/google.cloud.deploy.v1.Rollback"
19582    }
19583}
19584
19585/// `AutomationRuleCondition` contains conditions relevant to an
19586/// `Automation` rule.
19587#[derive(Clone, Default, PartialEq)]
19588#[non_exhaustive]
19589pub struct AutomationRuleCondition {
19590    /// Optional. Details around targets enumerated in the rule.
19591    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
19592
19593    /// Details specific to the automation rule type.
19594    pub rule_type_condition:
19595        std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19596
19597    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19598}
19599
19600impl AutomationRuleCondition {
19601    pub fn new() -> Self {
19602        std::default::Default::default()
19603    }
19604
19605    /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19606    ///
19607    /// # Example
19608    /// ```ignore,no_run
19609    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19610    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19611    /// let x = AutomationRuleCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
19612    /// ```
19613    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
19614    where
19615        T: std::convert::Into<crate::model::TargetsPresentCondition>,
19616    {
19617        self.targets_present_condition = std::option::Option::Some(v.into());
19618        self
19619    }
19620
19621    /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19622    ///
19623    /// # Example
19624    /// ```ignore,no_run
19625    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19626    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19627    /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
19628    /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
19629    /// ```
19630    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
19631    where
19632        T: std::convert::Into<crate::model::TargetsPresentCondition>,
19633    {
19634        self.targets_present_condition = v.map(|x| x.into());
19635        self
19636    }
19637
19638    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
19639    ///
19640    /// Note that all the setters affecting `rule_type_condition` are mutually
19641    /// exclusive.
19642    ///
19643    /// # Example
19644    /// ```ignore,no_run
19645    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19646    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19647    /// let x = AutomationRuleCondition::new().set_rule_type_condition(Some(
19648    ///     google_cloud_deploy_v1::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(TimedPromoteReleaseCondition::default().into())));
19649    /// ```
19650    pub fn set_rule_type_condition<
19651        T: std::convert::Into<
19652                std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19653            >,
19654    >(
19655        mut self,
19656        v: T,
19657    ) -> Self {
19658        self.rule_type_condition = v.into();
19659        self
19660    }
19661
19662    /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19663    /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
19664    /// holds a different branch.
19665    pub fn timed_promote_release_condition(
19666        &self,
19667    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
19668        #[allow(unreachable_patterns)]
19669        self.rule_type_condition.as_ref().and_then(|v| match v {
19670            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
19671            _ => std::option::Option::None,
19672        })
19673    }
19674
19675    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19676    /// to hold a `TimedPromoteReleaseCondition`.
19677    ///
19678    /// Note that all the setters affecting `rule_type_condition` are
19679    /// mutually exclusive.
19680    ///
19681    /// # Example
19682    /// ```ignore,no_run
19683    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19684    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19685    /// let x = AutomationRuleCondition::new().set_timed_promote_release_condition(TimedPromoteReleaseCondition::default()/* use setters */);
19686    /// assert!(x.timed_promote_release_condition().is_some());
19687    /// ```
19688    pub fn set_timed_promote_release_condition<
19689        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
19690    >(
19691        mut self,
19692        v: T,
19693    ) -> Self {
19694        self.rule_type_condition = std::option::Option::Some(
19695            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
19696                v.into()
19697            )
19698        );
19699        self
19700    }
19701}
19702
19703impl wkt::message::Message for AutomationRuleCondition {
19704    fn typename() -> &'static str {
19705        "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
19706    }
19707}
19708
19709/// Defines additional types related to [AutomationRuleCondition].
19710pub mod automation_rule_condition {
19711    #[allow(unused_imports)]
19712    use super::*;
19713
19714    /// Details specific to the automation rule type.
19715    #[derive(Clone, Debug, PartialEq)]
19716    #[non_exhaustive]
19717    pub enum RuleTypeCondition {
19718        /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
19719        /// to a an Automation with a timed promote release rule defined.
19720        TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
19721    }
19722}
19723
19724/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
19725/// with a Timed Promote Release rule defined.
19726#[derive(Clone, Default, PartialEq)]
19727#[non_exhaustive]
19728pub struct TimedPromoteReleaseCondition {
19729    /// Output only. When the next scheduled promotion(s) will occur.
19730    pub next_promotion_time: std::option::Option<wkt::Timestamp>,
19731
19732    /// Output only. A list of targets involved in the upcoming timed promotion(s).
19733    pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
19734
19735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19736}
19737
19738impl TimedPromoteReleaseCondition {
19739    pub fn new() -> Self {
19740        std::default::Default::default()
19741    }
19742
19743    /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19744    ///
19745    /// # Example
19746    /// ```ignore,no_run
19747    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19748    /// use wkt::Timestamp;
19749    /// let x = TimedPromoteReleaseCondition::new().set_next_promotion_time(Timestamp::default()/* use setters */);
19750    /// ```
19751    pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
19752    where
19753        T: std::convert::Into<wkt::Timestamp>,
19754    {
19755        self.next_promotion_time = std::option::Option::Some(v.into());
19756        self
19757    }
19758
19759    /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19760    ///
19761    /// # Example
19762    /// ```ignore,no_run
19763    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19764    /// use wkt::Timestamp;
19765    /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(Some(Timestamp::default()/* use setters */));
19766    /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(None::<Timestamp>);
19767    /// ```
19768    pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
19769    where
19770        T: std::convert::Into<wkt::Timestamp>,
19771    {
19772        self.next_promotion_time = v.map(|x| x.into());
19773        self
19774    }
19775
19776    /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
19777    ///
19778    /// # Example
19779    /// ```ignore,no_run
19780    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19781    /// use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19782    /// let x = TimedPromoteReleaseCondition::new()
19783    ///     .set_targets_list([
19784    ///         Targets::default()/* use setters */,
19785    ///         Targets::default()/* use (different) setters */,
19786    ///     ]);
19787    /// ```
19788    pub fn set_targets_list<T, V>(mut self, v: T) -> Self
19789    where
19790        T: std::iter::IntoIterator<Item = V>,
19791        V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
19792    {
19793        use std::iter::Iterator;
19794        self.targets_list = v.into_iter().map(|i| i.into()).collect();
19795        self
19796    }
19797}
19798
19799impl wkt::message::Message for TimedPromoteReleaseCondition {
19800    fn typename() -> &'static str {
19801        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
19802    }
19803}
19804
19805/// Defines additional types related to [TimedPromoteReleaseCondition].
19806pub mod timed_promote_release_condition {
19807    #[allow(unused_imports)]
19808    use super::*;
19809
19810    /// The targets involved in a single timed promotion.
19811    #[derive(Clone, Default, PartialEq)]
19812    #[non_exhaustive]
19813    pub struct Targets {
19814        /// Optional. The source target ID.
19815        pub source_target_id: std::string::String,
19816
19817        /// Optional. The destination target ID.
19818        pub destination_target_id: std::string::String,
19819
19820        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19821    }
19822
19823    impl Targets {
19824        pub fn new() -> Self {
19825            std::default::Default::default()
19826        }
19827
19828        /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
19829        ///
19830        /// # Example
19831        /// ```ignore,no_run
19832        /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19833        /// let x = Targets::new().set_source_target_id("example");
19834        /// ```
19835        pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
19836            mut self,
19837            v: T,
19838        ) -> Self {
19839            self.source_target_id = v.into();
19840            self
19841        }
19842
19843        /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
19844        ///
19845        /// # Example
19846        /// ```ignore,no_run
19847        /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19848        /// let x = Targets::new().set_destination_target_id("example");
19849        /// ```
19850        pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19851            mut self,
19852            v: T,
19853        ) -> Self {
19854            self.destination_target_id = v.into();
19855            self
19856        }
19857    }
19858
19859    impl wkt::message::Message for Targets {
19860        fn typename() -> &'static str {
19861            "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
19862        }
19863    }
19864}
19865
19866/// The request object for `CreateAutomation`.
19867#[derive(Clone, Default, PartialEq)]
19868#[non_exhaustive]
19869pub struct CreateAutomationRequest {
19870    /// Required. The parent collection in which the `Automation` must be created.
19871    /// The format is
19872    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
19873    pub parent: std::string::String,
19874
19875    /// Required. ID of the `Automation`.
19876    pub automation_id: std::string::String,
19877
19878    /// Required. The `Automation` to create.
19879    pub automation: std::option::Option<crate::model::Automation>,
19880
19881    /// Optional. A request ID to identify requests. Specify a unique request ID
19882    /// so that if you must retry your request, the server knows to ignore the
19883    /// request if it has already been completed. The server guarantees that for
19884    /// at least 60 minutes after the first request.
19885    ///
19886    /// For example, consider a situation where you make an initial request and the
19887    /// request times out. If you make the request again with the same request ID,
19888    /// the server can check if original operation with the same request ID was
19889    /// received, and if so, will ignore the second request. This prevents clients
19890    /// from accidentally creating duplicate commitments.
19891    ///
19892    /// The request ID must be a valid UUID with the exception that zero UUID is
19893    /// not supported (00000000-0000-0000-0000-000000000000).
19894    pub request_id: std::string::String,
19895
19896    /// Optional. If set to true, the request is validated and the user is provided
19897    /// with an expected result, but no actual change is made.
19898    pub validate_only: bool,
19899
19900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19901}
19902
19903impl CreateAutomationRequest {
19904    pub fn new() -> Self {
19905        std::default::Default::default()
19906    }
19907
19908    /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
19909    ///
19910    /// # Example
19911    /// ```ignore,no_run
19912    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19913    /// let x = CreateAutomationRequest::new().set_parent("example");
19914    /// ```
19915    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19916        self.parent = v.into();
19917        self
19918    }
19919
19920    /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
19921    ///
19922    /// # Example
19923    /// ```ignore,no_run
19924    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19925    /// let x = CreateAutomationRequest::new().set_automation_id("example");
19926    /// ```
19927    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19928        self.automation_id = v.into();
19929        self
19930    }
19931
19932    /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
19933    ///
19934    /// # Example
19935    /// ```ignore,no_run
19936    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19937    /// use google_cloud_deploy_v1::model::Automation;
19938    /// let x = CreateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
19939    /// ```
19940    pub fn set_automation<T>(mut self, v: T) -> Self
19941    where
19942        T: std::convert::Into<crate::model::Automation>,
19943    {
19944        self.automation = std::option::Option::Some(v.into());
19945        self
19946    }
19947
19948    /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
19949    ///
19950    /// # Example
19951    /// ```ignore,no_run
19952    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19953    /// use google_cloud_deploy_v1::model::Automation;
19954    /// let x = CreateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
19955    /// let x = CreateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
19956    /// ```
19957    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
19958    where
19959        T: std::convert::Into<crate::model::Automation>,
19960    {
19961        self.automation = v.map(|x| x.into());
19962        self
19963    }
19964
19965    /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
19966    ///
19967    /// # Example
19968    /// ```ignore,no_run
19969    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19970    /// let x = CreateAutomationRequest::new().set_request_id("example");
19971    /// ```
19972    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19973        self.request_id = v.into();
19974        self
19975    }
19976
19977    /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
19978    ///
19979    /// # Example
19980    /// ```ignore,no_run
19981    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19982    /// let x = CreateAutomationRequest::new().set_validate_only(true);
19983    /// ```
19984    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19985        self.validate_only = v.into();
19986        self
19987    }
19988}
19989
19990impl wkt::message::Message for CreateAutomationRequest {
19991    fn typename() -> &'static str {
19992        "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
19993    }
19994}
19995
19996/// The request object for `UpdateAutomation`.
19997#[derive(Clone, Default, PartialEq)]
19998#[non_exhaustive]
19999pub struct UpdateAutomationRequest {
20000    /// Required. Field mask is used to specify the fields to be overwritten by the
20001    /// update in the `Automation` resource. The fields specified in the
20002    /// update_mask are relative to the resource, not the full request. A field
20003    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
20004    /// then all fields are overwritten.
20005    pub update_mask: std::option::Option<wkt::FieldMask>,
20006
20007    /// Required. The `Automation` to update.
20008    pub automation: std::option::Option<crate::model::Automation>,
20009
20010    /// Optional. A request ID to identify requests. Specify a unique request ID
20011    /// so that if you must retry your request, the server knows to ignore the
20012    /// request if it has already been completed. The server guarantees that for
20013    /// at least 60 minutes after the first request.
20014    ///
20015    /// For example, consider a situation where you make an initial request and the
20016    /// request times out. If you make the request again with the same request ID,
20017    /// the server can check if original operation with the same request ID was
20018    /// received, and if so, will ignore the second request. This prevents clients
20019    /// from accidentally creating duplicate commitments.
20020    ///
20021    /// The request ID must be a valid UUID with the exception that zero UUID is
20022    /// not supported (00000000-0000-0000-0000-000000000000).
20023    pub request_id: std::string::String,
20024
20025    /// Optional. If set to true, updating a `Automation` that does not exist will
20026    /// result in the creation of a new `Automation`.
20027    pub allow_missing: bool,
20028
20029    /// Optional. If set to true, the request is validated and the user is provided
20030    /// with an expected result, but no actual change is made.
20031    pub validate_only: bool,
20032
20033    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20034}
20035
20036impl UpdateAutomationRequest {
20037    pub fn new() -> Self {
20038        std::default::Default::default()
20039    }
20040
20041    /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20042    ///
20043    /// # Example
20044    /// ```ignore,no_run
20045    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20046    /// use wkt::FieldMask;
20047    /// let x = UpdateAutomationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20048    /// ```
20049    pub fn set_update_mask<T>(mut self, v: T) -> Self
20050    where
20051        T: std::convert::Into<wkt::FieldMask>,
20052    {
20053        self.update_mask = std::option::Option::Some(v.into());
20054        self
20055    }
20056
20057    /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20058    ///
20059    /// # Example
20060    /// ```ignore,no_run
20061    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20062    /// use wkt::FieldMask;
20063    /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20064    /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20065    /// ```
20066    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20067    where
20068        T: std::convert::Into<wkt::FieldMask>,
20069    {
20070        self.update_mask = v.map(|x| x.into());
20071        self
20072    }
20073
20074    /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
20075    ///
20076    /// # Example
20077    /// ```ignore,no_run
20078    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20079    /// use google_cloud_deploy_v1::model::Automation;
20080    /// let x = UpdateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20081    /// ```
20082    pub fn set_automation<T>(mut self, v: T) -> Self
20083    where
20084        T: std::convert::Into<crate::model::Automation>,
20085    {
20086        self.automation = std::option::Option::Some(v.into());
20087        self
20088    }
20089
20090    /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
20091    ///
20092    /// # Example
20093    /// ```ignore,no_run
20094    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20095    /// use google_cloud_deploy_v1::model::Automation;
20096    /// let x = UpdateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20097    /// let x = UpdateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20098    /// ```
20099    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20100    where
20101        T: std::convert::Into<crate::model::Automation>,
20102    {
20103        self.automation = v.map(|x| x.into());
20104        self
20105    }
20106
20107    /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
20108    ///
20109    /// # Example
20110    /// ```ignore,no_run
20111    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20112    /// let x = UpdateAutomationRequest::new().set_request_id("example");
20113    /// ```
20114    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20115        self.request_id = v.into();
20116        self
20117    }
20118
20119    /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
20120    ///
20121    /// # Example
20122    /// ```ignore,no_run
20123    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20124    /// let x = UpdateAutomationRequest::new().set_allow_missing(true);
20125    /// ```
20126    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20127        self.allow_missing = v.into();
20128        self
20129    }
20130
20131    /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
20132    ///
20133    /// # Example
20134    /// ```ignore,no_run
20135    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20136    /// let x = UpdateAutomationRequest::new().set_validate_only(true);
20137    /// ```
20138    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20139        self.validate_only = v.into();
20140        self
20141    }
20142}
20143
20144impl wkt::message::Message for UpdateAutomationRequest {
20145    fn typename() -> &'static str {
20146        "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
20147    }
20148}
20149
20150/// The request object for `DeleteAutomation`.
20151#[derive(Clone, Default, PartialEq)]
20152#[non_exhaustive]
20153pub struct DeleteAutomationRequest {
20154    /// Required. The name of the `Automation` to delete. The format is
20155    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20156    pub name: std::string::String,
20157
20158    /// Optional. A request ID to identify requests. Specify a unique request ID
20159    /// so that if you must retry your request, the server knows to ignore the
20160    /// request if it has already been completed. The server guarantees that for
20161    /// at least 60 minutes after the first request.
20162    ///
20163    /// For example, consider a situation where you make an initial request and the
20164    /// request times out. If you make the request again with the same request ID,
20165    /// the server can check if original operation with the same request ID was
20166    /// received, and if so, will ignore the second request. This prevents clients
20167    /// from accidentally creating duplicate commitments.
20168    ///
20169    /// The request ID must be a valid UUID with the exception that zero UUID is
20170    /// not supported (00000000-0000-0000-0000-000000000000).
20171    pub request_id: std::string::String,
20172
20173    /// Optional. If set to true, then deleting an already deleted or non-existing
20174    /// `Automation` will succeed.
20175    pub allow_missing: bool,
20176
20177    /// Optional. If set, validate the request and verify whether the resource
20178    /// exists, but do not actually post it.
20179    pub validate_only: bool,
20180
20181    /// Optional. The weak etag of the request.
20182    /// This checksum is computed by the server based on the value of other
20183    /// fields, and may be sent on update and delete requests to ensure the
20184    /// client has an up-to-date value before proceeding.
20185    pub etag: std::string::String,
20186
20187    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20188}
20189
20190impl DeleteAutomationRequest {
20191    pub fn new() -> Self {
20192        std::default::Default::default()
20193    }
20194
20195    /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
20196    ///
20197    /// # Example
20198    /// ```ignore,no_run
20199    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20200    /// let x = DeleteAutomationRequest::new().set_name("example");
20201    /// ```
20202    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20203        self.name = v.into();
20204        self
20205    }
20206
20207    /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
20208    ///
20209    /// # Example
20210    /// ```ignore,no_run
20211    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20212    /// let x = DeleteAutomationRequest::new().set_request_id("example");
20213    /// ```
20214    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20215        self.request_id = v.into();
20216        self
20217    }
20218
20219    /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
20220    ///
20221    /// # Example
20222    /// ```ignore,no_run
20223    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20224    /// let x = DeleteAutomationRequest::new().set_allow_missing(true);
20225    /// ```
20226    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20227        self.allow_missing = v.into();
20228        self
20229    }
20230
20231    /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
20232    ///
20233    /// # Example
20234    /// ```ignore,no_run
20235    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20236    /// let x = DeleteAutomationRequest::new().set_validate_only(true);
20237    /// ```
20238    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20239        self.validate_only = v.into();
20240        self
20241    }
20242
20243    /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
20244    ///
20245    /// # Example
20246    /// ```ignore,no_run
20247    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20248    /// let x = DeleteAutomationRequest::new().set_etag("example");
20249    /// ```
20250    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20251        self.etag = v.into();
20252        self
20253    }
20254}
20255
20256impl wkt::message::Message for DeleteAutomationRequest {
20257    fn typename() -> &'static str {
20258        "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
20259    }
20260}
20261
20262/// The request object for `ListAutomations`.
20263#[derive(Clone, Default, PartialEq)]
20264#[non_exhaustive]
20265pub struct ListAutomationsRequest {
20266    /// Required. The parent `Delivery Pipeline`, which owns this collection of
20267    /// automations. Format must be
20268    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20269    pub parent: std::string::String,
20270
20271    /// The maximum number of automations to return. The service may return
20272    /// fewer than this value. If unspecified, at most 50 automations will
20273    /// be returned. The maximum value is 1000; values above 1000 will be set
20274    /// to 1000.
20275    pub page_size: i32,
20276
20277    /// A page token, received from a previous `ListAutomations` call.
20278    /// Provide this to retrieve the subsequent page.
20279    ///
20280    /// When paginating, all other provided parameters match
20281    /// the call that provided the page token.
20282    pub page_token: std::string::String,
20283
20284    /// Filter automations to be returned. All fields can be used in the
20285    /// filter.
20286    pub filter: std::string::String,
20287
20288    /// Field to sort by.
20289    pub order_by: std::string::String,
20290
20291    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20292}
20293
20294impl ListAutomationsRequest {
20295    pub fn new() -> Self {
20296        std::default::Default::default()
20297    }
20298
20299    /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
20300    ///
20301    /// # Example
20302    /// ```ignore,no_run
20303    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20304    /// let x = ListAutomationsRequest::new().set_parent("example");
20305    /// ```
20306    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20307        self.parent = v.into();
20308        self
20309    }
20310
20311    /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
20312    ///
20313    /// # Example
20314    /// ```ignore,no_run
20315    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20316    /// let x = ListAutomationsRequest::new().set_page_size(42);
20317    /// ```
20318    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20319        self.page_size = v.into();
20320        self
20321    }
20322
20323    /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
20324    ///
20325    /// # Example
20326    /// ```ignore,no_run
20327    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20328    /// let x = ListAutomationsRequest::new().set_page_token("example");
20329    /// ```
20330    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20331        self.page_token = v.into();
20332        self
20333    }
20334
20335    /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
20336    ///
20337    /// # Example
20338    /// ```ignore,no_run
20339    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20340    /// let x = ListAutomationsRequest::new().set_filter("example");
20341    /// ```
20342    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20343        self.filter = v.into();
20344        self
20345    }
20346
20347    /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
20348    ///
20349    /// # Example
20350    /// ```ignore,no_run
20351    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20352    /// let x = ListAutomationsRequest::new().set_order_by("example");
20353    /// ```
20354    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20355        self.order_by = v.into();
20356        self
20357    }
20358}
20359
20360impl wkt::message::Message for ListAutomationsRequest {
20361    fn typename() -> &'static str {
20362        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
20363    }
20364}
20365
20366/// The response object from `ListAutomations`.
20367#[derive(Clone, Default, PartialEq)]
20368#[non_exhaustive]
20369pub struct ListAutomationsResponse {
20370    /// The `Automation` objects.
20371    pub automations: std::vec::Vec<crate::model::Automation>,
20372
20373    /// A token, which can be sent as `page_token` to retrieve the next page.
20374    /// If this field is omitted, there are no subsequent pages.
20375    pub next_page_token: std::string::String,
20376
20377    /// Locations that could not be reached.
20378    pub unreachable: std::vec::Vec<std::string::String>,
20379
20380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20381}
20382
20383impl ListAutomationsResponse {
20384    pub fn new() -> Self {
20385        std::default::Default::default()
20386    }
20387
20388    /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
20389    ///
20390    /// # Example
20391    /// ```ignore,no_run
20392    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20393    /// use google_cloud_deploy_v1::model::Automation;
20394    /// let x = ListAutomationsResponse::new()
20395    ///     .set_automations([
20396    ///         Automation::default()/* use setters */,
20397    ///         Automation::default()/* use (different) setters */,
20398    ///     ]);
20399    /// ```
20400    pub fn set_automations<T, V>(mut self, v: T) -> Self
20401    where
20402        T: std::iter::IntoIterator<Item = V>,
20403        V: std::convert::Into<crate::model::Automation>,
20404    {
20405        use std::iter::Iterator;
20406        self.automations = v.into_iter().map(|i| i.into()).collect();
20407        self
20408    }
20409
20410    /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
20411    ///
20412    /// # Example
20413    /// ```ignore,no_run
20414    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20415    /// let x = ListAutomationsResponse::new().set_next_page_token("example");
20416    /// ```
20417    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20418        self.next_page_token = v.into();
20419        self
20420    }
20421
20422    /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
20423    ///
20424    /// # Example
20425    /// ```ignore,no_run
20426    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20427    /// let x = ListAutomationsResponse::new().set_unreachable(["a", "b", "c"]);
20428    /// ```
20429    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20430    where
20431        T: std::iter::IntoIterator<Item = V>,
20432        V: std::convert::Into<std::string::String>,
20433    {
20434        use std::iter::Iterator;
20435        self.unreachable = v.into_iter().map(|i| i.into()).collect();
20436        self
20437    }
20438}
20439
20440impl wkt::message::Message for ListAutomationsResponse {
20441    fn typename() -> &'static str {
20442        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
20443    }
20444}
20445
20446#[doc(hidden)]
20447impl gax::paginator::internal::PageableResponse for ListAutomationsResponse {
20448    type PageItem = crate::model::Automation;
20449
20450    fn items(self) -> std::vec::Vec<Self::PageItem> {
20451        self.automations
20452    }
20453
20454    fn next_page_token(&self) -> std::string::String {
20455        use std::clone::Clone;
20456        self.next_page_token.clone()
20457    }
20458}
20459
20460/// The request object for `GetAutomation`
20461#[derive(Clone, Default, PartialEq)]
20462#[non_exhaustive]
20463pub struct GetAutomationRequest {
20464    /// Required. Name of the `Automation`. Format must be
20465    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20466    pub name: std::string::String,
20467
20468    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20469}
20470
20471impl GetAutomationRequest {
20472    pub fn new() -> Self {
20473        std::default::Default::default()
20474    }
20475
20476    /// Sets the value of [name][crate::model::GetAutomationRequest::name].
20477    ///
20478    /// # Example
20479    /// ```ignore,no_run
20480    /// # use google_cloud_deploy_v1::model::GetAutomationRequest;
20481    /// let x = GetAutomationRequest::new().set_name("example");
20482    /// ```
20483    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20484        self.name = v.into();
20485        self
20486    }
20487}
20488
20489impl wkt::message::Message for GetAutomationRequest {
20490    fn typename() -> &'static str {
20491        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
20492    }
20493}
20494
20495/// An `AutomationRun` resource in the Cloud Deploy API.
20496///
20497/// An `AutomationRun` represents an execution instance of an
20498/// automation rule.
20499#[derive(Clone, Default, PartialEq)]
20500#[non_exhaustive]
20501pub struct AutomationRun {
20502    /// Output only. Name of the `AutomationRun`. Format is
20503    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
20504    pub name: std::string::String,
20505
20506    /// Output only. Time at which the `AutomationRun` was created.
20507    pub create_time: std::option::Option<wkt::Timestamp>,
20508
20509    /// Output only. Time at which the automationRun was updated.
20510    pub update_time: std::option::Option<wkt::Timestamp>,
20511
20512    /// Output only. The weak etag of the `AutomationRun` resource.
20513    /// This checksum is computed by the server based on the value of other
20514    /// fields, and may be sent on update and delete requests to ensure the
20515    /// client has an up-to-date value before proceeding.
20516    pub etag: std::string::String,
20517
20518    /// Output only. Email address of the user-managed IAM service account that
20519    /// performs the operations against Cloud Deploy resources.
20520    pub service_account: std::string::String,
20521
20522    /// Output only. Snapshot of the Automation taken at AutomationRun creation
20523    /// time.
20524    pub automation_snapshot: std::option::Option<crate::model::Automation>,
20525
20526    /// Output only. The ID of the source target that initiates the
20527    /// `AutomationRun`. The value of this field is the last segment of a target
20528    /// name.
20529    pub target_id: std::string::String,
20530
20531    /// Output only. Current state of the `AutomationRun`.
20532    pub state: crate::model::automation_run::State,
20533
20534    /// Output only. Explains the current state of the `AutomationRun`. Present
20535    /// only when an explanation is needed.
20536    pub state_description: std::string::String,
20537
20538    /// Output only. Contains information about what policies prevented the
20539    /// `AutomationRun` from proceeding.
20540    pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
20541
20542    /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
20543    /// after 14 days from its creation date.
20544    pub expire_time: std::option::Option<wkt::Timestamp>,
20545
20546    /// Output only. The ID of the automation rule that initiated the operation.
20547    pub rule_id: std::string::String,
20548
20549    /// Output only. The ID of the automation that initiated the operation.
20550    pub automation_id: std::string::String,
20551
20552    /// Output only. Earliest time the `AutomationRun` will attempt to resume.
20553    /// Wait-time is configured by `wait` in automation rule.
20554    pub wait_until_time: std::option::Option<wkt::Timestamp>,
20555
20556    /// The operation that the `AutomationRun` will perform.
20557    pub operation: std::option::Option<crate::model::automation_run::Operation>,
20558
20559    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20560}
20561
20562impl AutomationRun {
20563    pub fn new() -> Self {
20564        std::default::Default::default()
20565    }
20566
20567    /// Sets the value of [name][crate::model::AutomationRun::name].
20568    ///
20569    /// # Example
20570    /// ```ignore,no_run
20571    /// # use google_cloud_deploy_v1::model::AutomationRun;
20572    /// let x = AutomationRun::new().set_name("example");
20573    /// ```
20574    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20575        self.name = v.into();
20576        self
20577    }
20578
20579    /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
20580    ///
20581    /// # Example
20582    /// ```ignore,no_run
20583    /// # use google_cloud_deploy_v1::model::AutomationRun;
20584    /// use wkt::Timestamp;
20585    /// let x = AutomationRun::new().set_create_time(Timestamp::default()/* use setters */);
20586    /// ```
20587    pub fn set_create_time<T>(mut self, v: T) -> Self
20588    where
20589        T: std::convert::Into<wkt::Timestamp>,
20590    {
20591        self.create_time = std::option::Option::Some(v.into());
20592        self
20593    }
20594
20595    /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
20596    ///
20597    /// # Example
20598    /// ```ignore,no_run
20599    /// # use google_cloud_deploy_v1::model::AutomationRun;
20600    /// use wkt::Timestamp;
20601    /// let x = AutomationRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20602    /// let x = AutomationRun::new().set_or_clear_create_time(None::<Timestamp>);
20603    /// ```
20604    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20605    where
20606        T: std::convert::Into<wkt::Timestamp>,
20607    {
20608        self.create_time = v.map(|x| x.into());
20609        self
20610    }
20611
20612    /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
20613    ///
20614    /// # Example
20615    /// ```ignore,no_run
20616    /// # use google_cloud_deploy_v1::model::AutomationRun;
20617    /// use wkt::Timestamp;
20618    /// let x = AutomationRun::new().set_update_time(Timestamp::default()/* use setters */);
20619    /// ```
20620    pub fn set_update_time<T>(mut self, v: T) -> Self
20621    where
20622        T: std::convert::Into<wkt::Timestamp>,
20623    {
20624        self.update_time = std::option::Option::Some(v.into());
20625        self
20626    }
20627
20628    /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
20629    ///
20630    /// # Example
20631    /// ```ignore,no_run
20632    /// # use google_cloud_deploy_v1::model::AutomationRun;
20633    /// use wkt::Timestamp;
20634    /// let x = AutomationRun::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20635    /// let x = AutomationRun::new().set_or_clear_update_time(None::<Timestamp>);
20636    /// ```
20637    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20638    where
20639        T: std::convert::Into<wkt::Timestamp>,
20640    {
20641        self.update_time = v.map(|x| x.into());
20642        self
20643    }
20644
20645    /// Sets the value of [etag][crate::model::AutomationRun::etag].
20646    ///
20647    /// # Example
20648    /// ```ignore,no_run
20649    /// # use google_cloud_deploy_v1::model::AutomationRun;
20650    /// let x = AutomationRun::new().set_etag("example");
20651    /// ```
20652    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20653        self.etag = v.into();
20654        self
20655    }
20656
20657    /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
20658    ///
20659    /// # Example
20660    /// ```ignore,no_run
20661    /// # use google_cloud_deploy_v1::model::AutomationRun;
20662    /// let x = AutomationRun::new().set_service_account("example");
20663    /// ```
20664    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20665        self.service_account = v.into();
20666        self
20667    }
20668
20669    /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20670    ///
20671    /// # Example
20672    /// ```ignore,no_run
20673    /// # use google_cloud_deploy_v1::model::AutomationRun;
20674    /// use google_cloud_deploy_v1::model::Automation;
20675    /// let x = AutomationRun::new().set_automation_snapshot(Automation::default()/* use setters */);
20676    /// ```
20677    pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
20678    where
20679        T: std::convert::Into<crate::model::Automation>,
20680    {
20681        self.automation_snapshot = std::option::Option::Some(v.into());
20682        self
20683    }
20684
20685    /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20686    ///
20687    /// # Example
20688    /// ```ignore,no_run
20689    /// # use google_cloud_deploy_v1::model::AutomationRun;
20690    /// use google_cloud_deploy_v1::model::Automation;
20691    /// let x = AutomationRun::new().set_or_clear_automation_snapshot(Some(Automation::default()/* use setters */));
20692    /// let x = AutomationRun::new().set_or_clear_automation_snapshot(None::<Automation>);
20693    /// ```
20694    pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
20695    where
20696        T: std::convert::Into<crate::model::Automation>,
20697    {
20698        self.automation_snapshot = v.map(|x| x.into());
20699        self
20700    }
20701
20702    /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
20703    ///
20704    /// # Example
20705    /// ```ignore,no_run
20706    /// # use google_cloud_deploy_v1::model::AutomationRun;
20707    /// let x = AutomationRun::new().set_target_id("example");
20708    /// ```
20709    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20710        self.target_id = v.into();
20711        self
20712    }
20713
20714    /// Sets the value of [state][crate::model::AutomationRun::state].
20715    ///
20716    /// # Example
20717    /// ```ignore,no_run
20718    /// # use google_cloud_deploy_v1::model::AutomationRun;
20719    /// use google_cloud_deploy_v1::model::automation_run::State;
20720    /// let x0 = AutomationRun::new().set_state(State::Succeeded);
20721    /// let x1 = AutomationRun::new().set_state(State::Cancelled);
20722    /// let x2 = AutomationRun::new().set_state(State::Failed);
20723    /// ```
20724    pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
20725        mut self,
20726        v: T,
20727    ) -> Self {
20728        self.state = v.into();
20729        self
20730    }
20731
20732    /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
20733    ///
20734    /// # Example
20735    /// ```ignore,no_run
20736    /// # use google_cloud_deploy_v1::model::AutomationRun;
20737    /// let x = AutomationRun::new().set_state_description("example");
20738    /// ```
20739    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
20740        mut self,
20741        v: T,
20742    ) -> Self {
20743        self.state_description = v.into();
20744        self
20745    }
20746
20747    /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20748    ///
20749    /// # Example
20750    /// ```ignore,no_run
20751    /// # use google_cloud_deploy_v1::model::AutomationRun;
20752    /// use google_cloud_deploy_v1::model::PolicyViolation;
20753    /// let x = AutomationRun::new().set_policy_violation(PolicyViolation::default()/* use setters */);
20754    /// ```
20755    pub fn set_policy_violation<T>(mut self, v: T) -> Self
20756    where
20757        T: std::convert::Into<crate::model::PolicyViolation>,
20758    {
20759        self.policy_violation = std::option::Option::Some(v.into());
20760        self
20761    }
20762
20763    /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20764    ///
20765    /// # Example
20766    /// ```ignore,no_run
20767    /// # use google_cloud_deploy_v1::model::AutomationRun;
20768    /// use google_cloud_deploy_v1::model::PolicyViolation;
20769    /// let x = AutomationRun::new().set_or_clear_policy_violation(Some(PolicyViolation::default()/* use setters */));
20770    /// let x = AutomationRun::new().set_or_clear_policy_violation(None::<PolicyViolation>);
20771    /// ```
20772    pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
20773    where
20774        T: std::convert::Into<crate::model::PolicyViolation>,
20775    {
20776        self.policy_violation = v.map(|x| x.into());
20777        self
20778    }
20779
20780    /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
20781    ///
20782    /// # Example
20783    /// ```ignore,no_run
20784    /// # use google_cloud_deploy_v1::model::AutomationRun;
20785    /// use wkt::Timestamp;
20786    /// let x = AutomationRun::new().set_expire_time(Timestamp::default()/* use setters */);
20787    /// ```
20788    pub fn set_expire_time<T>(mut self, v: T) -> Self
20789    where
20790        T: std::convert::Into<wkt::Timestamp>,
20791    {
20792        self.expire_time = std::option::Option::Some(v.into());
20793        self
20794    }
20795
20796    /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
20797    ///
20798    /// # Example
20799    /// ```ignore,no_run
20800    /// # use google_cloud_deploy_v1::model::AutomationRun;
20801    /// use wkt::Timestamp;
20802    /// let x = AutomationRun::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
20803    /// let x = AutomationRun::new().set_or_clear_expire_time(None::<Timestamp>);
20804    /// ```
20805    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
20806    where
20807        T: std::convert::Into<wkt::Timestamp>,
20808    {
20809        self.expire_time = v.map(|x| x.into());
20810        self
20811    }
20812
20813    /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
20814    ///
20815    /// # Example
20816    /// ```ignore,no_run
20817    /// # use google_cloud_deploy_v1::model::AutomationRun;
20818    /// let x = AutomationRun::new().set_rule_id("example");
20819    /// ```
20820    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20821        self.rule_id = v.into();
20822        self
20823    }
20824
20825    /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
20826    ///
20827    /// # Example
20828    /// ```ignore,no_run
20829    /// # use google_cloud_deploy_v1::model::AutomationRun;
20830    /// let x = AutomationRun::new().set_automation_id("example");
20831    /// ```
20832    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20833        self.automation_id = v.into();
20834        self
20835    }
20836
20837    /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
20838    ///
20839    /// # Example
20840    /// ```ignore,no_run
20841    /// # use google_cloud_deploy_v1::model::AutomationRun;
20842    /// use wkt::Timestamp;
20843    /// let x = AutomationRun::new().set_wait_until_time(Timestamp::default()/* use setters */);
20844    /// ```
20845    pub fn set_wait_until_time<T>(mut self, v: T) -> Self
20846    where
20847        T: std::convert::Into<wkt::Timestamp>,
20848    {
20849        self.wait_until_time = std::option::Option::Some(v.into());
20850        self
20851    }
20852
20853    /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
20854    ///
20855    /// # Example
20856    /// ```ignore,no_run
20857    /// # use google_cloud_deploy_v1::model::AutomationRun;
20858    /// use wkt::Timestamp;
20859    /// let x = AutomationRun::new().set_or_clear_wait_until_time(Some(Timestamp::default()/* use setters */));
20860    /// let x = AutomationRun::new().set_or_clear_wait_until_time(None::<Timestamp>);
20861    /// ```
20862    pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
20863    where
20864        T: std::convert::Into<wkt::Timestamp>,
20865    {
20866        self.wait_until_time = v.map(|x| x.into());
20867        self
20868    }
20869
20870    /// Sets the value of [operation][crate::model::AutomationRun::operation].
20871    ///
20872    /// Note that all the setters affecting `operation` are mutually
20873    /// exclusive.
20874    ///
20875    /// # Example
20876    /// ```ignore,no_run
20877    /// # use google_cloud_deploy_v1::model::AutomationRun;
20878    /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
20879    /// let x = AutomationRun::new().set_operation(Some(
20880    ///     google_cloud_deploy_v1::model::automation_run::Operation::PromoteReleaseOperation(PromoteReleaseOperation::default().into())));
20881    /// ```
20882    pub fn set_operation<
20883        T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
20884    >(
20885        mut self,
20886        v: T,
20887    ) -> Self {
20888        self.operation = v.into();
20889        self
20890    }
20891
20892    /// The value of [operation][crate::model::AutomationRun::operation]
20893    /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
20894    /// holds a different branch.
20895    pub fn promote_release_operation(
20896        &self,
20897    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
20898        #[allow(unreachable_patterns)]
20899        self.operation.as_ref().and_then(|v| match v {
20900            crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
20901                std::option::Option::Some(v)
20902            }
20903            _ => std::option::Option::None,
20904        })
20905    }
20906
20907    /// Sets the value of [operation][crate::model::AutomationRun::operation]
20908    /// to hold a `PromoteReleaseOperation`.
20909    ///
20910    /// Note that all the setters affecting `operation` are
20911    /// mutually exclusive.
20912    ///
20913    /// # Example
20914    /// ```ignore,no_run
20915    /// # use google_cloud_deploy_v1::model::AutomationRun;
20916    /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
20917    /// let x = AutomationRun::new().set_promote_release_operation(PromoteReleaseOperation::default()/* use setters */);
20918    /// assert!(x.promote_release_operation().is_some());
20919    /// assert!(x.advance_rollout_operation().is_none());
20920    /// assert!(x.repair_rollout_operation().is_none());
20921    /// assert!(x.timed_promote_release_operation().is_none());
20922    /// ```
20923    pub fn set_promote_release_operation<
20924        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
20925    >(
20926        mut self,
20927        v: T,
20928    ) -> Self {
20929        self.operation = std::option::Option::Some(
20930            crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
20931        );
20932        self
20933    }
20934
20935    /// The value of [operation][crate::model::AutomationRun::operation]
20936    /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
20937    /// holds a different branch.
20938    pub fn advance_rollout_operation(
20939        &self,
20940    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
20941        #[allow(unreachable_patterns)]
20942        self.operation.as_ref().and_then(|v| match v {
20943            crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
20944                std::option::Option::Some(v)
20945            }
20946            _ => std::option::Option::None,
20947        })
20948    }
20949
20950    /// Sets the value of [operation][crate::model::AutomationRun::operation]
20951    /// to hold a `AdvanceRolloutOperation`.
20952    ///
20953    /// Note that all the setters affecting `operation` are
20954    /// mutually exclusive.
20955    ///
20956    /// # Example
20957    /// ```ignore,no_run
20958    /// # use google_cloud_deploy_v1::model::AutomationRun;
20959    /// use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
20960    /// let x = AutomationRun::new().set_advance_rollout_operation(AdvanceRolloutOperation::default()/* use setters */);
20961    /// assert!(x.advance_rollout_operation().is_some());
20962    /// assert!(x.promote_release_operation().is_none());
20963    /// assert!(x.repair_rollout_operation().is_none());
20964    /// assert!(x.timed_promote_release_operation().is_none());
20965    /// ```
20966    pub fn set_advance_rollout_operation<
20967        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
20968    >(
20969        mut self,
20970        v: T,
20971    ) -> Self {
20972        self.operation = std::option::Option::Some(
20973            crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
20974        );
20975        self
20976    }
20977
20978    /// The value of [operation][crate::model::AutomationRun::operation]
20979    /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
20980    /// holds a different branch.
20981    pub fn repair_rollout_operation(
20982        &self,
20983    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
20984        #[allow(unreachable_patterns)]
20985        self.operation.as_ref().and_then(|v| match v {
20986            crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
20987                std::option::Option::Some(v)
20988            }
20989            _ => std::option::Option::None,
20990        })
20991    }
20992
20993    /// Sets the value of [operation][crate::model::AutomationRun::operation]
20994    /// to hold a `RepairRolloutOperation`.
20995    ///
20996    /// Note that all the setters affecting `operation` are
20997    /// mutually exclusive.
20998    ///
20999    /// # Example
21000    /// ```ignore,no_run
21001    /// # use google_cloud_deploy_v1::model::AutomationRun;
21002    /// use google_cloud_deploy_v1::model::RepairRolloutOperation;
21003    /// let x = AutomationRun::new().set_repair_rollout_operation(RepairRolloutOperation::default()/* use setters */);
21004    /// assert!(x.repair_rollout_operation().is_some());
21005    /// assert!(x.promote_release_operation().is_none());
21006    /// assert!(x.advance_rollout_operation().is_none());
21007    /// assert!(x.timed_promote_release_operation().is_none());
21008    /// ```
21009    pub fn set_repair_rollout_operation<
21010        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
21011    >(
21012        mut self,
21013        v: T,
21014    ) -> Self {
21015        self.operation = std::option::Option::Some(
21016            crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
21017        );
21018        self
21019    }
21020
21021    /// The value of [operation][crate::model::AutomationRun::operation]
21022    /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
21023    /// holds a different branch.
21024    pub fn timed_promote_release_operation(
21025        &self,
21026    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
21027        #[allow(unreachable_patterns)]
21028        self.operation.as_ref().and_then(|v| match v {
21029            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
21030                std::option::Option::Some(v)
21031            }
21032            _ => std::option::Option::None,
21033        })
21034    }
21035
21036    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21037    /// to hold a `TimedPromoteReleaseOperation`.
21038    ///
21039    /// Note that all the setters affecting `operation` are
21040    /// mutually exclusive.
21041    ///
21042    /// # Example
21043    /// ```ignore,no_run
21044    /// # use google_cloud_deploy_v1::model::AutomationRun;
21045    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21046    /// let x = AutomationRun::new().set_timed_promote_release_operation(TimedPromoteReleaseOperation::default()/* use setters */);
21047    /// assert!(x.timed_promote_release_operation().is_some());
21048    /// assert!(x.promote_release_operation().is_none());
21049    /// assert!(x.advance_rollout_operation().is_none());
21050    /// assert!(x.repair_rollout_operation().is_none());
21051    /// ```
21052    pub fn set_timed_promote_release_operation<
21053        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
21054    >(
21055        mut self,
21056        v: T,
21057    ) -> Self {
21058        self.operation = std::option::Option::Some(
21059            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
21060        );
21061        self
21062    }
21063}
21064
21065impl wkt::message::Message for AutomationRun {
21066    fn typename() -> &'static str {
21067        "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
21068    }
21069}
21070
21071/// Defines additional types related to [AutomationRun].
21072pub mod automation_run {
21073    #[allow(unused_imports)]
21074    use super::*;
21075
21076    /// Valid state of an `AutomationRun`.
21077    ///
21078    /// # Working with unknown values
21079    ///
21080    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21081    /// additional enum variants at any time. Adding new variants is not considered
21082    /// a breaking change. Applications should write their code in anticipation of:
21083    ///
21084    /// - New values appearing in future releases of the client library, **and**
21085    /// - New values received dynamically, without application changes.
21086    ///
21087    /// Please consult the [Working with enums] section in the user guide for some
21088    /// guidelines.
21089    ///
21090    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21091    #[derive(Clone, Debug, PartialEq)]
21092    #[non_exhaustive]
21093    pub enum State {
21094        /// The `AutomationRun` has an unspecified state.
21095        Unspecified,
21096        /// The `AutomationRun` has succeeded.
21097        Succeeded,
21098        /// The `AutomationRun` was cancelled.
21099        Cancelled,
21100        /// The `AutomationRun` has failed.
21101        Failed,
21102        /// The `AutomationRun` is in progress.
21103        InProgress,
21104        /// The `AutomationRun` is pending.
21105        Pending,
21106        /// The `AutomationRun` was aborted.
21107        Aborted,
21108        /// If set, the enum was initialized with an unknown value.
21109        ///
21110        /// Applications can examine the value using [State::value] or
21111        /// [State::name].
21112        UnknownValue(state::UnknownValue),
21113    }
21114
21115    #[doc(hidden)]
21116    pub mod state {
21117        #[allow(unused_imports)]
21118        use super::*;
21119        #[derive(Clone, Debug, PartialEq)]
21120        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21121    }
21122
21123    impl State {
21124        /// Gets the enum value.
21125        ///
21126        /// Returns `None` if the enum contains an unknown value deserialized from
21127        /// the string representation of enums.
21128        pub fn value(&self) -> std::option::Option<i32> {
21129            match self {
21130                Self::Unspecified => std::option::Option::Some(0),
21131                Self::Succeeded => std::option::Option::Some(1),
21132                Self::Cancelled => std::option::Option::Some(2),
21133                Self::Failed => std::option::Option::Some(3),
21134                Self::InProgress => std::option::Option::Some(4),
21135                Self::Pending => std::option::Option::Some(5),
21136                Self::Aborted => std::option::Option::Some(6),
21137                Self::UnknownValue(u) => u.0.value(),
21138            }
21139        }
21140
21141        /// Gets the enum value as a string.
21142        ///
21143        /// Returns `None` if the enum contains an unknown value deserialized from
21144        /// the integer representation of enums.
21145        pub fn name(&self) -> std::option::Option<&str> {
21146            match self {
21147                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21148                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
21149                Self::Cancelled => std::option::Option::Some("CANCELLED"),
21150                Self::Failed => std::option::Option::Some("FAILED"),
21151                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
21152                Self::Pending => std::option::Option::Some("PENDING"),
21153                Self::Aborted => std::option::Option::Some("ABORTED"),
21154                Self::UnknownValue(u) => u.0.name(),
21155            }
21156        }
21157    }
21158
21159    impl std::default::Default for State {
21160        fn default() -> Self {
21161            use std::convert::From;
21162            Self::from(0)
21163        }
21164    }
21165
21166    impl std::fmt::Display for State {
21167        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21168            wkt::internal::display_enum(f, self.name(), self.value())
21169        }
21170    }
21171
21172    impl std::convert::From<i32> for State {
21173        fn from(value: i32) -> Self {
21174            match value {
21175                0 => Self::Unspecified,
21176                1 => Self::Succeeded,
21177                2 => Self::Cancelled,
21178                3 => Self::Failed,
21179                4 => Self::InProgress,
21180                5 => Self::Pending,
21181                6 => Self::Aborted,
21182                _ => Self::UnknownValue(state::UnknownValue(
21183                    wkt::internal::UnknownEnumValue::Integer(value),
21184                )),
21185            }
21186        }
21187    }
21188
21189    impl std::convert::From<&str> for State {
21190        fn from(value: &str) -> Self {
21191            use std::string::ToString;
21192            match value {
21193                "STATE_UNSPECIFIED" => Self::Unspecified,
21194                "SUCCEEDED" => Self::Succeeded,
21195                "CANCELLED" => Self::Cancelled,
21196                "FAILED" => Self::Failed,
21197                "IN_PROGRESS" => Self::InProgress,
21198                "PENDING" => Self::Pending,
21199                "ABORTED" => Self::Aborted,
21200                _ => Self::UnknownValue(state::UnknownValue(
21201                    wkt::internal::UnknownEnumValue::String(value.to_string()),
21202                )),
21203            }
21204        }
21205    }
21206
21207    impl serde::ser::Serialize for State {
21208        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21209        where
21210            S: serde::Serializer,
21211        {
21212            match self {
21213                Self::Unspecified => serializer.serialize_i32(0),
21214                Self::Succeeded => serializer.serialize_i32(1),
21215                Self::Cancelled => serializer.serialize_i32(2),
21216                Self::Failed => serializer.serialize_i32(3),
21217                Self::InProgress => serializer.serialize_i32(4),
21218                Self::Pending => serializer.serialize_i32(5),
21219                Self::Aborted => serializer.serialize_i32(6),
21220                Self::UnknownValue(u) => u.0.serialize(serializer),
21221            }
21222        }
21223    }
21224
21225    impl<'de> serde::de::Deserialize<'de> for State {
21226        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21227        where
21228            D: serde::Deserializer<'de>,
21229        {
21230            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21231                ".google.cloud.deploy.v1.AutomationRun.State",
21232            ))
21233        }
21234    }
21235
21236    /// The operation that the `AutomationRun` will perform.
21237    #[derive(Clone, Debug, PartialEq)]
21238    #[non_exhaustive]
21239    pub enum Operation {
21240        /// Output only. Promotes a release to a specified 'Target'.
21241        PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
21242        /// Output only. Advances a rollout to the next phase.
21243        AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
21244        /// Output only. Repairs a failed 'Rollout'.
21245        RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
21246        /// Output only. Promotes a release to a specified 'Target' as defined in a
21247        /// Timed Promote Release rule.
21248        TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
21249    }
21250}
21251
21252/// Contains the information of an automated promote-release operation.
21253#[derive(Clone, Default, PartialEq)]
21254#[non_exhaustive]
21255pub struct PromoteReleaseOperation {
21256    /// Output only. The ID of the target that represents the promotion stage to
21257    /// which the release will be promoted. The value of this field is the last
21258    /// segment of a target name.
21259    pub target_id: std::string::String,
21260
21261    /// Output only. How long the operation will be paused.
21262    pub wait: std::option::Option<wkt::Duration>,
21263
21264    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21265    pub rollout: std::string::String,
21266
21267    /// Output only. The starting phase of the rollout created by this operation.
21268    pub phase: std::string::String,
21269
21270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21271}
21272
21273impl PromoteReleaseOperation {
21274    pub fn new() -> Self {
21275        std::default::Default::default()
21276    }
21277
21278    /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
21279    ///
21280    /// # Example
21281    /// ```ignore,no_run
21282    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21283    /// let x = PromoteReleaseOperation::new().set_target_id("example");
21284    /// ```
21285    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21286        self.target_id = v.into();
21287        self
21288    }
21289
21290    /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
21291    ///
21292    /// # Example
21293    /// ```ignore,no_run
21294    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21295    /// use wkt::Duration;
21296    /// let x = PromoteReleaseOperation::new().set_wait(Duration::default()/* use setters */);
21297    /// ```
21298    pub fn set_wait<T>(mut self, v: T) -> Self
21299    where
21300        T: std::convert::Into<wkt::Duration>,
21301    {
21302        self.wait = std::option::Option::Some(v.into());
21303        self
21304    }
21305
21306    /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
21307    ///
21308    /// # Example
21309    /// ```ignore,no_run
21310    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21311    /// use wkt::Duration;
21312    /// let x = PromoteReleaseOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21313    /// let x = PromoteReleaseOperation::new().set_or_clear_wait(None::<Duration>);
21314    /// ```
21315    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21316    where
21317        T: std::convert::Into<wkt::Duration>,
21318    {
21319        self.wait = v.map(|x| x.into());
21320        self
21321    }
21322
21323    /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
21324    ///
21325    /// # Example
21326    /// ```ignore,no_run
21327    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21328    /// let x = PromoteReleaseOperation::new().set_rollout("example");
21329    /// ```
21330    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21331        self.rollout = v.into();
21332        self
21333    }
21334
21335    /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
21336    ///
21337    /// # Example
21338    /// ```ignore,no_run
21339    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21340    /// let x = PromoteReleaseOperation::new().set_phase("example");
21341    /// ```
21342    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21343        self.phase = v.into();
21344        self
21345    }
21346}
21347
21348impl wkt::message::Message for PromoteReleaseOperation {
21349    fn typename() -> &'static str {
21350        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
21351    }
21352}
21353
21354/// Contains the information of an automated advance-rollout operation.
21355#[derive(Clone, Default, PartialEq)]
21356#[non_exhaustive]
21357pub struct AdvanceRolloutOperation {
21358    /// Output only. The phase of a deployment that initiated the operation.
21359    pub source_phase: std::string::String,
21360
21361    /// Output only. How long the operation will be paused.
21362    pub wait: std::option::Option<wkt::Duration>,
21363
21364    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21365    pub rollout: std::string::String,
21366
21367    /// Output only. The phase the rollout will be advanced to.
21368    pub destination_phase: std::string::String,
21369
21370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21371}
21372
21373impl AdvanceRolloutOperation {
21374    pub fn new() -> Self {
21375        std::default::Default::default()
21376    }
21377
21378    /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
21379    ///
21380    /// # Example
21381    /// ```ignore,no_run
21382    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21383    /// let x = AdvanceRolloutOperation::new().set_source_phase("example");
21384    /// ```
21385    pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21386        self.source_phase = v.into();
21387        self
21388    }
21389
21390    /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21391    ///
21392    /// # Example
21393    /// ```ignore,no_run
21394    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21395    /// use wkt::Duration;
21396    /// let x = AdvanceRolloutOperation::new().set_wait(Duration::default()/* use setters */);
21397    /// ```
21398    pub fn set_wait<T>(mut self, v: T) -> Self
21399    where
21400        T: std::convert::Into<wkt::Duration>,
21401    {
21402        self.wait = std::option::Option::Some(v.into());
21403        self
21404    }
21405
21406    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21407    ///
21408    /// # Example
21409    /// ```ignore,no_run
21410    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21411    /// use wkt::Duration;
21412    /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21413    /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(None::<Duration>);
21414    /// ```
21415    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21416    where
21417        T: std::convert::Into<wkt::Duration>,
21418    {
21419        self.wait = v.map(|x| x.into());
21420        self
21421    }
21422
21423    /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
21424    ///
21425    /// # Example
21426    /// ```ignore,no_run
21427    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21428    /// let x = AdvanceRolloutOperation::new().set_rollout("example");
21429    /// ```
21430    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21431        self.rollout = v.into();
21432        self
21433    }
21434
21435    /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
21436    ///
21437    /// # Example
21438    /// ```ignore,no_run
21439    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21440    /// let x = AdvanceRolloutOperation::new().set_destination_phase("example");
21441    /// ```
21442    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21443        mut self,
21444        v: T,
21445    ) -> Self {
21446        self.destination_phase = v.into();
21447        self
21448    }
21449}
21450
21451impl wkt::message::Message for AdvanceRolloutOperation {
21452    fn typename() -> &'static str {
21453        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
21454    }
21455}
21456
21457/// Contains the information for an automated `repair rollout` operation.
21458#[derive(Clone, Default, PartialEq)]
21459#[non_exhaustive]
21460pub struct RepairRolloutOperation {
21461    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21462    pub rollout: std::string::String,
21463
21464    /// Output only. The index of the current repair action in the repair sequence.
21465    pub current_repair_phase_index: i64,
21466
21467    /// Output only. Records of the repair attempts. Each repair phase may have
21468    /// multiple retry attempts or single rollback attempt.
21469    pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
21470
21471    /// Output only. The phase ID of the phase that includes the job being
21472    /// repaired.
21473    pub phase_id: std::string::String,
21474
21475    /// Output only. The job ID for the Job to repair.
21476    pub job_id: std::string::String,
21477
21478    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21479}
21480
21481impl RepairRolloutOperation {
21482    pub fn new() -> Self {
21483        std::default::Default::default()
21484    }
21485
21486    /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
21487    ///
21488    /// # Example
21489    /// ```ignore,no_run
21490    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21491    /// let x = RepairRolloutOperation::new().set_rollout("example");
21492    /// ```
21493    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21494        self.rollout = v.into();
21495        self
21496    }
21497
21498    /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
21499    ///
21500    /// # Example
21501    /// ```ignore,no_run
21502    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21503    /// let x = RepairRolloutOperation::new().set_current_repair_phase_index(42);
21504    /// ```
21505    pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21506        self.current_repair_phase_index = v.into();
21507        self
21508    }
21509
21510    /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
21511    ///
21512    /// # Example
21513    /// ```ignore,no_run
21514    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21515    /// use google_cloud_deploy_v1::model::RepairPhase;
21516    /// let x = RepairRolloutOperation::new()
21517    ///     .set_repair_phases([
21518    ///         RepairPhase::default()/* use setters */,
21519    ///         RepairPhase::default()/* use (different) setters */,
21520    ///     ]);
21521    /// ```
21522    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
21523    where
21524        T: std::iter::IntoIterator<Item = V>,
21525        V: std::convert::Into<crate::model::RepairPhase>,
21526    {
21527        use std::iter::Iterator;
21528        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
21529        self
21530    }
21531
21532    /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
21533    ///
21534    /// # Example
21535    /// ```ignore,no_run
21536    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21537    /// let x = RepairRolloutOperation::new().set_phase_id("example");
21538    /// ```
21539    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21540        self.phase_id = v.into();
21541        self
21542    }
21543
21544    /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
21545    ///
21546    /// # Example
21547    /// ```ignore,no_run
21548    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21549    /// let x = RepairRolloutOperation::new().set_job_id("example");
21550    /// ```
21551    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21552        self.job_id = v.into();
21553        self
21554    }
21555}
21556
21557impl wkt::message::Message for RepairRolloutOperation {
21558    fn typename() -> &'static str {
21559        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
21560    }
21561}
21562
21563/// Contains the information of an automated timed promote-release operation.
21564#[derive(Clone, Default, PartialEq)]
21565#[non_exhaustive]
21566pub struct TimedPromoteReleaseOperation {
21567    /// Output only. The ID of the target that represents the promotion stage to
21568    /// which the release will be promoted. The value of this field is the last
21569    /// segment of a target name.
21570    pub target_id: std::string::String,
21571
21572    /// Output only. The name of the release to be promoted.
21573    pub release: std::string::String,
21574
21575    /// Output only. The starting phase of the rollout created by this operation.
21576    pub phase: std::string::String,
21577
21578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21579}
21580
21581impl TimedPromoteReleaseOperation {
21582    pub fn new() -> Self {
21583        std::default::Default::default()
21584    }
21585
21586    /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
21587    ///
21588    /// # Example
21589    /// ```ignore,no_run
21590    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21591    /// let x = TimedPromoteReleaseOperation::new().set_target_id("example");
21592    /// ```
21593    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21594        self.target_id = v.into();
21595        self
21596    }
21597
21598    /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
21599    ///
21600    /// # Example
21601    /// ```ignore,no_run
21602    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21603    /// let x = TimedPromoteReleaseOperation::new().set_release("example");
21604    /// ```
21605    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21606        self.release = v.into();
21607        self
21608    }
21609
21610    /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
21611    ///
21612    /// # Example
21613    /// ```ignore,no_run
21614    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21615    /// let x = TimedPromoteReleaseOperation::new().set_phase("example");
21616    /// ```
21617    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21618        self.phase = v.into();
21619        self
21620    }
21621}
21622
21623impl wkt::message::Message for TimedPromoteReleaseOperation {
21624    fn typename() -> &'static str {
21625        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
21626    }
21627}
21628
21629/// RepairPhase tracks the repair attempts that have been made for
21630/// each `RepairPhaseConfig` specified in the `Automation` resource.
21631#[derive(Clone, Default, PartialEq)]
21632#[non_exhaustive]
21633pub struct RepairPhase {
21634    /// The `RepairPhase` type and the information for that type.
21635    pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
21636
21637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21638}
21639
21640impl RepairPhase {
21641    pub fn new() -> Self {
21642        std::default::Default::default()
21643    }
21644
21645    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
21646    ///
21647    /// Note that all the setters affecting `repair_phase` are mutually
21648    /// exclusive.
21649    ///
21650    /// # Example
21651    /// ```ignore,no_run
21652    /// # use google_cloud_deploy_v1::model::RepairPhase;
21653    /// use google_cloud_deploy_v1::model::RetryPhase;
21654    /// let x = RepairPhase::new().set_repair_phase(Some(
21655    ///     google_cloud_deploy_v1::model::repair_phase::RepairPhase::Retry(RetryPhase::default().into())));
21656    /// ```
21657    pub fn set_repair_phase<
21658        T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
21659    >(
21660        mut self,
21661        v: T,
21662    ) -> Self {
21663        self.repair_phase = v.into();
21664        self
21665    }
21666
21667    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21668    /// if it holds a `Retry`, `None` if the field is not set or
21669    /// holds a different branch.
21670    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
21671        #[allow(unreachable_patterns)]
21672        self.repair_phase.as_ref().and_then(|v| match v {
21673            crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
21674            _ => std::option::Option::None,
21675        })
21676    }
21677
21678    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21679    /// to hold a `Retry`.
21680    ///
21681    /// Note that all the setters affecting `repair_phase` are
21682    /// mutually exclusive.
21683    ///
21684    /// # Example
21685    /// ```ignore,no_run
21686    /// # use google_cloud_deploy_v1::model::RepairPhase;
21687    /// use google_cloud_deploy_v1::model::RetryPhase;
21688    /// let x = RepairPhase::new().set_retry(RetryPhase::default()/* use setters */);
21689    /// assert!(x.retry().is_some());
21690    /// assert!(x.rollback().is_none());
21691    /// ```
21692    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
21693        mut self,
21694        v: T,
21695    ) -> Self {
21696        self.repair_phase =
21697            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
21698        self
21699    }
21700
21701    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21702    /// if it holds a `Rollback`, `None` if the field is not set or
21703    /// holds a different branch.
21704    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
21705        #[allow(unreachable_patterns)]
21706        self.repair_phase.as_ref().and_then(|v| match v {
21707            crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
21708            _ => std::option::Option::None,
21709        })
21710    }
21711
21712    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21713    /// to hold a `Rollback`.
21714    ///
21715    /// Note that all the setters affecting `repair_phase` are
21716    /// mutually exclusive.
21717    ///
21718    /// # Example
21719    /// ```ignore,no_run
21720    /// # use google_cloud_deploy_v1::model::RepairPhase;
21721    /// use google_cloud_deploy_v1::model::RollbackAttempt;
21722    /// let x = RepairPhase::new().set_rollback(RollbackAttempt::default()/* use setters */);
21723    /// assert!(x.rollback().is_some());
21724    /// assert!(x.retry().is_none());
21725    /// ```
21726    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
21727        mut self,
21728        v: T,
21729    ) -> Self {
21730        self.repair_phase =
21731            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
21732        self
21733    }
21734}
21735
21736impl wkt::message::Message for RepairPhase {
21737    fn typename() -> &'static str {
21738        "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
21739    }
21740}
21741
21742/// Defines additional types related to [RepairPhase].
21743pub mod repair_phase {
21744    #[allow(unused_imports)]
21745    use super::*;
21746
21747    /// The `RepairPhase` type and the information for that type.
21748    #[derive(Clone, Debug, PartialEq)]
21749    #[non_exhaustive]
21750    pub enum RepairPhase {
21751        /// Output only. Records of the retry attempts for retry repair mode.
21752        Retry(std::boxed::Box<crate::model::RetryPhase>),
21753        /// Output only. Rollback attempt for rollback repair mode .
21754        Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
21755    }
21756}
21757
21758/// RetryPhase contains the retry attempts and the metadata for initiating a
21759/// new attempt.
21760#[derive(Clone, Default, PartialEq)]
21761#[non_exhaustive]
21762pub struct RetryPhase {
21763    /// Output only. The number of attempts that have been made.
21764    pub total_attempts: i64,
21765
21766    /// Output only. The pattern of how the wait time of the retry attempt is
21767    /// calculated.
21768    pub backoff_mode: crate::model::BackoffMode,
21769
21770    /// Output only. Detail of a retry action.
21771    pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
21772
21773    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21774}
21775
21776impl RetryPhase {
21777    pub fn new() -> Self {
21778        std::default::Default::default()
21779    }
21780
21781    /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
21782    ///
21783    /// # Example
21784    /// ```ignore,no_run
21785    /// # use google_cloud_deploy_v1::model::RetryPhase;
21786    /// let x = RetryPhase::new().set_total_attempts(42);
21787    /// ```
21788    pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21789        self.total_attempts = v.into();
21790        self
21791    }
21792
21793    /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
21794    ///
21795    /// # Example
21796    /// ```ignore,no_run
21797    /// # use google_cloud_deploy_v1::model::RetryPhase;
21798    /// use google_cloud_deploy_v1::model::BackoffMode;
21799    /// let x0 = RetryPhase::new().set_backoff_mode(BackoffMode::Linear);
21800    /// let x1 = RetryPhase::new().set_backoff_mode(BackoffMode::Exponential);
21801    /// ```
21802    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
21803        mut self,
21804        v: T,
21805    ) -> Self {
21806        self.backoff_mode = v.into();
21807        self
21808    }
21809
21810    /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
21811    ///
21812    /// # Example
21813    /// ```ignore,no_run
21814    /// # use google_cloud_deploy_v1::model::RetryPhase;
21815    /// use google_cloud_deploy_v1::model::RetryAttempt;
21816    /// let x = RetryPhase::new()
21817    ///     .set_attempts([
21818    ///         RetryAttempt::default()/* use setters */,
21819    ///         RetryAttempt::default()/* use (different) setters */,
21820    ///     ]);
21821    /// ```
21822    pub fn set_attempts<T, V>(mut self, v: T) -> Self
21823    where
21824        T: std::iter::IntoIterator<Item = V>,
21825        V: std::convert::Into<crate::model::RetryAttempt>,
21826    {
21827        use std::iter::Iterator;
21828        self.attempts = v.into_iter().map(|i| i.into()).collect();
21829        self
21830    }
21831}
21832
21833impl wkt::message::Message for RetryPhase {
21834    fn typename() -> &'static str {
21835        "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
21836    }
21837}
21838
21839/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
21840#[derive(Clone, Default, PartialEq)]
21841#[non_exhaustive]
21842pub struct RetryAttempt {
21843    /// Output only. The index of this retry attempt.
21844    pub attempt: i64,
21845
21846    /// Output only. How long the operation will be paused.
21847    pub wait: std::option::Option<wkt::Duration>,
21848
21849    /// Output only. Valid state of this retry action.
21850    pub state: crate::model::RepairState,
21851
21852    /// Output only. Description of the state of the Retry.
21853    pub state_desc: std::string::String,
21854
21855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21856}
21857
21858impl RetryAttempt {
21859    pub fn new() -> Self {
21860        std::default::Default::default()
21861    }
21862
21863    /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
21864    ///
21865    /// # Example
21866    /// ```ignore,no_run
21867    /// # use google_cloud_deploy_v1::model::RetryAttempt;
21868    /// let x = RetryAttempt::new().set_attempt(42);
21869    /// ```
21870    pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21871        self.attempt = v.into();
21872        self
21873    }
21874
21875    /// Sets the value of [wait][crate::model::RetryAttempt::wait].
21876    ///
21877    /// # Example
21878    /// ```ignore,no_run
21879    /// # use google_cloud_deploy_v1::model::RetryAttempt;
21880    /// use wkt::Duration;
21881    /// let x = RetryAttempt::new().set_wait(Duration::default()/* use setters */);
21882    /// ```
21883    pub fn set_wait<T>(mut self, v: T) -> Self
21884    where
21885        T: std::convert::Into<wkt::Duration>,
21886    {
21887        self.wait = std::option::Option::Some(v.into());
21888        self
21889    }
21890
21891    /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
21892    ///
21893    /// # Example
21894    /// ```ignore,no_run
21895    /// # use google_cloud_deploy_v1::model::RetryAttempt;
21896    /// use wkt::Duration;
21897    /// let x = RetryAttempt::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21898    /// let x = RetryAttempt::new().set_or_clear_wait(None::<Duration>);
21899    /// ```
21900    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21901    where
21902        T: std::convert::Into<wkt::Duration>,
21903    {
21904        self.wait = v.map(|x| x.into());
21905        self
21906    }
21907
21908    /// Sets the value of [state][crate::model::RetryAttempt::state].
21909    ///
21910    /// # Example
21911    /// ```ignore,no_run
21912    /// # use google_cloud_deploy_v1::model::RetryAttempt;
21913    /// use google_cloud_deploy_v1::model::RepairState;
21914    /// let x0 = RetryAttempt::new().set_state(RepairState::Succeeded);
21915    /// let x1 = RetryAttempt::new().set_state(RepairState::Cancelled);
21916    /// let x2 = RetryAttempt::new().set_state(RepairState::Failed);
21917    /// ```
21918    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
21919        self.state = v.into();
21920        self
21921    }
21922
21923    /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
21924    ///
21925    /// # Example
21926    /// ```ignore,no_run
21927    /// # use google_cloud_deploy_v1::model::RetryAttempt;
21928    /// let x = RetryAttempt::new().set_state_desc("example");
21929    /// ```
21930    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21931        self.state_desc = v.into();
21932        self
21933    }
21934}
21935
21936impl wkt::message::Message for RetryAttempt {
21937    fn typename() -> &'static str {
21938        "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
21939    }
21940}
21941
21942/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
21943#[derive(Clone, Default, PartialEq)]
21944#[non_exhaustive]
21945pub struct RollbackAttempt {
21946    /// Output only. The phase to which the rollout will be rolled back to.
21947    pub destination_phase: std::string::String,
21948
21949    /// Output only. ID of the rollback `Rollout` to create.
21950    pub rollout_id: std::string::String,
21951
21952    /// Output only. Valid state of this rollback action.
21953    pub state: crate::model::RepairState,
21954
21955    /// Output only. Description of the state of the Rollback.
21956    pub state_desc: std::string::String,
21957
21958    /// Output only. If active rollout exists on the target, abort this rollback.
21959    pub disable_rollback_if_rollout_pending: bool,
21960
21961    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21962}
21963
21964impl RollbackAttempt {
21965    pub fn new() -> Self {
21966        std::default::Default::default()
21967    }
21968
21969    /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
21970    ///
21971    /// # Example
21972    /// ```ignore,no_run
21973    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21974    /// let x = RollbackAttempt::new().set_destination_phase("example");
21975    /// ```
21976    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21977        mut self,
21978        v: T,
21979    ) -> Self {
21980        self.destination_phase = v.into();
21981        self
21982    }
21983
21984    /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
21985    ///
21986    /// # Example
21987    /// ```ignore,no_run
21988    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21989    /// let x = RollbackAttempt::new().set_rollout_id("example");
21990    /// ```
21991    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21992        self.rollout_id = v.into();
21993        self
21994    }
21995
21996    /// Sets the value of [state][crate::model::RollbackAttempt::state].
21997    ///
21998    /// # Example
21999    /// ```ignore,no_run
22000    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22001    /// use google_cloud_deploy_v1::model::RepairState;
22002    /// let x0 = RollbackAttempt::new().set_state(RepairState::Succeeded);
22003    /// let x1 = RollbackAttempt::new().set_state(RepairState::Cancelled);
22004    /// let x2 = RollbackAttempt::new().set_state(RepairState::Failed);
22005    /// ```
22006    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22007        self.state = v.into();
22008        self
22009    }
22010
22011    /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
22012    ///
22013    /// # Example
22014    /// ```ignore,no_run
22015    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22016    /// let x = RollbackAttempt::new().set_state_desc("example");
22017    /// ```
22018    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22019        self.state_desc = v.into();
22020        self
22021    }
22022
22023    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
22024    ///
22025    /// # Example
22026    /// ```ignore,no_run
22027    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22028    /// let x = RollbackAttempt::new().set_disable_rollback_if_rollout_pending(true);
22029    /// ```
22030    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
22031        mut self,
22032        v: T,
22033    ) -> Self {
22034        self.disable_rollback_if_rollout_pending = v.into();
22035        self
22036    }
22037}
22038
22039impl wkt::message::Message for RollbackAttempt {
22040    fn typename() -> &'static str {
22041        "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
22042    }
22043}
22044
22045/// The request object for `ListAutomationRuns`.
22046#[derive(Clone, Default, PartialEq)]
22047#[non_exhaustive]
22048pub struct ListAutomationRunsRequest {
22049    /// Required. The parent `Delivery Pipeline`, which owns this collection of
22050    /// automationRuns. Format must be
22051    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
22052    pub parent: std::string::String,
22053
22054    /// The maximum number of automationRuns to return. The service may return
22055    /// fewer than this value. If unspecified, at most 50 automationRuns will
22056    /// be returned. The maximum value is 1000; values above 1000 will be set
22057    /// to 1000.
22058    pub page_size: i32,
22059
22060    /// A page token, received from a previous `ListAutomationRuns` call.
22061    /// Provide this to retrieve the subsequent page.
22062    ///
22063    /// When paginating, all other provided parameters match
22064    /// the call that provided the page token.
22065    pub page_token: std::string::String,
22066
22067    /// Filter automationRuns to be returned. All fields can be used in the
22068    /// filter.
22069    pub filter: std::string::String,
22070
22071    /// Field to sort by.
22072    pub order_by: std::string::String,
22073
22074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22075}
22076
22077impl ListAutomationRunsRequest {
22078    pub fn new() -> Self {
22079        std::default::Default::default()
22080    }
22081
22082    /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
22083    ///
22084    /// # Example
22085    /// ```ignore,no_run
22086    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22087    /// let x = ListAutomationRunsRequest::new().set_parent("example");
22088    /// ```
22089    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22090        self.parent = v.into();
22091        self
22092    }
22093
22094    /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
22095    ///
22096    /// # Example
22097    /// ```ignore,no_run
22098    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22099    /// let x = ListAutomationRunsRequest::new().set_page_size(42);
22100    /// ```
22101    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22102        self.page_size = v.into();
22103        self
22104    }
22105
22106    /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
22107    ///
22108    /// # Example
22109    /// ```ignore,no_run
22110    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22111    /// let x = ListAutomationRunsRequest::new().set_page_token("example");
22112    /// ```
22113    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22114        self.page_token = v.into();
22115        self
22116    }
22117
22118    /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
22119    ///
22120    /// # Example
22121    /// ```ignore,no_run
22122    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22123    /// let x = ListAutomationRunsRequest::new().set_filter("example");
22124    /// ```
22125    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22126        self.filter = v.into();
22127        self
22128    }
22129
22130    /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
22131    ///
22132    /// # Example
22133    /// ```ignore,no_run
22134    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22135    /// let x = ListAutomationRunsRequest::new().set_order_by("example");
22136    /// ```
22137    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22138        self.order_by = v.into();
22139        self
22140    }
22141}
22142
22143impl wkt::message::Message for ListAutomationRunsRequest {
22144    fn typename() -> &'static str {
22145        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
22146    }
22147}
22148
22149/// The response object from `ListAutomationRuns`.
22150#[derive(Clone, Default, PartialEq)]
22151#[non_exhaustive]
22152pub struct ListAutomationRunsResponse {
22153    /// The `AutomationRuns` objects.
22154    pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
22155
22156    /// A token, which can be sent as `page_token` to retrieve the next page.
22157    /// If this field is omitted, there are no subsequent pages.
22158    pub next_page_token: std::string::String,
22159
22160    /// Locations that could not be reached.
22161    pub unreachable: std::vec::Vec<std::string::String>,
22162
22163    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22164}
22165
22166impl ListAutomationRunsResponse {
22167    pub fn new() -> Self {
22168        std::default::Default::default()
22169    }
22170
22171    /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
22172    ///
22173    /// # Example
22174    /// ```ignore,no_run
22175    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22176    /// use google_cloud_deploy_v1::model::AutomationRun;
22177    /// let x = ListAutomationRunsResponse::new()
22178    ///     .set_automation_runs([
22179    ///         AutomationRun::default()/* use setters */,
22180    ///         AutomationRun::default()/* use (different) setters */,
22181    ///     ]);
22182    /// ```
22183    pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
22184    where
22185        T: std::iter::IntoIterator<Item = V>,
22186        V: std::convert::Into<crate::model::AutomationRun>,
22187    {
22188        use std::iter::Iterator;
22189        self.automation_runs = v.into_iter().map(|i| i.into()).collect();
22190        self
22191    }
22192
22193    /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
22194    ///
22195    /// # Example
22196    /// ```ignore,no_run
22197    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22198    /// let x = ListAutomationRunsResponse::new().set_next_page_token("example");
22199    /// ```
22200    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22201        self.next_page_token = v.into();
22202        self
22203    }
22204
22205    /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
22206    ///
22207    /// # Example
22208    /// ```ignore,no_run
22209    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22210    /// let x = ListAutomationRunsResponse::new().set_unreachable(["a", "b", "c"]);
22211    /// ```
22212    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
22213    where
22214        T: std::iter::IntoIterator<Item = V>,
22215        V: std::convert::Into<std::string::String>,
22216    {
22217        use std::iter::Iterator;
22218        self.unreachable = v.into_iter().map(|i| i.into()).collect();
22219        self
22220    }
22221}
22222
22223impl wkt::message::Message for ListAutomationRunsResponse {
22224    fn typename() -> &'static str {
22225        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
22226    }
22227}
22228
22229#[doc(hidden)]
22230impl gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
22231    type PageItem = crate::model::AutomationRun;
22232
22233    fn items(self) -> std::vec::Vec<Self::PageItem> {
22234        self.automation_runs
22235    }
22236
22237    fn next_page_token(&self) -> std::string::String {
22238        use std::clone::Clone;
22239        self.next_page_token.clone()
22240    }
22241}
22242
22243/// The request object for `GetAutomationRun`
22244#[derive(Clone, Default, PartialEq)]
22245#[non_exhaustive]
22246pub struct GetAutomationRunRequest {
22247    /// Required. Name of the `AutomationRun`. Format must be
22248    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22249    pub name: std::string::String,
22250
22251    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22252}
22253
22254impl GetAutomationRunRequest {
22255    pub fn new() -> Self {
22256        std::default::Default::default()
22257    }
22258
22259    /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
22260    ///
22261    /// # Example
22262    /// ```ignore,no_run
22263    /// # use google_cloud_deploy_v1::model::GetAutomationRunRequest;
22264    /// let x = GetAutomationRunRequest::new().set_name("example");
22265    /// ```
22266    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22267        self.name = v.into();
22268        self
22269    }
22270}
22271
22272impl wkt::message::Message for GetAutomationRunRequest {
22273    fn typename() -> &'static str {
22274        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
22275    }
22276}
22277
22278/// The request object used by `CancelAutomationRun`.
22279#[derive(Clone, Default, PartialEq)]
22280#[non_exhaustive]
22281pub struct CancelAutomationRunRequest {
22282    /// Required. Name of the `AutomationRun`. Format is
22283    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22284    pub name: std::string::String,
22285
22286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22287}
22288
22289impl CancelAutomationRunRequest {
22290    pub fn new() -> Self {
22291        std::default::Default::default()
22292    }
22293
22294    /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
22295    ///
22296    /// # Example
22297    /// ```ignore,no_run
22298    /// # use google_cloud_deploy_v1::model::CancelAutomationRunRequest;
22299    /// let x = CancelAutomationRunRequest::new().set_name("example");
22300    /// ```
22301    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22302        self.name = v.into();
22303        self
22304    }
22305}
22306
22307impl wkt::message::Message for CancelAutomationRunRequest {
22308    fn typename() -> &'static str {
22309        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
22310    }
22311}
22312
22313/// The response object from `CancelAutomationRun`.
22314#[derive(Clone, Default, PartialEq)]
22315#[non_exhaustive]
22316pub struct CancelAutomationRunResponse {
22317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22318}
22319
22320impl CancelAutomationRunResponse {
22321    pub fn new() -> Self {
22322        std::default::Default::default()
22323    }
22324}
22325
22326impl wkt::message::Message for CancelAutomationRunResponse {
22327    fn typename() -> &'static str {
22328        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
22329    }
22330}
22331
22332/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
22333/// Platform Log event that describes the failure to send a custom target type
22334/// status change Pub/Sub notification.
22335#[derive(Clone, Default, PartialEq)]
22336#[non_exhaustive]
22337pub struct CustomTargetTypeNotificationEvent {
22338    /// Debug message for when a notification fails to send.
22339    pub message: std::string::String,
22340
22341    /// Unique identifier of the `CustomTargetType`.
22342    pub custom_target_type_uid: std::string::String,
22343
22344    /// The name of the `CustomTargetType`.
22345    pub custom_target_type: std::string::String,
22346
22347    /// Type of this notification, e.g. for a Pub/Sub failure.
22348    pub r#type: crate::model::Type,
22349
22350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22351}
22352
22353impl CustomTargetTypeNotificationEvent {
22354    pub fn new() -> Self {
22355        std::default::Default::default()
22356    }
22357
22358    /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
22359    ///
22360    /// # Example
22361    /// ```ignore,no_run
22362    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22363    /// let x = CustomTargetTypeNotificationEvent::new().set_message("example");
22364    /// ```
22365    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22366        self.message = v.into();
22367        self
22368    }
22369
22370    /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
22371    ///
22372    /// # Example
22373    /// ```ignore,no_run
22374    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22375    /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type_uid("example");
22376    /// ```
22377    pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
22378        mut self,
22379        v: T,
22380    ) -> Self {
22381        self.custom_target_type_uid = v.into();
22382        self
22383    }
22384
22385    /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
22386    ///
22387    /// # Example
22388    /// ```ignore,no_run
22389    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22390    /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type("example");
22391    /// ```
22392    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
22393        mut self,
22394        v: T,
22395    ) -> Self {
22396        self.custom_target_type = v.into();
22397        self
22398    }
22399
22400    /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
22401    ///
22402    /// # Example
22403    /// ```ignore,no_run
22404    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22405    /// use google_cloud_deploy_v1::model::Type;
22406    /// let x0 = CustomTargetTypeNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22407    /// let x1 = CustomTargetTypeNotificationEvent::new().set_type(Type::ResourceStateChange);
22408    /// let x2 = CustomTargetTypeNotificationEvent::new().set_type(Type::ProcessAborted);
22409    /// ```
22410    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22411        self.r#type = v.into();
22412        self
22413    }
22414}
22415
22416impl wkt::message::Message for CustomTargetTypeNotificationEvent {
22417    fn typename() -> &'static str {
22418        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
22419    }
22420}
22421
22422/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
22423/// Platform Log event that describes the failure to send delivery pipeline
22424/// status change Pub/Sub notification.
22425#[derive(Clone, Default, PartialEq)]
22426#[non_exhaustive]
22427pub struct DeliveryPipelineNotificationEvent {
22428    /// Debug message for when a notification fails to send.
22429    pub message: std::string::String,
22430
22431    /// Unique identifier of the `DeliveryPipeline`.
22432    pub pipeline_uid: std::string::String,
22433
22434    /// The name of the `Delivery Pipeline`.
22435    pub delivery_pipeline: std::string::String,
22436
22437    /// Type of this notification, e.g. for a Pub/Sub failure.
22438    pub r#type: crate::model::Type,
22439
22440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22441}
22442
22443impl DeliveryPipelineNotificationEvent {
22444    pub fn new() -> Self {
22445        std::default::Default::default()
22446    }
22447
22448    /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
22449    ///
22450    /// # Example
22451    /// ```ignore,no_run
22452    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22453    /// let x = DeliveryPipelineNotificationEvent::new().set_message("example");
22454    /// ```
22455    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22456        self.message = v.into();
22457        self
22458    }
22459
22460    /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
22461    ///
22462    /// # Example
22463    /// ```ignore,no_run
22464    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22465    /// let x = DeliveryPipelineNotificationEvent::new().set_pipeline_uid("example");
22466    /// ```
22467    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22468        self.pipeline_uid = v.into();
22469        self
22470    }
22471
22472    /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
22473    ///
22474    /// # Example
22475    /// ```ignore,no_run
22476    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22477    /// let x = DeliveryPipelineNotificationEvent::new().set_delivery_pipeline("example");
22478    /// ```
22479    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22480        mut self,
22481        v: T,
22482    ) -> Self {
22483        self.delivery_pipeline = v.into();
22484        self
22485    }
22486
22487    /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
22488    ///
22489    /// # Example
22490    /// ```ignore,no_run
22491    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22492    /// use google_cloud_deploy_v1::model::Type;
22493    /// let x0 = DeliveryPipelineNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22494    /// let x1 = DeliveryPipelineNotificationEvent::new().set_type(Type::ResourceStateChange);
22495    /// let x2 = DeliveryPipelineNotificationEvent::new().set_type(Type::ProcessAborted);
22496    /// ```
22497    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22498        self.r#type = v.into();
22499        self
22500    }
22501}
22502
22503impl wkt::message::Message for DeliveryPipelineNotificationEvent {
22504    fn typename() -> &'static str {
22505        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
22506    }
22507}
22508
22509/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
22510/// Platform Log event that describes the deploy policy evaluation event.
22511#[derive(Clone, Default, PartialEq)]
22512#[non_exhaustive]
22513pub struct DeployPolicyEvaluationEvent {
22514    /// Debug message for when a deploy policy event occurs.
22515    pub message: std::string::String,
22516
22517    /// Rule type (e.g. Restrict Rollouts).
22518    pub rule_type: std::string::String,
22519
22520    /// Rule id.
22521    pub rule: std::string::String,
22522
22523    /// Unique identifier of the `Delivery Pipeline`.
22524    pub pipeline_uid: std::string::String,
22525
22526    /// The name of the `Delivery Pipeline`.
22527    pub delivery_pipeline: std::string::String,
22528
22529    /// Unique identifier of the `Target`. This is an optional field, as a `Target`
22530    /// may not always be applicable to a policy.
22531    pub target_uid: std::string::String,
22532
22533    /// The name of the `Target`. This is an optional field, as a `Target` may not
22534    /// always be applicable to a policy.
22535    pub target: std::string::String,
22536
22537    /// What invoked the action (e.g. a user or automation).
22538    pub invoker: crate::model::deploy_policy::Invoker,
22539
22540    /// The name of the `DeployPolicy`.
22541    pub deploy_policy: std::string::String,
22542
22543    /// Unique identifier of the `DeployPolicy`.
22544    pub deploy_policy_uid: std::string::String,
22545
22546    /// Whether the request is allowed. Allowed is set as true if:
22547    /// (1) the request complies with the policy; or
22548    /// (2) the request doesn't comply with the policy but the policy was
22549    /// overridden; or
22550    /// (3) the request doesn't comply with the policy but the policy was suspended
22551    pub allowed: bool,
22552
22553    /// The policy verdict of the request.
22554    pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
22555
22556    /// Things that could have overridden the policy verdict. Overrides together
22557    /// with verdict decide whether the request is allowed.
22558    pub overrides:
22559        std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22560
22561    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22562}
22563
22564impl DeployPolicyEvaluationEvent {
22565    pub fn new() -> Self {
22566        std::default::Default::default()
22567    }
22568
22569    /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
22570    ///
22571    /// # Example
22572    /// ```ignore,no_run
22573    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22574    /// let x = DeployPolicyEvaluationEvent::new().set_message("example");
22575    /// ```
22576    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22577        self.message = v.into();
22578        self
22579    }
22580
22581    /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
22582    ///
22583    /// # Example
22584    /// ```ignore,no_run
22585    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22586    /// let x = DeployPolicyEvaluationEvent::new().set_rule_type("example");
22587    /// ```
22588    pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22589        self.rule_type = v.into();
22590        self
22591    }
22592
22593    /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
22594    ///
22595    /// # Example
22596    /// ```ignore,no_run
22597    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22598    /// let x = DeployPolicyEvaluationEvent::new().set_rule("example");
22599    /// ```
22600    pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22601        self.rule = v.into();
22602        self
22603    }
22604
22605    /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
22606    ///
22607    /// # Example
22608    /// ```ignore,no_run
22609    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22610    /// let x = DeployPolicyEvaluationEvent::new().set_pipeline_uid("example");
22611    /// ```
22612    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22613        self.pipeline_uid = v.into();
22614        self
22615    }
22616
22617    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
22618    ///
22619    /// # Example
22620    /// ```ignore,no_run
22621    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22622    /// let x = DeployPolicyEvaluationEvent::new().set_delivery_pipeline("example");
22623    /// ```
22624    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22625        mut self,
22626        v: T,
22627    ) -> Self {
22628        self.delivery_pipeline = v.into();
22629        self
22630    }
22631
22632    /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
22633    ///
22634    /// # Example
22635    /// ```ignore,no_run
22636    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22637    /// let x = DeployPolicyEvaluationEvent::new().set_target_uid("example");
22638    /// ```
22639    pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22640        self.target_uid = v.into();
22641        self
22642    }
22643
22644    /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
22645    ///
22646    /// # Example
22647    /// ```ignore,no_run
22648    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22649    /// let x = DeployPolicyEvaluationEvent::new().set_target("example");
22650    /// ```
22651    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22652        self.target = v.into();
22653        self
22654    }
22655
22656    /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
22657    ///
22658    /// # Example
22659    /// ```ignore,no_run
22660    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22661    /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
22662    /// let x0 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::User);
22663    /// let x1 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::DeployAutomation);
22664    /// ```
22665    pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
22666        mut self,
22667        v: T,
22668    ) -> Self {
22669        self.invoker = v.into();
22670        self
22671    }
22672
22673    /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
22674    ///
22675    /// # Example
22676    /// ```ignore,no_run
22677    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22678    /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy("example");
22679    /// ```
22680    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22681        self.deploy_policy = v.into();
22682        self
22683    }
22684
22685    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
22686    ///
22687    /// # Example
22688    /// ```ignore,no_run
22689    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22690    /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy_uid("example");
22691    /// ```
22692    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
22693        mut self,
22694        v: T,
22695    ) -> Self {
22696        self.deploy_policy_uid = v.into();
22697        self
22698    }
22699
22700    /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
22701    ///
22702    /// # Example
22703    /// ```ignore,no_run
22704    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22705    /// let x = DeployPolicyEvaluationEvent::new().set_allowed(true);
22706    /// ```
22707    pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22708        self.allowed = v.into();
22709        self
22710    }
22711
22712    /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
22713    ///
22714    /// # Example
22715    /// ```ignore,no_run
22716    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22717    /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdict;
22718    /// let x0 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::AllowedByPolicy);
22719    /// let x1 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::DeniedByPolicy);
22720    /// ```
22721    pub fn set_verdict<
22722        T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
22723    >(
22724        mut self,
22725        v: T,
22726    ) -> Self {
22727        self.verdict = v.into();
22728        self
22729    }
22730
22731    /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
22732    ///
22733    /// # Example
22734    /// ```ignore,no_run
22735    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22736    /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdictOverride;
22737    /// let x = DeployPolicyEvaluationEvent::new().set_overrides([
22738    ///     PolicyVerdictOverride::PolicyOverridden,
22739    ///     PolicyVerdictOverride::PolicySuspended,
22740    /// ]);
22741    /// ```
22742    pub fn set_overrides<T, V>(mut self, v: T) -> Self
22743    where
22744        T: std::iter::IntoIterator<Item = V>,
22745        V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22746    {
22747        use std::iter::Iterator;
22748        self.overrides = v.into_iter().map(|i| i.into()).collect();
22749        self
22750    }
22751}
22752
22753impl wkt::message::Message for DeployPolicyEvaluationEvent {
22754    fn typename() -> &'static str {
22755        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
22756    }
22757}
22758
22759/// Defines additional types related to [DeployPolicyEvaluationEvent].
22760pub mod deploy_policy_evaluation_event {
22761    #[allow(unused_imports)]
22762    use super::*;
22763
22764    /// The policy verdict of the request.
22765    ///
22766    /// # Working with unknown values
22767    ///
22768    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22769    /// additional enum variants at any time. Adding new variants is not considered
22770    /// a breaking change. Applications should write their code in anticipation of:
22771    ///
22772    /// - New values appearing in future releases of the client library, **and**
22773    /// - New values received dynamically, without application changes.
22774    ///
22775    /// Please consult the [Working with enums] section in the user guide for some
22776    /// guidelines.
22777    ///
22778    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22779    #[derive(Clone, Debug, PartialEq)]
22780    #[non_exhaustive]
22781    pub enum PolicyVerdict {
22782        /// This should never happen.
22783        Unspecified,
22784        /// Allowed by policy. This enum value is not currently used but may be used
22785        /// in the future. Currently logs are only generated when a request is denied
22786        /// by policy.
22787        AllowedByPolicy,
22788        /// Denied by policy.
22789        DeniedByPolicy,
22790        /// If set, the enum was initialized with an unknown value.
22791        ///
22792        /// Applications can examine the value using [PolicyVerdict::value] or
22793        /// [PolicyVerdict::name].
22794        UnknownValue(policy_verdict::UnknownValue),
22795    }
22796
22797    #[doc(hidden)]
22798    pub mod policy_verdict {
22799        #[allow(unused_imports)]
22800        use super::*;
22801        #[derive(Clone, Debug, PartialEq)]
22802        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22803    }
22804
22805    impl PolicyVerdict {
22806        /// Gets the enum value.
22807        ///
22808        /// Returns `None` if the enum contains an unknown value deserialized from
22809        /// the string representation of enums.
22810        pub fn value(&self) -> std::option::Option<i32> {
22811            match self {
22812                Self::Unspecified => std::option::Option::Some(0),
22813                Self::AllowedByPolicy => std::option::Option::Some(1),
22814                Self::DeniedByPolicy => std::option::Option::Some(2),
22815                Self::UnknownValue(u) => u.0.value(),
22816            }
22817        }
22818
22819        /// Gets the enum value as a string.
22820        ///
22821        /// Returns `None` if the enum contains an unknown value deserialized from
22822        /// the integer representation of enums.
22823        pub fn name(&self) -> std::option::Option<&str> {
22824            match self {
22825                Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
22826                Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
22827                Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
22828                Self::UnknownValue(u) => u.0.name(),
22829            }
22830        }
22831    }
22832
22833    impl std::default::Default for PolicyVerdict {
22834        fn default() -> Self {
22835            use std::convert::From;
22836            Self::from(0)
22837        }
22838    }
22839
22840    impl std::fmt::Display for PolicyVerdict {
22841        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22842            wkt::internal::display_enum(f, self.name(), self.value())
22843        }
22844    }
22845
22846    impl std::convert::From<i32> for PolicyVerdict {
22847        fn from(value: i32) -> Self {
22848            match value {
22849                0 => Self::Unspecified,
22850                1 => Self::AllowedByPolicy,
22851                2 => Self::DeniedByPolicy,
22852                _ => Self::UnknownValue(policy_verdict::UnknownValue(
22853                    wkt::internal::UnknownEnumValue::Integer(value),
22854                )),
22855            }
22856        }
22857    }
22858
22859    impl std::convert::From<&str> for PolicyVerdict {
22860        fn from(value: &str) -> Self {
22861            use std::string::ToString;
22862            match value {
22863                "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
22864                "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
22865                "DENIED_BY_POLICY" => Self::DeniedByPolicy,
22866                _ => Self::UnknownValue(policy_verdict::UnknownValue(
22867                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22868                )),
22869            }
22870        }
22871    }
22872
22873    impl serde::ser::Serialize for PolicyVerdict {
22874        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22875        where
22876            S: serde::Serializer,
22877        {
22878            match self {
22879                Self::Unspecified => serializer.serialize_i32(0),
22880                Self::AllowedByPolicy => serializer.serialize_i32(1),
22881                Self::DeniedByPolicy => serializer.serialize_i32(2),
22882                Self::UnknownValue(u) => u.0.serialize(serializer),
22883            }
22884        }
22885    }
22886
22887    impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
22888        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22889        where
22890            D: serde::Deserializer<'de>,
22891        {
22892            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
22893                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
22894            ))
22895        }
22896    }
22897
22898    /// Things that could have overridden the policy verdict. When overrides are
22899    /// used, the request will be allowed even if it is DENIED_BY_POLICY.
22900    ///
22901    /// # Working with unknown values
22902    ///
22903    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22904    /// additional enum variants at any time. Adding new variants is not considered
22905    /// a breaking change. Applications should write their code in anticipation of:
22906    ///
22907    /// - New values appearing in future releases of the client library, **and**
22908    /// - New values received dynamically, without application changes.
22909    ///
22910    /// Please consult the [Working with enums] section in the user guide for some
22911    /// guidelines.
22912    ///
22913    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22914    #[derive(Clone, Debug, PartialEq)]
22915    #[non_exhaustive]
22916    pub enum PolicyVerdictOverride {
22917        /// This should never happen.
22918        Unspecified,
22919        /// The policy was overridden.
22920        PolicyOverridden,
22921        /// The policy was suspended.
22922        PolicySuspended,
22923        /// If set, the enum was initialized with an unknown value.
22924        ///
22925        /// Applications can examine the value using [PolicyVerdictOverride::value] or
22926        /// [PolicyVerdictOverride::name].
22927        UnknownValue(policy_verdict_override::UnknownValue),
22928    }
22929
22930    #[doc(hidden)]
22931    pub mod policy_verdict_override {
22932        #[allow(unused_imports)]
22933        use super::*;
22934        #[derive(Clone, Debug, PartialEq)]
22935        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22936    }
22937
22938    impl PolicyVerdictOverride {
22939        /// Gets the enum value.
22940        ///
22941        /// Returns `None` if the enum contains an unknown value deserialized from
22942        /// the string representation of enums.
22943        pub fn value(&self) -> std::option::Option<i32> {
22944            match self {
22945                Self::Unspecified => std::option::Option::Some(0),
22946                Self::PolicyOverridden => std::option::Option::Some(1),
22947                Self::PolicySuspended => std::option::Option::Some(2),
22948                Self::UnknownValue(u) => u.0.value(),
22949            }
22950        }
22951
22952        /// Gets the enum value as a string.
22953        ///
22954        /// Returns `None` if the enum contains an unknown value deserialized from
22955        /// the integer representation of enums.
22956        pub fn name(&self) -> std::option::Option<&str> {
22957            match self {
22958                Self::Unspecified => {
22959                    std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
22960                }
22961                Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
22962                Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
22963                Self::UnknownValue(u) => u.0.name(),
22964            }
22965        }
22966    }
22967
22968    impl std::default::Default for PolicyVerdictOverride {
22969        fn default() -> Self {
22970            use std::convert::From;
22971            Self::from(0)
22972        }
22973    }
22974
22975    impl std::fmt::Display for PolicyVerdictOverride {
22976        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22977            wkt::internal::display_enum(f, self.name(), self.value())
22978        }
22979    }
22980
22981    impl std::convert::From<i32> for PolicyVerdictOverride {
22982        fn from(value: i32) -> Self {
22983            match value {
22984                0 => Self::Unspecified,
22985                1 => Self::PolicyOverridden,
22986                2 => Self::PolicySuspended,
22987                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
22988                    wkt::internal::UnknownEnumValue::Integer(value),
22989                )),
22990            }
22991        }
22992    }
22993
22994    impl std::convert::From<&str> for PolicyVerdictOverride {
22995        fn from(value: &str) -> Self {
22996            use std::string::ToString;
22997            match value {
22998                "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
22999                "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
23000                "POLICY_SUSPENDED" => Self::PolicySuspended,
23001                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23002                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23003                )),
23004            }
23005        }
23006    }
23007
23008    impl serde::ser::Serialize for PolicyVerdictOverride {
23009        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23010        where
23011            S: serde::Serializer,
23012        {
23013            match self {
23014                Self::Unspecified => serializer.serialize_i32(0),
23015                Self::PolicyOverridden => serializer.serialize_i32(1),
23016                Self::PolicySuspended => serializer.serialize_i32(2),
23017                Self::UnknownValue(u) => u.0.serialize(serializer),
23018            }
23019        }
23020    }
23021
23022    impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
23023        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23024        where
23025            D: serde::Deserializer<'de>,
23026        {
23027            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
23028                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
23029            ))
23030        }
23031    }
23032}
23033
23034/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
23035/// Platform Log event that describes the failure to send a pub/sub notification
23036/// when there is a DeployPolicy status change.
23037#[derive(Clone, Default, PartialEq)]
23038#[non_exhaustive]
23039pub struct DeployPolicyNotificationEvent {
23040    /// Debug message for when a deploy policy fails to send a pub/sub
23041    /// notification.
23042    pub message: std::string::String,
23043
23044    /// The name of the `DeployPolicy`.
23045    pub deploy_policy: std::string::String,
23046
23047    /// Unique identifier of the deploy policy.
23048    pub deploy_policy_uid: std::string::String,
23049
23050    /// Type of this notification, e.g. for a Pub/Sub failure.
23051    pub r#type: crate::model::Type,
23052
23053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23054}
23055
23056impl DeployPolicyNotificationEvent {
23057    pub fn new() -> Self {
23058        std::default::Default::default()
23059    }
23060
23061    /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
23062    ///
23063    /// # Example
23064    /// ```ignore,no_run
23065    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23066    /// let x = DeployPolicyNotificationEvent::new().set_message("example");
23067    /// ```
23068    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23069        self.message = v.into();
23070        self
23071    }
23072
23073    /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
23074    ///
23075    /// # Example
23076    /// ```ignore,no_run
23077    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23078    /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy("example");
23079    /// ```
23080    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23081        self.deploy_policy = v.into();
23082        self
23083    }
23084
23085    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
23086    ///
23087    /// # Example
23088    /// ```ignore,no_run
23089    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23090    /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy_uid("example");
23091    /// ```
23092    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23093        mut self,
23094        v: T,
23095    ) -> Self {
23096        self.deploy_policy_uid = v.into();
23097        self
23098    }
23099
23100    /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
23101    ///
23102    /// # Example
23103    /// ```ignore,no_run
23104    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23105    /// use google_cloud_deploy_v1::model::Type;
23106    /// let x0 = DeployPolicyNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23107    /// let x1 = DeployPolicyNotificationEvent::new().set_type(Type::ResourceStateChange);
23108    /// let x2 = DeployPolicyNotificationEvent::new().set_type(Type::ProcessAborted);
23109    /// ```
23110    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23111        self.r#type = v.into();
23112        self
23113    }
23114}
23115
23116impl wkt::message::Message for DeployPolicyNotificationEvent {
23117    fn typename() -> &'static str {
23118        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
23119    }
23120}
23121
23122/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
23123/// Platform Log event that describes the failure to send JobRun resource update
23124/// Pub/Sub notification.
23125#[derive(Clone, Default, PartialEq)]
23126#[non_exhaustive]
23127pub struct JobRunNotificationEvent {
23128    /// Debug message for when a notification fails to send.
23129    pub message: std::string::String,
23130
23131    /// The name of the `JobRun`.
23132    pub job_run: std::string::String,
23133
23134    /// Unique identifier of the `DeliveryPipeline`.
23135    pub pipeline_uid: std::string::String,
23136
23137    /// Unique identifier of the `Release`.
23138    pub release_uid: std::string::String,
23139
23140    /// The name of the `Release`.
23141    pub release: std::string::String,
23142
23143    /// Unique identifier of the `Rollout`.
23144    pub rollout_uid: std::string::String,
23145
23146    /// The name of the `Rollout`.
23147    pub rollout: std::string::String,
23148
23149    /// ID of the `Target`.
23150    pub target_id: std::string::String,
23151
23152    /// Type of this notification, e.g. for a Pub/Sub failure.
23153    pub r#type: crate::model::Type,
23154
23155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23156}
23157
23158impl JobRunNotificationEvent {
23159    pub fn new() -> Self {
23160        std::default::Default::default()
23161    }
23162
23163    /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
23164    ///
23165    /// # Example
23166    /// ```ignore,no_run
23167    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23168    /// let x = JobRunNotificationEvent::new().set_message("example");
23169    /// ```
23170    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23171        self.message = v.into();
23172        self
23173    }
23174
23175    /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
23176    ///
23177    /// # Example
23178    /// ```ignore,no_run
23179    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23180    /// let x = JobRunNotificationEvent::new().set_job_run("example");
23181    /// ```
23182    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23183        self.job_run = v.into();
23184        self
23185    }
23186
23187    /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
23188    ///
23189    /// # Example
23190    /// ```ignore,no_run
23191    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23192    /// let x = JobRunNotificationEvent::new().set_pipeline_uid("example");
23193    /// ```
23194    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23195        self.pipeline_uid = v.into();
23196        self
23197    }
23198
23199    /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
23200    ///
23201    /// # Example
23202    /// ```ignore,no_run
23203    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23204    /// let x = JobRunNotificationEvent::new().set_release_uid("example");
23205    /// ```
23206    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23207        self.release_uid = v.into();
23208        self
23209    }
23210
23211    /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
23212    ///
23213    /// # Example
23214    /// ```ignore,no_run
23215    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23216    /// let x = JobRunNotificationEvent::new().set_release("example");
23217    /// ```
23218    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23219        self.release = v.into();
23220        self
23221    }
23222
23223    /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
23224    ///
23225    /// # Example
23226    /// ```ignore,no_run
23227    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23228    /// let x = JobRunNotificationEvent::new().set_rollout_uid("example");
23229    /// ```
23230    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23231        self.rollout_uid = v.into();
23232        self
23233    }
23234
23235    /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
23236    ///
23237    /// # Example
23238    /// ```ignore,no_run
23239    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23240    /// let x = JobRunNotificationEvent::new().set_rollout("example");
23241    /// ```
23242    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23243        self.rollout = v.into();
23244        self
23245    }
23246
23247    /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
23248    ///
23249    /// # Example
23250    /// ```ignore,no_run
23251    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23252    /// let x = JobRunNotificationEvent::new().set_target_id("example");
23253    /// ```
23254    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23255        self.target_id = v.into();
23256        self
23257    }
23258
23259    /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
23260    ///
23261    /// # Example
23262    /// ```ignore,no_run
23263    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23264    /// use google_cloud_deploy_v1::model::Type;
23265    /// let x0 = JobRunNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23266    /// let x1 = JobRunNotificationEvent::new().set_type(Type::ResourceStateChange);
23267    /// let x2 = JobRunNotificationEvent::new().set_type(Type::ProcessAborted);
23268    /// ```
23269    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23270        self.r#type = v.into();
23271        self
23272    }
23273}
23274
23275impl wkt::message::Message for JobRunNotificationEvent {
23276    fn typename() -> &'static str {
23277        "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
23278    }
23279}
23280
23281/// Payload proto for "clouddeploy.googleapis.com/release_notification"
23282/// Platform Log event that describes the failure to send release status change
23283/// Pub/Sub notification.
23284#[derive(Clone, Default, PartialEq)]
23285#[non_exhaustive]
23286pub struct ReleaseNotificationEvent {
23287    /// Debug message for when a notification fails to send.
23288    pub message: std::string::String,
23289
23290    /// Unique identifier of the `DeliveryPipeline`.
23291    pub pipeline_uid: std::string::String,
23292
23293    /// Unique identifier of the `Release`.
23294    pub release_uid: std::string::String,
23295
23296    /// The name of the `Release`.
23297    pub release: std::string::String,
23298
23299    /// Type of this notification, e.g. for a Pub/Sub failure.
23300    pub r#type: crate::model::Type,
23301
23302    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23303}
23304
23305impl ReleaseNotificationEvent {
23306    pub fn new() -> Self {
23307        std::default::Default::default()
23308    }
23309
23310    /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
23311    ///
23312    /// # Example
23313    /// ```ignore,no_run
23314    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23315    /// let x = ReleaseNotificationEvent::new().set_message("example");
23316    /// ```
23317    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23318        self.message = v.into();
23319        self
23320    }
23321
23322    /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
23323    ///
23324    /// # Example
23325    /// ```ignore,no_run
23326    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23327    /// let x = ReleaseNotificationEvent::new().set_pipeline_uid("example");
23328    /// ```
23329    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23330        self.pipeline_uid = v.into();
23331        self
23332    }
23333
23334    /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
23335    ///
23336    /// # Example
23337    /// ```ignore,no_run
23338    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23339    /// let x = ReleaseNotificationEvent::new().set_release_uid("example");
23340    /// ```
23341    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23342        self.release_uid = v.into();
23343        self
23344    }
23345
23346    /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
23347    ///
23348    /// # Example
23349    /// ```ignore,no_run
23350    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23351    /// let x = ReleaseNotificationEvent::new().set_release("example");
23352    /// ```
23353    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23354        self.release = v.into();
23355        self
23356    }
23357
23358    /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
23359    ///
23360    /// # Example
23361    /// ```ignore,no_run
23362    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23363    /// use google_cloud_deploy_v1::model::Type;
23364    /// let x0 = ReleaseNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23365    /// let x1 = ReleaseNotificationEvent::new().set_type(Type::ResourceStateChange);
23366    /// let x2 = ReleaseNotificationEvent::new().set_type(Type::ProcessAborted);
23367    /// ```
23368    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23369        self.r#type = v.into();
23370        self
23371    }
23372}
23373
23374impl wkt::message::Message for ReleaseNotificationEvent {
23375    fn typename() -> &'static str {
23376        "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
23377    }
23378}
23379
23380/// Payload proto for "clouddeploy.googleapis.com/release_render"
23381/// Platform Log event that describes the render status change.
23382#[derive(Clone, Default, PartialEq)]
23383#[non_exhaustive]
23384pub struct ReleaseRenderEvent {
23385    /// Debug message for when a render transition occurs. Provides further
23386    /// details as rendering progresses through render states.
23387    pub message: std::string::String,
23388
23389    /// Unique identifier of the `DeliveryPipeline`.
23390    pub pipeline_uid: std::string::String,
23391
23392    /// The name of the release.
23393    /// release_uid is not in this log message because we write some of these log
23394    /// messages at release creation time, before we've generated the uid.
23395    pub release: std::string::String,
23396
23397    /// Type of this notification, e.g. for a release render state change event.
23398    pub r#type: crate::model::Type,
23399
23400    /// The state of the release render.
23401    pub release_render_state: crate::model::release::RenderState,
23402
23403    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23404}
23405
23406impl ReleaseRenderEvent {
23407    pub fn new() -> Self {
23408        std::default::Default::default()
23409    }
23410
23411    /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
23412    ///
23413    /// # Example
23414    /// ```ignore,no_run
23415    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23416    /// let x = ReleaseRenderEvent::new().set_message("example");
23417    /// ```
23418    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23419        self.message = v.into();
23420        self
23421    }
23422
23423    /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
23424    ///
23425    /// # Example
23426    /// ```ignore,no_run
23427    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23428    /// let x = ReleaseRenderEvent::new().set_pipeline_uid("example");
23429    /// ```
23430    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23431        self.pipeline_uid = v.into();
23432        self
23433    }
23434
23435    /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
23436    ///
23437    /// # Example
23438    /// ```ignore,no_run
23439    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23440    /// let x = ReleaseRenderEvent::new().set_release("example");
23441    /// ```
23442    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23443        self.release = v.into();
23444        self
23445    }
23446
23447    /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
23448    ///
23449    /// # Example
23450    /// ```ignore,no_run
23451    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23452    /// use google_cloud_deploy_v1::model::Type;
23453    /// let x0 = ReleaseRenderEvent::new().set_type(Type::PubsubNotificationFailure);
23454    /// let x1 = ReleaseRenderEvent::new().set_type(Type::ResourceStateChange);
23455    /// let x2 = ReleaseRenderEvent::new().set_type(Type::ProcessAborted);
23456    /// ```
23457    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23458        self.r#type = v.into();
23459        self
23460    }
23461
23462    /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
23463    ///
23464    /// # Example
23465    /// ```ignore,no_run
23466    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23467    /// use google_cloud_deploy_v1::model::release::RenderState;
23468    /// let x0 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Succeeded);
23469    /// let x1 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Failed);
23470    /// let x2 = ReleaseRenderEvent::new().set_release_render_state(RenderState::InProgress);
23471    /// ```
23472    pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
23473        mut self,
23474        v: T,
23475    ) -> Self {
23476        self.release_render_state = v.into();
23477        self
23478    }
23479}
23480
23481impl wkt::message::Message for ReleaseRenderEvent {
23482    fn typename() -> &'static str {
23483        "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
23484    }
23485}
23486
23487/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
23488/// Platform Log event that describes the failure to send rollout status change
23489/// Pub/Sub notification.
23490#[derive(Clone, Default, PartialEq)]
23491#[non_exhaustive]
23492pub struct RolloutNotificationEvent {
23493    /// Debug message for when a notification fails to send.
23494    pub message: std::string::String,
23495
23496    /// Unique identifier of the `DeliveryPipeline`.
23497    pub pipeline_uid: std::string::String,
23498
23499    /// Unique identifier of the `Release`.
23500    pub release_uid: std::string::String,
23501
23502    /// The name of the `Release`.
23503    pub release: std::string::String,
23504
23505    /// Unique identifier of the `Rollout`.
23506    pub rollout_uid: std::string::String,
23507
23508    /// The name of the `Rollout`.
23509    pub rollout: std::string::String,
23510
23511    /// ID of the `Target` that the rollout is deployed to.
23512    pub target_id: std::string::String,
23513
23514    /// Type of this notification, e.g. for a Pub/Sub failure.
23515    pub r#type: crate::model::Type,
23516
23517    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23518}
23519
23520impl RolloutNotificationEvent {
23521    pub fn new() -> Self {
23522        std::default::Default::default()
23523    }
23524
23525    /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
23526    ///
23527    /// # Example
23528    /// ```ignore,no_run
23529    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23530    /// let x = RolloutNotificationEvent::new().set_message("example");
23531    /// ```
23532    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23533        self.message = v.into();
23534        self
23535    }
23536
23537    /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
23538    ///
23539    /// # Example
23540    /// ```ignore,no_run
23541    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23542    /// let x = RolloutNotificationEvent::new().set_pipeline_uid("example");
23543    /// ```
23544    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23545        self.pipeline_uid = v.into();
23546        self
23547    }
23548
23549    /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
23550    ///
23551    /// # Example
23552    /// ```ignore,no_run
23553    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23554    /// let x = RolloutNotificationEvent::new().set_release_uid("example");
23555    /// ```
23556    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23557        self.release_uid = v.into();
23558        self
23559    }
23560
23561    /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
23562    ///
23563    /// # Example
23564    /// ```ignore,no_run
23565    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23566    /// let x = RolloutNotificationEvent::new().set_release("example");
23567    /// ```
23568    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23569        self.release = v.into();
23570        self
23571    }
23572
23573    /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
23574    ///
23575    /// # Example
23576    /// ```ignore,no_run
23577    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23578    /// let x = RolloutNotificationEvent::new().set_rollout_uid("example");
23579    /// ```
23580    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23581        self.rollout_uid = v.into();
23582        self
23583    }
23584
23585    /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
23586    ///
23587    /// # Example
23588    /// ```ignore,no_run
23589    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23590    /// let x = RolloutNotificationEvent::new().set_rollout("example");
23591    /// ```
23592    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23593        self.rollout = v.into();
23594        self
23595    }
23596
23597    /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
23598    ///
23599    /// # Example
23600    /// ```ignore,no_run
23601    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23602    /// let x = RolloutNotificationEvent::new().set_target_id("example");
23603    /// ```
23604    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23605        self.target_id = v.into();
23606        self
23607    }
23608
23609    /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
23610    ///
23611    /// # Example
23612    /// ```ignore,no_run
23613    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23614    /// use google_cloud_deploy_v1::model::Type;
23615    /// let x0 = RolloutNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23616    /// let x1 = RolloutNotificationEvent::new().set_type(Type::ResourceStateChange);
23617    /// let x2 = RolloutNotificationEvent::new().set_type(Type::ProcessAborted);
23618    /// ```
23619    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23620        self.r#type = v.into();
23621        self
23622    }
23623}
23624
23625impl wkt::message::Message for RolloutNotificationEvent {
23626    fn typename() -> &'static str {
23627        "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
23628    }
23629}
23630
23631/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
23632/// Platform Log event that describes the rollout update event.
23633#[derive(Clone, Default, PartialEq)]
23634#[non_exhaustive]
23635pub struct RolloutUpdateEvent {
23636    /// Debug message for when a rollout update event occurs.
23637    pub message: std::string::String,
23638
23639    /// Unique identifier of the pipeline.
23640    pub pipeline_uid: std::string::String,
23641
23642    /// Unique identifier of the release.
23643    pub release_uid: std::string::String,
23644
23645    /// The name of the `Release`.
23646    pub release: std::string::String,
23647
23648    /// The name of the rollout.
23649    /// rollout_uid is not in this log message because we write some of these log
23650    /// messages at rollout creation time, before we've generated the uid.
23651    pub rollout: std::string::String,
23652
23653    /// ID of the target.
23654    pub target_id: std::string::String,
23655
23656    /// Type of this notification, e.g. for a rollout update event.
23657    pub r#type: crate::model::Type,
23658
23659    /// The type of the rollout update.
23660    pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
23661
23662    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23663}
23664
23665impl RolloutUpdateEvent {
23666    pub fn new() -> Self {
23667        std::default::Default::default()
23668    }
23669
23670    /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
23671    ///
23672    /// # Example
23673    /// ```ignore,no_run
23674    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23675    /// let x = RolloutUpdateEvent::new().set_message("example");
23676    /// ```
23677    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23678        self.message = v.into();
23679        self
23680    }
23681
23682    /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
23683    ///
23684    /// # Example
23685    /// ```ignore,no_run
23686    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23687    /// let x = RolloutUpdateEvent::new().set_pipeline_uid("example");
23688    /// ```
23689    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23690        self.pipeline_uid = v.into();
23691        self
23692    }
23693
23694    /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
23695    ///
23696    /// # Example
23697    /// ```ignore,no_run
23698    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23699    /// let x = RolloutUpdateEvent::new().set_release_uid("example");
23700    /// ```
23701    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23702        self.release_uid = v.into();
23703        self
23704    }
23705
23706    /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
23707    ///
23708    /// # Example
23709    /// ```ignore,no_run
23710    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23711    /// let x = RolloutUpdateEvent::new().set_release("example");
23712    /// ```
23713    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23714        self.release = v.into();
23715        self
23716    }
23717
23718    /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
23719    ///
23720    /// # Example
23721    /// ```ignore,no_run
23722    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23723    /// let x = RolloutUpdateEvent::new().set_rollout("example");
23724    /// ```
23725    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23726        self.rollout = v.into();
23727        self
23728    }
23729
23730    /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
23731    ///
23732    /// # Example
23733    /// ```ignore,no_run
23734    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23735    /// let x = RolloutUpdateEvent::new().set_target_id("example");
23736    /// ```
23737    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23738        self.target_id = v.into();
23739        self
23740    }
23741
23742    /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
23743    ///
23744    /// # Example
23745    /// ```ignore,no_run
23746    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23747    /// use google_cloud_deploy_v1::model::Type;
23748    /// let x0 = RolloutUpdateEvent::new().set_type(Type::PubsubNotificationFailure);
23749    /// let x1 = RolloutUpdateEvent::new().set_type(Type::ResourceStateChange);
23750    /// let x2 = RolloutUpdateEvent::new().set_type(Type::ProcessAborted);
23751    /// ```
23752    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23753        self.r#type = v.into();
23754        self
23755    }
23756
23757    /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
23758    ///
23759    /// # Example
23760    /// ```ignore,no_run
23761    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23762    /// use google_cloud_deploy_v1::model::rollout_update_event::RolloutUpdateType;
23763    /// let x0 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::Pending);
23764    /// let x1 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::PendingRelease);
23765    /// let x2 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::InProgress);
23766    /// ```
23767    pub fn set_rollout_update_type<
23768        T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
23769    >(
23770        mut self,
23771        v: T,
23772    ) -> Self {
23773        self.rollout_update_type = v.into();
23774        self
23775    }
23776}
23777
23778impl wkt::message::Message for RolloutUpdateEvent {
23779    fn typename() -> &'static str {
23780        "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
23781    }
23782}
23783
23784/// Defines additional types related to [RolloutUpdateEvent].
23785pub mod rollout_update_event {
23786    #[allow(unused_imports)]
23787    use super::*;
23788
23789    /// RolloutUpdateType indicates the type of the rollout update.
23790    ///
23791    /// # Working with unknown values
23792    ///
23793    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23794    /// additional enum variants at any time. Adding new variants is not considered
23795    /// a breaking change. Applications should write their code in anticipation of:
23796    ///
23797    /// - New values appearing in future releases of the client library, **and**
23798    /// - New values received dynamically, without application changes.
23799    ///
23800    /// Please consult the [Working with enums] section in the user guide for some
23801    /// guidelines.
23802    ///
23803    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23804    #[derive(Clone, Debug, PartialEq)]
23805    #[non_exhaustive]
23806    pub enum RolloutUpdateType {
23807        /// Rollout update type unspecified.
23808        Unspecified,
23809        /// rollout state updated to pending.
23810        Pending,
23811        /// Rollout state updated to pending release.
23812        PendingRelease,
23813        /// Rollout state updated to in progress.
23814        InProgress,
23815        /// Rollout state updated to cancelling.
23816        Cancelling,
23817        /// Rollout state updated to cancelled.
23818        Cancelled,
23819        /// Rollout state updated to halted.
23820        Halted,
23821        /// Rollout state updated to succeeded.
23822        Succeeded,
23823        /// Rollout state updated to failed.
23824        Failed,
23825        /// Rollout requires approval.
23826        ApprovalRequired,
23827        /// Rollout has been approved.
23828        Approved,
23829        /// Rollout has been rejected.
23830        Rejected,
23831        /// Rollout requires advance to the next phase.
23832        AdvanceRequired,
23833        /// Rollout has been advanced.
23834        Advanced,
23835        /// If set, the enum was initialized with an unknown value.
23836        ///
23837        /// Applications can examine the value using [RolloutUpdateType::value] or
23838        /// [RolloutUpdateType::name].
23839        UnknownValue(rollout_update_type::UnknownValue),
23840    }
23841
23842    #[doc(hidden)]
23843    pub mod rollout_update_type {
23844        #[allow(unused_imports)]
23845        use super::*;
23846        #[derive(Clone, Debug, PartialEq)]
23847        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23848    }
23849
23850    impl RolloutUpdateType {
23851        /// Gets the enum value.
23852        ///
23853        /// Returns `None` if the enum contains an unknown value deserialized from
23854        /// the string representation of enums.
23855        pub fn value(&self) -> std::option::Option<i32> {
23856            match self {
23857                Self::Unspecified => std::option::Option::Some(0),
23858                Self::Pending => std::option::Option::Some(1),
23859                Self::PendingRelease => std::option::Option::Some(2),
23860                Self::InProgress => std::option::Option::Some(3),
23861                Self::Cancelling => std::option::Option::Some(4),
23862                Self::Cancelled => std::option::Option::Some(5),
23863                Self::Halted => std::option::Option::Some(6),
23864                Self::Succeeded => std::option::Option::Some(7),
23865                Self::Failed => std::option::Option::Some(8),
23866                Self::ApprovalRequired => std::option::Option::Some(9),
23867                Self::Approved => std::option::Option::Some(10),
23868                Self::Rejected => std::option::Option::Some(11),
23869                Self::AdvanceRequired => std::option::Option::Some(12),
23870                Self::Advanced => std::option::Option::Some(13),
23871                Self::UnknownValue(u) => u.0.value(),
23872            }
23873        }
23874
23875        /// Gets the enum value as a string.
23876        ///
23877        /// Returns `None` if the enum contains an unknown value deserialized from
23878        /// the integer representation of enums.
23879        pub fn name(&self) -> std::option::Option<&str> {
23880            match self {
23881                Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
23882                Self::Pending => std::option::Option::Some("PENDING"),
23883                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
23884                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
23885                Self::Cancelling => std::option::Option::Some("CANCELLING"),
23886                Self::Cancelled => std::option::Option::Some("CANCELLED"),
23887                Self::Halted => std::option::Option::Some("HALTED"),
23888                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
23889                Self::Failed => std::option::Option::Some("FAILED"),
23890                Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
23891                Self::Approved => std::option::Option::Some("APPROVED"),
23892                Self::Rejected => std::option::Option::Some("REJECTED"),
23893                Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
23894                Self::Advanced => std::option::Option::Some("ADVANCED"),
23895                Self::UnknownValue(u) => u.0.name(),
23896            }
23897        }
23898    }
23899
23900    impl std::default::Default for RolloutUpdateType {
23901        fn default() -> Self {
23902            use std::convert::From;
23903            Self::from(0)
23904        }
23905    }
23906
23907    impl std::fmt::Display for RolloutUpdateType {
23908        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23909            wkt::internal::display_enum(f, self.name(), self.value())
23910        }
23911    }
23912
23913    impl std::convert::From<i32> for RolloutUpdateType {
23914        fn from(value: i32) -> Self {
23915            match value {
23916                0 => Self::Unspecified,
23917                1 => Self::Pending,
23918                2 => Self::PendingRelease,
23919                3 => Self::InProgress,
23920                4 => Self::Cancelling,
23921                5 => Self::Cancelled,
23922                6 => Self::Halted,
23923                7 => Self::Succeeded,
23924                8 => Self::Failed,
23925                9 => Self::ApprovalRequired,
23926                10 => Self::Approved,
23927                11 => Self::Rejected,
23928                12 => Self::AdvanceRequired,
23929                13 => Self::Advanced,
23930                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
23931                    wkt::internal::UnknownEnumValue::Integer(value),
23932                )),
23933            }
23934        }
23935    }
23936
23937    impl std::convert::From<&str> for RolloutUpdateType {
23938        fn from(value: &str) -> Self {
23939            use std::string::ToString;
23940            match value {
23941                "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
23942                "PENDING" => Self::Pending,
23943                "PENDING_RELEASE" => Self::PendingRelease,
23944                "IN_PROGRESS" => Self::InProgress,
23945                "CANCELLING" => Self::Cancelling,
23946                "CANCELLED" => Self::Cancelled,
23947                "HALTED" => Self::Halted,
23948                "SUCCEEDED" => Self::Succeeded,
23949                "FAILED" => Self::Failed,
23950                "APPROVAL_REQUIRED" => Self::ApprovalRequired,
23951                "APPROVED" => Self::Approved,
23952                "REJECTED" => Self::Rejected,
23953                "ADVANCE_REQUIRED" => Self::AdvanceRequired,
23954                "ADVANCED" => Self::Advanced,
23955                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
23956                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23957                )),
23958            }
23959        }
23960    }
23961
23962    impl serde::ser::Serialize for RolloutUpdateType {
23963        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23964        where
23965            S: serde::Serializer,
23966        {
23967            match self {
23968                Self::Unspecified => serializer.serialize_i32(0),
23969                Self::Pending => serializer.serialize_i32(1),
23970                Self::PendingRelease => serializer.serialize_i32(2),
23971                Self::InProgress => serializer.serialize_i32(3),
23972                Self::Cancelling => serializer.serialize_i32(4),
23973                Self::Cancelled => serializer.serialize_i32(5),
23974                Self::Halted => serializer.serialize_i32(6),
23975                Self::Succeeded => serializer.serialize_i32(7),
23976                Self::Failed => serializer.serialize_i32(8),
23977                Self::ApprovalRequired => serializer.serialize_i32(9),
23978                Self::Approved => serializer.serialize_i32(10),
23979                Self::Rejected => serializer.serialize_i32(11),
23980                Self::AdvanceRequired => serializer.serialize_i32(12),
23981                Self::Advanced => serializer.serialize_i32(13),
23982                Self::UnknownValue(u) => u.0.serialize(serializer),
23983            }
23984        }
23985    }
23986
23987    impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
23988        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23989        where
23990            D: serde::Deserializer<'de>,
23991        {
23992            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
23993                ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
23994            ))
23995        }
23996    }
23997}
23998
23999/// Payload proto for "clouddeploy.googleapis.com/target_notification"
24000/// Platform Log event that describes the failure to send target status change
24001/// Pub/Sub notification.
24002#[derive(Clone, Default, PartialEq)]
24003#[non_exhaustive]
24004pub struct TargetNotificationEvent {
24005    /// Debug message for when a notification fails to send.
24006    pub message: std::string::String,
24007
24008    /// The name of the `Target`.
24009    pub target: std::string::String,
24010
24011    /// Type of this notification, e.g. for a Pub/Sub failure.
24012    pub r#type: crate::model::Type,
24013
24014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24015}
24016
24017impl TargetNotificationEvent {
24018    pub fn new() -> Self {
24019        std::default::Default::default()
24020    }
24021
24022    /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
24023    ///
24024    /// # Example
24025    /// ```ignore,no_run
24026    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24027    /// let x = TargetNotificationEvent::new().set_message("example");
24028    /// ```
24029    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24030        self.message = v.into();
24031        self
24032    }
24033
24034    /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
24035    ///
24036    /// # Example
24037    /// ```ignore,no_run
24038    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24039    /// let x = TargetNotificationEvent::new().set_target("example");
24040    /// ```
24041    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24042        self.target = v.into();
24043        self
24044    }
24045
24046    /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
24047    ///
24048    /// # Example
24049    /// ```ignore,no_run
24050    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24051    /// use google_cloud_deploy_v1::model::Type;
24052    /// let x0 = TargetNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
24053    /// let x1 = TargetNotificationEvent::new().set_type(Type::ResourceStateChange);
24054    /// let x2 = TargetNotificationEvent::new().set_type(Type::ProcessAborted);
24055    /// ```
24056    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24057        self.r#type = v.into();
24058        self
24059    }
24060}
24061
24062impl wkt::message::Message for TargetNotificationEvent {
24063    fn typename() -> &'static str {
24064        "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
24065    }
24066}
24067
24068/// The support state of a specific Skaffold version.
24069///
24070/// # Working with unknown values
24071///
24072/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24073/// additional enum variants at any time. Adding new variants is not considered
24074/// a breaking change. Applications should write their code in anticipation of:
24075///
24076/// - New values appearing in future releases of the client library, **and**
24077/// - New values received dynamically, without application changes.
24078///
24079/// Please consult the [Working with enums] section in the user guide for some
24080/// guidelines.
24081///
24082/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24083#[derive(Clone, Debug, PartialEq)]
24084#[non_exhaustive]
24085pub enum SkaffoldSupportState {
24086    /// Default value. This value is unused.
24087    Unspecified,
24088    /// This Skaffold version is currently supported.
24089    Supported,
24090    /// This Skaffold version is in maintenance mode.
24091    MaintenanceMode,
24092    /// This Skaffold version is no longer supported.
24093    Unsupported,
24094    /// If set, the enum was initialized with an unknown value.
24095    ///
24096    /// Applications can examine the value using [SkaffoldSupportState::value] or
24097    /// [SkaffoldSupportState::name].
24098    UnknownValue(skaffold_support_state::UnknownValue),
24099}
24100
24101#[doc(hidden)]
24102pub mod skaffold_support_state {
24103    #[allow(unused_imports)]
24104    use super::*;
24105    #[derive(Clone, Debug, PartialEq)]
24106    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24107}
24108
24109impl SkaffoldSupportState {
24110    /// Gets the enum value.
24111    ///
24112    /// Returns `None` if the enum contains an unknown value deserialized from
24113    /// the string representation of enums.
24114    pub fn value(&self) -> std::option::Option<i32> {
24115        match self {
24116            Self::Unspecified => std::option::Option::Some(0),
24117            Self::Supported => std::option::Option::Some(1),
24118            Self::MaintenanceMode => std::option::Option::Some(2),
24119            Self::Unsupported => std::option::Option::Some(3),
24120            Self::UnknownValue(u) => u.0.value(),
24121        }
24122    }
24123
24124    /// Gets the enum value as a string.
24125    ///
24126    /// Returns `None` if the enum contains an unknown value deserialized from
24127    /// the integer representation of enums.
24128    pub fn name(&self) -> std::option::Option<&str> {
24129        match self {
24130            Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
24131            Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
24132            Self::MaintenanceMode => {
24133                std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
24134            }
24135            Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
24136            Self::UnknownValue(u) => u.0.name(),
24137        }
24138    }
24139}
24140
24141impl std::default::Default for SkaffoldSupportState {
24142    fn default() -> Self {
24143        use std::convert::From;
24144        Self::from(0)
24145    }
24146}
24147
24148impl std::fmt::Display for SkaffoldSupportState {
24149    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24150        wkt::internal::display_enum(f, self.name(), self.value())
24151    }
24152}
24153
24154impl std::convert::From<i32> for SkaffoldSupportState {
24155    fn from(value: i32) -> Self {
24156        match value {
24157            0 => Self::Unspecified,
24158            1 => Self::Supported,
24159            2 => Self::MaintenanceMode,
24160            3 => Self::Unsupported,
24161            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24162                wkt::internal::UnknownEnumValue::Integer(value),
24163            )),
24164        }
24165    }
24166}
24167
24168impl std::convert::From<&str> for SkaffoldSupportState {
24169    fn from(value: &str) -> Self {
24170        use std::string::ToString;
24171        match value {
24172            "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
24173            "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
24174            "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
24175            "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
24176            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24177                wkt::internal::UnknownEnumValue::String(value.to_string()),
24178            )),
24179        }
24180    }
24181}
24182
24183impl serde::ser::Serialize for SkaffoldSupportState {
24184    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24185    where
24186        S: serde::Serializer,
24187    {
24188        match self {
24189            Self::Unspecified => serializer.serialize_i32(0),
24190            Self::Supported => serializer.serialize_i32(1),
24191            Self::MaintenanceMode => serializer.serialize_i32(2),
24192            Self::Unsupported => serializer.serialize_i32(3),
24193            Self::UnknownValue(u) => u.0.serialize(serializer),
24194        }
24195    }
24196}
24197
24198impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
24199    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24200    where
24201        D: serde::Deserializer<'de>,
24202    {
24203        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
24204            ".google.cloud.deploy.v1.SkaffoldSupportState",
24205        ))
24206    }
24207}
24208
24209/// The pattern of how wait time is increased.
24210///
24211/// # Working with unknown values
24212///
24213/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24214/// additional enum variants at any time. Adding new variants is not considered
24215/// a breaking change. Applications should write their code in anticipation of:
24216///
24217/// - New values appearing in future releases of the client library, **and**
24218/// - New values received dynamically, without application changes.
24219///
24220/// Please consult the [Working with enums] section in the user guide for some
24221/// guidelines.
24222///
24223/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24224#[derive(Clone, Debug, PartialEq)]
24225#[non_exhaustive]
24226pub enum BackoffMode {
24227    /// No WaitMode is specified.
24228    Unspecified,
24229    /// Increases the wait time linearly.
24230    Linear,
24231    /// Increases the wait time exponentially.
24232    Exponential,
24233    /// If set, the enum was initialized with an unknown value.
24234    ///
24235    /// Applications can examine the value using [BackoffMode::value] or
24236    /// [BackoffMode::name].
24237    UnknownValue(backoff_mode::UnknownValue),
24238}
24239
24240#[doc(hidden)]
24241pub mod backoff_mode {
24242    #[allow(unused_imports)]
24243    use super::*;
24244    #[derive(Clone, Debug, PartialEq)]
24245    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24246}
24247
24248impl BackoffMode {
24249    /// Gets the enum value.
24250    ///
24251    /// Returns `None` if the enum contains an unknown value deserialized from
24252    /// the string representation of enums.
24253    pub fn value(&self) -> std::option::Option<i32> {
24254        match self {
24255            Self::Unspecified => std::option::Option::Some(0),
24256            Self::Linear => std::option::Option::Some(1),
24257            Self::Exponential => std::option::Option::Some(2),
24258            Self::UnknownValue(u) => u.0.value(),
24259        }
24260    }
24261
24262    /// Gets the enum value as a string.
24263    ///
24264    /// Returns `None` if the enum contains an unknown value deserialized from
24265    /// the integer representation of enums.
24266    pub fn name(&self) -> std::option::Option<&str> {
24267        match self {
24268            Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
24269            Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
24270            Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
24271            Self::UnknownValue(u) => u.0.name(),
24272        }
24273    }
24274}
24275
24276impl std::default::Default for BackoffMode {
24277    fn default() -> Self {
24278        use std::convert::From;
24279        Self::from(0)
24280    }
24281}
24282
24283impl std::fmt::Display for BackoffMode {
24284    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24285        wkt::internal::display_enum(f, self.name(), self.value())
24286    }
24287}
24288
24289impl std::convert::From<i32> for BackoffMode {
24290    fn from(value: i32) -> Self {
24291        match value {
24292            0 => Self::Unspecified,
24293            1 => Self::Linear,
24294            2 => Self::Exponential,
24295            _ => Self::UnknownValue(backoff_mode::UnknownValue(
24296                wkt::internal::UnknownEnumValue::Integer(value),
24297            )),
24298        }
24299    }
24300}
24301
24302impl std::convert::From<&str> for BackoffMode {
24303    fn from(value: &str) -> Self {
24304        use std::string::ToString;
24305        match value {
24306            "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
24307            "BACKOFF_MODE_LINEAR" => Self::Linear,
24308            "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
24309            _ => Self::UnknownValue(backoff_mode::UnknownValue(
24310                wkt::internal::UnknownEnumValue::String(value.to_string()),
24311            )),
24312        }
24313    }
24314}
24315
24316impl serde::ser::Serialize for BackoffMode {
24317    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24318    where
24319        S: serde::Serializer,
24320    {
24321        match self {
24322            Self::Unspecified => serializer.serialize_i32(0),
24323            Self::Linear => serializer.serialize_i32(1),
24324            Self::Exponential => serializer.serialize_i32(2),
24325            Self::UnknownValue(u) => u.0.serialize(serializer),
24326        }
24327    }
24328}
24329
24330impl<'de> serde::de::Deserialize<'de> for BackoffMode {
24331    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24332    where
24333        D: serde::Deserializer<'de>,
24334    {
24335        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
24336            ".google.cloud.deploy.v1.BackoffMode",
24337        ))
24338    }
24339}
24340
24341/// Valid state of a repair attempt.
24342///
24343/// # Working with unknown values
24344///
24345/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24346/// additional enum variants at any time. Adding new variants is not considered
24347/// a breaking change. Applications should write their code in anticipation of:
24348///
24349/// - New values appearing in future releases of the client library, **and**
24350/// - New values received dynamically, without application changes.
24351///
24352/// Please consult the [Working with enums] section in the user guide for some
24353/// guidelines.
24354///
24355/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24356#[derive(Clone, Debug, PartialEq)]
24357#[non_exhaustive]
24358pub enum RepairState {
24359    /// The `repair` has an unspecified state.
24360    Unspecified,
24361    /// The `repair` action has succeeded.
24362    Succeeded,
24363    /// The `repair` action was cancelled.
24364    Cancelled,
24365    /// The `repair` action has failed.
24366    Failed,
24367    /// The `repair` action is in progress.
24368    InProgress,
24369    /// The `repair` action is pending.
24370    Pending,
24371    /// The `repair` action was aborted.
24372    Aborted,
24373    /// If set, the enum was initialized with an unknown value.
24374    ///
24375    /// Applications can examine the value using [RepairState::value] or
24376    /// [RepairState::name].
24377    UnknownValue(repair_state::UnknownValue),
24378}
24379
24380#[doc(hidden)]
24381pub mod repair_state {
24382    #[allow(unused_imports)]
24383    use super::*;
24384    #[derive(Clone, Debug, PartialEq)]
24385    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24386}
24387
24388impl RepairState {
24389    /// Gets the enum value.
24390    ///
24391    /// Returns `None` if the enum contains an unknown value deserialized from
24392    /// the string representation of enums.
24393    pub fn value(&self) -> std::option::Option<i32> {
24394        match self {
24395            Self::Unspecified => std::option::Option::Some(0),
24396            Self::Succeeded => std::option::Option::Some(1),
24397            Self::Cancelled => std::option::Option::Some(2),
24398            Self::Failed => std::option::Option::Some(3),
24399            Self::InProgress => std::option::Option::Some(4),
24400            Self::Pending => std::option::Option::Some(5),
24401            Self::Aborted => std::option::Option::Some(7),
24402            Self::UnknownValue(u) => u.0.value(),
24403        }
24404    }
24405
24406    /// Gets the enum value as a string.
24407    ///
24408    /// Returns `None` if the enum contains an unknown value deserialized from
24409    /// the integer representation of enums.
24410    pub fn name(&self) -> std::option::Option<&str> {
24411        match self {
24412            Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
24413            Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
24414            Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
24415            Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
24416            Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
24417            Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
24418            Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
24419            Self::UnknownValue(u) => u.0.name(),
24420        }
24421    }
24422}
24423
24424impl std::default::Default for RepairState {
24425    fn default() -> Self {
24426        use std::convert::From;
24427        Self::from(0)
24428    }
24429}
24430
24431impl std::fmt::Display for RepairState {
24432    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24433        wkt::internal::display_enum(f, self.name(), self.value())
24434    }
24435}
24436
24437impl std::convert::From<i32> for RepairState {
24438    fn from(value: i32) -> Self {
24439        match value {
24440            0 => Self::Unspecified,
24441            1 => Self::Succeeded,
24442            2 => Self::Cancelled,
24443            3 => Self::Failed,
24444            4 => Self::InProgress,
24445            5 => Self::Pending,
24446            7 => Self::Aborted,
24447            _ => Self::UnknownValue(repair_state::UnknownValue(
24448                wkt::internal::UnknownEnumValue::Integer(value),
24449            )),
24450        }
24451    }
24452}
24453
24454impl std::convert::From<&str> for RepairState {
24455    fn from(value: &str) -> Self {
24456        use std::string::ToString;
24457        match value {
24458            "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
24459            "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
24460            "REPAIR_STATE_CANCELLED" => Self::Cancelled,
24461            "REPAIR_STATE_FAILED" => Self::Failed,
24462            "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
24463            "REPAIR_STATE_PENDING" => Self::Pending,
24464            "REPAIR_STATE_ABORTED" => Self::Aborted,
24465            _ => Self::UnknownValue(repair_state::UnknownValue(
24466                wkt::internal::UnknownEnumValue::String(value.to_string()),
24467            )),
24468        }
24469    }
24470}
24471
24472impl serde::ser::Serialize for RepairState {
24473    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24474    where
24475        S: serde::Serializer,
24476    {
24477        match self {
24478            Self::Unspecified => serializer.serialize_i32(0),
24479            Self::Succeeded => serializer.serialize_i32(1),
24480            Self::Cancelled => serializer.serialize_i32(2),
24481            Self::Failed => serializer.serialize_i32(3),
24482            Self::InProgress => serializer.serialize_i32(4),
24483            Self::Pending => serializer.serialize_i32(5),
24484            Self::Aborted => serializer.serialize_i32(7),
24485            Self::UnknownValue(u) => u.0.serialize(serializer),
24486        }
24487    }
24488}
24489
24490impl<'de> serde::de::Deserialize<'de> for RepairState {
24491    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24492    where
24493        D: serde::Deserializer<'de>,
24494    {
24495        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
24496            ".google.cloud.deploy.v1.RepairState",
24497        ))
24498    }
24499}
24500
24501/// Type indicates the type of the log entry and can be used as a filter.
24502///
24503/// # Working with unknown values
24504///
24505/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24506/// additional enum variants at any time. Adding new variants is not considered
24507/// a breaking change. Applications should write their code in anticipation of:
24508///
24509/// - New values appearing in future releases of the client library, **and**
24510/// - New values received dynamically, without application changes.
24511///
24512/// Please consult the [Working with enums] section in the user guide for some
24513/// guidelines.
24514///
24515/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24516#[derive(Clone, Debug, PartialEq)]
24517#[non_exhaustive]
24518pub enum Type {
24519    /// Type is unspecified.
24520    Unspecified,
24521    /// A Pub/Sub notification failed to be sent.
24522    PubsubNotificationFailure,
24523    /// Resource state changed.
24524    ResourceStateChange,
24525    /// A process aborted.
24526    ProcessAborted,
24527    /// Restriction check failed.
24528    RestrictionViolated,
24529    /// Resource deleted.
24530    ResourceDeleted,
24531    /// Rollout updated.
24532    RolloutUpdate,
24533    /// Deploy Policy evaluation.
24534    DeployPolicyEvaluation,
24535    /// Deprecated: This field is never used. Use release_render log type instead.
24536    #[deprecated]
24537    RenderStatuesChange,
24538    /// If set, the enum was initialized with an unknown value.
24539    ///
24540    /// Applications can examine the value using [Type::value] or
24541    /// [Type::name].
24542    UnknownValue(r#type::UnknownValue),
24543}
24544
24545#[doc(hidden)]
24546pub mod r#type {
24547    #[allow(unused_imports)]
24548    use super::*;
24549    #[derive(Clone, Debug, PartialEq)]
24550    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24551}
24552
24553impl Type {
24554    /// Gets the enum value.
24555    ///
24556    /// Returns `None` if the enum contains an unknown value deserialized from
24557    /// the string representation of enums.
24558    pub fn value(&self) -> std::option::Option<i32> {
24559        match self {
24560            Self::Unspecified => std::option::Option::Some(0),
24561            Self::PubsubNotificationFailure => std::option::Option::Some(1),
24562            Self::ResourceStateChange => std::option::Option::Some(3),
24563            Self::ProcessAborted => std::option::Option::Some(4),
24564            Self::RestrictionViolated => std::option::Option::Some(5),
24565            Self::ResourceDeleted => std::option::Option::Some(6),
24566            Self::RolloutUpdate => std::option::Option::Some(7),
24567            Self::DeployPolicyEvaluation => std::option::Option::Some(8),
24568            Self::RenderStatuesChange => std::option::Option::Some(2),
24569            Self::UnknownValue(u) => u.0.value(),
24570        }
24571    }
24572
24573    /// Gets the enum value as a string.
24574    ///
24575    /// Returns `None` if the enum contains an unknown value deserialized from
24576    /// the integer representation of enums.
24577    pub fn name(&self) -> std::option::Option<&str> {
24578        match self {
24579            Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
24580            Self::PubsubNotificationFailure => {
24581                std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
24582            }
24583            Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
24584            Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
24585            Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
24586            Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
24587            Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
24588            Self::DeployPolicyEvaluation => {
24589                std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
24590            }
24591            Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
24592            Self::UnknownValue(u) => u.0.name(),
24593        }
24594    }
24595}
24596
24597impl std::default::Default for Type {
24598    fn default() -> Self {
24599        use std::convert::From;
24600        Self::from(0)
24601    }
24602}
24603
24604impl std::fmt::Display for Type {
24605    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24606        wkt::internal::display_enum(f, self.name(), self.value())
24607    }
24608}
24609
24610impl std::convert::From<i32> for Type {
24611    fn from(value: i32) -> Self {
24612        match value {
24613            0 => Self::Unspecified,
24614            1 => Self::PubsubNotificationFailure,
24615            2 => Self::RenderStatuesChange,
24616            3 => Self::ResourceStateChange,
24617            4 => Self::ProcessAborted,
24618            5 => Self::RestrictionViolated,
24619            6 => Self::ResourceDeleted,
24620            7 => Self::RolloutUpdate,
24621            8 => Self::DeployPolicyEvaluation,
24622            _ => Self::UnknownValue(r#type::UnknownValue(
24623                wkt::internal::UnknownEnumValue::Integer(value),
24624            )),
24625        }
24626    }
24627}
24628
24629impl std::convert::From<&str> for Type {
24630    fn from(value: &str) -> Self {
24631        use std::string::ToString;
24632        match value {
24633            "TYPE_UNSPECIFIED" => Self::Unspecified,
24634            "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
24635            "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
24636            "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
24637            "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
24638            "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
24639            "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
24640            "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
24641            "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
24642            _ => Self::UnknownValue(r#type::UnknownValue(
24643                wkt::internal::UnknownEnumValue::String(value.to_string()),
24644            )),
24645        }
24646    }
24647}
24648
24649impl serde::ser::Serialize for Type {
24650    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24651    where
24652        S: serde::Serializer,
24653    {
24654        match self {
24655            Self::Unspecified => serializer.serialize_i32(0),
24656            Self::PubsubNotificationFailure => serializer.serialize_i32(1),
24657            Self::ResourceStateChange => serializer.serialize_i32(3),
24658            Self::ProcessAborted => serializer.serialize_i32(4),
24659            Self::RestrictionViolated => serializer.serialize_i32(5),
24660            Self::ResourceDeleted => serializer.serialize_i32(6),
24661            Self::RolloutUpdate => serializer.serialize_i32(7),
24662            Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
24663            Self::RenderStatuesChange => serializer.serialize_i32(2),
24664            Self::UnknownValue(u) => u.0.serialize(serializer),
24665        }
24666    }
24667}
24668
24669impl<'de> serde::de::Deserialize<'de> for Type {
24670    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24671    where
24672        D: serde::Deserializer<'de>,
24673    {
24674        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
24675            ".google.cloud.deploy.v1.Type",
24676        ))
24677    }
24678}