Skip to main content

google_cloud_deploy_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_type;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Payload proto for "clouddeploy.googleapis.com/automation"
41/// Platform Log event that describes the Automation related events.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct AutomationEvent {
45    /// Debug message for when there is an update on the AutomationRun.
46    /// Provides further details about the resource creation or state change.
47    pub message: std::string::String,
48
49    /// The name of the `AutomationRun`.
50    pub automation: std::string::String,
51
52    /// Unique identifier of the `DeliveryPipeline`.
53    pub pipeline_uid: std::string::String,
54
55    /// Type of this notification, e.g. for a Pub/Sub failure.
56    pub r#type: crate::model::Type,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl AutomationEvent {
62    /// Creates a new default instance.
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [message][crate::model::AutomationEvent::message].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_deploy_v1::model::AutomationEvent;
72    /// let x = AutomationEvent::new().set_message("example");
73    /// ```
74    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75        self.message = v.into();
76        self
77    }
78
79    /// Sets the value of [automation][crate::model::AutomationEvent::automation].
80    ///
81    /// # Example
82    /// ```ignore,no_run
83    /// # use google_cloud_deploy_v1::model::AutomationEvent;
84    /// let x = AutomationEvent::new().set_automation("example");
85    /// ```
86    pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
87        self.automation = v.into();
88        self
89    }
90
91    /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
92    ///
93    /// # Example
94    /// ```ignore,no_run
95    /// # use google_cloud_deploy_v1::model::AutomationEvent;
96    /// let x = AutomationEvent::new().set_pipeline_uid("example");
97    /// ```
98    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.pipeline_uid = v.into();
100        self
101    }
102
103    /// Sets the value of [r#type][crate::model::AutomationEvent::type].
104    ///
105    /// # Example
106    /// ```ignore,no_run
107    /// # use google_cloud_deploy_v1::model::AutomationEvent;
108    /// use google_cloud_deploy_v1::model::Type;
109    /// let x0 = AutomationEvent::new().set_type(Type::PubsubNotificationFailure);
110    /// let x1 = AutomationEvent::new().set_type(Type::ResourceStateChange);
111    /// let x2 = AutomationEvent::new().set_type(Type::ProcessAborted);
112    /// ```
113    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
114        self.r#type = v.into();
115        self
116    }
117}
118
119impl wkt::message::Message for AutomationEvent {
120    fn typename() -> &'static str {
121        "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
122    }
123}
124
125/// Payload proto for "clouddeploy.googleapis.com/automation_run"
126/// Platform Log event that describes the AutomationRun related events.
127#[derive(Clone, Default, PartialEq)]
128#[non_exhaustive]
129pub struct AutomationRunEvent {
130    /// Debug message for when there is an update on the AutomationRun.
131    /// Provides further details about the resource creation or state change.
132    pub message: std::string::String,
133
134    /// The name of the `AutomationRun`.
135    pub automation_run: std::string::String,
136
137    /// Unique identifier of the `DeliveryPipeline`.
138    pub pipeline_uid: std::string::String,
139
140    /// Identifier of the `Automation`.
141    pub automation_id: std::string::String,
142
143    /// Identifier of the `Automation` rule.
144    pub rule_id: std::string::String,
145
146    /// ID of the `Target` to which the `AutomationRun` is created.
147    pub destination_target_id: std::string::String,
148
149    /// Type of this notification, e.g. for a Pub/Sub failure.
150    pub r#type: crate::model::Type,
151
152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
153}
154
155impl AutomationRunEvent {
156    /// Creates a new default instance.
157    pub fn new() -> Self {
158        std::default::Default::default()
159    }
160
161    /// Sets the value of [message][crate::model::AutomationRunEvent::message].
162    ///
163    /// # Example
164    /// ```ignore,no_run
165    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
166    /// let x = AutomationRunEvent::new().set_message("example");
167    /// ```
168    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169        self.message = v.into();
170        self
171    }
172
173    /// Sets the value of [automation_run][crate::model::AutomationRunEvent::automation_run].
174    ///
175    /// # Example
176    /// ```ignore,no_run
177    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
178    /// let x = AutomationRunEvent::new().set_automation_run("example");
179    /// ```
180    pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
181        self.automation_run = v.into();
182        self
183    }
184
185    /// Sets the value of [pipeline_uid][crate::model::AutomationRunEvent::pipeline_uid].
186    ///
187    /// # Example
188    /// ```ignore,no_run
189    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
190    /// let x = AutomationRunEvent::new().set_pipeline_uid("example");
191    /// ```
192    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
193        self.pipeline_uid = v.into();
194        self
195    }
196
197    /// Sets the value of [automation_id][crate::model::AutomationRunEvent::automation_id].
198    ///
199    /// # Example
200    /// ```ignore,no_run
201    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
202    /// let x = AutomationRunEvent::new().set_automation_id("example");
203    /// ```
204    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205        self.automation_id = v.into();
206        self
207    }
208
209    /// Sets the value of [rule_id][crate::model::AutomationRunEvent::rule_id].
210    ///
211    /// # Example
212    /// ```ignore,no_run
213    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
214    /// let x = AutomationRunEvent::new().set_rule_id("example");
215    /// ```
216    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
217        self.rule_id = v.into();
218        self
219    }
220
221    /// Sets the value of [destination_target_id][crate::model::AutomationRunEvent::destination_target_id].
222    ///
223    /// # Example
224    /// ```ignore,no_run
225    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
226    /// let x = AutomationRunEvent::new().set_destination_target_id("example");
227    /// ```
228    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
229        mut self,
230        v: T,
231    ) -> Self {
232        self.destination_target_id = v.into();
233        self
234    }
235
236    /// Sets the value of [r#type][crate::model::AutomationRunEvent::type].
237    ///
238    /// # Example
239    /// ```ignore,no_run
240    /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
241    /// use google_cloud_deploy_v1::model::Type;
242    /// let x0 = AutomationRunEvent::new().set_type(Type::PubsubNotificationFailure);
243    /// let x1 = AutomationRunEvent::new().set_type(Type::ResourceStateChange);
244    /// let x2 = AutomationRunEvent::new().set_type(Type::ProcessAborted);
245    /// ```
246    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
247        self.r#type = v.into();
248        self
249    }
250}
251
252impl wkt::message::Message for AutomationRunEvent {
253    fn typename() -> &'static str {
254        "type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
255    }
256}
257
258/// A `DeliveryPipeline` resource in the Cloud Deploy API.
259///
260/// A `DeliveryPipeline` defines a pipeline through which a Skaffold
261/// configuration can progress.
262#[derive(Clone, Default, PartialEq)]
263#[non_exhaustive]
264pub struct DeliveryPipeline {
265    /// Identifier. Name of the `DeliveryPipeline`. Format is
266    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`.
267    /// The `deliveryPipeline` component must match
268    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
269    pub name: std::string::String,
270
271    /// Output only. Unique identifier of the `DeliveryPipeline`.
272    pub uid: std::string::String,
273
274    /// Optional. Description of the `DeliveryPipeline`. Max length is 255
275    /// characters.
276    pub description: std::string::String,
277
278    /// Optional. User annotations. These attributes can only be set and used by
279    /// the user, and not by Cloud Deploy.
280    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
281
282    /// Labels are attributes that can be set and used by both the
283    /// user and by Cloud Deploy. Labels must meet the following constraints:
284    ///
285    /// * Keys and values can contain only lowercase letters, numeric characters,
286    ///   underscores, and dashes.
287    /// * All characters must use UTF-8 encoding, and international characters are
288    ///   allowed.
289    /// * Keys must start with a lowercase letter or international character.
290    /// * Each resource is limited to a maximum of 64 labels.
291    ///
292    /// Both keys and values are additionally constrained to be <= 128 bytes.
293    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
294
295    /// Output only. Time at which the pipeline was created.
296    pub create_time: std::option::Option<wkt::Timestamp>,
297
298    /// Output only. Most recent time at which the pipeline was updated.
299    pub update_time: std::option::Option<wkt::Timestamp>,
300
301    /// Output only. Information around the state of the Delivery Pipeline.
302    pub condition: std::option::Option<crate::model::PipelineCondition>,
303
304    /// This checksum is computed by the server based on the value of other
305    /// fields, and may be sent on update and delete requests to ensure the
306    /// client has an up-to-date value before proceeding.
307    pub etag: std::string::String,
308
309    /// Optional. When suspended, no new releases or rollouts can be created,
310    /// but in-progress ones will complete.
311    pub suspended: bool,
312
313    /// The ordering configuration of the `DeliveryPipeline`.
314    pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
315
316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
317}
318
319impl DeliveryPipeline {
320    /// Creates a new default instance.
321    pub fn new() -> Self {
322        std::default::Default::default()
323    }
324
325    /// Sets the value of [name][crate::model::DeliveryPipeline::name].
326    ///
327    /// # Example
328    /// ```ignore,no_run
329    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
330    /// # let project_id = "project_id";
331    /// # let location_id = "location_id";
332    /// # let delivery_pipeline_id = "delivery_pipeline_id";
333    /// let x = DeliveryPipeline::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
334    /// ```
335    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
336        self.name = v.into();
337        self
338    }
339
340    /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
341    ///
342    /// # Example
343    /// ```ignore,no_run
344    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
345    /// let x = DeliveryPipeline::new().set_uid("example");
346    /// ```
347    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
348        self.uid = v.into();
349        self
350    }
351
352    /// Sets the value of [description][crate::model::DeliveryPipeline::description].
353    ///
354    /// # Example
355    /// ```ignore,no_run
356    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
357    /// let x = DeliveryPipeline::new().set_description("example");
358    /// ```
359    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
360        self.description = v.into();
361        self
362    }
363
364    /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
365    ///
366    /// # Example
367    /// ```ignore,no_run
368    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
369    /// let x = DeliveryPipeline::new().set_annotations([
370    ///     ("key0", "abc"),
371    ///     ("key1", "xyz"),
372    /// ]);
373    /// ```
374    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
375    where
376        T: std::iter::IntoIterator<Item = (K, V)>,
377        K: std::convert::Into<std::string::String>,
378        V: std::convert::Into<std::string::String>,
379    {
380        use std::iter::Iterator;
381        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
382        self
383    }
384
385    /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
386    ///
387    /// # Example
388    /// ```ignore,no_run
389    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
390    /// let x = DeliveryPipeline::new().set_labels([
391    ///     ("key0", "abc"),
392    ///     ("key1", "xyz"),
393    /// ]);
394    /// ```
395    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
396    where
397        T: std::iter::IntoIterator<Item = (K, V)>,
398        K: std::convert::Into<std::string::String>,
399        V: std::convert::Into<std::string::String>,
400    {
401        use std::iter::Iterator;
402        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
403        self
404    }
405
406    /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
407    ///
408    /// # Example
409    /// ```ignore,no_run
410    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
411    /// use wkt::Timestamp;
412    /// let x = DeliveryPipeline::new().set_create_time(Timestamp::default()/* use setters */);
413    /// ```
414    pub fn set_create_time<T>(mut self, v: T) -> Self
415    where
416        T: std::convert::Into<wkt::Timestamp>,
417    {
418        self.create_time = std::option::Option::Some(v.into());
419        self
420    }
421
422    /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
423    ///
424    /// # Example
425    /// ```ignore,no_run
426    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
427    /// use wkt::Timestamp;
428    /// let x = DeliveryPipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
429    /// let x = DeliveryPipeline::new().set_or_clear_create_time(None::<Timestamp>);
430    /// ```
431    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
432    where
433        T: std::convert::Into<wkt::Timestamp>,
434    {
435        self.create_time = v.map(|x| x.into());
436        self
437    }
438
439    /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
440    ///
441    /// # Example
442    /// ```ignore,no_run
443    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
444    /// use wkt::Timestamp;
445    /// let x = DeliveryPipeline::new().set_update_time(Timestamp::default()/* use setters */);
446    /// ```
447    pub fn set_update_time<T>(mut self, v: T) -> Self
448    where
449        T: std::convert::Into<wkt::Timestamp>,
450    {
451        self.update_time = std::option::Option::Some(v.into());
452        self
453    }
454
455    /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
456    ///
457    /// # Example
458    /// ```ignore,no_run
459    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
460    /// use wkt::Timestamp;
461    /// let x = DeliveryPipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
462    /// let x = DeliveryPipeline::new().set_or_clear_update_time(None::<Timestamp>);
463    /// ```
464    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
465    where
466        T: std::convert::Into<wkt::Timestamp>,
467    {
468        self.update_time = v.map(|x| x.into());
469        self
470    }
471
472    /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
473    ///
474    /// # Example
475    /// ```ignore,no_run
476    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
477    /// use google_cloud_deploy_v1::model::PipelineCondition;
478    /// let x = DeliveryPipeline::new().set_condition(PipelineCondition::default()/* use setters */);
479    /// ```
480    pub fn set_condition<T>(mut self, v: T) -> Self
481    where
482        T: std::convert::Into<crate::model::PipelineCondition>,
483    {
484        self.condition = std::option::Option::Some(v.into());
485        self
486    }
487
488    /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
489    ///
490    /// # Example
491    /// ```ignore,no_run
492    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
493    /// use google_cloud_deploy_v1::model::PipelineCondition;
494    /// let x = DeliveryPipeline::new().set_or_clear_condition(Some(PipelineCondition::default()/* use setters */));
495    /// let x = DeliveryPipeline::new().set_or_clear_condition(None::<PipelineCondition>);
496    /// ```
497    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
498    where
499        T: std::convert::Into<crate::model::PipelineCondition>,
500    {
501        self.condition = v.map(|x| x.into());
502        self
503    }
504
505    /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
506    ///
507    /// # Example
508    /// ```ignore,no_run
509    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
510    /// let x = DeliveryPipeline::new().set_etag("example");
511    /// ```
512    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
513        self.etag = v.into();
514        self
515    }
516
517    /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
518    ///
519    /// # Example
520    /// ```ignore,no_run
521    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
522    /// let x = DeliveryPipeline::new().set_suspended(true);
523    /// ```
524    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
525        self.suspended = v.into();
526        self
527    }
528
529    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
530    ///
531    /// Note that all the setters affecting `pipeline` are mutually
532    /// exclusive.
533    ///
534    /// # Example
535    /// ```ignore,no_run
536    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
537    /// use google_cloud_deploy_v1::model::SerialPipeline;
538    /// let x = DeliveryPipeline::new().set_pipeline(Some(
539    ///     google_cloud_deploy_v1::model::delivery_pipeline::Pipeline::SerialPipeline(SerialPipeline::default().into())));
540    /// ```
541    pub fn set_pipeline<
542        T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
543    >(
544        mut self,
545        v: T,
546    ) -> Self {
547        self.pipeline = v.into();
548        self
549    }
550
551    /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
552    /// if it holds a `SerialPipeline`, `None` if the field is not set or
553    /// holds a different branch.
554    pub fn serial_pipeline(
555        &self,
556    ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
557        #[allow(unreachable_patterns)]
558        self.pipeline.as_ref().and_then(|v| match v {
559            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
560                std::option::Option::Some(v)
561            }
562            _ => std::option::Option::None,
563        })
564    }
565
566    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
567    /// to hold a `SerialPipeline`.
568    ///
569    /// Note that all the setters affecting `pipeline` are
570    /// mutually exclusive.
571    ///
572    /// # Example
573    /// ```ignore,no_run
574    /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
575    /// use google_cloud_deploy_v1::model::SerialPipeline;
576    /// let x = DeliveryPipeline::new().set_serial_pipeline(SerialPipeline::default()/* use setters */);
577    /// assert!(x.serial_pipeline().is_some());
578    /// ```
579    pub fn set_serial_pipeline<
580        T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
581    >(
582        mut self,
583        v: T,
584    ) -> Self {
585        self.pipeline = std::option::Option::Some(
586            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
587        );
588        self
589    }
590}
591
592impl wkt::message::Message for DeliveryPipeline {
593    fn typename() -> &'static str {
594        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
595    }
596}
597
598/// Defines additional types related to [DeliveryPipeline].
599pub mod delivery_pipeline {
600    #[allow(unused_imports)]
601    use super::*;
602
603    /// The ordering configuration of the `DeliveryPipeline`.
604    #[derive(Clone, Debug, PartialEq)]
605    #[non_exhaustive]
606    pub enum Pipeline {
607        /// Optional. SerialPipeline defines a sequential set of stages for a
608        /// `DeliveryPipeline`.
609        SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
610    }
611}
612
613/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
614#[derive(Clone, Default, PartialEq)]
615#[non_exhaustive]
616pub struct SerialPipeline {
617    /// Optional. Each stage specifies configuration for a `Target`. The ordering
618    /// of this list defines the promotion flow.
619    pub stages: std::vec::Vec<crate::model::Stage>,
620
621    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
622}
623
624impl SerialPipeline {
625    /// Creates a new default instance.
626    pub fn new() -> Self {
627        std::default::Default::default()
628    }
629
630    /// Sets the value of [stages][crate::model::SerialPipeline::stages].
631    ///
632    /// # Example
633    /// ```ignore,no_run
634    /// # use google_cloud_deploy_v1::model::SerialPipeline;
635    /// use google_cloud_deploy_v1::model::Stage;
636    /// let x = SerialPipeline::new()
637    ///     .set_stages([
638    ///         Stage::default()/* use setters */,
639    ///         Stage::default()/* use (different) setters */,
640    ///     ]);
641    /// ```
642    pub fn set_stages<T, V>(mut self, v: T) -> Self
643    where
644        T: std::iter::IntoIterator<Item = V>,
645        V: std::convert::Into<crate::model::Stage>,
646    {
647        use std::iter::Iterator;
648        self.stages = v.into_iter().map(|i| i.into()).collect();
649        self
650    }
651}
652
653impl wkt::message::Message for SerialPipeline {
654    fn typename() -> &'static str {
655        "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
656    }
657}
658
659/// Stage specifies a location to which to deploy.
660#[derive(Clone, Default, PartialEq)]
661#[non_exhaustive]
662pub struct Stage {
663    /// Optional. The target_id to which this stage points. This field refers
664    /// exclusively to the last segment of a target name. For example, this field
665    /// would just be `my-target` (rather than
666    /// `projects/project/locations/location/targets/my-target`). The location of
667    /// the `Target` is inferred to be the same as the location of the
668    /// `DeliveryPipeline` that contains this `Stage`.
669    pub target_id: std::string::String,
670
671    /// Optional. Skaffold profiles to use when rendering the manifest for this
672    /// stage's `Target`.
673    pub profiles: std::vec::Vec<std::string::String>,
674
675    /// Optional. The strategy to use for a `Rollout` to this stage.
676    pub strategy: std::option::Option<crate::model::Strategy>,
677
678    /// Optional. The deploy parameters to use for the target in this stage.
679    pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
680
681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
682}
683
684impl Stage {
685    /// Creates a new default instance.
686    pub fn new() -> Self {
687        std::default::Default::default()
688    }
689
690    /// Sets the value of [target_id][crate::model::Stage::target_id].
691    ///
692    /// # Example
693    /// ```ignore,no_run
694    /// # use google_cloud_deploy_v1::model::Stage;
695    /// let x = Stage::new().set_target_id("example");
696    /// ```
697    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
698        self.target_id = v.into();
699        self
700    }
701
702    /// Sets the value of [profiles][crate::model::Stage::profiles].
703    ///
704    /// # Example
705    /// ```ignore,no_run
706    /// # use google_cloud_deploy_v1::model::Stage;
707    /// let x = Stage::new().set_profiles(["a", "b", "c"]);
708    /// ```
709    pub fn set_profiles<T, V>(mut self, v: T) -> Self
710    where
711        T: std::iter::IntoIterator<Item = V>,
712        V: std::convert::Into<std::string::String>,
713    {
714        use std::iter::Iterator;
715        self.profiles = v.into_iter().map(|i| i.into()).collect();
716        self
717    }
718
719    /// Sets the value of [strategy][crate::model::Stage::strategy].
720    ///
721    /// # Example
722    /// ```ignore,no_run
723    /// # use google_cloud_deploy_v1::model::Stage;
724    /// use google_cloud_deploy_v1::model::Strategy;
725    /// let x = Stage::new().set_strategy(Strategy::default()/* use setters */);
726    /// ```
727    pub fn set_strategy<T>(mut self, v: T) -> Self
728    where
729        T: std::convert::Into<crate::model::Strategy>,
730    {
731        self.strategy = std::option::Option::Some(v.into());
732        self
733    }
734
735    /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
736    ///
737    /// # Example
738    /// ```ignore,no_run
739    /// # use google_cloud_deploy_v1::model::Stage;
740    /// use google_cloud_deploy_v1::model::Strategy;
741    /// let x = Stage::new().set_or_clear_strategy(Some(Strategy::default()/* use setters */));
742    /// let x = Stage::new().set_or_clear_strategy(None::<Strategy>);
743    /// ```
744    pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
745    where
746        T: std::convert::Into<crate::model::Strategy>,
747    {
748        self.strategy = v.map(|x| x.into());
749        self
750    }
751
752    /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
753    ///
754    /// # Example
755    /// ```ignore,no_run
756    /// # use google_cloud_deploy_v1::model::Stage;
757    /// use google_cloud_deploy_v1::model::DeployParameters;
758    /// let x = Stage::new()
759    ///     .set_deploy_parameters([
760    ///         DeployParameters::default()/* use setters */,
761    ///         DeployParameters::default()/* use (different) setters */,
762    ///     ]);
763    /// ```
764    pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
765    where
766        T: std::iter::IntoIterator<Item = V>,
767        V: std::convert::Into<crate::model::DeployParameters>,
768    {
769        use std::iter::Iterator;
770        self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
771        self
772    }
773}
774
775impl wkt::message::Message for Stage {
776    fn typename() -> &'static str {
777        "type.googleapis.com/google.cloud.deploy.v1.Stage"
778    }
779}
780
781/// DeployParameters contains deploy parameters information.
782#[derive(Clone, Default, PartialEq)]
783#[non_exhaustive]
784pub struct DeployParameters {
785    /// Required. Values are deploy parameters in key-value pairs.
786    pub values: std::collections::HashMap<std::string::String, std::string::String>,
787
788    /// Optional. Deploy parameters are applied to targets with match labels.
789    /// If unspecified, deploy parameters are applied to all targets (including
790    /// child targets of a multi-target).
791    pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
792
793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
794}
795
796impl DeployParameters {
797    /// Creates a new default instance.
798    pub fn new() -> Self {
799        std::default::Default::default()
800    }
801
802    /// Sets the value of [values][crate::model::DeployParameters::values].
803    ///
804    /// # Example
805    /// ```ignore,no_run
806    /// # use google_cloud_deploy_v1::model::DeployParameters;
807    /// let x = DeployParameters::new().set_values([
808    ///     ("key0", "abc"),
809    ///     ("key1", "xyz"),
810    /// ]);
811    /// ```
812    pub fn set_values<T, K, V>(mut self, v: T) -> Self
813    where
814        T: std::iter::IntoIterator<Item = (K, V)>,
815        K: std::convert::Into<std::string::String>,
816        V: std::convert::Into<std::string::String>,
817    {
818        use std::iter::Iterator;
819        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
820        self
821    }
822
823    /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
824    ///
825    /// # Example
826    /// ```ignore,no_run
827    /// # use google_cloud_deploy_v1::model::DeployParameters;
828    /// let x = DeployParameters::new().set_match_target_labels([
829    ///     ("key0", "abc"),
830    ///     ("key1", "xyz"),
831    /// ]);
832    /// ```
833    pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
834    where
835        T: std::iter::IntoIterator<Item = (K, V)>,
836        K: std::convert::Into<std::string::String>,
837        V: std::convert::Into<std::string::String>,
838    {
839        use std::iter::Iterator;
840        self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
841        self
842    }
843}
844
845impl wkt::message::Message for DeployParameters {
846    fn typename() -> &'static str {
847        "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
848    }
849}
850
851/// Strategy contains deployment strategy information.
852#[derive(Clone, Default, PartialEq)]
853#[non_exhaustive]
854pub struct Strategy {
855    /// Deployment strategy details.
856    pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
857
858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
859}
860
861impl Strategy {
862    /// Creates a new default instance.
863    pub fn new() -> Self {
864        std::default::Default::default()
865    }
866
867    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
868    ///
869    /// Note that all the setters affecting `deployment_strategy` are mutually
870    /// exclusive.
871    ///
872    /// # Example
873    /// ```ignore,no_run
874    /// # use google_cloud_deploy_v1::model::Strategy;
875    /// use google_cloud_deploy_v1::model::Standard;
876    /// let x = Strategy::new().set_deployment_strategy(Some(
877    ///     google_cloud_deploy_v1::model::strategy::DeploymentStrategy::Standard(Standard::default().into())));
878    /// ```
879    pub fn set_deployment_strategy<
880        T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
881    >(
882        mut self,
883        v: T,
884    ) -> Self {
885        self.deployment_strategy = v.into();
886        self
887    }
888
889    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
890    /// if it holds a `Standard`, `None` if the field is not set or
891    /// holds a different branch.
892    pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
893        #[allow(unreachable_patterns)]
894        self.deployment_strategy.as_ref().and_then(|v| match v {
895            crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
896            _ => std::option::Option::None,
897        })
898    }
899
900    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
901    /// to hold a `Standard`.
902    ///
903    /// Note that all the setters affecting `deployment_strategy` are
904    /// mutually exclusive.
905    ///
906    /// # Example
907    /// ```ignore,no_run
908    /// # use google_cloud_deploy_v1::model::Strategy;
909    /// use google_cloud_deploy_v1::model::Standard;
910    /// let x = Strategy::new().set_standard(Standard::default()/* use setters */);
911    /// assert!(x.standard().is_some());
912    /// assert!(x.canary().is_none());
913    /// ```
914    pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
915        mut self,
916        v: T,
917    ) -> Self {
918        self.deployment_strategy = std::option::Option::Some(
919            crate::model::strategy::DeploymentStrategy::Standard(v.into()),
920        );
921        self
922    }
923
924    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
925    /// if it holds a `Canary`, `None` if the field is not set or
926    /// holds a different branch.
927    pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
928        #[allow(unreachable_patterns)]
929        self.deployment_strategy.as_ref().and_then(|v| match v {
930            crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
931            _ => std::option::Option::None,
932        })
933    }
934
935    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
936    /// to hold a `Canary`.
937    ///
938    /// Note that all the setters affecting `deployment_strategy` are
939    /// mutually exclusive.
940    ///
941    /// # Example
942    /// ```ignore,no_run
943    /// # use google_cloud_deploy_v1::model::Strategy;
944    /// use google_cloud_deploy_v1::model::Canary;
945    /// let x = Strategy::new().set_canary(Canary::default()/* use setters */);
946    /// assert!(x.canary().is_some());
947    /// assert!(x.standard().is_none());
948    /// ```
949    pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
950        mut self,
951        v: T,
952    ) -> Self {
953        self.deployment_strategy =
954            std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
955        self
956    }
957}
958
959impl wkt::message::Message for Strategy {
960    fn typename() -> &'static str {
961        "type.googleapis.com/google.cloud.deploy.v1.Strategy"
962    }
963}
964
965/// Defines additional types related to [Strategy].
966pub mod strategy {
967    #[allow(unused_imports)]
968    use super::*;
969
970    /// Deployment strategy details.
971    #[derive(Clone, Debug, PartialEq)]
972    #[non_exhaustive]
973    pub enum DeploymentStrategy {
974        /// Optional. Standard deployment strategy executes a single deploy and
975        /// allows verifying the deployment.
976        Standard(std::boxed::Box<crate::model::Standard>),
977        /// Optional. Canary deployment strategy provides progressive percentage
978        /// based deployments to a Target.
979        Canary(std::boxed::Box<crate::model::Canary>),
980    }
981}
982
983/// Predeploy contains the predeploy job configuration information.
984#[derive(Clone, Default, PartialEq)]
985#[non_exhaustive]
986pub struct Predeploy {
987    /// Optional. A sequence of Skaffold custom actions to invoke during execution
988    /// of the predeploy job.
989    pub actions: std::vec::Vec<std::string::String>,
990
991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
992}
993
994impl Predeploy {
995    /// Creates a new default instance.
996    pub fn new() -> Self {
997        std::default::Default::default()
998    }
999
1000    /// Sets the value of [actions][crate::model::Predeploy::actions].
1001    ///
1002    /// # Example
1003    /// ```ignore,no_run
1004    /// # use google_cloud_deploy_v1::model::Predeploy;
1005    /// let x = Predeploy::new().set_actions(["a", "b", "c"]);
1006    /// ```
1007    pub fn set_actions<T, V>(mut self, v: T) -> Self
1008    where
1009        T: std::iter::IntoIterator<Item = V>,
1010        V: std::convert::Into<std::string::String>,
1011    {
1012        use std::iter::Iterator;
1013        self.actions = v.into_iter().map(|i| i.into()).collect();
1014        self
1015    }
1016}
1017
1018impl wkt::message::Message for Predeploy {
1019    fn typename() -> &'static str {
1020        "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
1021    }
1022}
1023
1024/// Postdeploy contains the postdeploy job configuration information.
1025#[derive(Clone, Default, PartialEq)]
1026#[non_exhaustive]
1027pub struct Postdeploy {
1028    /// Optional. A sequence of Skaffold custom actions to invoke during execution
1029    /// of the postdeploy job.
1030    pub actions: std::vec::Vec<std::string::String>,
1031
1032    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1033}
1034
1035impl Postdeploy {
1036    /// Creates a new default instance.
1037    pub fn new() -> Self {
1038        std::default::Default::default()
1039    }
1040
1041    /// Sets the value of [actions][crate::model::Postdeploy::actions].
1042    ///
1043    /// # Example
1044    /// ```ignore,no_run
1045    /// # use google_cloud_deploy_v1::model::Postdeploy;
1046    /// let x = Postdeploy::new().set_actions(["a", "b", "c"]);
1047    /// ```
1048    pub fn set_actions<T, V>(mut self, v: T) -> Self
1049    where
1050        T: std::iter::IntoIterator<Item = V>,
1051        V: std::convert::Into<std::string::String>,
1052    {
1053        use std::iter::Iterator;
1054        self.actions = v.into_iter().map(|i| i.into()).collect();
1055        self
1056    }
1057}
1058
1059impl wkt::message::Message for Postdeploy {
1060    fn typename() -> &'static str {
1061        "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
1062    }
1063}
1064
1065/// Standard represents the standard deployment strategy.
1066#[derive(Clone, Default, PartialEq)]
1067#[non_exhaustive]
1068pub struct Standard {
1069    /// Optional. Whether to verify a deployment via `skaffold verify`.
1070    pub verify: bool,
1071
1072    /// Optional. Configuration for the predeploy job. If this is not configured,
1073    /// the predeploy job will not be present.
1074    pub predeploy: std::option::Option<crate::model::Predeploy>,
1075
1076    /// Optional. Configuration for the postdeploy job. If this is not configured,
1077    /// the postdeploy job will not be present.
1078    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1079
1080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1081}
1082
1083impl Standard {
1084    /// Creates a new default instance.
1085    pub fn new() -> Self {
1086        std::default::Default::default()
1087    }
1088
1089    /// Sets the value of [verify][crate::model::Standard::verify].
1090    ///
1091    /// # Example
1092    /// ```ignore,no_run
1093    /// # use google_cloud_deploy_v1::model::Standard;
1094    /// let x = Standard::new().set_verify(true);
1095    /// ```
1096    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1097        self.verify = v.into();
1098        self
1099    }
1100
1101    /// Sets the value of [predeploy][crate::model::Standard::predeploy].
1102    ///
1103    /// # Example
1104    /// ```ignore,no_run
1105    /// # use google_cloud_deploy_v1::model::Standard;
1106    /// use google_cloud_deploy_v1::model::Predeploy;
1107    /// let x = Standard::new().set_predeploy(Predeploy::default()/* use setters */);
1108    /// ```
1109    pub fn set_predeploy<T>(mut self, v: T) -> Self
1110    where
1111        T: std::convert::Into<crate::model::Predeploy>,
1112    {
1113        self.predeploy = std::option::Option::Some(v.into());
1114        self
1115    }
1116
1117    /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
1118    ///
1119    /// # Example
1120    /// ```ignore,no_run
1121    /// # use google_cloud_deploy_v1::model::Standard;
1122    /// use google_cloud_deploy_v1::model::Predeploy;
1123    /// let x = Standard::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1124    /// let x = Standard::new().set_or_clear_predeploy(None::<Predeploy>);
1125    /// ```
1126    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1127    where
1128        T: std::convert::Into<crate::model::Predeploy>,
1129    {
1130        self.predeploy = v.map(|x| x.into());
1131        self
1132    }
1133
1134    /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
1135    ///
1136    /// # Example
1137    /// ```ignore,no_run
1138    /// # use google_cloud_deploy_v1::model::Standard;
1139    /// use google_cloud_deploy_v1::model::Postdeploy;
1140    /// let x = Standard::new().set_postdeploy(Postdeploy::default()/* use setters */);
1141    /// ```
1142    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1143    where
1144        T: std::convert::Into<crate::model::Postdeploy>,
1145    {
1146        self.postdeploy = std::option::Option::Some(v.into());
1147        self
1148    }
1149
1150    /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
1151    ///
1152    /// # Example
1153    /// ```ignore,no_run
1154    /// # use google_cloud_deploy_v1::model::Standard;
1155    /// use google_cloud_deploy_v1::model::Postdeploy;
1156    /// let x = Standard::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1157    /// let x = Standard::new().set_or_clear_postdeploy(None::<Postdeploy>);
1158    /// ```
1159    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1160    where
1161        T: std::convert::Into<crate::model::Postdeploy>,
1162    {
1163        self.postdeploy = v.map(|x| x.into());
1164        self
1165    }
1166}
1167
1168impl wkt::message::Message for Standard {
1169    fn typename() -> &'static str {
1170        "type.googleapis.com/google.cloud.deploy.v1.Standard"
1171    }
1172}
1173
1174/// Canary represents the canary deployment strategy.
1175#[derive(Clone, Default, PartialEq)]
1176#[non_exhaustive]
1177pub struct Canary {
1178    /// Optional. Runtime specific configurations for the deployment strategy. The
1179    /// runtime configuration is used to determine how Cloud Deploy will split
1180    /// traffic to enable a progressive deployment.
1181    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1182
1183    /// The mode to use for the canary deployment strategy.
1184    pub mode: std::option::Option<crate::model::canary::Mode>,
1185
1186    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1187}
1188
1189impl Canary {
1190    /// Creates a new default instance.
1191    pub fn new() -> Self {
1192        std::default::Default::default()
1193    }
1194
1195    /// Sets the value of [runtime_config][crate::model::Canary::runtime_config].
1196    ///
1197    /// # Example
1198    /// ```ignore,no_run
1199    /// # use google_cloud_deploy_v1::model::Canary;
1200    /// use google_cloud_deploy_v1::model::RuntimeConfig;
1201    /// let x = Canary::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
1202    /// ```
1203    pub fn set_runtime_config<T>(mut self, v: T) -> Self
1204    where
1205        T: std::convert::Into<crate::model::RuntimeConfig>,
1206    {
1207        self.runtime_config = std::option::Option::Some(v.into());
1208        self
1209    }
1210
1211    /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
1212    ///
1213    /// # Example
1214    /// ```ignore,no_run
1215    /// # use google_cloud_deploy_v1::model::Canary;
1216    /// use google_cloud_deploy_v1::model::RuntimeConfig;
1217    /// let x = Canary::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
1218    /// let x = Canary::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
1219    /// ```
1220    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1221    where
1222        T: std::convert::Into<crate::model::RuntimeConfig>,
1223    {
1224        self.runtime_config = v.map(|x| x.into());
1225        self
1226    }
1227
1228    /// Sets the value of [mode][crate::model::Canary::mode].
1229    ///
1230    /// Note that all the setters affecting `mode` are mutually
1231    /// exclusive.
1232    ///
1233    /// # Example
1234    /// ```ignore,no_run
1235    /// # use google_cloud_deploy_v1::model::Canary;
1236    /// use google_cloud_deploy_v1::model::CanaryDeployment;
1237    /// let x = Canary::new().set_mode(Some(
1238    ///     google_cloud_deploy_v1::model::canary::Mode::CanaryDeployment(CanaryDeployment::default().into())));
1239    /// ```
1240    pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
1241        mut self,
1242        v: T,
1243    ) -> Self {
1244        self.mode = v.into();
1245        self
1246    }
1247
1248    /// The value of [mode][crate::model::Canary::mode]
1249    /// if it holds a `CanaryDeployment`, `None` if the field is not set or
1250    /// holds a different branch.
1251    pub fn canary_deployment(
1252        &self,
1253    ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
1254        #[allow(unreachable_patterns)]
1255        self.mode.as_ref().and_then(|v| match v {
1256            crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
1257            _ => std::option::Option::None,
1258        })
1259    }
1260
1261    /// Sets the value of [mode][crate::model::Canary::mode]
1262    /// to hold a `CanaryDeployment`.
1263    ///
1264    /// Note that all the setters affecting `mode` are
1265    /// mutually exclusive.
1266    ///
1267    /// # Example
1268    /// ```ignore,no_run
1269    /// # use google_cloud_deploy_v1::model::Canary;
1270    /// use google_cloud_deploy_v1::model::CanaryDeployment;
1271    /// let x = Canary::new().set_canary_deployment(CanaryDeployment::default()/* use setters */);
1272    /// assert!(x.canary_deployment().is_some());
1273    /// assert!(x.custom_canary_deployment().is_none());
1274    /// ```
1275    pub fn set_canary_deployment<
1276        T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
1277    >(
1278        mut self,
1279        v: T,
1280    ) -> Self {
1281        self.mode =
1282            std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
1283        self
1284    }
1285
1286    /// The value of [mode][crate::model::Canary::mode]
1287    /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
1288    /// holds a different branch.
1289    pub fn custom_canary_deployment(
1290        &self,
1291    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
1292        #[allow(unreachable_patterns)]
1293        self.mode.as_ref().and_then(|v| match v {
1294            crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
1295            _ => std::option::Option::None,
1296        })
1297    }
1298
1299    /// Sets the value of [mode][crate::model::Canary::mode]
1300    /// to hold a `CustomCanaryDeployment`.
1301    ///
1302    /// Note that all the setters affecting `mode` are
1303    /// mutually exclusive.
1304    ///
1305    /// # Example
1306    /// ```ignore,no_run
1307    /// # use google_cloud_deploy_v1::model::Canary;
1308    /// use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1309    /// let x = Canary::new().set_custom_canary_deployment(CustomCanaryDeployment::default()/* use setters */);
1310    /// assert!(x.custom_canary_deployment().is_some());
1311    /// assert!(x.canary_deployment().is_none());
1312    /// ```
1313    pub fn set_custom_canary_deployment<
1314        T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
1315    >(
1316        mut self,
1317        v: T,
1318    ) -> Self {
1319        self.mode =
1320            std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
1321        self
1322    }
1323}
1324
1325impl wkt::message::Message for Canary {
1326    fn typename() -> &'static str {
1327        "type.googleapis.com/google.cloud.deploy.v1.Canary"
1328    }
1329}
1330
1331/// Defines additional types related to [Canary].
1332pub mod canary {
1333    #[allow(unused_imports)]
1334    use super::*;
1335
1336    /// The mode to use for the canary deployment strategy.
1337    #[derive(Clone, Debug, PartialEq)]
1338    #[non_exhaustive]
1339    pub enum Mode {
1340        /// Optional. Configures the progressive based deployment for a Target.
1341        CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
1342        /// Optional. Configures the progressive based deployment for a Target, but
1343        /// allows customizing at the phase level where a phase represents each of
1344        /// the percentage deployments.
1345        CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
1346    }
1347}
1348
1349/// CanaryDeployment represents the canary deployment configuration
1350#[derive(Clone, Default, PartialEq)]
1351#[non_exhaustive]
1352pub struct CanaryDeployment {
1353    /// Required. The percentage based deployments that will occur as a part of a
1354    /// `Rollout`. List is expected in ascending order and each integer n is
1355    /// 0 <= n < 100.
1356    /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
1357    /// n is 0 <= n <= 100.
1358    pub percentages: std::vec::Vec<i32>,
1359
1360    /// Optional. Whether to run verify tests after each percentage deployment via
1361    /// `skaffold verify`.
1362    pub verify: bool,
1363
1364    /// Optional. Configuration for the predeploy job of the first phase. If this
1365    /// is not configured, there will be no predeploy job for this phase.
1366    pub predeploy: std::option::Option<crate::model::Predeploy>,
1367
1368    /// Optional. Configuration for the postdeploy job of the last phase. If this
1369    /// is not configured, there will be no postdeploy job for this phase.
1370    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1371
1372    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1373}
1374
1375impl CanaryDeployment {
1376    /// Creates a new default instance.
1377    pub fn new() -> Self {
1378        std::default::Default::default()
1379    }
1380
1381    /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1382    ///
1383    /// # Example
1384    /// ```ignore,no_run
1385    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1386    /// let x = CanaryDeployment::new().set_percentages([1, 2, 3]);
1387    /// ```
1388    pub fn set_percentages<T, V>(mut self, v: T) -> Self
1389    where
1390        T: std::iter::IntoIterator<Item = V>,
1391        V: std::convert::Into<i32>,
1392    {
1393        use std::iter::Iterator;
1394        self.percentages = v.into_iter().map(|i| i.into()).collect();
1395        self
1396    }
1397
1398    /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1399    ///
1400    /// # Example
1401    /// ```ignore,no_run
1402    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1403    /// let x = CanaryDeployment::new().set_verify(true);
1404    /// ```
1405    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1406        self.verify = v.into();
1407        self
1408    }
1409
1410    /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1411    ///
1412    /// # Example
1413    /// ```ignore,no_run
1414    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1415    /// use google_cloud_deploy_v1::model::Predeploy;
1416    /// let x = CanaryDeployment::new().set_predeploy(Predeploy::default()/* use setters */);
1417    /// ```
1418    pub fn set_predeploy<T>(mut self, v: T) -> Self
1419    where
1420        T: std::convert::Into<crate::model::Predeploy>,
1421    {
1422        self.predeploy = std::option::Option::Some(v.into());
1423        self
1424    }
1425
1426    /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1427    ///
1428    /// # Example
1429    /// ```ignore,no_run
1430    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1431    /// use google_cloud_deploy_v1::model::Predeploy;
1432    /// let x = CanaryDeployment::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1433    /// let x = CanaryDeployment::new().set_or_clear_predeploy(None::<Predeploy>);
1434    /// ```
1435    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1436    where
1437        T: std::convert::Into<crate::model::Predeploy>,
1438    {
1439        self.predeploy = v.map(|x| x.into());
1440        self
1441    }
1442
1443    /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1444    ///
1445    /// # Example
1446    /// ```ignore,no_run
1447    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1448    /// use google_cloud_deploy_v1::model::Postdeploy;
1449    /// let x = CanaryDeployment::new().set_postdeploy(Postdeploy::default()/* use setters */);
1450    /// ```
1451    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1452    where
1453        T: std::convert::Into<crate::model::Postdeploy>,
1454    {
1455        self.postdeploy = std::option::Option::Some(v.into());
1456        self
1457    }
1458
1459    /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1460    ///
1461    /// # Example
1462    /// ```ignore,no_run
1463    /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1464    /// use google_cloud_deploy_v1::model::Postdeploy;
1465    /// let x = CanaryDeployment::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1466    /// let x = CanaryDeployment::new().set_or_clear_postdeploy(None::<Postdeploy>);
1467    /// ```
1468    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1469    where
1470        T: std::convert::Into<crate::model::Postdeploy>,
1471    {
1472        self.postdeploy = v.map(|x| x.into());
1473        self
1474    }
1475}
1476
1477impl wkt::message::Message for CanaryDeployment {
1478    fn typename() -> &'static str {
1479        "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1480    }
1481}
1482
1483/// CustomCanaryDeployment represents the custom canary deployment
1484/// configuration.
1485#[derive(Clone, Default, PartialEq)]
1486#[non_exhaustive]
1487pub struct CustomCanaryDeployment {
1488    /// Required. Configuration for each phase in the canary deployment in the
1489    /// order executed.
1490    pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1491
1492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1493}
1494
1495impl CustomCanaryDeployment {
1496    /// Creates a new default instance.
1497    pub fn new() -> Self {
1498        std::default::Default::default()
1499    }
1500
1501    /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1502    ///
1503    /// # Example
1504    /// ```ignore,no_run
1505    /// # use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1506    /// use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1507    /// let x = CustomCanaryDeployment::new()
1508    ///     .set_phase_configs([
1509    ///         PhaseConfig::default()/* use setters */,
1510    ///         PhaseConfig::default()/* use (different) setters */,
1511    ///     ]);
1512    /// ```
1513    pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1514    where
1515        T: std::iter::IntoIterator<Item = V>,
1516        V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1517    {
1518        use std::iter::Iterator;
1519        self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1520        self
1521    }
1522}
1523
1524impl wkt::message::Message for CustomCanaryDeployment {
1525    fn typename() -> &'static str {
1526        "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1527    }
1528}
1529
1530/// Defines additional types related to [CustomCanaryDeployment].
1531pub mod custom_canary_deployment {
1532    #[allow(unused_imports)]
1533    use super::*;
1534
1535    /// PhaseConfig represents the configuration for a phase in the custom
1536    /// canary deployment.
1537    #[derive(Clone, Default, PartialEq)]
1538    #[non_exhaustive]
1539    pub struct PhaseConfig {
1540        /// Required. The ID to assign to the `Rollout` phase.
1541        /// This value must consist of lower-case letters, numbers, and hyphens,
1542        /// start with a letter and end with a letter or a number, and have a max
1543        /// length of 63 characters. In other words, it must match the following
1544        /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1545        pub phase_id: std::string::String,
1546
1547        /// Required. Percentage deployment for the phase.
1548        pub percentage: i32,
1549
1550        /// Optional. Skaffold profiles to use when rendering the manifest for this
1551        /// phase. These are in addition to the profiles list specified in the
1552        /// `DeliveryPipeline` stage.
1553        pub profiles: std::vec::Vec<std::string::String>,
1554
1555        /// Optional. Whether to run verify tests after the deployment via `skaffold
1556        /// verify`.
1557        pub verify: bool,
1558
1559        /// Optional. Configuration for the predeploy job of this phase. If this is
1560        /// not configured, there will be no predeploy job for this phase.
1561        pub predeploy: std::option::Option<crate::model::Predeploy>,
1562
1563        /// Optional. Configuration for the postdeploy job of this phase. If this is
1564        /// not configured, there will be no postdeploy job for this phase.
1565        pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1566
1567        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1568    }
1569
1570    impl PhaseConfig {
1571        /// Creates a new default instance.
1572        pub fn new() -> Self {
1573            std::default::Default::default()
1574        }
1575
1576        /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1577        ///
1578        /// # Example
1579        /// ```ignore,no_run
1580        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1581        /// let x = PhaseConfig::new().set_phase_id("example");
1582        /// ```
1583        pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1584            self.phase_id = v.into();
1585            self
1586        }
1587
1588        /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1589        ///
1590        /// # Example
1591        /// ```ignore,no_run
1592        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1593        /// let x = PhaseConfig::new().set_percentage(42);
1594        /// ```
1595        pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1596            self.percentage = v.into();
1597            self
1598        }
1599
1600        /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1601        ///
1602        /// # Example
1603        /// ```ignore,no_run
1604        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1605        /// let x = PhaseConfig::new().set_profiles(["a", "b", "c"]);
1606        /// ```
1607        pub fn set_profiles<T, V>(mut self, v: T) -> Self
1608        where
1609            T: std::iter::IntoIterator<Item = V>,
1610            V: std::convert::Into<std::string::String>,
1611        {
1612            use std::iter::Iterator;
1613            self.profiles = v.into_iter().map(|i| i.into()).collect();
1614            self
1615        }
1616
1617        /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1618        ///
1619        /// # Example
1620        /// ```ignore,no_run
1621        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1622        /// let x = PhaseConfig::new().set_verify(true);
1623        /// ```
1624        pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1625            self.verify = v.into();
1626            self
1627        }
1628
1629        /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1630        ///
1631        /// # Example
1632        /// ```ignore,no_run
1633        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1634        /// use google_cloud_deploy_v1::model::Predeploy;
1635        /// let x = PhaseConfig::new().set_predeploy(Predeploy::default()/* use setters */);
1636        /// ```
1637        pub fn set_predeploy<T>(mut self, v: T) -> Self
1638        where
1639            T: std::convert::Into<crate::model::Predeploy>,
1640        {
1641            self.predeploy = std::option::Option::Some(v.into());
1642            self
1643        }
1644
1645        /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1646        ///
1647        /// # Example
1648        /// ```ignore,no_run
1649        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1650        /// use google_cloud_deploy_v1::model::Predeploy;
1651        /// let x = PhaseConfig::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1652        /// let x = PhaseConfig::new().set_or_clear_predeploy(None::<Predeploy>);
1653        /// ```
1654        pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1655        where
1656            T: std::convert::Into<crate::model::Predeploy>,
1657        {
1658            self.predeploy = v.map(|x| x.into());
1659            self
1660        }
1661
1662        /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1663        ///
1664        /// # Example
1665        /// ```ignore,no_run
1666        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1667        /// use google_cloud_deploy_v1::model::Postdeploy;
1668        /// let x = PhaseConfig::new().set_postdeploy(Postdeploy::default()/* use setters */);
1669        /// ```
1670        pub fn set_postdeploy<T>(mut self, v: T) -> Self
1671        where
1672            T: std::convert::Into<crate::model::Postdeploy>,
1673        {
1674            self.postdeploy = std::option::Option::Some(v.into());
1675            self
1676        }
1677
1678        /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1679        ///
1680        /// # Example
1681        /// ```ignore,no_run
1682        /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1683        /// use google_cloud_deploy_v1::model::Postdeploy;
1684        /// let x = PhaseConfig::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1685        /// let x = PhaseConfig::new().set_or_clear_postdeploy(None::<Postdeploy>);
1686        /// ```
1687        pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1688        where
1689            T: std::convert::Into<crate::model::Postdeploy>,
1690        {
1691            self.postdeploy = v.map(|x| x.into());
1692            self
1693        }
1694    }
1695
1696    impl wkt::message::Message for PhaseConfig {
1697        fn typename() -> &'static str {
1698            "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1699        }
1700    }
1701}
1702
1703/// KubernetesConfig contains the Kubernetes runtime configuration.
1704#[derive(Clone, Default, PartialEq)]
1705#[non_exhaustive]
1706pub struct KubernetesConfig {
1707    /// The service definition configuration.
1708    pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1709
1710    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1711}
1712
1713impl KubernetesConfig {
1714    /// Creates a new default instance.
1715    pub fn new() -> Self {
1716        std::default::Default::default()
1717    }
1718
1719    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1720    ///
1721    /// Note that all the setters affecting `service_definition` are mutually
1722    /// exclusive.
1723    ///
1724    /// # Example
1725    /// ```ignore,no_run
1726    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1727    /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1728    /// let x = KubernetesConfig::new().set_service_definition(Some(
1729    ///     google_cloud_deploy_v1::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(GatewayServiceMesh::default().into())));
1730    /// ```
1731    pub fn set_service_definition<
1732        T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1733    >(
1734        mut self,
1735        v: T,
1736    ) -> Self {
1737        self.service_definition = v.into();
1738        self
1739    }
1740
1741    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1742    /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1743    /// holds a different branch.
1744    pub fn gateway_service_mesh(
1745        &self,
1746    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1747    {
1748        #[allow(unreachable_patterns)]
1749        self.service_definition.as_ref().and_then(|v| match v {
1750            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1751                std::option::Option::Some(v)
1752            }
1753            _ => std::option::Option::None,
1754        })
1755    }
1756
1757    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1758    /// to hold a `GatewayServiceMesh`.
1759    ///
1760    /// Note that all the setters affecting `service_definition` are
1761    /// mutually exclusive.
1762    ///
1763    /// # Example
1764    /// ```ignore,no_run
1765    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1766    /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1767    /// let x = KubernetesConfig::new().set_gateway_service_mesh(GatewayServiceMesh::default()/* use setters */);
1768    /// assert!(x.gateway_service_mesh().is_some());
1769    /// assert!(x.service_networking().is_none());
1770    /// ```
1771    pub fn set_gateway_service_mesh<
1772        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1773    >(
1774        mut self,
1775        v: T,
1776    ) -> Self {
1777        self.service_definition = std::option::Option::Some(
1778            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1779        );
1780        self
1781    }
1782
1783    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1784    /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1785    /// holds a different branch.
1786    pub fn service_networking(
1787        &self,
1788    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1789    {
1790        #[allow(unreachable_patterns)]
1791        self.service_definition.as_ref().and_then(|v| match v {
1792            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1793                std::option::Option::Some(v)
1794            }
1795            _ => std::option::Option::None,
1796        })
1797    }
1798
1799    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1800    /// to hold a `ServiceNetworking`.
1801    ///
1802    /// Note that all the setters affecting `service_definition` are
1803    /// mutually exclusive.
1804    ///
1805    /// # Example
1806    /// ```ignore,no_run
1807    /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1808    /// use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
1809    /// let x = KubernetesConfig::new().set_service_networking(ServiceNetworking::default()/* use setters */);
1810    /// assert!(x.service_networking().is_some());
1811    /// assert!(x.gateway_service_mesh().is_none());
1812    /// ```
1813    pub fn set_service_networking<
1814        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1815    >(
1816        mut self,
1817        v: T,
1818    ) -> Self {
1819        self.service_definition = std::option::Option::Some(
1820            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1821        );
1822        self
1823    }
1824}
1825
1826impl wkt::message::Message for KubernetesConfig {
1827    fn typename() -> &'static str {
1828        "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1829    }
1830}
1831
1832/// Defines additional types related to [KubernetesConfig].
1833pub mod kubernetes_config {
1834    #[allow(unused_imports)]
1835    use super::*;
1836
1837    /// Information about the Kubernetes Gateway API service mesh configuration.
1838    #[derive(Clone, Default, PartialEq)]
1839    #[non_exhaustive]
1840    pub struct GatewayServiceMesh {
1841        /// Required. Name of the Gateway API HTTPRoute.
1842        pub http_route: std::string::String,
1843
1844        /// Required. Name of the Kubernetes Service.
1845        pub service: std::string::String,
1846
1847        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1848        /// the specified HTTPRoute and Service.
1849        pub deployment: std::string::String,
1850
1851        /// Optional. The time to wait for route updates to propagate. The maximum
1852        /// configurable time is 3 hours, in seconds format. If unspecified, there is
1853        /// no wait time.
1854        pub route_update_wait_time: std::option::Option<wkt::Duration>,
1855
1856        /// Optional. The amount of time to migrate traffic back from the canary
1857        /// Service to the original Service during the stable phase deployment. If
1858        /// specified, must be between 15s and 3600s. If unspecified, there is no
1859        /// cutback time.
1860        pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1861
1862        /// Optional. The label to use when selecting Pods for the Deployment and
1863        /// Service resources. This label must already be present in both resources.
1864        pub pod_selector_label: std::string::String,
1865
1866        /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1867        /// to be deployed to additional clusters. This option is available for
1868        /// multi-cluster service mesh set ups that require the route to exist in the
1869        /// clusters that call the service. If unspecified, the HTTPRoute will only
1870        /// be deployed to the Target cluster.
1871        pub route_destinations: std::option::Option<
1872            crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1873        >,
1874
1875        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1876    }
1877
1878    impl GatewayServiceMesh {
1879        /// Creates a new default instance.
1880        pub fn new() -> Self {
1881            std::default::Default::default()
1882        }
1883
1884        /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1885        ///
1886        /// # Example
1887        /// ```ignore,no_run
1888        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1889        /// let x = GatewayServiceMesh::new().set_http_route("example");
1890        /// ```
1891        pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1892            self.http_route = v.into();
1893            self
1894        }
1895
1896        /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1897        ///
1898        /// # Example
1899        /// ```ignore,no_run
1900        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1901        /// let x = GatewayServiceMesh::new().set_service("example");
1902        /// ```
1903        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1904            self.service = v.into();
1905            self
1906        }
1907
1908        /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1909        ///
1910        /// # Example
1911        /// ```ignore,no_run
1912        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1913        /// let x = GatewayServiceMesh::new().set_deployment("example");
1914        /// ```
1915        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1916            self.deployment = v.into();
1917            self
1918        }
1919
1920        /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1921        ///
1922        /// # Example
1923        /// ```ignore,no_run
1924        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1925        /// use wkt::Duration;
1926        /// let x = GatewayServiceMesh::new().set_route_update_wait_time(Duration::default()/* use setters */);
1927        /// ```
1928        pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1929        where
1930            T: std::convert::Into<wkt::Duration>,
1931        {
1932            self.route_update_wait_time = std::option::Option::Some(v.into());
1933            self
1934        }
1935
1936        /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
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_or_clear_route_update_wait_time(Some(Duration::default()/* use setters */));
1943        /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(None::<Duration>);
1944        /// ```
1945        pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1946        where
1947            T: std::convert::Into<wkt::Duration>,
1948        {
1949            self.route_update_wait_time = v.map(|x| x.into());
1950            self
1951        }
1952
1953        /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1954        ///
1955        /// # Example
1956        /// ```ignore,no_run
1957        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1958        /// use wkt::Duration;
1959        /// let x = GatewayServiceMesh::new().set_stable_cutback_duration(Duration::default()/* use setters */);
1960        /// ```
1961        pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1962        where
1963            T: std::convert::Into<wkt::Duration>,
1964        {
1965            self.stable_cutback_duration = std::option::Option::Some(v.into());
1966            self
1967        }
1968
1969        /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1970        ///
1971        /// # Example
1972        /// ```ignore,no_run
1973        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1974        /// use wkt::Duration;
1975        /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(Some(Duration::default()/* use setters */));
1976        /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(None::<Duration>);
1977        /// ```
1978        pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1979        where
1980            T: std::convert::Into<wkt::Duration>,
1981        {
1982            self.stable_cutback_duration = v.map(|x| x.into());
1983            self
1984        }
1985
1986        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1987        ///
1988        /// # Example
1989        /// ```ignore,no_run
1990        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1991        /// let x = GatewayServiceMesh::new().set_pod_selector_label("example");
1992        /// ```
1993        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1994            mut self,
1995            v: T,
1996        ) -> Self {
1997            self.pod_selector_label = v.into();
1998            self
1999        }
2000
2001        /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2002        ///
2003        /// # Example
2004        /// ```ignore,no_run
2005        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2006        /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2007        /// let x = GatewayServiceMesh::new().set_route_destinations(RouteDestinations::default()/* use setters */);
2008        /// ```
2009        pub fn set_route_destinations<T>(mut self, v: T) -> Self
2010        where
2011            T: std::convert::Into<
2012                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2013                >,
2014        {
2015            self.route_destinations = std::option::Option::Some(v.into());
2016            self
2017        }
2018
2019        /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2020        ///
2021        /// # Example
2022        /// ```ignore,no_run
2023        /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2024        /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2025        /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(Some(RouteDestinations::default()/* use setters */));
2026        /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(None::<RouteDestinations>);
2027        /// ```
2028        pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
2029        where
2030            T: std::convert::Into<
2031                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2032                >,
2033        {
2034            self.route_destinations = v.map(|x| x.into());
2035            self
2036        }
2037    }
2038
2039    impl wkt::message::Message for GatewayServiceMesh {
2040        fn typename() -> &'static str {
2041            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
2042        }
2043    }
2044
2045    /// Defines additional types related to [GatewayServiceMesh].
2046    pub mod gateway_service_mesh {
2047        #[allow(unused_imports)]
2048        use super::*;
2049
2050        /// Information about route destinations for the Gateway API service mesh.
2051        #[derive(Clone, Default, PartialEq)]
2052        #[non_exhaustive]
2053        pub struct RouteDestinations {
2054            /// Required. The clusters where the Gateway API HTTPRoute resource will be
2055            /// deployed to. Valid entries include the associated entities IDs
2056            /// configured in the Target resource and "@self" to include the Target
2057            /// cluster.
2058            pub destination_ids: std::vec::Vec<std::string::String>,
2059
2060            /// Optional. Whether to propagate the Kubernetes Service to the route
2061            /// destination clusters. The Service will always be deployed to the Target
2062            /// cluster even if the HTTPRoute is not. This option may be used to
2063            /// facilitate successful DNS lookup in the route destination clusters. Can
2064            /// only be set to true if destinations are specified.
2065            pub propagate_service: bool,
2066
2067            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2068        }
2069
2070        impl RouteDestinations {
2071            /// Creates a new default instance.
2072            pub fn new() -> Self {
2073                std::default::Default::default()
2074            }
2075
2076            /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
2077            ///
2078            /// # Example
2079            /// ```ignore,no_run
2080            /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2081            /// let x = RouteDestinations::new().set_destination_ids(["a", "b", "c"]);
2082            /// ```
2083            pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
2084            where
2085                T: std::iter::IntoIterator<Item = V>,
2086                V: std::convert::Into<std::string::String>,
2087            {
2088                use std::iter::Iterator;
2089                self.destination_ids = v.into_iter().map(|i| i.into()).collect();
2090                self
2091            }
2092
2093            /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
2094            ///
2095            /// # Example
2096            /// ```ignore,no_run
2097            /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2098            /// let x = RouteDestinations::new().set_propagate_service(true);
2099            /// ```
2100            pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2101                self.propagate_service = v.into();
2102                self
2103            }
2104        }
2105
2106        impl wkt::message::Message for RouteDestinations {
2107            fn typename() -> &'static str {
2108                "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
2109            }
2110        }
2111    }
2112
2113    /// Information about the Kubernetes Service networking configuration.
2114    #[derive(Clone, Default, PartialEq)]
2115    #[non_exhaustive]
2116    pub struct ServiceNetworking {
2117        /// Required. Name of the Kubernetes Service.
2118        pub service: std::string::String,
2119
2120        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
2121        /// the specified Service.
2122        pub deployment: std::string::String,
2123
2124        /// Optional. Whether to disable Pod overprovisioning. If Pod
2125        /// overprovisioning is disabled then Cloud Deploy will limit the number of
2126        /// total Pods used for the deployment strategy to the number of Pods the
2127        /// Deployment has on the cluster.
2128        pub disable_pod_overprovisioning: bool,
2129
2130        /// Optional. The label to use when selecting Pods for the Deployment
2131        /// resource. This label must already be present in the Deployment.
2132        pub pod_selector_label: std::string::String,
2133
2134        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2135    }
2136
2137    impl ServiceNetworking {
2138        /// Creates a new default instance.
2139        pub fn new() -> Self {
2140            std::default::Default::default()
2141        }
2142
2143        /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
2144        ///
2145        /// # Example
2146        /// ```ignore,no_run
2147        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2148        /// let x = ServiceNetworking::new().set_service("example");
2149        /// ```
2150        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2151            self.service = v.into();
2152            self
2153        }
2154
2155        /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
2156        ///
2157        /// # Example
2158        /// ```ignore,no_run
2159        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2160        /// let x = ServiceNetworking::new().set_deployment("example");
2161        /// ```
2162        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2163            self.deployment = v.into();
2164            self
2165        }
2166
2167        /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
2168        ///
2169        /// # Example
2170        /// ```ignore,no_run
2171        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2172        /// let x = ServiceNetworking::new().set_disable_pod_overprovisioning(true);
2173        /// ```
2174        pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
2175            mut self,
2176            v: T,
2177        ) -> Self {
2178            self.disable_pod_overprovisioning = v.into();
2179            self
2180        }
2181
2182        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
2183        ///
2184        /// # Example
2185        /// ```ignore,no_run
2186        /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2187        /// let x = ServiceNetworking::new().set_pod_selector_label("example");
2188        /// ```
2189        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
2190            mut self,
2191            v: T,
2192        ) -> Self {
2193            self.pod_selector_label = v.into();
2194            self
2195        }
2196    }
2197
2198    impl wkt::message::Message for ServiceNetworking {
2199        fn typename() -> &'static str {
2200            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
2201        }
2202    }
2203
2204    /// The service definition configuration.
2205    #[derive(Clone, Debug, PartialEq)]
2206    #[non_exhaustive]
2207    pub enum ServiceDefinition {
2208        /// Optional. Kubernetes Gateway API service mesh configuration.
2209        GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
2210        /// Optional. Kubernetes Service networking configuration.
2211        ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
2212    }
2213}
2214
2215/// CloudRunConfig contains the Cloud Run runtime configuration.
2216#[derive(Clone, Default, PartialEq)]
2217#[non_exhaustive]
2218pub struct CloudRunConfig {
2219    /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
2220    /// Run Service on the user's behalf to facilitate traffic splitting. This is
2221    /// required to be true for CanaryDeployments, but optional for
2222    /// CustomCanaryDeployments.
2223    pub automatic_traffic_control: bool,
2224
2225    /// Optional. A list of tags that are added to the canary revision while the
2226    /// canary phase is in progress.
2227    pub canary_revision_tags: std::vec::Vec<std::string::String>,
2228
2229    /// Optional. A list of tags that are added to the prior revision while the
2230    /// canary phase is in progress.
2231    pub prior_revision_tags: std::vec::Vec<std::string::String>,
2232
2233    /// Optional. A list of tags that are added to the final stable revision when
2234    /// the stable phase is applied.
2235    pub stable_revision_tags: std::vec::Vec<std::string::String>,
2236
2237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2238}
2239
2240impl CloudRunConfig {
2241    /// Creates a new default instance.
2242    pub fn new() -> Self {
2243        std::default::Default::default()
2244    }
2245
2246    /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
2247    ///
2248    /// # Example
2249    /// ```ignore,no_run
2250    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2251    /// let x = CloudRunConfig::new().set_automatic_traffic_control(true);
2252    /// ```
2253    pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2254        self.automatic_traffic_control = v.into();
2255        self
2256    }
2257
2258    /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
2259    ///
2260    /// # Example
2261    /// ```ignore,no_run
2262    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2263    /// let x = CloudRunConfig::new().set_canary_revision_tags(["a", "b", "c"]);
2264    /// ```
2265    pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
2266    where
2267        T: std::iter::IntoIterator<Item = V>,
2268        V: std::convert::Into<std::string::String>,
2269    {
2270        use std::iter::Iterator;
2271        self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
2272        self
2273    }
2274
2275    /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
2276    ///
2277    /// # Example
2278    /// ```ignore,no_run
2279    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2280    /// let x = CloudRunConfig::new().set_prior_revision_tags(["a", "b", "c"]);
2281    /// ```
2282    pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
2283    where
2284        T: std::iter::IntoIterator<Item = V>,
2285        V: std::convert::Into<std::string::String>,
2286    {
2287        use std::iter::Iterator;
2288        self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
2289        self
2290    }
2291
2292    /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
2293    ///
2294    /// # Example
2295    /// ```ignore,no_run
2296    /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2297    /// let x = CloudRunConfig::new().set_stable_revision_tags(["a", "b", "c"]);
2298    /// ```
2299    pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
2300    where
2301        T: std::iter::IntoIterator<Item = V>,
2302        V: std::convert::Into<std::string::String>,
2303    {
2304        use std::iter::Iterator;
2305        self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
2306        self
2307    }
2308}
2309
2310impl wkt::message::Message for CloudRunConfig {
2311    fn typename() -> &'static str {
2312        "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
2313    }
2314}
2315
2316/// RuntimeConfig contains the runtime specific configurations for a deployment
2317/// strategy.
2318#[derive(Clone, Default, PartialEq)]
2319#[non_exhaustive]
2320pub struct RuntimeConfig {
2321    /// The runtime configuration details.
2322    pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
2323
2324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2325}
2326
2327impl RuntimeConfig {
2328    /// Creates a new default instance.
2329    pub fn new() -> Self {
2330        std::default::Default::default()
2331    }
2332
2333    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
2334    ///
2335    /// Note that all the setters affecting `runtime_config` are mutually
2336    /// exclusive.
2337    ///
2338    /// # Example
2339    /// ```ignore,no_run
2340    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2341    /// use google_cloud_deploy_v1::model::KubernetesConfig;
2342    /// let x = RuntimeConfig::new().set_runtime_config(Some(
2343    ///     google_cloud_deploy_v1::model::runtime_config::RuntimeConfig::Kubernetes(KubernetesConfig::default().into())));
2344    /// ```
2345    pub fn set_runtime_config<
2346        T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
2347    >(
2348        mut self,
2349        v: T,
2350    ) -> Self {
2351        self.runtime_config = v.into();
2352        self
2353    }
2354
2355    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2356    /// if it holds a `Kubernetes`, `None` if the field is not set or
2357    /// holds a different branch.
2358    pub fn kubernetes(
2359        &self,
2360    ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
2361        #[allow(unreachable_patterns)]
2362        self.runtime_config.as_ref().and_then(|v| match v {
2363            crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
2364                std::option::Option::Some(v)
2365            }
2366            _ => std::option::Option::None,
2367        })
2368    }
2369
2370    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2371    /// to hold a `Kubernetes`.
2372    ///
2373    /// Note that all the setters affecting `runtime_config` are
2374    /// mutually exclusive.
2375    ///
2376    /// # Example
2377    /// ```ignore,no_run
2378    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2379    /// use google_cloud_deploy_v1::model::KubernetesConfig;
2380    /// let x = RuntimeConfig::new().set_kubernetes(KubernetesConfig::default()/* use setters */);
2381    /// assert!(x.kubernetes().is_some());
2382    /// assert!(x.cloud_run().is_none());
2383    /// ```
2384    pub fn set_kubernetes<
2385        T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
2386    >(
2387        mut self,
2388        v: T,
2389    ) -> Self {
2390        self.runtime_config = std::option::Option::Some(
2391            crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
2392        );
2393        self
2394    }
2395
2396    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2397    /// if it holds a `CloudRun`, `None` if the field is not set or
2398    /// holds a different branch.
2399    pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
2400        #[allow(unreachable_patterns)]
2401        self.runtime_config.as_ref().and_then(|v| match v {
2402            crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
2403                std::option::Option::Some(v)
2404            }
2405            _ => std::option::Option::None,
2406        })
2407    }
2408
2409    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2410    /// to hold a `CloudRun`.
2411    ///
2412    /// Note that all the setters affecting `runtime_config` are
2413    /// mutually exclusive.
2414    ///
2415    /// # Example
2416    /// ```ignore,no_run
2417    /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2418    /// use google_cloud_deploy_v1::model::CloudRunConfig;
2419    /// let x = RuntimeConfig::new().set_cloud_run(CloudRunConfig::default()/* use setters */);
2420    /// assert!(x.cloud_run().is_some());
2421    /// assert!(x.kubernetes().is_none());
2422    /// ```
2423    pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
2424        mut self,
2425        v: T,
2426    ) -> Self {
2427        self.runtime_config = std::option::Option::Some(
2428            crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
2429        );
2430        self
2431    }
2432}
2433
2434impl wkt::message::Message for RuntimeConfig {
2435    fn typename() -> &'static str {
2436        "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
2437    }
2438}
2439
2440/// Defines additional types related to [RuntimeConfig].
2441pub mod runtime_config {
2442    #[allow(unused_imports)]
2443    use super::*;
2444
2445    /// The runtime configuration details.
2446    #[derive(Clone, Debug, PartialEq)]
2447    #[non_exhaustive]
2448    pub enum RuntimeConfig {
2449        /// Optional. Kubernetes runtime configuration.
2450        Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
2451        /// Optional. Cloud Run runtime configuration.
2452        CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
2453    }
2454}
2455
2456/// PipelineReadyCondition contains information around the status of the
2457/// Pipeline.
2458#[derive(Clone, Default, PartialEq)]
2459#[non_exhaustive]
2460pub struct PipelineReadyCondition {
2461    /// True if the Pipeline is in a valid state. Otherwise at least one condition
2462    /// in `PipelineCondition` is in an invalid state. Iterate over those
2463    /// conditions and see which condition(s) has status = false to find out what
2464    /// is wrong with the Pipeline.
2465    pub status: bool,
2466
2467    /// Last time the condition was updated.
2468    pub update_time: std::option::Option<wkt::Timestamp>,
2469
2470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2471}
2472
2473impl PipelineReadyCondition {
2474    /// Creates a new default instance.
2475    pub fn new() -> Self {
2476        std::default::Default::default()
2477    }
2478
2479    /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
2480    ///
2481    /// # Example
2482    /// ```ignore,no_run
2483    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2484    /// let x = PipelineReadyCondition::new().set_status(true);
2485    /// ```
2486    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2487        self.status = v.into();
2488        self
2489    }
2490
2491    /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2492    ///
2493    /// # Example
2494    /// ```ignore,no_run
2495    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2496    /// use wkt::Timestamp;
2497    /// let x = PipelineReadyCondition::new().set_update_time(Timestamp::default()/* use setters */);
2498    /// ```
2499    pub fn set_update_time<T>(mut self, v: T) -> Self
2500    where
2501        T: std::convert::Into<wkt::Timestamp>,
2502    {
2503        self.update_time = std::option::Option::Some(v.into());
2504        self
2505    }
2506
2507    /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2508    ///
2509    /// # Example
2510    /// ```ignore,no_run
2511    /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2512    /// use wkt::Timestamp;
2513    /// let x = PipelineReadyCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2514    /// let x = PipelineReadyCondition::new().set_or_clear_update_time(None::<Timestamp>);
2515    /// ```
2516    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2517    where
2518        T: std::convert::Into<wkt::Timestamp>,
2519    {
2520        self.update_time = v.map(|x| x.into());
2521        self
2522    }
2523}
2524
2525impl wkt::message::Message for PipelineReadyCondition {
2526    fn typename() -> &'static str {
2527        "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
2528    }
2529}
2530
2531/// `TargetsPresentCondition` contains information on any Targets referenced in
2532/// the Delivery Pipeline that do not actually exist.
2533#[derive(Clone, Default, PartialEq)]
2534#[non_exhaustive]
2535pub struct TargetsPresentCondition {
2536    /// True if there aren't any missing Targets.
2537    pub status: bool,
2538
2539    /// The list of Target names that do not exist. For example,
2540    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
2541    pub missing_targets: std::vec::Vec<std::string::String>,
2542
2543    /// Last time the condition was updated.
2544    pub update_time: std::option::Option<wkt::Timestamp>,
2545
2546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2547}
2548
2549impl TargetsPresentCondition {
2550    /// Creates a new default instance.
2551    pub fn new() -> Self {
2552        std::default::Default::default()
2553    }
2554
2555    /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
2556    ///
2557    /// # Example
2558    /// ```ignore,no_run
2559    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2560    /// let x = TargetsPresentCondition::new().set_status(true);
2561    /// ```
2562    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2563        self.status = v.into();
2564        self
2565    }
2566
2567    /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
2568    ///
2569    /// # Example
2570    /// ```ignore,no_run
2571    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2572    /// let x = TargetsPresentCondition::new().set_missing_targets(["a", "b", "c"]);
2573    /// ```
2574    pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
2575    where
2576        T: std::iter::IntoIterator<Item = V>,
2577        V: std::convert::Into<std::string::String>,
2578    {
2579        use std::iter::Iterator;
2580        self.missing_targets = v.into_iter().map(|i| i.into()).collect();
2581        self
2582    }
2583
2584    /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2585    ///
2586    /// # Example
2587    /// ```ignore,no_run
2588    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2589    /// use wkt::Timestamp;
2590    /// let x = TargetsPresentCondition::new().set_update_time(Timestamp::default()/* use setters */);
2591    /// ```
2592    pub fn set_update_time<T>(mut self, v: T) -> Self
2593    where
2594        T: std::convert::Into<wkt::Timestamp>,
2595    {
2596        self.update_time = std::option::Option::Some(v.into());
2597        self
2598    }
2599
2600    /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2601    ///
2602    /// # Example
2603    /// ```ignore,no_run
2604    /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2605    /// use wkt::Timestamp;
2606    /// let x = TargetsPresentCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2607    /// let x = TargetsPresentCondition::new().set_or_clear_update_time(None::<Timestamp>);
2608    /// ```
2609    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2610    where
2611        T: std::convert::Into<wkt::Timestamp>,
2612    {
2613        self.update_time = v.map(|x| x.into());
2614        self
2615    }
2616}
2617
2618impl wkt::message::Message for TargetsPresentCondition {
2619    fn typename() -> &'static str {
2620        "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
2621    }
2622}
2623
2624/// TargetsTypeCondition contains information on whether the Targets defined in
2625/// the Delivery Pipeline are of the same type.
2626#[derive(Clone, Default, PartialEq)]
2627#[non_exhaustive]
2628pub struct TargetsTypeCondition {
2629    /// True if the targets are all a comparable type. For example this is true if
2630    /// all targets are GKE clusters. This is false if some targets are Cloud Run
2631    /// targets and others are GKE clusters.
2632    pub status: bool,
2633
2634    /// Human readable error message.
2635    pub error_details: std::string::String,
2636
2637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2638}
2639
2640impl TargetsTypeCondition {
2641    /// Creates a new default instance.
2642    pub fn new() -> Self {
2643        std::default::Default::default()
2644    }
2645
2646    /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
2647    ///
2648    /// # Example
2649    /// ```ignore,no_run
2650    /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2651    /// let x = TargetsTypeCondition::new().set_status(true);
2652    /// ```
2653    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2654        self.status = v.into();
2655        self
2656    }
2657
2658    /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
2659    ///
2660    /// # Example
2661    /// ```ignore,no_run
2662    /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2663    /// let x = TargetsTypeCondition::new().set_error_details("example");
2664    /// ```
2665    pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2666        self.error_details = v.into();
2667        self
2668    }
2669}
2670
2671impl wkt::message::Message for TargetsTypeCondition {
2672    fn typename() -> &'static str {
2673        "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
2674    }
2675}
2676
2677/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
2678#[derive(Clone, Default, PartialEq)]
2679#[non_exhaustive]
2680pub struct PipelineCondition {
2681    /// Details around the Pipeline's overall status.
2682    pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
2683
2684    /// Details around targets enumerated in the pipeline.
2685    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
2686
2687    /// Details on the whether the targets enumerated in the pipeline are of the
2688    /// same type.
2689    pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
2690
2691    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2692}
2693
2694impl PipelineCondition {
2695    /// Creates a new default instance.
2696    pub fn new() -> Self {
2697        std::default::Default::default()
2698    }
2699
2700    /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2701    ///
2702    /// # Example
2703    /// ```ignore,no_run
2704    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2705    /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2706    /// let x = PipelineCondition::new().set_pipeline_ready_condition(PipelineReadyCondition::default()/* use setters */);
2707    /// ```
2708    pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
2709    where
2710        T: std::convert::Into<crate::model::PipelineReadyCondition>,
2711    {
2712        self.pipeline_ready_condition = std::option::Option::Some(v.into());
2713        self
2714    }
2715
2716    /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2717    ///
2718    /// # Example
2719    /// ```ignore,no_run
2720    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2721    /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2722    /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(Some(PipelineReadyCondition::default()/* use setters */));
2723    /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(None::<PipelineReadyCondition>);
2724    /// ```
2725    pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
2726    where
2727        T: std::convert::Into<crate::model::PipelineReadyCondition>,
2728    {
2729        self.pipeline_ready_condition = v.map(|x| x.into());
2730        self
2731    }
2732
2733    /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2734    ///
2735    /// # Example
2736    /// ```ignore,no_run
2737    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2738    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2739    /// let x = PipelineCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
2740    /// ```
2741    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
2742    where
2743        T: std::convert::Into<crate::model::TargetsPresentCondition>,
2744    {
2745        self.targets_present_condition = std::option::Option::Some(v.into());
2746        self
2747    }
2748
2749    /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2750    ///
2751    /// # Example
2752    /// ```ignore,no_run
2753    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2754    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2755    /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
2756    /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
2757    /// ```
2758    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
2759    where
2760        T: std::convert::Into<crate::model::TargetsPresentCondition>,
2761    {
2762        self.targets_present_condition = v.map(|x| x.into());
2763        self
2764    }
2765
2766    /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2767    ///
2768    /// # Example
2769    /// ```ignore,no_run
2770    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2771    /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2772    /// let x = PipelineCondition::new().set_targets_type_condition(TargetsTypeCondition::default()/* use setters */);
2773    /// ```
2774    pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2775    where
2776        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2777    {
2778        self.targets_type_condition = std::option::Option::Some(v.into());
2779        self
2780    }
2781
2782    /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2783    ///
2784    /// # Example
2785    /// ```ignore,no_run
2786    /// # use google_cloud_deploy_v1::model::PipelineCondition;
2787    /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2788    /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(Some(TargetsTypeCondition::default()/* use setters */));
2789    /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(None::<TargetsTypeCondition>);
2790    /// ```
2791    pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2792    where
2793        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2794    {
2795        self.targets_type_condition = v.map(|x| x.into());
2796        self
2797    }
2798}
2799
2800impl wkt::message::Message for PipelineCondition {
2801    fn typename() -> &'static str {
2802        "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2803    }
2804}
2805
2806/// The request object for `ListDeliveryPipelines`.
2807#[derive(Clone, Default, PartialEq)]
2808#[non_exhaustive]
2809pub struct ListDeliveryPipelinesRequest {
2810    /// Required. The parent, which owns this collection of pipelines. Format must
2811    /// be `projects/{project_id}/locations/{location_name}`.
2812    pub parent: std::string::String,
2813
2814    /// The maximum number of pipelines to return. The service may return
2815    /// fewer than this value. If unspecified, at most 50 pipelines will
2816    /// be returned. The maximum value is 1000; values above 1000 will be set
2817    /// to 1000.
2818    pub page_size: i32,
2819
2820    /// A page token, received from a previous `ListDeliveryPipelines` call.
2821    /// Provide this to retrieve the subsequent page.
2822    ///
2823    /// When paginating, all other provided parameters match
2824    /// the call that provided the page token.
2825    pub page_token: std::string::String,
2826
2827    /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2828    /// details.
2829    pub filter: std::string::String,
2830
2831    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2832    pub order_by: std::string::String,
2833
2834    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2835}
2836
2837impl ListDeliveryPipelinesRequest {
2838    /// Creates a new default instance.
2839    pub fn new() -> Self {
2840        std::default::Default::default()
2841    }
2842
2843    /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2844    ///
2845    /// # Example
2846    /// ```ignore,no_run
2847    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2848    /// # let project_id = "project_id";
2849    /// # let location_id = "location_id";
2850    /// let x = ListDeliveryPipelinesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2851    /// ```
2852    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2853        self.parent = v.into();
2854        self
2855    }
2856
2857    /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2858    ///
2859    /// # Example
2860    /// ```ignore,no_run
2861    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2862    /// let x = ListDeliveryPipelinesRequest::new().set_page_size(42);
2863    /// ```
2864    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2865        self.page_size = v.into();
2866        self
2867    }
2868
2869    /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2870    ///
2871    /// # Example
2872    /// ```ignore,no_run
2873    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2874    /// let x = ListDeliveryPipelinesRequest::new().set_page_token("example");
2875    /// ```
2876    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2877        self.page_token = v.into();
2878        self
2879    }
2880
2881    /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2882    ///
2883    /// # Example
2884    /// ```ignore,no_run
2885    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2886    /// let x = ListDeliveryPipelinesRequest::new().set_filter("example");
2887    /// ```
2888    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2889        self.filter = v.into();
2890        self
2891    }
2892
2893    /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2894    ///
2895    /// # Example
2896    /// ```ignore,no_run
2897    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2898    /// let x = ListDeliveryPipelinesRequest::new().set_order_by("example");
2899    /// ```
2900    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2901        self.order_by = v.into();
2902        self
2903    }
2904}
2905
2906impl wkt::message::Message for ListDeliveryPipelinesRequest {
2907    fn typename() -> &'static str {
2908        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2909    }
2910}
2911
2912/// The response object from `ListDeliveryPipelines`.
2913#[derive(Clone, Default, PartialEq)]
2914#[non_exhaustive]
2915pub struct ListDeliveryPipelinesResponse {
2916    /// The `DeliveryPipeline` objects.
2917    pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2918
2919    /// A token, which can be sent as `page_token` to retrieve the next page.
2920    /// If this field is omitted, there are no subsequent pages.
2921    pub next_page_token: std::string::String,
2922
2923    /// Locations that could not be reached.
2924    pub unreachable: std::vec::Vec<std::string::String>,
2925
2926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2927}
2928
2929impl ListDeliveryPipelinesResponse {
2930    /// Creates a new default instance.
2931    pub fn new() -> Self {
2932        std::default::Default::default()
2933    }
2934
2935    /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2936    ///
2937    /// # Example
2938    /// ```ignore,no_run
2939    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2940    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
2941    /// let x = ListDeliveryPipelinesResponse::new()
2942    ///     .set_delivery_pipelines([
2943    ///         DeliveryPipeline::default()/* use setters */,
2944    ///         DeliveryPipeline::default()/* use (different) setters */,
2945    ///     ]);
2946    /// ```
2947    pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2948    where
2949        T: std::iter::IntoIterator<Item = V>,
2950        V: std::convert::Into<crate::model::DeliveryPipeline>,
2951    {
2952        use std::iter::Iterator;
2953        self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2954        self
2955    }
2956
2957    /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2958    ///
2959    /// # Example
2960    /// ```ignore,no_run
2961    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2962    /// let x = ListDeliveryPipelinesResponse::new().set_next_page_token("example");
2963    /// ```
2964    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2965        self.next_page_token = v.into();
2966        self
2967    }
2968
2969    /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2970    ///
2971    /// # Example
2972    /// ```ignore,no_run
2973    /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2974    /// let x = ListDeliveryPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
2975    /// ```
2976    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2977    where
2978        T: std::iter::IntoIterator<Item = V>,
2979        V: std::convert::Into<std::string::String>,
2980    {
2981        use std::iter::Iterator;
2982        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2983        self
2984    }
2985}
2986
2987impl wkt::message::Message for ListDeliveryPipelinesResponse {
2988    fn typename() -> &'static str {
2989        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2990    }
2991}
2992
2993#[doc(hidden)]
2994impl google_cloud_gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2995    type PageItem = crate::model::DeliveryPipeline;
2996
2997    fn items(self) -> std::vec::Vec<Self::PageItem> {
2998        self.delivery_pipelines
2999    }
3000
3001    fn next_page_token(&self) -> std::string::String {
3002        use std::clone::Clone;
3003        self.next_page_token.clone()
3004    }
3005}
3006
3007/// The request object for `GetDeliveryPipeline`
3008#[derive(Clone, Default, PartialEq)]
3009#[non_exhaustive]
3010pub struct GetDeliveryPipelineRequest {
3011    /// Required. Name of the `DeliveryPipeline`. Format must be
3012    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3013    pub name: std::string::String,
3014
3015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3016}
3017
3018impl GetDeliveryPipelineRequest {
3019    /// Creates a new default instance.
3020    pub fn new() -> Self {
3021        std::default::Default::default()
3022    }
3023
3024    /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
3025    ///
3026    /// # Example
3027    /// ```ignore,no_run
3028    /// # use google_cloud_deploy_v1::model::GetDeliveryPipelineRequest;
3029    /// # let project_id = "project_id";
3030    /// # let location_id = "location_id";
3031    /// # let delivery_pipeline_id = "delivery_pipeline_id";
3032    /// let x = GetDeliveryPipelineRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
3033    /// ```
3034    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3035        self.name = v.into();
3036        self
3037    }
3038}
3039
3040impl wkt::message::Message for GetDeliveryPipelineRequest {
3041    fn typename() -> &'static str {
3042        "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
3043    }
3044}
3045
3046/// The request object for `CreateDeliveryPipeline`.
3047#[derive(Clone, Default, PartialEq)]
3048#[non_exhaustive]
3049pub struct CreateDeliveryPipelineRequest {
3050    /// Required. The parent collection in which the `DeliveryPipeline` must be
3051    /// created. The format is `projects/{project_id}/locations/{location_name}`.
3052    pub parent: std::string::String,
3053
3054    /// Required. ID of the `DeliveryPipeline`.
3055    pub delivery_pipeline_id: std::string::String,
3056
3057    /// Required. The `DeliveryPipeline` to create.
3058    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3059
3060    /// Optional. A request ID to identify requests. Specify a unique request ID
3061    /// so that if you must retry your request, the server knows to ignore the
3062    /// request if it has already been completed. The server guarantees that for
3063    /// at least 60 minutes after the first request.
3064    ///
3065    /// For example, consider a situation where you make an initial request and the
3066    /// request times out. If you make the request again with the same request ID,
3067    /// the server can check if original operation with the same request ID was
3068    /// received, and if so, will ignore the second request. This prevents clients
3069    /// from accidentally creating duplicate commitments.
3070    ///
3071    /// The request ID must be a valid UUID with the exception that zero UUID is
3072    /// not supported (00000000-0000-0000-0000-000000000000).
3073    pub request_id: std::string::String,
3074
3075    /// Optional. If set to true, the request is validated and the user is provided
3076    /// with an expected result, but no actual change is made.
3077    pub validate_only: bool,
3078
3079    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3080}
3081
3082impl CreateDeliveryPipelineRequest {
3083    /// Creates a new default instance.
3084    pub fn new() -> Self {
3085        std::default::Default::default()
3086    }
3087
3088    /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
3089    ///
3090    /// # Example
3091    /// ```ignore,no_run
3092    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3093    /// # let project_id = "project_id";
3094    /// # let location_id = "location_id";
3095    /// let x = CreateDeliveryPipelineRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3096    /// ```
3097    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3098        self.parent = v.into();
3099        self
3100    }
3101
3102    /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
3103    ///
3104    /// # Example
3105    /// ```ignore,no_run
3106    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3107    /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline_id("example");
3108    /// ```
3109    pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
3110        mut self,
3111        v: T,
3112    ) -> Self {
3113        self.delivery_pipeline_id = v.into();
3114        self
3115    }
3116
3117    /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3118    ///
3119    /// # Example
3120    /// ```ignore,no_run
3121    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3122    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3123    /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3124    /// ```
3125    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3126    where
3127        T: std::convert::Into<crate::model::DeliveryPipeline>,
3128    {
3129        self.delivery_pipeline = std::option::Option::Some(v.into());
3130        self
3131    }
3132
3133    /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3134    ///
3135    /// # Example
3136    /// ```ignore,no_run
3137    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3138    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3139    /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3140    /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3141    /// ```
3142    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3143    where
3144        T: std::convert::Into<crate::model::DeliveryPipeline>,
3145    {
3146        self.delivery_pipeline = v.map(|x| x.into());
3147        self
3148    }
3149
3150    /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
3151    ///
3152    /// # Example
3153    /// ```ignore,no_run
3154    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3155    /// let x = CreateDeliveryPipelineRequest::new().set_request_id("example");
3156    /// ```
3157    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3158        self.request_id = v.into();
3159        self
3160    }
3161
3162    /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
3163    ///
3164    /// # Example
3165    /// ```ignore,no_run
3166    /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3167    /// let x = CreateDeliveryPipelineRequest::new().set_validate_only(true);
3168    /// ```
3169    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3170        self.validate_only = v.into();
3171        self
3172    }
3173}
3174
3175impl wkt::message::Message for CreateDeliveryPipelineRequest {
3176    fn typename() -> &'static str {
3177        "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
3178    }
3179}
3180
3181/// The request object for `UpdateDeliveryPipeline`.
3182#[derive(Clone, Default, PartialEq)]
3183#[non_exhaustive]
3184pub struct UpdateDeliveryPipelineRequest {
3185    /// Required. Field mask is used to specify the fields to be overwritten by the
3186    /// update in the `DeliveryPipeline` resource. The fields specified in the
3187    /// update_mask are relative to the resource, not the full request. A field
3188    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
3189    /// then all fields are overwritten.
3190    pub update_mask: std::option::Option<wkt::FieldMask>,
3191
3192    /// Required. The `DeliveryPipeline` to update.
3193    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3194
3195    /// Optional. A request ID to identify requests. Specify a unique request ID
3196    /// so that if you must retry your request, the server knows to ignore the
3197    /// request if it has already been completed. The server guarantees that for
3198    /// at least 60 minutes after the first request.
3199    ///
3200    /// For example, consider a situation where you make an initial request and the
3201    /// request times out. If you make the request again with the same request ID,
3202    /// the server can check if original operation with the same request ID was
3203    /// received, and if so, will ignore the second request. This prevents clients
3204    /// from accidentally creating duplicate commitments.
3205    ///
3206    /// The request ID must be a valid UUID with the exception that zero UUID is
3207    /// not supported (00000000-0000-0000-0000-000000000000).
3208    pub request_id: std::string::String,
3209
3210    /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
3211    /// will result in the creation of a new `DeliveryPipeline`.
3212    pub allow_missing: bool,
3213
3214    /// Optional. If set to true, the request is validated and the user is provided
3215    /// with an expected result, but no actual change is made.
3216    pub validate_only: bool,
3217
3218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3219}
3220
3221impl UpdateDeliveryPipelineRequest {
3222    /// Creates a new default instance.
3223    pub fn new() -> Self {
3224        std::default::Default::default()
3225    }
3226
3227    /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3228    ///
3229    /// # Example
3230    /// ```ignore,no_run
3231    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3232    /// use wkt::FieldMask;
3233    /// let x = UpdateDeliveryPipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3234    /// ```
3235    pub fn set_update_mask<T>(mut self, v: T) -> Self
3236    where
3237        T: std::convert::Into<wkt::FieldMask>,
3238    {
3239        self.update_mask = std::option::Option::Some(v.into());
3240        self
3241    }
3242
3243    /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3244    ///
3245    /// # Example
3246    /// ```ignore,no_run
3247    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3248    /// use wkt::FieldMask;
3249    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3250    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3251    /// ```
3252    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3253    where
3254        T: std::convert::Into<wkt::FieldMask>,
3255    {
3256        self.update_mask = v.map(|x| x.into());
3257        self
3258    }
3259
3260    /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3261    ///
3262    /// # Example
3263    /// ```ignore,no_run
3264    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3265    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3266    /// let x = UpdateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3267    /// ```
3268    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3269    where
3270        T: std::convert::Into<crate::model::DeliveryPipeline>,
3271    {
3272        self.delivery_pipeline = std::option::Option::Some(v.into());
3273        self
3274    }
3275
3276    /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3277    ///
3278    /// # Example
3279    /// ```ignore,no_run
3280    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3281    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3282    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3283    /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3284    /// ```
3285    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3286    where
3287        T: std::convert::Into<crate::model::DeliveryPipeline>,
3288    {
3289        self.delivery_pipeline = v.map(|x| x.into());
3290        self
3291    }
3292
3293    /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
3294    ///
3295    /// # Example
3296    /// ```ignore,no_run
3297    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3298    /// let x = UpdateDeliveryPipelineRequest::new().set_request_id("example");
3299    /// ```
3300    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3301        self.request_id = v.into();
3302        self
3303    }
3304
3305    /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
3306    ///
3307    /// # Example
3308    /// ```ignore,no_run
3309    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3310    /// let x = UpdateDeliveryPipelineRequest::new().set_allow_missing(true);
3311    /// ```
3312    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3313        self.allow_missing = v.into();
3314        self
3315    }
3316
3317    /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
3318    ///
3319    /// # Example
3320    /// ```ignore,no_run
3321    /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3322    /// let x = UpdateDeliveryPipelineRequest::new().set_validate_only(true);
3323    /// ```
3324    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3325        self.validate_only = v.into();
3326        self
3327    }
3328}
3329
3330impl wkt::message::Message for UpdateDeliveryPipelineRequest {
3331    fn typename() -> &'static str {
3332        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
3333    }
3334}
3335
3336/// The request object for `DeleteDeliveryPipeline`.
3337#[derive(Clone, Default, PartialEq)]
3338#[non_exhaustive]
3339pub struct DeleteDeliveryPipelineRequest {
3340    /// Required. The name of the `DeliveryPipeline` to delete. The format is
3341    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3342    pub name: std::string::String,
3343
3344    /// Optional. A request ID to identify requests. Specify a unique request ID
3345    /// so that if you must retry your request, the server knows to ignore the
3346    /// request if it has already been completed. The server guarantees that for
3347    /// at least 60 minutes after the first request.
3348    ///
3349    /// For example, consider a situation where you make an initial request and the
3350    /// request times out. If you make the request again with the same request ID,
3351    /// the server can check if original operation with the same request ID was
3352    /// received, and if so, will ignore the second request. This prevents clients
3353    /// from accidentally creating duplicate commitments.
3354    ///
3355    /// The request ID must be a valid UUID with the exception that zero UUID is
3356    /// not supported (00000000-0000-0000-0000-000000000000).
3357    pub request_id: std::string::String,
3358
3359    /// Optional. If set to true, then deleting an already deleted or non-existing
3360    /// `DeliveryPipeline` will succeed.
3361    pub allow_missing: bool,
3362
3363    /// Optional. If set, validate the request and preview the review, but do not
3364    /// actually post it.
3365    pub validate_only: bool,
3366
3367    /// Optional. If set to true, all child resources under this pipeline will also
3368    /// be deleted. Otherwise, the request will only work if the pipeline has no
3369    /// child resources.
3370    pub force: bool,
3371
3372    /// Optional. This checksum is computed by the server based on the value of
3373    /// other fields, and may be sent on update and delete requests to ensure the
3374    /// client has an up-to-date value before proceeding.
3375    pub etag: std::string::String,
3376
3377    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3378}
3379
3380impl DeleteDeliveryPipelineRequest {
3381    /// Creates a new default instance.
3382    pub fn new() -> Self {
3383        std::default::Default::default()
3384    }
3385
3386    /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
3387    ///
3388    /// # Example
3389    /// ```ignore,no_run
3390    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3391    /// # let project_id = "project_id";
3392    /// # let location_id = "location_id";
3393    /// # let delivery_pipeline_id = "delivery_pipeline_id";
3394    /// let x = DeleteDeliveryPipelineRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
3395    /// ```
3396    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3397        self.name = v.into();
3398        self
3399    }
3400
3401    /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
3402    ///
3403    /// # Example
3404    /// ```ignore,no_run
3405    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3406    /// let x = DeleteDeliveryPipelineRequest::new().set_request_id("example");
3407    /// ```
3408    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3409        self.request_id = v.into();
3410        self
3411    }
3412
3413    /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
3414    ///
3415    /// # Example
3416    /// ```ignore,no_run
3417    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3418    /// let x = DeleteDeliveryPipelineRequest::new().set_allow_missing(true);
3419    /// ```
3420    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3421        self.allow_missing = v.into();
3422        self
3423    }
3424
3425    /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
3426    ///
3427    /// # Example
3428    /// ```ignore,no_run
3429    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3430    /// let x = DeleteDeliveryPipelineRequest::new().set_validate_only(true);
3431    /// ```
3432    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3433        self.validate_only = v.into();
3434        self
3435    }
3436
3437    /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
3438    ///
3439    /// # Example
3440    /// ```ignore,no_run
3441    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3442    /// let x = DeleteDeliveryPipelineRequest::new().set_force(true);
3443    /// ```
3444    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3445        self.force = v.into();
3446        self
3447    }
3448
3449    /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
3450    ///
3451    /// # Example
3452    /// ```ignore,no_run
3453    /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3454    /// let x = DeleteDeliveryPipelineRequest::new().set_etag("example");
3455    /// ```
3456    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3457        self.etag = v.into();
3458        self
3459    }
3460}
3461
3462impl wkt::message::Message for DeleteDeliveryPipelineRequest {
3463    fn typename() -> &'static str {
3464        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
3465    }
3466}
3467
3468/// Configs for the Rollback rollout.
3469#[derive(Clone, Default, PartialEq)]
3470#[non_exhaustive]
3471pub struct RollbackTargetConfig {
3472    /// Optional. The rollback `Rollout` to create.
3473    pub rollout: std::option::Option<crate::model::Rollout>,
3474
3475    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
3476    /// `Rollout` will start in the stable phase.
3477    pub starting_phase_id: std::string::String,
3478
3479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3480}
3481
3482impl RollbackTargetConfig {
3483    /// Creates a new default instance.
3484    pub fn new() -> Self {
3485        std::default::Default::default()
3486    }
3487
3488    /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3489    ///
3490    /// # Example
3491    /// ```ignore,no_run
3492    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3493    /// use google_cloud_deploy_v1::model::Rollout;
3494    /// let x = RollbackTargetConfig::new().set_rollout(Rollout::default()/* use setters */);
3495    /// ```
3496    pub fn set_rollout<T>(mut self, v: T) -> Self
3497    where
3498        T: std::convert::Into<crate::model::Rollout>,
3499    {
3500        self.rollout = std::option::Option::Some(v.into());
3501        self
3502    }
3503
3504    /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3505    ///
3506    /// # Example
3507    /// ```ignore,no_run
3508    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3509    /// use google_cloud_deploy_v1::model::Rollout;
3510    /// let x = RollbackTargetConfig::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
3511    /// let x = RollbackTargetConfig::new().set_or_clear_rollout(None::<Rollout>);
3512    /// ```
3513    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3514    where
3515        T: std::convert::Into<crate::model::Rollout>,
3516    {
3517        self.rollout = v.map(|x| x.into());
3518        self
3519    }
3520
3521    /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
3522    ///
3523    /// # Example
3524    /// ```ignore,no_run
3525    /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3526    /// let x = RollbackTargetConfig::new().set_starting_phase_id("example");
3527    /// ```
3528    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
3529        mut self,
3530        v: T,
3531    ) -> Self {
3532        self.starting_phase_id = v.into();
3533        self
3534    }
3535}
3536
3537impl wkt::message::Message for RollbackTargetConfig {
3538    fn typename() -> &'static str {
3539        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
3540    }
3541}
3542
3543/// The request object for `RollbackTarget`.
3544#[derive(Clone, Default, PartialEq)]
3545#[non_exhaustive]
3546pub struct RollbackTargetRequest {
3547    /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
3548    /// created. The format is
3549    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3550    pub name: std::string::String,
3551
3552    /// Required. ID of the `Target` that is being rolled back.
3553    pub target_id: std::string::String,
3554
3555    /// Required. ID of the rollback `Rollout` to create.
3556    pub rollout_id: std::string::String,
3557
3558    /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
3559    /// previous successful `Rollout` to the specified target will be used to
3560    /// determine the `Release`.
3561    pub release_id: std::string::String,
3562
3563    /// Optional. If provided, this must be the latest `Rollout` that is on the
3564    /// `Target`.
3565    pub rollout_to_roll_back: std::string::String,
3566
3567    /// Optional. Configs for the rollback `Rollout`.
3568    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3569
3570    /// Optional. If set to true, the request is validated and the user is provided
3571    /// with a `RollbackTargetResponse`.
3572    pub validate_only: bool,
3573
3574    /// Optional. Deploy policies to override. Format is
3575    /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
3576    pub override_deploy_policy: std::vec::Vec<std::string::String>,
3577
3578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3579}
3580
3581impl RollbackTargetRequest {
3582    /// Creates a new default instance.
3583    pub fn new() -> Self {
3584        std::default::Default::default()
3585    }
3586
3587    /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
3588    ///
3589    /// # Example
3590    /// ```ignore,no_run
3591    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3592    /// # let project_id = "project_id";
3593    /// # let location_id = "location_id";
3594    /// # let delivery_pipeline_id = "delivery_pipeline_id";
3595    /// let x = RollbackTargetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
3596    /// ```
3597    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3598        self.name = v.into();
3599        self
3600    }
3601
3602    /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
3603    ///
3604    /// # Example
3605    /// ```ignore,no_run
3606    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3607    /// let x = RollbackTargetRequest::new().set_target_id("example");
3608    /// ```
3609    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3610        self.target_id = v.into();
3611        self
3612    }
3613
3614    /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
3615    ///
3616    /// # Example
3617    /// ```ignore,no_run
3618    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3619    /// let x = RollbackTargetRequest::new().set_rollout_id("example");
3620    /// ```
3621    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3622        self.rollout_id = v.into();
3623        self
3624    }
3625
3626    /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
3627    ///
3628    /// # Example
3629    /// ```ignore,no_run
3630    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3631    /// let x = RollbackTargetRequest::new().set_release_id("example");
3632    /// ```
3633    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634        self.release_id = v.into();
3635        self
3636    }
3637
3638    /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
3639    ///
3640    /// # Example
3641    /// ```ignore,no_run
3642    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3643    /// let x = RollbackTargetRequest::new().set_rollout_to_roll_back("example");
3644    /// ```
3645    pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
3646        mut self,
3647        v: T,
3648    ) -> Self {
3649        self.rollout_to_roll_back = v.into();
3650        self
3651    }
3652
3653    /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3654    ///
3655    /// # Example
3656    /// ```ignore,no_run
3657    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3658    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3659    /// let x = RollbackTargetRequest::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3660    /// ```
3661    pub fn set_rollback_config<T>(mut self, v: T) -> Self
3662    where
3663        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3664    {
3665        self.rollback_config = std::option::Option::Some(v.into());
3666        self
3667    }
3668
3669    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3670    ///
3671    /// # Example
3672    /// ```ignore,no_run
3673    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3674    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3675    /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3676    /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3677    /// ```
3678    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3679    where
3680        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3681    {
3682        self.rollback_config = v.map(|x| x.into());
3683        self
3684    }
3685
3686    /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
3687    ///
3688    /// # Example
3689    /// ```ignore,no_run
3690    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3691    /// let x = RollbackTargetRequest::new().set_validate_only(true);
3692    /// ```
3693    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3694        self.validate_only = v.into();
3695        self
3696    }
3697
3698    /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
3699    ///
3700    /// # Example
3701    /// ```ignore,no_run
3702    /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3703    /// let x = RollbackTargetRequest::new().set_override_deploy_policy(["a", "b", "c"]);
3704    /// ```
3705    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3706    where
3707        T: std::iter::IntoIterator<Item = V>,
3708        V: std::convert::Into<std::string::String>,
3709    {
3710        use std::iter::Iterator;
3711        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3712        self
3713    }
3714}
3715
3716impl wkt::message::Message for RollbackTargetRequest {
3717    fn typename() -> &'static str {
3718        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
3719    }
3720}
3721
3722/// The response object from `RollbackTarget`.
3723#[derive(Clone, Default, PartialEq)]
3724#[non_exhaustive]
3725pub struct RollbackTargetResponse {
3726    /// The config of the rollback `Rollout` created or will be created.
3727    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3728
3729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3730}
3731
3732impl RollbackTargetResponse {
3733    /// Creates a new default instance.
3734    pub fn new() -> Self {
3735        std::default::Default::default()
3736    }
3737
3738    /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3739    ///
3740    /// # Example
3741    /// ```ignore,no_run
3742    /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3743    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3744    /// let x = RollbackTargetResponse::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3745    /// ```
3746    pub fn set_rollback_config<T>(mut self, v: T) -> Self
3747    where
3748        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3749    {
3750        self.rollback_config = std::option::Option::Some(v.into());
3751        self
3752    }
3753
3754    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3755    ///
3756    /// # Example
3757    /// ```ignore,no_run
3758    /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3759    /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3760    /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3761    /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3762    /// ```
3763    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3764    where
3765        T: std::convert::Into<crate::model::RollbackTargetConfig>,
3766    {
3767        self.rollback_config = v.map(|x| x.into());
3768        self
3769    }
3770}
3771
3772impl wkt::message::Message for RollbackTargetResponse {
3773    fn typename() -> &'static str {
3774        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
3775    }
3776}
3777
3778/// A `Target` resource in the Cloud Deploy API.
3779///
3780/// A `Target` defines a location to which a Skaffold configuration
3781/// can be deployed.
3782#[derive(Clone, Default, PartialEq)]
3783#[non_exhaustive]
3784pub struct Target {
3785    /// Identifier. Name of the `Target`. Format is
3786    /// `projects/{project}/locations/{location}/targets/{target}`.
3787    /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
3788    pub name: std::string::String,
3789
3790    /// Output only. Resource id of the `Target`.
3791    pub target_id: std::string::String,
3792
3793    /// Output only. Unique identifier of the `Target`.
3794    pub uid: std::string::String,
3795
3796    /// Optional. Description of the `Target`. Max length is 255 characters.
3797    pub description: std::string::String,
3798
3799    /// Optional. User annotations. These attributes can only be set and used by
3800    /// the user, and not by Cloud Deploy. See
3801    /// <https://google.aip.dev/128#annotations> for more details such as format and
3802    /// size limitations.
3803    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3804
3805    /// Optional. Labels are attributes that can be set and used by both the
3806    /// user and by Cloud Deploy. Labels must meet the following constraints:
3807    ///
3808    /// * Keys and values can contain only lowercase letters, numeric characters,
3809    ///   underscores, and dashes.
3810    /// * All characters must use UTF-8 encoding, and international characters are
3811    ///   allowed.
3812    /// * Keys must start with a lowercase letter or international character.
3813    /// * Each resource is limited to a maximum of 64 labels.
3814    ///
3815    /// Both keys and values are additionally constrained to be <= 128 bytes.
3816    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3817
3818    /// Optional. Whether or not the `Target` requires approval.
3819    pub require_approval: bool,
3820
3821    /// Output only. Time at which the `Target` was created.
3822    pub create_time: std::option::Option<wkt::Timestamp>,
3823
3824    /// Output only. Most recent time at which the `Target` was updated.
3825    pub update_time: std::option::Option<wkt::Timestamp>,
3826
3827    /// Optional. Map of entity IDs to their associated entities. Associated
3828    /// entities allows specifying places other than the deployment target for
3829    /// specific features. For example, the Gateway API canary can be configured to
3830    /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
3831    /// using associated entities. An entity ID must consist of lower-case letters,
3832    /// numbers, and hyphens, start with a letter and end with a letter or a
3833    /// number, and have a max length of 63 characters. In other words, it must
3834    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3835    pub associated_entities:
3836        std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
3837
3838    /// Optional. This checksum is computed by the server based on the value of
3839    /// other fields, and may be sent on update and delete requests to ensure the
3840    /// client has an up-to-date value before proceeding.
3841    pub etag: std::string::String,
3842
3843    /// Optional. Configurations for all execution that relates to this `Target`.
3844    /// Each `ExecutionEnvironmentUsage` value may only be used in a single
3845    /// configuration; using the same value multiple times is an error.
3846    /// When one or more configurations are specified, they must include the
3847    /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
3848    /// When no configurations are specified, execution will use the default
3849    /// specified in `DefaultPool`.
3850    pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
3851
3852    /// Optional. The deploy parameters to use for this target.
3853    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
3854
3855    /// Destination to which the Skaffold configuration is applied during a
3856    /// rollout.
3857    pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
3858
3859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3860}
3861
3862impl Target {
3863    /// Creates a new default instance.
3864    pub fn new() -> Self {
3865        std::default::Default::default()
3866    }
3867
3868    /// Sets the value of [name][crate::model::Target::name].
3869    ///
3870    /// # Example
3871    /// ```ignore,no_run
3872    /// # use google_cloud_deploy_v1::model::Target;
3873    /// # let project_id = "project_id";
3874    /// # let location_id = "location_id";
3875    /// # let target_id = "target_id";
3876    /// let x = Target::new().set_name(format!("projects/{project_id}/locations/{location_id}/targets/{target_id}"));
3877    /// ```
3878    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3879        self.name = v.into();
3880        self
3881    }
3882
3883    /// Sets the value of [target_id][crate::model::Target::target_id].
3884    ///
3885    /// # Example
3886    /// ```ignore,no_run
3887    /// # use google_cloud_deploy_v1::model::Target;
3888    /// let x = Target::new().set_target_id("example");
3889    /// ```
3890    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3891        self.target_id = v.into();
3892        self
3893    }
3894
3895    /// Sets the value of [uid][crate::model::Target::uid].
3896    ///
3897    /// # Example
3898    /// ```ignore,no_run
3899    /// # use google_cloud_deploy_v1::model::Target;
3900    /// let x = Target::new().set_uid("example");
3901    /// ```
3902    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3903        self.uid = v.into();
3904        self
3905    }
3906
3907    /// Sets the value of [description][crate::model::Target::description].
3908    ///
3909    /// # Example
3910    /// ```ignore,no_run
3911    /// # use google_cloud_deploy_v1::model::Target;
3912    /// let x = Target::new().set_description("example");
3913    /// ```
3914    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3915        self.description = v.into();
3916        self
3917    }
3918
3919    /// Sets the value of [annotations][crate::model::Target::annotations].
3920    ///
3921    /// # Example
3922    /// ```ignore,no_run
3923    /// # use google_cloud_deploy_v1::model::Target;
3924    /// let x = Target::new().set_annotations([
3925    ///     ("key0", "abc"),
3926    ///     ("key1", "xyz"),
3927    /// ]);
3928    /// ```
3929    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3930    where
3931        T: std::iter::IntoIterator<Item = (K, V)>,
3932        K: std::convert::Into<std::string::String>,
3933        V: std::convert::Into<std::string::String>,
3934    {
3935        use std::iter::Iterator;
3936        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3937        self
3938    }
3939
3940    /// Sets the value of [labels][crate::model::Target::labels].
3941    ///
3942    /// # Example
3943    /// ```ignore,no_run
3944    /// # use google_cloud_deploy_v1::model::Target;
3945    /// let x = Target::new().set_labels([
3946    ///     ("key0", "abc"),
3947    ///     ("key1", "xyz"),
3948    /// ]);
3949    /// ```
3950    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3951    where
3952        T: std::iter::IntoIterator<Item = (K, V)>,
3953        K: std::convert::Into<std::string::String>,
3954        V: std::convert::Into<std::string::String>,
3955    {
3956        use std::iter::Iterator;
3957        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3958        self
3959    }
3960
3961    /// Sets the value of [require_approval][crate::model::Target::require_approval].
3962    ///
3963    /// # Example
3964    /// ```ignore,no_run
3965    /// # use google_cloud_deploy_v1::model::Target;
3966    /// let x = Target::new().set_require_approval(true);
3967    /// ```
3968    pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3969        self.require_approval = v.into();
3970        self
3971    }
3972
3973    /// Sets the value of [create_time][crate::model::Target::create_time].
3974    ///
3975    /// # Example
3976    /// ```ignore,no_run
3977    /// # use google_cloud_deploy_v1::model::Target;
3978    /// use wkt::Timestamp;
3979    /// let x = Target::new().set_create_time(Timestamp::default()/* use setters */);
3980    /// ```
3981    pub fn set_create_time<T>(mut self, v: T) -> Self
3982    where
3983        T: std::convert::Into<wkt::Timestamp>,
3984    {
3985        self.create_time = std::option::Option::Some(v.into());
3986        self
3987    }
3988
3989    /// Sets or clears the value of [create_time][crate::model::Target::create_time].
3990    ///
3991    /// # Example
3992    /// ```ignore,no_run
3993    /// # use google_cloud_deploy_v1::model::Target;
3994    /// use wkt::Timestamp;
3995    /// let x = Target::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3996    /// let x = Target::new().set_or_clear_create_time(None::<Timestamp>);
3997    /// ```
3998    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3999    where
4000        T: std::convert::Into<wkt::Timestamp>,
4001    {
4002        self.create_time = v.map(|x| x.into());
4003        self
4004    }
4005
4006    /// Sets the value of [update_time][crate::model::Target::update_time].
4007    ///
4008    /// # Example
4009    /// ```ignore,no_run
4010    /// # use google_cloud_deploy_v1::model::Target;
4011    /// use wkt::Timestamp;
4012    /// let x = Target::new().set_update_time(Timestamp::default()/* use setters */);
4013    /// ```
4014    pub fn set_update_time<T>(mut self, v: T) -> Self
4015    where
4016        T: std::convert::Into<wkt::Timestamp>,
4017    {
4018        self.update_time = std::option::Option::Some(v.into());
4019        self
4020    }
4021
4022    /// Sets or clears the value of [update_time][crate::model::Target::update_time].
4023    ///
4024    /// # Example
4025    /// ```ignore,no_run
4026    /// # use google_cloud_deploy_v1::model::Target;
4027    /// use wkt::Timestamp;
4028    /// let x = Target::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4029    /// let x = Target::new().set_or_clear_update_time(None::<Timestamp>);
4030    /// ```
4031    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4032    where
4033        T: std::convert::Into<wkt::Timestamp>,
4034    {
4035        self.update_time = v.map(|x| x.into());
4036        self
4037    }
4038
4039    /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
4040    ///
4041    /// # Example
4042    /// ```ignore,no_run
4043    /// # use google_cloud_deploy_v1::model::Target;
4044    /// use google_cloud_deploy_v1::model::AssociatedEntities;
4045    /// let x = Target::new().set_associated_entities([
4046    ///     ("key0", AssociatedEntities::default()/* use setters */),
4047    ///     ("key1", AssociatedEntities::default()/* use (different) setters */),
4048    /// ]);
4049    /// ```
4050    pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
4051    where
4052        T: std::iter::IntoIterator<Item = (K, V)>,
4053        K: std::convert::Into<std::string::String>,
4054        V: std::convert::Into<crate::model::AssociatedEntities>,
4055    {
4056        use std::iter::Iterator;
4057        self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4058        self
4059    }
4060
4061    /// Sets the value of [etag][crate::model::Target::etag].
4062    ///
4063    /// # Example
4064    /// ```ignore,no_run
4065    /// # use google_cloud_deploy_v1::model::Target;
4066    /// let x = Target::new().set_etag("example");
4067    /// ```
4068    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4069        self.etag = v.into();
4070        self
4071    }
4072
4073    /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
4074    ///
4075    /// # Example
4076    /// ```ignore,no_run
4077    /// # use google_cloud_deploy_v1::model::Target;
4078    /// use google_cloud_deploy_v1::model::ExecutionConfig;
4079    /// let x = Target::new()
4080    ///     .set_execution_configs([
4081    ///         ExecutionConfig::default()/* use setters */,
4082    ///         ExecutionConfig::default()/* use (different) setters */,
4083    ///     ]);
4084    /// ```
4085    pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
4086    where
4087        T: std::iter::IntoIterator<Item = V>,
4088        V: std::convert::Into<crate::model::ExecutionConfig>,
4089    {
4090        use std::iter::Iterator;
4091        self.execution_configs = v.into_iter().map(|i| i.into()).collect();
4092        self
4093    }
4094
4095    /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
4096    ///
4097    /// # Example
4098    /// ```ignore,no_run
4099    /// # use google_cloud_deploy_v1::model::Target;
4100    /// let x = Target::new().set_deploy_parameters([
4101    ///     ("key0", "abc"),
4102    ///     ("key1", "xyz"),
4103    /// ]);
4104    /// ```
4105    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
4106    where
4107        T: std::iter::IntoIterator<Item = (K, V)>,
4108        K: std::convert::Into<std::string::String>,
4109        V: std::convert::Into<std::string::String>,
4110    {
4111        use std::iter::Iterator;
4112        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4113        self
4114    }
4115
4116    /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
4117    ///
4118    /// Note that all the setters affecting `deployment_target` are mutually
4119    /// exclusive.
4120    ///
4121    /// # Example
4122    /// ```ignore,no_run
4123    /// # use google_cloud_deploy_v1::model::Target;
4124    /// use google_cloud_deploy_v1::model::GkeCluster;
4125    /// let x = Target::new().set_deployment_target(Some(
4126    ///     google_cloud_deploy_v1::model::target::DeploymentTarget::Gke(GkeCluster::default().into())));
4127    /// ```
4128    pub fn set_deployment_target<
4129        T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
4130    >(
4131        mut self,
4132        v: T,
4133    ) -> Self {
4134        self.deployment_target = v.into();
4135        self
4136    }
4137
4138    /// The value of [deployment_target][crate::model::Target::deployment_target]
4139    /// if it holds a `Gke`, `None` if the field is not set or
4140    /// holds a different branch.
4141    pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
4142        #[allow(unreachable_patterns)]
4143        self.deployment_target.as_ref().and_then(|v| match v {
4144            crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
4145            _ => std::option::Option::None,
4146        })
4147    }
4148
4149    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4150    /// to hold a `Gke`.
4151    ///
4152    /// Note that all the setters affecting `deployment_target` are
4153    /// mutually exclusive.
4154    ///
4155    /// # Example
4156    /// ```ignore,no_run
4157    /// # use google_cloud_deploy_v1::model::Target;
4158    /// use google_cloud_deploy_v1::model::GkeCluster;
4159    /// let x = Target::new().set_gke(GkeCluster::default()/* use setters */);
4160    /// assert!(x.gke().is_some());
4161    /// assert!(x.anthos_cluster().is_none());
4162    /// assert!(x.run().is_none());
4163    /// assert!(x.multi_target().is_none());
4164    /// assert!(x.custom_target().is_none());
4165    /// ```
4166    pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
4167        mut self,
4168        v: T,
4169    ) -> Self {
4170        self.deployment_target =
4171            std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
4172        self
4173    }
4174
4175    /// The value of [deployment_target][crate::model::Target::deployment_target]
4176    /// if it holds a `AnthosCluster`, `None` if the field is not set or
4177    /// holds a different branch.
4178    pub fn anthos_cluster(
4179        &self,
4180    ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
4181        #[allow(unreachable_patterns)]
4182        self.deployment_target.as_ref().and_then(|v| match v {
4183            crate::model::target::DeploymentTarget::AnthosCluster(v) => {
4184                std::option::Option::Some(v)
4185            }
4186            _ => std::option::Option::None,
4187        })
4188    }
4189
4190    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4191    /// to hold a `AnthosCluster`.
4192    ///
4193    /// Note that all the setters affecting `deployment_target` are
4194    /// mutually exclusive.
4195    ///
4196    /// # Example
4197    /// ```ignore,no_run
4198    /// # use google_cloud_deploy_v1::model::Target;
4199    /// use google_cloud_deploy_v1::model::AnthosCluster;
4200    /// let x = Target::new().set_anthos_cluster(AnthosCluster::default()/* use setters */);
4201    /// assert!(x.anthos_cluster().is_some());
4202    /// assert!(x.gke().is_none());
4203    /// assert!(x.run().is_none());
4204    /// assert!(x.multi_target().is_none());
4205    /// assert!(x.custom_target().is_none());
4206    /// ```
4207    pub fn set_anthos_cluster<
4208        T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
4209    >(
4210        mut self,
4211        v: T,
4212    ) -> Self {
4213        self.deployment_target = std::option::Option::Some(
4214            crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
4215        );
4216        self
4217    }
4218
4219    /// The value of [deployment_target][crate::model::Target::deployment_target]
4220    /// if it holds a `Run`, `None` if the field is not set or
4221    /// holds a different branch.
4222    pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
4223        #[allow(unreachable_patterns)]
4224        self.deployment_target.as_ref().and_then(|v| match v {
4225            crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
4226            _ => std::option::Option::None,
4227        })
4228    }
4229
4230    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4231    /// to hold a `Run`.
4232    ///
4233    /// Note that all the setters affecting `deployment_target` are
4234    /// mutually exclusive.
4235    ///
4236    /// # Example
4237    /// ```ignore,no_run
4238    /// # use google_cloud_deploy_v1::model::Target;
4239    /// use google_cloud_deploy_v1::model::CloudRunLocation;
4240    /// let x = Target::new().set_run(CloudRunLocation::default()/* use setters */);
4241    /// assert!(x.run().is_some());
4242    /// assert!(x.gke().is_none());
4243    /// assert!(x.anthos_cluster().is_none());
4244    /// assert!(x.multi_target().is_none());
4245    /// assert!(x.custom_target().is_none());
4246    /// ```
4247    pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
4248        mut self,
4249        v: T,
4250    ) -> Self {
4251        self.deployment_target =
4252            std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
4253        self
4254    }
4255
4256    /// The value of [deployment_target][crate::model::Target::deployment_target]
4257    /// if it holds a `MultiTarget`, `None` if the field is not set or
4258    /// holds a different branch.
4259    pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
4260        #[allow(unreachable_patterns)]
4261        self.deployment_target.as_ref().and_then(|v| match v {
4262            crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
4263            _ => std::option::Option::None,
4264        })
4265    }
4266
4267    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4268    /// to hold a `MultiTarget`.
4269    ///
4270    /// Note that all the setters affecting `deployment_target` are
4271    /// mutually exclusive.
4272    ///
4273    /// # Example
4274    /// ```ignore,no_run
4275    /// # use google_cloud_deploy_v1::model::Target;
4276    /// use google_cloud_deploy_v1::model::MultiTarget;
4277    /// let x = Target::new().set_multi_target(MultiTarget::default()/* use setters */);
4278    /// assert!(x.multi_target().is_some());
4279    /// assert!(x.gke().is_none());
4280    /// assert!(x.anthos_cluster().is_none());
4281    /// assert!(x.run().is_none());
4282    /// assert!(x.custom_target().is_none());
4283    /// ```
4284    pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
4285        mut self,
4286        v: T,
4287    ) -> Self {
4288        self.deployment_target = std::option::Option::Some(
4289            crate::model::target::DeploymentTarget::MultiTarget(v.into()),
4290        );
4291        self
4292    }
4293
4294    /// The value of [deployment_target][crate::model::Target::deployment_target]
4295    /// if it holds a `CustomTarget`, `None` if the field is not set or
4296    /// holds a different branch.
4297    pub fn custom_target(
4298        &self,
4299    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
4300        #[allow(unreachable_patterns)]
4301        self.deployment_target.as_ref().and_then(|v| match v {
4302            crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
4303            _ => std::option::Option::None,
4304        })
4305    }
4306
4307    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4308    /// to hold a `CustomTarget`.
4309    ///
4310    /// Note that all the setters affecting `deployment_target` are
4311    /// mutually exclusive.
4312    ///
4313    /// # Example
4314    /// ```ignore,no_run
4315    /// # use google_cloud_deploy_v1::model::Target;
4316    /// use google_cloud_deploy_v1::model::CustomTarget;
4317    /// let x = Target::new().set_custom_target(CustomTarget::default()/* use setters */);
4318    /// assert!(x.custom_target().is_some());
4319    /// assert!(x.gke().is_none());
4320    /// assert!(x.anthos_cluster().is_none());
4321    /// assert!(x.run().is_none());
4322    /// assert!(x.multi_target().is_none());
4323    /// ```
4324    pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
4325        mut self,
4326        v: T,
4327    ) -> Self {
4328        self.deployment_target = std::option::Option::Some(
4329            crate::model::target::DeploymentTarget::CustomTarget(v.into()),
4330        );
4331        self
4332    }
4333}
4334
4335impl wkt::message::Message for Target {
4336    fn typename() -> &'static str {
4337        "type.googleapis.com/google.cloud.deploy.v1.Target"
4338    }
4339}
4340
4341/// Defines additional types related to [Target].
4342pub mod target {
4343    #[allow(unused_imports)]
4344    use super::*;
4345
4346    /// Destination to which the Skaffold configuration is applied during a
4347    /// rollout.
4348    #[derive(Clone, Debug, PartialEq)]
4349    #[non_exhaustive]
4350    pub enum DeploymentTarget {
4351        /// Optional. Information specifying a GKE Cluster.
4352        Gke(std::boxed::Box<crate::model::GkeCluster>),
4353        /// Optional. Information specifying an Anthos Cluster.
4354        AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
4355        /// Optional. Information specifying a Cloud Run deployment target.
4356        Run(std::boxed::Box<crate::model::CloudRunLocation>),
4357        /// Optional. Information specifying a multiTarget.
4358        MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
4359        /// Optional. Information specifying a Custom Target.
4360        CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
4361    }
4362}
4363
4364/// Configuration of the environment to use when calling Skaffold.
4365#[derive(Clone, Default, PartialEq)]
4366#[non_exhaustive]
4367pub struct ExecutionConfig {
4368    /// Required. Usages when this configuration should be applied.
4369    pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
4370
4371    /// Optional. The resource name of the `WorkerPool`, with the format
4372    /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
4373    /// If this optional field is unspecified, the default Cloud Build pool will be
4374    /// used.
4375    pub worker_pool: std::string::String,
4376
4377    /// Optional. Google service account to use for execution. If unspecified,
4378    /// the project execution service account
4379    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
4380    pub service_account: std::string::String,
4381
4382    /// Optional. Cloud Storage location in which to store execution outputs. This
4383    /// can either be a bucket ("gs://my-bucket") or a path within a bucket
4384    /// ("gs://my-bucket/my-dir").
4385    /// If unspecified, a default bucket located in the same region will be used.
4386    pub artifact_storage: std::string::String,
4387
4388    /// Optional. Execution timeout for a Cloud Build Execution. This must be
4389    /// between 10m and 24h in seconds format. If unspecified, a default timeout of
4390    /// 1h is used.
4391    pub execution_timeout: std::option::Option<wkt::Duration>,
4392
4393    /// Optional. If true, additional logging will be enabled when running builds
4394    /// in this execution environment.
4395    pub verbose: bool,
4396
4397    /// Details of the environment.
4398    pub execution_environment:
4399        std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4400
4401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4402}
4403
4404impl ExecutionConfig {
4405    /// Creates a new default instance.
4406    pub fn new() -> Self {
4407        std::default::Default::default()
4408    }
4409
4410    /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
4411    ///
4412    /// # Example
4413    /// ```ignore,no_run
4414    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4415    /// use google_cloud_deploy_v1::model::execution_config::ExecutionEnvironmentUsage;
4416    /// let x = ExecutionConfig::new().set_usages([
4417    ///     ExecutionEnvironmentUsage::Render,
4418    ///     ExecutionEnvironmentUsage::Deploy,
4419    ///     ExecutionEnvironmentUsage::Verify,
4420    /// ]);
4421    /// ```
4422    pub fn set_usages<T, V>(mut self, v: T) -> Self
4423    where
4424        T: std::iter::IntoIterator<Item = V>,
4425        V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
4426    {
4427        use std::iter::Iterator;
4428        self.usages = v.into_iter().map(|i| i.into()).collect();
4429        self
4430    }
4431
4432    /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
4433    ///
4434    /// # Example
4435    /// ```ignore,no_run
4436    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4437    /// let x = ExecutionConfig::new().set_worker_pool("example");
4438    /// ```
4439    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4440        self.worker_pool = v.into();
4441        self
4442    }
4443
4444    /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
4445    ///
4446    /// # Example
4447    /// ```ignore,no_run
4448    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4449    /// let x = ExecutionConfig::new().set_service_account("example");
4450    /// ```
4451    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4452        self.service_account = v.into();
4453        self
4454    }
4455
4456    /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
4457    ///
4458    /// # Example
4459    /// ```ignore,no_run
4460    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4461    /// let x = ExecutionConfig::new().set_artifact_storage("example");
4462    /// ```
4463    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4464        mut self,
4465        v: T,
4466    ) -> Self {
4467        self.artifact_storage = v.into();
4468        self
4469    }
4470
4471    /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4472    ///
4473    /// # Example
4474    /// ```ignore,no_run
4475    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4476    /// use wkt::Duration;
4477    /// let x = ExecutionConfig::new().set_execution_timeout(Duration::default()/* use setters */);
4478    /// ```
4479    pub fn set_execution_timeout<T>(mut self, v: T) -> Self
4480    where
4481        T: std::convert::Into<wkt::Duration>,
4482    {
4483        self.execution_timeout = std::option::Option::Some(v.into());
4484        self
4485    }
4486
4487    /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4488    ///
4489    /// # Example
4490    /// ```ignore,no_run
4491    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4492    /// use wkt::Duration;
4493    /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(Some(Duration::default()/* use setters */));
4494    /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(None::<Duration>);
4495    /// ```
4496    pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4497    where
4498        T: std::convert::Into<wkt::Duration>,
4499    {
4500        self.execution_timeout = v.map(|x| x.into());
4501        self
4502    }
4503
4504    /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
4505    ///
4506    /// # Example
4507    /// ```ignore,no_run
4508    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4509    /// let x = ExecutionConfig::new().set_verbose(true);
4510    /// ```
4511    pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4512        self.verbose = v.into();
4513        self
4514    }
4515
4516    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
4517    ///
4518    /// Note that all the setters affecting `execution_environment` are mutually
4519    /// exclusive.
4520    ///
4521    /// # Example
4522    /// ```ignore,no_run
4523    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4524    /// use google_cloud_deploy_v1::model::DefaultPool;
4525    /// let x = ExecutionConfig::new().set_execution_environment(Some(
4526    ///     google_cloud_deploy_v1::model::execution_config::ExecutionEnvironment::DefaultPool(DefaultPool::default().into())));
4527    /// ```
4528    pub fn set_execution_environment<
4529        T: std::convert::Into<
4530                std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4531            >,
4532    >(
4533        mut self,
4534        v: T,
4535    ) -> Self {
4536        self.execution_environment = v.into();
4537        self
4538    }
4539
4540    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4541    /// if it holds a `DefaultPool`, `None` if the field is not set or
4542    /// holds a different branch.
4543    pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
4544        #[allow(unreachable_patterns)]
4545        self.execution_environment.as_ref().and_then(|v| match v {
4546            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
4547                std::option::Option::Some(v)
4548            }
4549            _ => std::option::Option::None,
4550        })
4551    }
4552
4553    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4554    /// to hold a `DefaultPool`.
4555    ///
4556    /// Note that all the setters affecting `execution_environment` are
4557    /// mutually exclusive.
4558    ///
4559    /// # Example
4560    /// ```ignore,no_run
4561    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4562    /// use google_cloud_deploy_v1::model::DefaultPool;
4563    /// let x = ExecutionConfig::new().set_default_pool(DefaultPool::default()/* use setters */);
4564    /// assert!(x.default_pool().is_some());
4565    /// assert!(x.private_pool().is_none());
4566    /// ```
4567    pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
4568        mut self,
4569        v: T,
4570    ) -> Self {
4571        self.execution_environment = std::option::Option::Some(
4572            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
4573        );
4574        self
4575    }
4576
4577    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4578    /// if it holds a `PrivatePool`, `None` if the field is not set or
4579    /// holds a different branch.
4580    pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
4581        #[allow(unreachable_patterns)]
4582        self.execution_environment.as_ref().and_then(|v| match v {
4583            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
4584                std::option::Option::Some(v)
4585            }
4586            _ => std::option::Option::None,
4587        })
4588    }
4589
4590    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4591    /// to hold a `PrivatePool`.
4592    ///
4593    /// Note that all the setters affecting `execution_environment` are
4594    /// mutually exclusive.
4595    ///
4596    /// # Example
4597    /// ```ignore,no_run
4598    /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4599    /// use google_cloud_deploy_v1::model::PrivatePool;
4600    /// let x = ExecutionConfig::new().set_private_pool(PrivatePool::default()/* use setters */);
4601    /// assert!(x.private_pool().is_some());
4602    /// assert!(x.default_pool().is_none());
4603    /// ```
4604    pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
4605        mut self,
4606        v: T,
4607    ) -> Self {
4608        self.execution_environment = std::option::Option::Some(
4609            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
4610        );
4611        self
4612    }
4613}
4614
4615impl wkt::message::Message for ExecutionConfig {
4616    fn typename() -> &'static str {
4617        "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
4618    }
4619}
4620
4621/// Defines additional types related to [ExecutionConfig].
4622pub mod execution_config {
4623    #[allow(unused_imports)]
4624    use super::*;
4625
4626    /// Possible usages of this configuration.
4627    ///
4628    /// # Working with unknown values
4629    ///
4630    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4631    /// additional enum variants at any time. Adding new variants is not considered
4632    /// a breaking change. Applications should write their code in anticipation of:
4633    ///
4634    /// - New values appearing in future releases of the client library, **and**
4635    /// - New values received dynamically, without application changes.
4636    ///
4637    /// Please consult the [Working with enums] section in the user guide for some
4638    /// guidelines.
4639    ///
4640    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4641    #[derive(Clone, Debug, PartialEq)]
4642    #[non_exhaustive]
4643    pub enum ExecutionEnvironmentUsage {
4644        /// Default value. This value is unused.
4645        Unspecified,
4646        /// Use for rendering.
4647        Render,
4648        /// Use for deploying and deployment hooks.
4649        Deploy,
4650        /// Use for deployment verification.
4651        Verify,
4652        /// Use for predeploy job execution.
4653        Predeploy,
4654        /// Use for postdeploy job execution.
4655        Postdeploy,
4656        /// If set, the enum was initialized with an unknown value.
4657        ///
4658        /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
4659        /// [ExecutionEnvironmentUsage::name].
4660        UnknownValue(execution_environment_usage::UnknownValue),
4661    }
4662
4663    #[doc(hidden)]
4664    pub mod execution_environment_usage {
4665        #[allow(unused_imports)]
4666        use super::*;
4667        #[derive(Clone, Debug, PartialEq)]
4668        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4669    }
4670
4671    impl ExecutionEnvironmentUsage {
4672        /// Gets the enum value.
4673        ///
4674        /// Returns `None` if the enum contains an unknown value deserialized from
4675        /// the string representation of enums.
4676        pub fn value(&self) -> std::option::Option<i32> {
4677            match self {
4678                Self::Unspecified => std::option::Option::Some(0),
4679                Self::Render => std::option::Option::Some(1),
4680                Self::Deploy => std::option::Option::Some(2),
4681                Self::Verify => std::option::Option::Some(3),
4682                Self::Predeploy => std::option::Option::Some(4),
4683                Self::Postdeploy => std::option::Option::Some(5),
4684                Self::UnknownValue(u) => u.0.value(),
4685            }
4686        }
4687
4688        /// Gets the enum value as a string.
4689        ///
4690        /// Returns `None` if the enum contains an unknown value deserialized from
4691        /// the integer representation of enums.
4692        pub fn name(&self) -> std::option::Option<&str> {
4693            match self {
4694                Self::Unspecified => {
4695                    std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
4696                }
4697                Self::Render => std::option::Option::Some("RENDER"),
4698                Self::Deploy => std::option::Option::Some("DEPLOY"),
4699                Self::Verify => std::option::Option::Some("VERIFY"),
4700                Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
4701                Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
4702                Self::UnknownValue(u) => u.0.name(),
4703            }
4704        }
4705    }
4706
4707    impl std::default::Default for ExecutionEnvironmentUsage {
4708        fn default() -> Self {
4709            use std::convert::From;
4710            Self::from(0)
4711        }
4712    }
4713
4714    impl std::fmt::Display for ExecutionEnvironmentUsage {
4715        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4716            wkt::internal::display_enum(f, self.name(), self.value())
4717        }
4718    }
4719
4720    impl std::convert::From<i32> for ExecutionEnvironmentUsage {
4721        fn from(value: i32) -> Self {
4722            match value {
4723                0 => Self::Unspecified,
4724                1 => Self::Render,
4725                2 => Self::Deploy,
4726                3 => Self::Verify,
4727                4 => Self::Predeploy,
4728                5 => Self::Postdeploy,
4729                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4730                    wkt::internal::UnknownEnumValue::Integer(value),
4731                )),
4732            }
4733        }
4734    }
4735
4736    impl std::convert::From<&str> for ExecutionEnvironmentUsage {
4737        fn from(value: &str) -> Self {
4738            use std::string::ToString;
4739            match value {
4740                "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
4741                "RENDER" => Self::Render,
4742                "DEPLOY" => Self::Deploy,
4743                "VERIFY" => Self::Verify,
4744                "PREDEPLOY" => Self::Predeploy,
4745                "POSTDEPLOY" => Self::Postdeploy,
4746                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4747                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4748                )),
4749            }
4750        }
4751    }
4752
4753    impl serde::ser::Serialize for ExecutionEnvironmentUsage {
4754        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4755        where
4756            S: serde::Serializer,
4757        {
4758            match self {
4759                Self::Unspecified => serializer.serialize_i32(0),
4760                Self::Render => serializer.serialize_i32(1),
4761                Self::Deploy => serializer.serialize_i32(2),
4762                Self::Verify => serializer.serialize_i32(3),
4763                Self::Predeploy => serializer.serialize_i32(4),
4764                Self::Postdeploy => serializer.serialize_i32(5),
4765                Self::UnknownValue(u) => u.0.serialize(serializer),
4766            }
4767        }
4768    }
4769
4770    impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
4771        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4772        where
4773            D: serde::Deserializer<'de>,
4774        {
4775            deserializer.deserialize_any(
4776                wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
4777                    ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
4778                ),
4779            )
4780        }
4781    }
4782
4783    /// Details of the environment.
4784    #[derive(Clone, Debug, PartialEq)]
4785    #[non_exhaustive]
4786    pub enum ExecutionEnvironment {
4787        /// Optional. Use default Cloud Build pool.
4788        DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
4789        /// Optional. Use private Cloud Build pool.
4790        PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
4791    }
4792}
4793
4794/// Execution using the default Cloud Build pool.
4795#[derive(Clone, Default, PartialEq)]
4796#[non_exhaustive]
4797pub struct DefaultPool {
4798    /// Optional. Google service account to use for execution. If unspecified,
4799    /// the project execution service account
4800    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4801    pub service_account: std::string::String,
4802
4803    /// Optional. Cloud Storage location where execution outputs should be stored.
4804    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4805    /// ("gs://my-bucket/my-dir").
4806    /// If unspecified, a default bucket located in the same region will be used.
4807    pub artifact_storage: std::string::String,
4808
4809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4810}
4811
4812impl DefaultPool {
4813    /// Creates a new default instance.
4814    pub fn new() -> Self {
4815        std::default::Default::default()
4816    }
4817
4818    /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
4819    ///
4820    /// # Example
4821    /// ```ignore,no_run
4822    /// # use google_cloud_deploy_v1::model::DefaultPool;
4823    /// let x = DefaultPool::new().set_service_account("example");
4824    /// ```
4825    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4826        self.service_account = v.into();
4827        self
4828    }
4829
4830    /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
4831    ///
4832    /// # Example
4833    /// ```ignore,no_run
4834    /// # use google_cloud_deploy_v1::model::DefaultPool;
4835    /// let x = DefaultPool::new().set_artifact_storage("example");
4836    /// ```
4837    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4838        mut self,
4839        v: T,
4840    ) -> Self {
4841        self.artifact_storage = v.into();
4842        self
4843    }
4844}
4845
4846impl wkt::message::Message for DefaultPool {
4847    fn typename() -> &'static str {
4848        "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
4849    }
4850}
4851
4852/// Execution using a private Cloud Build pool.
4853#[derive(Clone, Default, PartialEq)]
4854#[non_exhaustive]
4855pub struct PrivatePool {
4856    /// Required. Resource name of the Cloud Build worker pool to use. The format
4857    /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
4858    pub worker_pool: std::string::String,
4859
4860    /// Optional. Google service account to use for execution. If unspecified,
4861    /// the project execution service account
4862    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4863    pub service_account: std::string::String,
4864
4865    /// Optional. Cloud Storage location where execution outputs should be stored.
4866    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4867    /// ("gs://my-bucket/my-dir").
4868    /// If unspecified, a default bucket located in the same region will be used.
4869    pub artifact_storage: std::string::String,
4870
4871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4872}
4873
4874impl PrivatePool {
4875    /// Creates a new default instance.
4876    pub fn new() -> Self {
4877        std::default::Default::default()
4878    }
4879
4880    /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
4881    ///
4882    /// # Example
4883    /// ```ignore,no_run
4884    /// # use google_cloud_deploy_v1::model::PrivatePool;
4885    /// let x = PrivatePool::new().set_worker_pool("example");
4886    /// ```
4887    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4888        self.worker_pool = v.into();
4889        self
4890    }
4891
4892    /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
4893    ///
4894    /// # Example
4895    /// ```ignore,no_run
4896    /// # use google_cloud_deploy_v1::model::PrivatePool;
4897    /// let x = PrivatePool::new().set_service_account("example");
4898    /// ```
4899    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4900        self.service_account = v.into();
4901        self
4902    }
4903
4904    /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
4905    ///
4906    /// # Example
4907    /// ```ignore,no_run
4908    /// # use google_cloud_deploy_v1::model::PrivatePool;
4909    /// let x = PrivatePool::new().set_artifact_storage("example");
4910    /// ```
4911    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4912        mut self,
4913        v: T,
4914    ) -> Self {
4915        self.artifact_storage = v.into();
4916        self
4917    }
4918}
4919
4920impl wkt::message::Message for PrivatePool {
4921    fn typename() -> &'static str {
4922        "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
4923    }
4924}
4925
4926/// Information specifying a GKE Cluster.
4927#[derive(Clone, Default, PartialEq)]
4928#[non_exhaustive]
4929pub struct GkeCluster {
4930    /// Optional. Information specifying a GKE Cluster. Format is
4931    /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
4932    pub cluster: std::string::String,
4933
4934    /// Optional. If true, `cluster` is accessed using the private IP address of
4935    /// the control plane endpoint. Otherwise, the default IP address of the
4936    /// control plane endpoint is used. The default IP address is the private IP
4937    /// address for clusters with private control-plane endpoints and the public IP
4938    /// address otherwise.
4939    ///
4940    /// Only specify this option when `cluster` is a [private GKE
4941    /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
4942    /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
4943    pub internal_ip: bool,
4944
4945    /// Optional. If set, used to configure a
4946    /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
4947    /// to the Kubernetes server.
4948    pub proxy_url: std::string::String,
4949
4950    /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
4951    /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
4952    pub dns_endpoint: bool,
4953
4954    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4955}
4956
4957impl GkeCluster {
4958    /// Creates a new default instance.
4959    pub fn new() -> Self {
4960        std::default::Default::default()
4961    }
4962
4963    /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
4964    ///
4965    /// # Example
4966    /// ```ignore,no_run
4967    /// # use google_cloud_deploy_v1::model::GkeCluster;
4968    /// let x = GkeCluster::new().set_cluster("example");
4969    /// ```
4970    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4971        self.cluster = v.into();
4972        self
4973    }
4974
4975    /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
4976    ///
4977    /// # Example
4978    /// ```ignore,no_run
4979    /// # use google_cloud_deploy_v1::model::GkeCluster;
4980    /// let x = GkeCluster::new().set_internal_ip(true);
4981    /// ```
4982    pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4983        self.internal_ip = v.into();
4984        self
4985    }
4986
4987    /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
4988    ///
4989    /// # Example
4990    /// ```ignore,no_run
4991    /// # use google_cloud_deploy_v1::model::GkeCluster;
4992    /// let x = GkeCluster::new().set_proxy_url("example");
4993    /// ```
4994    pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4995        self.proxy_url = v.into();
4996        self
4997    }
4998
4999    /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
5000    ///
5001    /// # Example
5002    /// ```ignore,no_run
5003    /// # use google_cloud_deploy_v1::model::GkeCluster;
5004    /// let x = GkeCluster::new().set_dns_endpoint(true);
5005    /// ```
5006    pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5007        self.dns_endpoint = v.into();
5008        self
5009    }
5010}
5011
5012impl wkt::message::Message for GkeCluster {
5013    fn typename() -> &'static str {
5014        "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
5015    }
5016}
5017
5018/// Information specifying an Anthos Cluster.
5019#[derive(Clone, Default, PartialEq)]
5020#[non_exhaustive]
5021pub struct AnthosCluster {
5022    /// Optional. Membership of the GKE Hub-registered cluster to which to apply
5023    /// the Skaffold configuration. Format is
5024    /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
5025    pub membership: std::string::String,
5026
5027    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5028}
5029
5030impl AnthosCluster {
5031    /// Creates a new default instance.
5032    pub fn new() -> Self {
5033        std::default::Default::default()
5034    }
5035
5036    /// Sets the value of [membership][crate::model::AnthosCluster::membership].
5037    ///
5038    /// # Example
5039    /// ```ignore,no_run
5040    /// # use google_cloud_deploy_v1::model::AnthosCluster;
5041    /// let x = AnthosCluster::new().set_membership("example");
5042    /// ```
5043    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5044        self.membership = v.into();
5045        self
5046    }
5047}
5048
5049impl wkt::message::Message for AnthosCluster {
5050    fn typename() -> &'static str {
5051        "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
5052    }
5053}
5054
5055/// Information specifying where to deploy a Cloud Run Service.
5056#[derive(Clone, Default, PartialEq)]
5057#[non_exhaustive]
5058pub struct CloudRunLocation {
5059    /// Required. The location for the Cloud Run Service. Format must be
5060    /// `projects/{project}/locations/{location}`.
5061    pub location: std::string::String,
5062
5063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5064}
5065
5066impl CloudRunLocation {
5067    /// Creates a new default instance.
5068    pub fn new() -> Self {
5069        std::default::Default::default()
5070    }
5071
5072    /// Sets the value of [location][crate::model::CloudRunLocation::location].
5073    ///
5074    /// # Example
5075    /// ```ignore,no_run
5076    /// # use google_cloud_deploy_v1::model::CloudRunLocation;
5077    /// let x = CloudRunLocation::new().set_location("example");
5078    /// ```
5079    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5080        self.location = v.into();
5081        self
5082    }
5083}
5084
5085impl wkt::message::Message for CloudRunLocation {
5086    fn typename() -> &'static str {
5087        "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
5088    }
5089}
5090
5091/// Information specifying a multiTarget.
5092#[derive(Clone, Default, PartialEq)]
5093#[non_exhaustive]
5094pub struct MultiTarget {
5095    /// Required. The target_ids of this multiTarget.
5096    pub target_ids: std::vec::Vec<std::string::String>,
5097
5098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5099}
5100
5101impl MultiTarget {
5102    /// Creates a new default instance.
5103    pub fn new() -> Self {
5104        std::default::Default::default()
5105    }
5106
5107    /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
5108    ///
5109    /// # Example
5110    /// ```ignore,no_run
5111    /// # use google_cloud_deploy_v1::model::MultiTarget;
5112    /// let x = MultiTarget::new().set_target_ids(["a", "b", "c"]);
5113    /// ```
5114    pub fn set_target_ids<T, V>(mut self, v: T) -> Self
5115    where
5116        T: std::iter::IntoIterator<Item = V>,
5117        V: std::convert::Into<std::string::String>,
5118    {
5119        use std::iter::Iterator;
5120        self.target_ids = v.into_iter().map(|i| i.into()).collect();
5121        self
5122    }
5123}
5124
5125impl wkt::message::Message for MultiTarget {
5126    fn typename() -> &'static str {
5127        "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
5128    }
5129}
5130
5131/// Information specifying a Custom Target.
5132#[derive(Clone, Default, PartialEq)]
5133#[non_exhaustive]
5134pub struct CustomTarget {
5135    /// Required. The name of the CustomTargetType. Format must be
5136    /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
5137    pub custom_target_type: std::string::String,
5138
5139    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5140}
5141
5142impl CustomTarget {
5143    /// Creates a new default instance.
5144    pub fn new() -> Self {
5145        std::default::Default::default()
5146    }
5147
5148    /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
5149    ///
5150    /// # Example
5151    /// ```ignore,no_run
5152    /// # use google_cloud_deploy_v1::model::CustomTarget;
5153    /// # let project_id = "project_id";
5154    /// # let location_id = "location_id";
5155    /// # let custom_target_type_id = "custom_target_type_id";
5156    /// let x = CustomTarget::new().set_custom_target_type(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
5157    /// ```
5158    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
5159        mut self,
5160        v: T,
5161    ) -> Self {
5162        self.custom_target_type = v.into();
5163        self
5164    }
5165}
5166
5167impl wkt::message::Message for CustomTarget {
5168    fn typename() -> &'static str {
5169        "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
5170    }
5171}
5172
5173/// Information about entities associated with a `Target`.
5174#[derive(Clone, Default, PartialEq)]
5175#[non_exhaustive]
5176pub struct AssociatedEntities {
5177    /// Optional. Information specifying GKE clusters as associated entities.
5178    pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
5179
5180    /// Optional. Information specifying Anthos clusters as associated entities.
5181    pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
5182
5183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5184}
5185
5186impl AssociatedEntities {
5187    /// Creates a new default instance.
5188    pub fn new() -> Self {
5189        std::default::Default::default()
5190    }
5191
5192    /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
5193    ///
5194    /// # Example
5195    /// ```ignore,no_run
5196    /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5197    /// use google_cloud_deploy_v1::model::GkeCluster;
5198    /// let x = AssociatedEntities::new()
5199    ///     .set_gke_clusters([
5200    ///         GkeCluster::default()/* use setters */,
5201    ///         GkeCluster::default()/* use (different) setters */,
5202    ///     ]);
5203    /// ```
5204    pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
5205    where
5206        T: std::iter::IntoIterator<Item = V>,
5207        V: std::convert::Into<crate::model::GkeCluster>,
5208    {
5209        use std::iter::Iterator;
5210        self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
5211        self
5212    }
5213
5214    /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
5215    ///
5216    /// # Example
5217    /// ```ignore,no_run
5218    /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5219    /// use google_cloud_deploy_v1::model::AnthosCluster;
5220    /// let x = AssociatedEntities::new()
5221    ///     .set_anthos_clusters([
5222    ///         AnthosCluster::default()/* use setters */,
5223    ///         AnthosCluster::default()/* use (different) setters */,
5224    ///     ]);
5225    /// ```
5226    pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
5227    where
5228        T: std::iter::IntoIterator<Item = V>,
5229        V: std::convert::Into<crate::model::AnthosCluster>,
5230    {
5231        use std::iter::Iterator;
5232        self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
5233        self
5234    }
5235}
5236
5237impl wkt::message::Message for AssociatedEntities {
5238    fn typename() -> &'static str {
5239        "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
5240    }
5241}
5242
5243/// The request object for `ListTargets`.
5244#[derive(Clone, Default, PartialEq)]
5245#[non_exhaustive]
5246pub struct ListTargetsRequest {
5247    /// Required. The parent, which owns this collection of targets. Format must be
5248    /// `projects/{project_id}/locations/{location_name}`.
5249    pub parent: std::string::String,
5250
5251    /// Optional. The maximum number of `Target` objects to return. The service may
5252    /// return fewer than this value. If unspecified, at most 50 `Target` objects
5253    /// will be returned. The maximum value is 1000; values above 1000 will be set
5254    /// to 1000.
5255    pub page_size: i32,
5256
5257    /// Optional. A page token, received from a previous `ListTargets` call.
5258    /// Provide this to retrieve the subsequent page.
5259    ///
5260    /// When paginating, all other provided parameters match
5261    /// the call that provided the page token.
5262    pub page_token: std::string::String,
5263
5264    /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
5265    /// more details.
5266    pub filter: std::string::String,
5267
5268    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
5269    /// more details.
5270    pub order_by: std::string::String,
5271
5272    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5273}
5274
5275impl ListTargetsRequest {
5276    /// Creates a new default instance.
5277    pub fn new() -> Self {
5278        std::default::Default::default()
5279    }
5280
5281    /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
5282    ///
5283    /// # Example
5284    /// ```ignore,no_run
5285    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5286    /// # let project_id = "project_id";
5287    /// # let location_id = "location_id";
5288    /// let x = ListTargetsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5289    /// ```
5290    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5291        self.parent = v.into();
5292        self
5293    }
5294
5295    /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
5296    ///
5297    /// # Example
5298    /// ```ignore,no_run
5299    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5300    /// let x = ListTargetsRequest::new().set_page_size(42);
5301    /// ```
5302    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5303        self.page_size = v.into();
5304        self
5305    }
5306
5307    /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
5308    ///
5309    /// # Example
5310    /// ```ignore,no_run
5311    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5312    /// let x = ListTargetsRequest::new().set_page_token("example");
5313    /// ```
5314    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5315        self.page_token = v.into();
5316        self
5317    }
5318
5319    /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
5320    ///
5321    /// # Example
5322    /// ```ignore,no_run
5323    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5324    /// let x = ListTargetsRequest::new().set_filter("example");
5325    /// ```
5326    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5327        self.filter = v.into();
5328        self
5329    }
5330
5331    /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
5332    ///
5333    /// # Example
5334    /// ```ignore,no_run
5335    /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5336    /// let x = ListTargetsRequest::new().set_order_by("example");
5337    /// ```
5338    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5339        self.order_by = v.into();
5340        self
5341    }
5342}
5343
5344impl wkt::message::Message for ListTargetsRequest {
5345    fn typename() -> &'static str {
5346        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
5347    }
5348}
5349
5350/// The response object from `ListTargets`.
5351#[derive(Clone, Default, PartialEq)]
5352#[non_exhaustive]
5353pub struct ListTargetsResponse {
5354    /// The `Target` objects.
5355    pub targets: std::vec::Vec<crate::model::Target>,
5356
5357    /// A token, which can be sent as `page_token` to retrieve the next page.
5358    /// If this field is omitted, there are no subsequent pages.
5359    pub next_page_token: std::string::String,
5360
5361    /// Locations that could not be reached.
5362    pub unreachable: std::vec::Vec<std::string::String>,
5363
5364    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5365}
5366
5367impl ListTargetsResponse {
5368    /// Creates a new default instance.
5369    pub fn new() -> Self {
5370        std::default::Default::default()
5371    }
5372
5373    /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
5374    ///
5375    /// # Example
5376    /// ```ignore,no_run
5377    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5378    /// use google_cloud_deploy_v1::model::Target;
5379    /// let x = ListTargetsResponse::new()
5380    ///     .set_targets([
5381    ///         Target::default()/* use setters */,
5382    ///         Target::default()/* use (different) setters */,
5383    ///     ]);
5384    /// ```
5385    pub fn set_targets<T, V>(mut self, v: T) -> Self
5386    where
5387        T: std::iter::IntoIterator<Item = V>,
5388        V: std::convert::Into<crate::model::Target>,
5389    {
5390        use std::iter::Iterator;
5391        self.targets = v.into_iter().map(|i| i.into()).collect();
5392        self
5393    }
5394
5395    /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
5396    ///
5397    /// # Example
5398    /// ```ignore,no_run
5399    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5400    /// let x = ListTargetsResponse::new().set_next_page_token("example");
5401    /// ```
5402    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5403        self.next_page_token = v.into();
5404        self
5405    }
5406
5407    /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
5408    ///
5409    /// # Example
5410    /// ```ignore,no_run
5411    /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5412    /// let x = ListTargetsResponse::new().set_unreachable(["a", "b", "c"]);
5413    /// ```
5414    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5415    where
5416        T: std::iter::IntoIterator<Item = V>,
5417        V: std::convert::Into<std::string::String>,
5418    {
5419        use std::iter::Iterator;
5420        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5421        self
5422    }
5423}
5424
5425impl wkt::message::Message for ListTargetsResponse {
5426    fn typename() -> &'static str {
5427        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
5428    }
5429}
5430
5431#[doc(hidden)]
5432impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetsResponse {
5433    type PageItem = crate::model::Target;
5434
5435    fn items(self) -> std::vec::Vec<Self::PageItem> {
5436        self.targets
5437    }
5438
5439    fn next_page_token(&self) -> std::string::String {
5440        use std::clone::Clone;
5441        self.next_page_token.clone()
5442    }
5443}
5444
5445/// The request object for `GetTarget`.
5446#[derive(Clone, Default, PartialEq)]
5447#[non_exhaustive]
5448pub struct GetTargetRequest {
5449    /// Required. Name of the `Target`. Format must be
5450    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5451    pub name: std::string::String,
5452
5453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5454}
5455
5456impl GetTargetRequest {
5457    /// Creates a new default instance.
5458    pub fn new() -> Self {
5459        std::default::Default::default()
5460    }
5461
5462    /// Sets the value of [name][crate::model::GetTargetRequest::name].
5463    ///
5464    /// # Example
5465    /// ```ignore,no_run
5466    /// # use google_cloud_deploy_v1::model::GetTargetRequest;
5467    /// # let project_id = "project_id";
5468    /// # let location_id = "location_id";
5469    /// # let target_id = "target_id";
5470    /// let x = GetTargetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/targets/{target_id}"));
5471    /// ```
5472    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5473        self.name = v.into();
5474        self
5475    }
5476}
5477
5478impl wkt::message::Message for GetTargetRequest {
5479    fn typename() -> &'static str {
5480        "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
5481    }
5482}
5483
5484/// The request object for `CreateTarget`.
5485#[derive(Clone, Default, PartialEq)]
5486#[non_exhaustive]
5487pub struct CreateTargetRequest {
5488    /// Required. The parent collection in which the `Target` must be created.
5489    /// The format is
5490    /// `projects/{project_id}/locations/{location_name}`.
5491    pub parent: std::string::String,
5492
5493    /// Required. ID of the `Target`.
5494    pub target_id: std::string::String,
5495
5496    /// Required. The `Target` to create.
5497    pub target: std::option::Option<crate::model::Target>,
5498
5499    /// Optional. A request ID to identify requests. Specify a unique request ID
5500    /// so that if you must retry your request, the server knows to ignore the
5501    /// request if it has already been completed. The server guarantees that for
5502    /// at least 60 minutes after the first request.
5503    ///
5504    /// For example, consider a situation where you make an initial request and the
5505    /// request times out. If you make the request again with the same request ID,
5506    /// the server can check if original operation with the same request ID was
5507    /// received, and if so, will ignore the second request. This prevents clients
5508    /// from accidentally creating duplicate commitments.
5509    ///
5510    /// The request ID must be a valid UUID with the exception that zero UUID is
5511    /// not supported (00000000-0000-0000-0000-000000000000).
5512    pub request_id: std::string::String,
5513
5514    /// Optional. If set to true, the request is validated and the user is provided
5515    /// with an expected result, but no actual change is made.
5516    pub validate_only: bool,
5517
5518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5519}
5520
5521impl CreateTargetRequest {
5522    /// Creates a new default instance.
5523    pub fn new() -> Self {
5524        std::default::Default::default()
5525    }
5526
5527    /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
5528    ///
5529    /// # Example
5530    /// ```ignore,no_run
5531    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5532    /// # let project_id = "project_id";
5533    /// # let location_id = "location_id";
5534    /// let x = CreateTargetRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5535    /// ```
5536    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537        self.parent = v.into();
5538        self
5539    }
5540
5541    /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
5542    ///
5543    /// # Example
5544    /// ```ignore,no_run
5545    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5546    /// let x = CreateTargetRequest::new().set_target_id("example");
5547    /// ```
5548    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5549        self.target_id = v.into();
5550        self
5551    }
5552
5553    /// Sets the value of [target][crate::model::CreateTargetRequest::target].
5554    ///
5555    /// # Example
5556    /// ```ignore,no_run
5557    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5558    /// use google_cloud_deploy_v1::model::Target;
5559    /// let x = CreateTargetRequest::new().set_target(Target::default()/* use setters */);
5560    /// ```
5561    pub fn set_target<T>(mut self, v: T) -> Self
5562    where
5563        T: std::convert::Into<crate::model::Target>,
5564    {
5565        self.target = std::option::Option::Some(v.into());
5566        self
5567    }
5568
5569    /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
5570    ///
5571    /// # Example
5572    /// ```ignore,no_run
5573    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5574    /// use google_cloud_deploy_v1::model::Target;
5575    /// let x = CreateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5576    /// let x = CreateTargetRequest::new().set_or_clear_target(None::<Target>);
5577    /// ```
5578    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5579    where
5580        T: std::convert::Into<crate::model::Target>,
5581    {
5582        self.target = v.map(|x| x.into());
5583        self
5584    }
5585
5586    /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
5587    ///
5588    /// # Example
5589    /// ```ignore,no_run
5590    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5591    /// let x = CreateTargetRequest::new().set_request_id("example");
5592    /// ```
5593    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5594        self.request_id = v.into();
5595        self
5596    }
5597
5598    /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
5599    ///
5600    /// # Example
5601    /// ```ignore,no_run
5602    /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5603    /// let x = CreateTargetRequest::new().set_validate_only(true);
5604    /// ```
5605    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5606        self.validate_only = v.into();
5607        self
5608    }
5609}
5610
5611impl wkt::message::Message for CreateTargetRequest {
5612    fn typename() -> &'static str {
5613        "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
5614    }
5615}
5616
5617/// The request object for `UpdateTarget`.
5618#[derive(Clone, Default, PartialEq)]
5619#[non_exhaustive]
5620pub struct UpdateTargetRequest {
5621    /// Required. Field mask is used to specify the fields to be overwritten by the
5622    /// update in the `Target` resource. The fields specified in the update_mask
5623    /// are relative to the resource, not the full request. A field will be
5624    /// overwritten if it's in the mask. If the user doesn't provide a mask then
5625    /// all fields are overwritten.
5626    pub update_mask: std::option::Option<wkt::FieldMask>,
5627
5628    /// Required. The `Target` to update.
5629    pub target: std::option::Option<crate::model::Target>,
5630
5631    /// Optional. A request ID to identify requests. Specify a unique request ID
5632    /// so that if you must retry your request, the server knows to ignore the
5633    /// request if it has already been completed. The server guarantees that for
5634    /// at least 60 minutes after the first request.
5635    ///
5636    /// For example, consider a situation where you make an initial request and the
5637    /// request times out. If you make the request again with the same request ID,
5638    /// the server can check if original operation with the same request ID was
5639    /// received, and if so, will ignore the second request. This prevents clients
5640    /// from accidentally creating duplicate commitments.
5641    ///
5642    /// The request ID must be a valid UUID with the exception that zero UUID is
5643    /// not supported (00000000-0000-0000-0000-000000000000).
5644    pub request_id: std::string::String,
5645
5646    /// Optional. If set to true, updating a `Target` that does not exist will
5647    /// result in the creation of a new `Target`.
5648    pub allow_missing: bool,
5649
5650    /// Optional. If set to true, the request is validated and the user is provided
5651    /// with an expected result, but no actual change is made.
5652    pub validate_only: bool,
5653
5654    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5655}
5656
5657impl UpdateTargetRequest {
5658    /// Creates a new default instance.
5659    pub fn new() -> Self {
5660        std::default::Default::default()
5661    }
5662
5663    /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5664    ///
5665    /// # Example
5666    /// ```ignore,no_run
5667    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5668    /// use wkt::FieldMask;
5669    /// let x = UpdateTargetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5670    /// ```
5671    pub fn set_update_mask<T>(mut self, v: T) -> Self
5672    where
5673        T: std::convert::Into<wkt::FieldMask>,
5674    {
5675        self.update_mask = std::option::Option::Some(v.into());
5676        self
5677    }
5678
5679    /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5680    ///
5681    /// # Example
5682    /// ```ignore,no_run
5683    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5684    /// use wkt::FieldMask;
5685    /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5686    /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5687    /// ```
5688    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5689    where
5690        T: std::convert::Into<wkt::FieldMask>,
5691    {
5692        self.update_mask = v.map(|x| x.into());
5693        self
5694    }
5695
5696    /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
5697    ///
5698    /// # Example
5699    /// ```ignore,no_run
5700    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5701    /// use google_cloud_deploy_v1::model::Target;
5702    /// let x = UpdateTargetRequest::new().set_target(Target::default()/* use setters */);
5703    /// ```
5704    pub fn set_target<T>(mut self, v: T) -> Self
5705    where
5706        T: std::convert::Into<crate::model::Target>,
5707    {
5708        self.target = std::option::Option::Some(v.into());
5709        self
5710    }
5711
5712    /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
5713    ///
5714    /// # Example
5715    /// ```ignore,no_run
5716    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5717    /// use google_cloud_deploy_v1::model::Target;
5718    /// let x = UpdateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5719    /// let x = UpdateTargetRequest::new().set_or_clear_target(None::<Target>);
5720    /// ```
5721    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5722    where
5723        T: std::convert::Into<crate::model::Target>,
5724    {
5725        self.target = v.map(|x| x.into());
5726        self
5727    }
5728
5729    /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
5730    ///
5731    /// # Example
5732    /// ```ignore,no_run
5733    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5734    /// let x = UpdateTargetRequest::new().set_request_id("example");
5735    /// ```
5736    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5737        self.request_id = v.into();
5738        self
5739    }
5740
5741    /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
5742    ///
5743    /// # Example
5744    /// ```ignore,no_run
5745    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5746    /// let x = UpdateTargetRequest::new().set_allow_missing(true);
5747    /// ```
5748    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5749        self.allow_missing = v.into();
5750        self
5751    }
5752
5753    /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
5754    ///
5755    /// # Example
5756    /// ```ignore,no_run
5757    /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5758    /// let x = UpdateTargetRequest::new().set_validate_only(true);
5759    /// ```
5760    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5761        self.validate_only = v.into();
5762        self
5763    }
5764}
5765
5766impl wkt::message::Message for UpdateTargetRequest {
5767    fn typename() -> &'static str {
5768        "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
5769    }
5770}
5771
5772/// The request object for `DeleteTarget`.
5773#[derive(Clone, Default, PartialEq)]
5774#[non_exhaustive]
5775pub struct DeleteTargetRequest {
5776    /// Required. The name of the `Target` to delete. The format is
5777    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5778    pub name: std::string::String,
5779
5780    /// Optional. A request ID to identify requests. Specify a unique request ID
5781    /// so that if you must retry your request, the server knows to ignore the
5782    /// request if it has already been completed. The server guarantees that for
5783    /// at least 60 minutes after the first request.
5784    ///
5785    /// For example, consider a situation where you make an initial request and the
5786    /// request times out. If you make the request again with the same request ID,
5787    /// the server can check if original operation with the same request ID was
5788    /// received, and if so, will ignore the second request. This prevents clients
5789    /// from accidentally creating duplicate commitments.
5790    ///
5791    /// The request ID must be a valid UUID with the exception that zero UUID is
5792    /// not supported (00000000-0000-0000-0000-000000000000).
5793    pub request_id: std::string::String,
5794
5795    /// Optional. If set to true, then deleting an already deleted or non-existing
5796    /// `Target` will succeed.
5797    pub allow_missing: bool,
5798
5799    /// Optional. If set, validate the request and preview the review, but do not
5800    /// actually post it.
5801    pub validate_only: bool,
5802
5803    /// Optional. This checksum is computed by the server based on the value of
5804    /// other fields, and may be sent on update and delete requests to ensure the
5805    /// client has an up-to-date value before proceeding.
5806    pub etag: std::string::String,
5807
5808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5809}
5810
5811impl DeleteTargetRequest {
5812    /// Creates a new default instance.
5813    pub fn new() -> Self {
5814        std::default::Default::default()
5815    }
5816
5817    /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
5818    ///
5819    /// # Example
5820    /// ```ignore,no_run
5821    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5822    /// # let project_id = "project_id";
5823    /// # let location_id = "location_id";
5824    /// # let target_id = "target_id";
5825    /// let x = DeleteTargetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/targets/{target_id}"));
5826    /// ```
5827    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828        self.name = v.into();
5829        self
5830    }
5831
5832    /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
5833    ///
5834    /// # Example
5835    /// ```ignore,no_run
5836    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5837    /// let x = DeleteTargetRequest::new().set_request_id("example");
5838    /// ```
5839    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5840        self.request_id = v.into();
5841        self
5842    }
5843
5844    /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
5845    ///
5846    /// # Example
5847    /// ```ignore,no_run
5848    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5849    /// let x = DeleteTargetRequest::new().set_allow_missing(true);
5850    /// ```
5851    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5852        self.allow_missing = v.into();
5853        self
5854    }
5855
5856    /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
5857    ///
5858    /// # Example
5859    /// ```ignore,no_run
5860    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5861    /// let x = DeleteTargetRequest::new().set_validate_only(true);
5862    /// ```
5863    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5864        self.validate_only = v.into();
5865        self
5866    }
5867
5868    /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
5869    ///
5870    /// # Example
5871    /// ```ignore,no_run
5872    /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5873    /// let x = DeleteTargetRequest::new().set_etag("example");
5874    /// ```
5875    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5876        self.etag = v.into();
5877        self
5878    }
5879}
5880
5881impl wkt::message::Message for DeleteTargetRequest {
5882    fn typename() -> &'static str {
5883        "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
5884    }
5885}
5886
5887/// A `CustomTargetType` resource in the Cloud Deploy API.
5888///
5889/// A `CustomTargetType` defines a type of custom target that can be referenced
5890/// in a `Target` in order to facilitate deploying to other systems besides the
5891/// supported runtimes.
5892#[derive(Clone, Default, PartialEq)]
5893#[non_exhaustive]
5894pub struct CustomTargetType {
5895    /// Identifier. Name of the `CustomTargetType`. Format is
5896    /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
5897    /// The `customTargetType` component must match
5898    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5899    pub name: std::string::String,
5900
5901    /// Output only. Resource id of the `CustomTargetType`.
5902    pub custom_target_type_id: std::string::String,
5903
5904    /// Output only. Unique identifier of the `CustomTargetType`.
5905    pub uid: std::string::String,
5906
5907    /// Optional. Description of the `CustomTargetType`. Max length is 255
5908    /// characters.
5909    pub description: std::string::String,
5910
5911    /// Optional. User annotations. These attributes can only be set and used by
5912    /// the user, and not by Cloud Deploy. See
5913    /// <https://google.aip.dev/128#annotations> for more details such as format and
5914    /// size limitations.
5915    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5916
5917    /// Optional. Labels are attributes that can be set and used by both the
5918    /// user and by Cloud Deploy. Labels must meet the following constraints:
5919    ///
5920    /// * Keys and values can contain only lowercase letters, numeric characters,
5921    ///   underscores, and dashes.
5922    /// * All characters must use UTF-8 encoding, and international characters are
5923    ///   allowed.
5924    /// * Keys must start with a lowercase letter or international character.
5925    /// * Each resource is limited to a maximum of 64 labels.
5926    ///
5927    /// Both keys and values are additionally constrained to be <= 128 bytes.
5928    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5929
5930    /// Output only. Time at which the `CustomTargetType` was created.
5931    pub create_time: std::option::Option<wkt::Timestamp>,
5932
5933    /// Output only. Most recent time at which the `CustomTargetType` was updated.
5934    pub update_time: std::option::Option<wkt::Timestamp>,
5935
5936    /// Optional. This checksum is computed by the server based on the value of
5937    /// other fields, and may be sent on update and delete requests to ensure the
5938    /// client has an up-to-date value before proceeding.
5939    pub etag: std::string::String,
5940
5941    /// Defines the `CustomTargetType` renderer and deployer.
5942    pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
5943
5944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5945}
5946
5947impl CustomTargetType {
5948    /// Creates a new default instance.
5949    pub fn new() -> Self {
5950        std::default::Default::default()
5951    }
5952
5953    /// Sets the value of [name][crate::model::CustomTargetType::name].
5954    ///
5955    /// # Example
5956    /// ```ignore,no_run
5957    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5958    /// # let project_id = "project_id";
5959    /// # let location_id = "location_id";
5960    /// # let custom_target_type_id = "custom_target_type_id";
5961    /// let x = CustomTargetType::new().set_name(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
5962    /// ```
5963    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5964        self.name = v.into();
5965        self
5966    }
5967
5968    /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
5969    ///
5970    /// # Example
5971    /// ```ignore,no_run
5972    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5973    /// let x = CustomTargetType::new().set_custom_target_type_id("example");
5974    /// ```
5975    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5976        mut self,
5977        v: T,
5978    ) -> Self {
5979        self.custom_target_type_id = v.into();
5980        self
5981    }
5982
5983    /// Sets the value of [uid][crate::model::CustomTargetType::uid].
5984    ///
5985    /// # Example
5986    /// ```ignore,no_run
5987    /// # use google_cloud_deploy_v1::model::CustomTargetType;
5988    /// let x = CustomTargetType::new().set_uid("example");
5989    /// ```
5990    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5991        self.uid = v.into();
5992        self
5993    }
5994
5995    /// Sets the value of [description][crate::model::CustomTargetType::description].
5996    ///
5997    /// # Example
5998    /// ```ignore,no_run
5999    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6000    /// let x = CustomTargetType::new().set_description("example");
6001    /// ```
6002    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6003        self.description = v.into();
6004        self
6005    }
6006
6007    /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
6008    ///
6009    /// # Example
6010    /// ```ignore,no_run
6011    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6012    /// let x = CustomTargetType::new().set_annotations([
6013    ///     ("key0", "abc"),
6014    ///     ("key1", "xyz"),
6015    /// ]);
6016    /// ```
6017    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6018    where
6019        T: std::iter::IntoIterator<Item = (K, V)>,
6020        K: std::convert::Into<std::string::String>,
6021        V: std::convert::Into<std::string::String>,
6022    {
6023        use std::iter::Iterator;
6024        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6025        self
6026    }
6027
6028    /// Sets the value of [labels][crate::model::CustomTargetType::labels].
6029    ///
6030    /// # Example
6031    /// ```ignore,no_run
6032    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6033    /// let x = CustomTargetType::new().set_labels([
6034    ///     ("key0", "abc"),
6035    ///     ("key1", "xyz"),
6036    /// ]);
6037    /// ```
6038    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6039    where
6040        T: std::iter::IntoIterator<Item = (K, V)>,
6041        K: std::convert::Into<std::string::String>,
6042        V: std::convert::Into<std::string::String>,
6043    {
6044        use std::iter::Iterator;
6045        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6046        self
6047    }
6048
6049    /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
6050    ///
6051    /// # Example
6052    /// ```ignore,no_run
6053    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6054    /// use wkt::Timestamp;
6055    /// let x = CustomTargetType::new().set_create_time(Timestamp::default()/* use setters */);
6056    /// ```
6057    pub fn set_create_time<T>(mut self, v: T) -> Self
6058    where
6059        T: std::convert::Into<wkt::Timestamp>,
6060    {
6061        self.create_time = std::option::Option::Some(v.into());
6062        self
6063    }
6064
6065    /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
6066    ///
6067    /// # Example
6068    /// ```ignore,no_run
6069    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6070    /// use wkt::Timestamp;
6071    /// let x = CustomTargetType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6072    /// let x = CustomTargetType::new().set_or_clear_create_time(None::<Timestamp>);
6073    /// ```
6074    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6075    where
6076        T: std::convert::Into<wkt::Timestamp>,
6077    {
6078        self.create_time = v.map(|x| x.into());
6079        self
6080    }
6081
6082    /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
6083    ///
6084    /// # Example
6085    /// ```ignore,no_run
6086    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6087    /// use wkt::Timestamp;
6088    /// let x = CustomTargetType::new().set_update_time(Timestamp::default()/* use setters */);
6089    /// ```
6090    pub fn set_update_time<T>(mut self, v: T) -> Self
6091    where
6092        T: std::convert::Into<wkt::Timestamp>,
6093    {
6094        self.update_time = std::option::Option::Some(v.into());
6095        self
6096    }
6097
6098    /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
6099    ///
6100    /// # Example
6101    /// ```ignore,no_run
6102    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6103    /// use wkt::Timestamp;
6104    /// let x = CustomTargetType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6105    /// let x = CustomTargetType::new().set_or_clear_update_time(None::<Timestamp>);
6106    /// ```
6107    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6108    where
6109        T: std::convert::Into<wkt::Timestamp>,
6110    {
6111        self.update_time = v.map(|x| x.into());
6112        self
6113    }
6114
6115    /// Sets the value of [etag][crate::model::CustomTargetType::etag].
6116    ///
6117    /// # Example
6118    /// ```ignore,no_run
6119    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6120    /// let x = CustomTargetType::new().set_etag("example");
6121    /// ```
6122    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6123        self.etag = v.into();
6124        self
6125    }
6126
6127    /// Sets the value of [definition][crate::model::CustomTargetType::definition].
6128    ///
6129    /// Note that all the setters affecting `definition` are mutually
6130    /// exclusive.
6131    ///
6132    /// # Example
6133    /// ```ignore,no_run
6134    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6135    /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6136    /// let x = CustomTargetType::new().set_definition(Some(
6137    ///     google_cloud_deploy_v1::model::custom_target_type::Definition::CustomActions(CustomTargetSkaffoldActions::default().into())));
6138    /// ```
6139    pub fn set_definition<
6140        T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
6141    >(
6142        mut self,
6143        v: T,
6144    ) -> Self {
6145        self.definition = v.into();
6146        self
6147    }
6148
6149    /// The value of [definition][crate::model::CustomTargetType::definition]
6150    /// if it holds a `CustomActions`, `None` if the field is not set or
6151    /// holds a different branch.
6152    pub fn custom_actions(
6153        &self,
6154    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
6155        #[allow(unreachable_patterns)]
6156        self.definition.as_ref().and_then(|v| match v {
6157            crate::model::custom_target_type::Definition::CustomActions(v) => {
6158                std::option::Option::Some(v)
6159            }
6160            _ => std::option::Option::None,
6161        })
6162    }
6163
6164    /// Sets the value of [definition][crate::model::CustomTargetType::definition]
6165    /// to hold a `CustomActions`.
6166    ///
6167    /// Note that all the setters affecting `definition` are
6168    /// mutually exclusive.
6169    ///
6170    /// # Example
6171    /// ```ignore,no_run
6172    /// # use google_cloud_deploy_v1::model::CustomTargetType;
6173    /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6174    /// let x = CustomTargetType::new().set_custom_actions(CustomTargetSkaffoldActions::default()/* use setters */);
6175    /// assert!(x.custom_actions().is_some());
6176    /// ```
6177    pub fn set_custom_actions<
6178        T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
6179    >(
6180        mut self,
6181        v: T,
6182    ) -> Self {
6183        self.definition = std::option::Option::Some(
6184            crate::model::custom_target_type::Definition::CustomActions(v.into()),
6185        );
6186        self
6187    }
6188}
6189
6190impl wkt::message::Message for CustomTargetType {
6191    fn typename() -> &'static str {
6192        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
6193    }
6194}
6195
6196/// Defines additional types related to [CustomTargetType].
6197pub mod custom_target_type {
6198    #[allow(unused_imports)]
6199    use super::*;
6200
6201    /// Defines the `CustomTargetType` renderer and deployer.
6202    #[derive(Clone, Debug, PartialEq)]
6203    #[non_exhaustive]
6204    pub enum Definition {
6205        /// Optional. Configures render and deploy for the `CustomTargetType` using
6206        /// Skaffold custom actions.
6207        CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
6208    }
6209}
6210
6211/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
6212/// using Skaffold custom actions.
6213#[derive(Clone, Default, PartialEq)]
6214#[non_exhaustive]
6215pub struct CustomTargetSkaffoldActions {
6216    /// Optional. The Skaffold custom action responsible for render operations. If
6217    /// not provided then Cloud Deploy will perform the render operations via
6218    /// `skaffold render`.
6219    pub render_action: std::string::String,
6220
6221    /// Required. The Skaffold custom action responsible for deploy operations.
6222    pub deploy_action: std::string::String,
6223
6224    /// Optional. List of Skaffold modules Cloud Deploy will include in the
6225    /// Skaffold Config as required before performing diagnose.
6226    pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
6227
6228    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6229}
6230
6231impl CustomTargetSkaffoldActions {
6232    /// Creates a new default instance.
6233    pub fn new() -> Self {
6234        std::default::Default::default()
6235    }
6236
6237    /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
6238    ///
6239    /// # Example
6240    /// ```ignore,no_run
6241    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6242    /// let x = CustomTargetSkaffoldActions::new().set_render_action("example");
6243    /// ```
6244    pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6245        self.render_action = v.into();
6246        self
6247    }
6248
6249    /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
6250    ///
6251    /// # Example
6252    /// ```ignore,no_run
6253    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6254    /// let x = CustomTargetSkaffoldActions::new().set_deploy_action("example");
6255    /// ```
6256    pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6257        self.deploy_action = v.into();
6258        self
6259    }
6260
6261    /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
6262    ///
6263    /// # Example
6264    /// ```ignore,no_run
6265    /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6266    /// use google_cloud_deploy_v1::model::SkaffoldModules;
6267    /// let x = CustomTargetSkaffoldActions::new()
6268    ///     .set_include_skaffold_modules([
6269    ///         SkaffoldModules::default()/* use setters */,
6270    ///         SkaffoldModules::default()/* use (different) setters */,
6271    ///     ]);
6272    /// ```
6273    pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
6274    where
6275        T: std::iter::IntoIterator<Item = V>,
6276        V: std::convert::Into<crate::model::SkaffoldModules>,
6277    {
6278        use std::iter::Iterator;
6279        self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
6280        self
6281    }
6282}
6283
6284impl wkt::message::Message for CustomTargetSkaffoldActions {
6285    fn typename() -> &'static str {
6286        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
6287    }
6288}
6289
6290/// Skaffold Config modules and their remote source.
6291#[derive(Clone, Default, PartialEq)]
6292#[non_exhaustive]
6293pub struct SkaffoldModules {
6294    /// Optional. The Skaffold Config modules to use from the specified source.
6295    pub configs: std::vec::Vec<std::string::String>,
6296
6297    /// The source that contains the Skaffold Config modules.
6298    pub source: std::option::Option<crate::model::skaffold_modules::Source>,
6299
6300    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6301}
6302
6303impl SkaffoldModules {
6304    /// Creates a new default instance.
6305    pub fn new() -> Self {
6306        std::default::Default::default()
6307    }
6308
6309    /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
6310    ///
6311    /// # Example
6312    /// ```ignore,no_run
6313    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6314    /// let x = SkaffoldModules::new().set_configs(["a", "b", "c"]);
6315    /// ```
6316    pub fn set_configs<T, V>(mut self, v: T) -> Self
6317    where
6318        T: std::iter::IntoIterator<Item = V>,
6319        V: std::convert::Into<std::string::String>,
6320    {
6321        use std::iter::Iterator;
6322        self.configs = v.into_iter().map(|i| i.into()).collect();
6323        self
6324    }
6325
6326    /// Sets the value of [source][crate::model::SkaffoldModules::source].
6327    ///
6328    /// Note that all the setters affecting `source` are mutually
6329    /// exclusive.
6330    ///
6331    /// # Example
6332    /// ```ignore,no_run
6333    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6334    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6335    /// let x = SkaffoldModules::new().set_source(Some(
6336    ///     google_cloud_deploy_v1::model::skaffold_modules::Source::Git(SkaffoldGitSource::default().into())));
6337    /// ```
6338    pub fn set_source<
6339        T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
6340    >(
6341        mut self,
6342        v: T,
6343    ) -> Self {
6344        self.source = v.into();
6345        self
6346    }
6347
6348    /// The value of [source][crate::model::SkaffoldModules::source]
6349    /// if it holds a `Git`, `None` if the field is not set or
6350    /// holds a different branch.
6351    pub fn git(
6352        &self,
6353    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
6354    {
6355        #[allow(unreachable_patterns)]
6356        self.source.as_ref().and_then(|v| match v {
6357            crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
6358            _ => std::option::Option::None,
6359        })
6360    }
6361
6362    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6363    /// to hold a `Git`.
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::SkaffoldGitSource;
6372    /// let x = SkaffoldModules::new().set_git(SkaffoldGitSource::default()/* use setters */);
6373    /// assert!(x.git().is_some());
6374    /// assert!(x.google_cloud_storage().is_none());
6375    /// assert!(x.google_cloud_build_repo().is_none());
6376    /// ```
6377    pub fn set_git<
6378        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
6379    >(
6380        mut self,
6381        v: T,
6382    ) -> Self {
6383        self.source =
6384            std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
6385        self
6386    }
6387
6388    /// The value of [source][crate::model::SkaffoldModules::source]
6389    /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
6390    /// holds a different branch.
6391    pub fn google_cloud_storage(
6392        &self,
6393    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
6394    {
6395        #[allow(unreachable_patterns)]
6396        self.source.as_ref().and_then(|v| match v {
6397            crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
6398                std::option::Option::Some(v)
6399            }
6400            _ => std::option::Option::None,
6401        })
6402    }
6403
6404    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6405    /// to hold a `GoogleCloudStorage`.
6406    ///
6407    /// Note that all the setters affecting `source` are
6408    /// mutually exclusive.
6409    ///
6410    /// # Example
6411    /// ```ignore,no_run
6412    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6413    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6414    /// let x = SkaffoldModules::new().set_google_cloud_storage(SkaffoldGCSSource::default()/* use setters */);
6415    /// assert!(x.google_cloud_storage().is_some());
6416    /// assert!(x.git().is_none());
6417    /// assert!(x.google_cloud_build_repo().is_none());
6418    /// ```
6419    pub fn set_google_cloud_storage<
6420        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
6421    >(
6422        mut self,
6423        v: T,
6424    ) -> Self {
6425        self.source = std::option::Option::Some(
6426            crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
6427        );
6428        self
6429    }
6430
6431    /// The value of [source][crate::model::SkaffoldModules::source]
6432    /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
6433    /// holds a different branch.
6434    pub fn google_cloud_build_repo(
6435        &self,
6436    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
6437    {
6438        #[allow(unreachable_patterns)]
6439        self.source.as_ref().and_then(|v| match v {
6440            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
6441                std::option::Option::Some(v)
6442            }
6443            _ => std::option::Option::None,
6444        })
6445    }
6446
6447    /// Sets the value of [source][crate::model::SkaffoldModules::source]
6448    /// to hold a `GoogleCloudBuildRepo`.
6449    ///
6450    /// Note that all the setters affecting `source` are
6451    /// mutually exclusive.
6452    ///
6453    /// # Example
6454    /// ```ignore,no_run
6455    /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6456    /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6457    /// let x = SkaffoldModules::new().set_google_cloud_build_repo(SkaffoldGCBRepoSource::default()/* use setters */);
6458    /// assert!(x.google_cloud_build_repo().is_some());
6459    /// assert!(x.git().is_none());
6460    /// assert!(x.google_cloud_storage().is_none());
6461    /// ```
6462    pub fn set_google_cloud_build_repo<
6463        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
6464    >(
6465        mut self,
6466        v: T,
6467    ) -> Self {
6468        self.source = std::option::Option::Some(
6469            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
6470        );
6471        self
6472    }
6473}
6474
6475impl wkt::message::Message for SkaffoldModules {
6476    fn typename() -> &'static str {
6477        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
6478    }
6479}
6480
6481/// Defines additional types related to [SkaffoldModules].
6482pub mod skaffold_modules {
6483    #[allow(unused_imports)]
6484    use super::*;
6485
6486    /// Git repository containing Skaffold Config modules.
6487    #[derive(Clone, Default, PartialEq)]
6488    #[non_exhaustive]
6489    pub struct SkaffoldGitSource {
6490        /// Required. Git repository the package should be cloned from.
6491        pub repo: std::string::String,
6492
6493        /// Optional. Relative path from the repository root to the Skaffold file.
6494        pub path: std::string::String,
6495
6496        /// Optional. Git branch or tag to use when cloning the repository.
6497        pub r#ref: std::string::String,
6498
6499        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6500    }
6501
6502    impl SkaffoldGitSource {
6503        /// Creates a new default instance.
6504        pub fn new() -> Self {
6505            std::default::Default::default()
6506        }
6507
6508        /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
6509        ///
6510        /// # Example
6511        /// ```ignore,no_run
6512        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6513        /// let x = SkaffoldGitSource::new().set_repo("example");
6514        /// ```
6515        pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6516            self.repo = v.into();
6517            self
6518        }
6519
6520        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
6521        ///
6522        /// # Example
6523        /// ```ignore,no_run
6524        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6525        /// let x = SkaffoldGitSource::new().set_path("example");
6526        /// ```
6527        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6528            self.path = v.into();
6529            self
6530        }
6531
6532        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
6533        ///
6534        /// # Example
6535        /// ```ignore,no_run
6536        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6537        /// let x = SkaffoldGitSource::new().set_ref("example");
6538        /// ```
6539        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6540            self.r#ref = v.into();
6541            self
6542        }
6543    }
6544
6545    impl wkt::message::Message for SkaffoldGitSource {
6546        fn typename() -> &'static str {
6547            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
6548        }
6549    }
6550
6551    /// Cloud Storage bucket containing Skaffold Config modules.
6552    #[derive(Clone, Default, PartialEq)]
6553    #[non_exhaustive]
6554    pub struct SkaffoldGCSSource {
6555        /// Required. Cloud Storage source paths to copy recursively. For example,
6556        /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
6557        /// all files within the "dir/configs" directory in the bucket "my-bucket".
6558        pub source: std::string::String,
6559
6560        /// Optional. Relative path from the source to the Skaffold file.
6561        pub path: std::string::String,
6562
6563        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6564    }
6565
6566    impl SkaffoldGCSSource {
6567        /// Creates a new default instance.
6568        pub fn new() -> Self {
6569            std::default::Default::default()
6570        }
6571
6572        /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
6573        ///
6574        /// # Example
6575        /// ```ignore,no_run
6576        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6577        /// let x = SkaffoldGCSSource::new().set_source("example");
6578        /// ```
6579        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6580            self.source = v.into();
6581            self
6582        }
6583
6584        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
6585        ///
6586        /// # Example
6587        /// ```ignore,no_run
6588        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6589        /// let x = SkaffoldGCSSource::new().set_path("example");
6590        /// ```
6591        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6592            self.path = v.into();
6593            self
6594        }
6595    }
6596
6597    impl wkt::message::Message for SkaffoldGCSSource {
6598        fn typename() -> &'static str {
6599            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
6600        }
6601    }
6602
6603    /// Cloud Build V2 Repository containing Skaffold Configs.
6604    #[derive(Clone, Default, PartialEq)]
6605    #[non_exhaustive]
6606    pub struct SkaffoldGCBRepoSource {
6607        /// Required. Name of the Cloud Build V2 Repository.
6608        /// Format is
6609        /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
6610        pub repository: std::string::String,
6611
6612        /// Optional. Relative path from the repository root to the Skaffold Config
6613        /// file.
6614        pub path: std::string::String,
6615
6616        /// Optional. Branch or tag to use when cloning the repository.
6617        pub r#ref: std::string::String,
6618
6619        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6620    }
6621
6622    impl SkaffoldGCBRepoSource {
6623        /// Creates a new default instance.
6624        pub fn new() -> Self {
6625            std::default::Default::default()
6626        }
6627
6628        /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
6629        ///
6630        /// # Example
6631        /// ```ignore,no_run
6632        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6633        /// let x = SkaffoldGCBRepoSource::new().set_repository("example");
6634        /// ```
6635        pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6636            self.repository = v.into();
6637            self
6638        }
6639
6640        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
6641        ///
6642        /// # Example
6643        /// ```ignore,no_run
6644        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6645        /// let x = SkaffoldGCBRepoSource::new().set_path("example");
6646        /// ```
6647        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6648            self.path = v.into();
6649            self
6650        }
6651
6652        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
6653        ///
6654        /// # Example
6655        /// ```ignore,no_run
6656        /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6657        /// let x = SkaffoldGCBRepoSource::new().set_ref("example");
6658        /// ```
6659        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6660            self.r#ref = v.into();
6661            self
6662        }
6663    }
6664
6665    impl wkt::message::Message for SkaffoldGCBRepoSource {
6666        fn typename() -> &'static str {
6667            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
6668        }
6669    }
6670
6671    /// The source that contains the Skaffold Config modules.
6672    #[derive(Clone, Debug, PartialEq)]
6673    #[non_exhaustive]
6674    pub enum Source {
6675        /// Optional. Remote git repository containing the Skaffold Config modules.
6676        Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
6677        /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
6678        GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
6679        /// Optional. Cloud Build V2 repository containing the Skaffold Config
6680        /// modules.
6681        GoogleCloudBuildRepo(
6682            std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
6683        ),
6684    }
6685}
6686
6687/// The request object for `ListCustomTargetTypes`.
6688#[derive(Clone, Default, PartialEq)]
6689#[non_exhaustive]
6690pub struct ListCustomTargetTypesRequest {
6691    /// Required. The parent that owns this collection of custom target types.
6692    /// Format must be `projects/{project_id}/locations/{location_name}`.
6693    pub parent: std::string::String,
6694
6695    /// Optional. The maximum number of `CustomTargetType` objects to return. The
6696    /// service may return fewer than this value. If unspecified, at most 50
6697    /// `CustomTargetType` objects will be returned. The maximum value is 1000;
6698    /// values above 1000 will be set to 1000.
6699    pub page_size: i32,
6700
6701    /// Optional. A page token, received from a previous `ListCustomTargetTypes`
6702    /// call. Provide this to retrieve the subsequent page.
6703    ///
6704    /// When paginating, all other provided parameters match
6705    /// the call that provided the page token.
6706    pub page_token: std::string::String,
6707
6708    /// Optional. Filter custom target types to be returned. See
6709    /// <https://google.aip.dev/160> for more details.
6710    pub filter: std::string::String,
6711
6712    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
6713    /// more details.
6714    pub order_by: std::string::String,
6715
6716    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6717}
6718
6719impl ListCustomTargetTypesRequest {
6720    /// Creates a new default instance.
6721    pub fn new() -> Self {
6722        std::default::Default::default()
6723    }
6724
6725    /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
6726    ///
6727    /// # Example
6728    /// ```ignore,no_run
6729    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6730    /// # let project_id = "project_id";
6731    /// # let location_id = "location_id";
6732    /// let x = ListCustomTargetTypesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6733    /// ```
6734    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6735        self.parent = v.into();
6736        self
6737    }
6738
6739    /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
6740    ///
6741    /// # Example
6742    /// ```ignore,no_run
6743    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6744    /// let x = ListCustomTargetTypesRequest::new().set_page_size(42);
6745    /// ```
6746    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6747        self.page_size = v.into();
6748        self
6749    }
6750
6751    /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
6752    ///
6753    /// # Example
6754    /// ```ignore,no_run
6755    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6756    /// let x = ListCustomTargetTypesRequest::new().set_page_token("example");
6757    /// ```
6758    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6759        self.page_token = v.into();
6760        self
6761    }
6762
6763    /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
6764    ///
6765    /// # Example
6766    /// ```ignore,no_run
6767    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6768    /// let x = ListCustomTargetTypesRequest::new().set_filter("example");
6769    /// ```
6770    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6771        self.filter = v.into();
6772        self
6773    }
6774
6775    /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
6776    ///
6777    /// # Example
6778    /// ```ignore,no_run
6779    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6780    /// let x = ListCustomTargetTypesRequest::new().set_order_by("example");
6781    /// ```
6782    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6783        self.order_by = v.into();
6784        self
6785    }
6786}
6787
6788impl wkt::message::Message for ListCustomTargetTypesRequest {
6789    fn typename() -> &'static str {
6790        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
6791    }
6792}
6793
6794/// The response object from `ListCustomTargetTypes.`
6795#[derive(Clone, Default, PartialEq)]
6796#[non_exhaustive]
6797pub struct ListCustomTargetTypesResponse {
6798    /// The `CustomTargetType` objects.
6799    pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
6800
6801    /// A token, which can be sent as `page_token` to retrieve the next page.
6802    /// If this field is omitted, there are no subsequent pages.
6803    pub next_page_token: std::string::String,
6804
6805    /// Locations that could not be reached.
6806    pub unreachable: std::vec::Vec<std::string::String>,
6807
6808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6809}
6810
6811impl ListCustomTargetTypesResponse {
6812    /// Creates a new default instance.
6813    pub fn new() -> Self {
6814        std::default::Default::default()
6815    }
6816
6817    /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
6818    ///
6819    /// # Example
6820    /// ```ignore,no_run
6821    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6822    /// use google_cloud_deploy_v1::model::CustomTargetType;
6823    /// let x = ListCustomTargetTypesResponse::new()
6824    ///     .set_custom_target_types([
6825    ///         CustomTargetType::default()/* use setters */,
6826    ///         CustomTargetType::default()/* use (different) setters */,
6827    ///     ]);
6828    /// ```
6829    pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
6830    where
6831        T: std::iter::IntoIterator<Item = V>,
6832        V: std::convert::Into<crate::model::CustomTargetType>,
6833    {
6834        use std::iter::Iterator;
6835        self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
6836        self
6837    }
6838
6839    /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
6840    ///
6841    /// # Example
6842    /// ```ignore,no_run
6843    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6844    /// let x = ListCustomTargetTypesResponse::new().set_next_page_token("example");
6845    /// ```
6846    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6847        self.next_page_token = v.into();
6848        self
6849    }
6850
6851    /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
6852    ///
6853    /// # Example
6854    /// ```ignore,no_run
6855    /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6856    /// let x = ListCustomTargetTypesResponse::new().set_unreachable(["a", "b", "c"]);
6857    /// ```
6858    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6859    where
6860        T: std::iter::IntoIterator<Item = V>,
6861        V: std::convert::Into<std::string::String>,
6862    {
6863        use std::iter::Iterator;
6864        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6865        self
6866    }
6867}
6868
6869impl wkt::message::Message for ListCustomTargetTypesResponse {
6870    fn typename() -> &'static str {
6871        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
6872    }
6873}
6874
6875#[doc(hidden)]
6876impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
6877    type PageItem = crate::model::CustomTargetType;
6878
6879    fn items(self) -> std::vec::Vec<Self::PageItem> {
6880        self.custom_target_types
6881    }
6882
6883    fn next_page_token(&self) -> std::string::String {
6884        use std::clone::Clone;
6885        self.next_page_token.clone()
6886    }
6887}
6888
6889/// The request object for `GetCustomTargetType`.
6890#[derive(Clone, Default, PartialEq)]
6891#[non_exhaustive]
6892pub struct GetCustomTargetTypeRequest {
6893    /// Required. Name of the `CustomTargetType`. Format must be
6894    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
6895    pub name: std::string::String,
6896
6897    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6898}
6899
6900impl GetCustomTargetTypeRequest {
6901    /// Creates a new default instance.
6902    pub fn new() -> Self {
6903        std::default::Default::default()
6904    }
6905
6906    /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
6907    ///
6908    /// # Example
6909    /// ```ignore,no_run
6910    /// # use google_cloud_deploy_v1::model::GetCustomTargetTypeRequest;
6911    /// # let project_id = "project_id";
6912    /// # let location_id = "location_id";
6913    /// # let custom_target_type_id = "custom_target_type_id";
6914    /// let x = GetCustomTargetTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
6915    /// ```
6916    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6917        self.name = v.into();
6918        self
6919    }
6920}
6921
6922impl wkt::message::Message for GetCustomTargetTypeRequest {
6923    fn typename() -> &'static str {
6924        "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
6925    }
6926}
6927
6928/// The request object for `CreateCustomTargetType`.
6929#[derive(Clone, Default, PartialEq)]
6930#[non_exhaustive]
6931pub struct CreateCustomTargetTypeRequest {
6932    /// Required. The parent collection in which the `CustomTargetType` must be
6933    /// created. The format is `projects/{project_id}/locations/{location_name}`.
6934    pub parent: std::string::String,
6935
6936    /// Required. ID of the `CustomTargetType`.
6937    pub custom_target_type_id: std::string::String,
6938
6939    /// Required. The `CustomTargetType` to create.
6940    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6941
6942    /// Optional. A request ID to identify requests. Specify a unique request ID
6943    /// so that if you must retry your request, the server knows to ignore the
6944    /// request if it has already been completed. The server guarantees that for
6945    /// at least 60 minutes after the first request.
6946    ///
6947    /// For example, consider a situation where you make an initial request and the
6948    /// request times out. If you make the request again with the same request ID,
6949    /// the server can check if original operation with the same request ID was
6950    /// received, and if so, will ignore the second request. This prevents clients
6951    /// from accidentally creating duplicate commitments.
6952    ///
6953    /// The request ID must be a valid UUID with the exception that zero UUID is
6954    /// not supported (00000000-0000-0000-0000-000000000000).
6955    pub request_id: std::string::String,
6956
6957    /// Optional. If set to true, the request is validated and the user is provided
6958    /// with an expected result, but no actual change is made.
6959    pub validate_only: bool,
6960
6961    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6962}
6963
6964impl CreateCustomTargetTypeRequest {
6965    /// Creates a new default instance.
6966    pub fn new() -> Self {
6967        std::default::Default::default()
6968    }
6969
6970    /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
6971    ///
6972    /// # Example
6973    /// ```ignore,no_run
6974    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6975    /// # let project_id = "project_id";
6976    /// # let location_id = "location_id";
6977    /// let x = CreateCustomTargetTypeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6978    /// ```
6979    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6980        self.parent = v.into();
6981        self
6982    }
6983
6984    /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
6985    ///
6986    /// # Example
6987    /// ```ignore,no_run
6988    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6989    /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type_id("example");
6990    /// ```
6991    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
6992        mut self,
6993        v: T,
6994    ) -> Self {
6995        self.custom_target_type_id = v.into();
6996        self
6997    }
6998
6999    /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
7000    ///
7001    /// # Example
7002    /// ```ignore,no_run
7003    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7004    /// use google_cloud_deploy_v1::model::CustomTargetType;
7005    /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7006    /// ```
7007    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7008    where
7009        T: std::convert::Into<crate::model::CustomTargetType>,
7010    {
7011        self.custom_target_type = std::option::Option::Some(v.into());
7012        self
7013    }
7014
7015    /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
7016    ///
7017    /// # Example
7018    /// ```ignore,no_run
7019    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7020    /// use google_cloud_deploy_v1::model::CustomTargetType;
7021    /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7022    /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7023    /// ```
7024    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7025    where
7026        T: std::convert::Into<crate::model::CustomTargetType>,
7027    {
7028        self.custom_target_type = v.map(|x| x.into());
7029        self
7030    }
7031
7032    /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
7033    ///
7034    /// # Example
7035    /// ```ignore,no_run
7036    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7037    /// let x = CreateCustomTargetTypeRequest::new().set_request_id("example");
7038    /// ```
7039    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7040        self.request_id = v.into();
7041        self
7042    }
7043
7044    /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
7045    ///
7046    /// # Example
7047    /// ```ignore,no_run
7048    /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7049    /// let x = CreateCustomTargetTypeRequest::new().set_validate_only(true);
7050    /// ```
7051    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7052        self.validate_only = v.into();
7053        self
7054    }
7055}
7056
7057impl wkt::message::Message for CreateCustomTargetTypeRequest {
7058    fn typename() -> &'static str {
7059        "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
7060    }
7061}
7062
7063/// The request object for `UpdateCustomTargetType`.
7064#[derive(Clone, Default, PartialEq)]
7065#[non_exhaustive]
7066pub struct UpdateCustomTargetTypeRequest {
7067    /// Required. Field mask is used to specify the fields to be overwritten by the
7068    /// update in the `CustomTargetType` resource. The fields specified in the
7069    /// update_mask are relative to the resource, not the full request. A field
7070    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
7071    /// then all fields are overwritten.
7072    pub update_mask: std::option::Option<wkt::FieldMask>,
7073
7074    /// Required. The `CustomTargetType` to update.
7075    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
7076
7077    /// Optional. A request ID to identify requests. Specify a unique request ID
7078    /// so that if you must retry your request, the server knows to ignore the
7079    /// request if it has already been completed. The server guarantees that for
7080    /// at least 60 minutes after the first request.
7081    ///
7082    /// For example, consider a situation where you make an initial request and the
7083    /// request times out. If you make the request again with the same request ID,
7084    /// the server can check if original operation with the same request ID was
7085    /// received, and if so, will ignore the second request. This prevents clients
7086    /// from accidentally creating duplicate commitments.
7087    ///
7088    /// The request ID must be a valid UUID with the exception that zero UUID is
7089    /// not supported (00000000-0000-0000-0000-000000000000).
7090    pub request_id: std::string::String,
7091
7092    /// Optional. If set to true, updating a `CustomTargetType` that does not exist
7093    /// will result in the creation of a new `CustomTargetType`.
7094    pub allow_missing: bool,
7095
7096    /// Optional. If set to true, the request is validated and the user is provided
7097    /// with an expected result, but no actual change is made.
7098    pub validate_only: bool,
7099
7100    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7101}
7102
7103impl UpdateCustomTargetTypeRequest {
7104    /// Creates a new default instance.
7105    pub fn new() -> Self {
7106        std::default::Default::default()
7107    }
7108
7109    /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7110    ///
7111    /// # Example
7112    /// ```ignore,no_run
7113    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7114    /// use wkt::FieldMask;
7115    /// let x = UpdateCustomTargetTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7116    /// ```
7117    pub fn set_update_mask<T>(mut self, v: T) -> Self
7118    where
7119        T: std::convert::Into<wkt::FieldMask>,
7120    {
7121        self.update_mask = std::option::Option::Some(v.into());
7122        self
7123    }
7124
7125    /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7126    ///
7127    /// # Example
7128    /// ```ignore,no_run
7129    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7130    /// use wkt::FieldMask;
7131    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7132    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7133    /// ```
7134    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7135    where
7136        T: std::convert::Into<wkt::FieldMask>,
7137    {
7138        self.update_mask = v.map(|x| x.into());
7139        self
7140    }
7141
7142    /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7143    ///
7144    /// # Example
7145    /// ```ignore,no_run
7146    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7147    /// use google_cloud_deploy_v1::model::CustomTargetType;
7148    /// let x = UpdateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7149    /// ```
7150    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7151    where
7152        T: std::convert::Into<crate::model::CustomTargetType>,
7153    {
7154        self.custom_target_type = std::option::Option::Some(v.into());
7155        self
7156    }
7157
7158    /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7159    ///
7160    /// # Example
7161    /// ```ignore,no_run
7162    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7163    /// use google_cloud_deploy_v1::model::CustomTargetType;
7164    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7165    /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7166    /// ```
7167    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7168    where
7169        T: std::convert::Into<crate::model::CustomTargetType>,
7170    {
7171        self.custom_target_type = v.map(|x| x.into());
7172        self
7173    }
7174
7175    /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
7176    ///
7177    /// # Example
7178    /// ```ignore,no_run
7179    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7180    /// let x = UpdateCustomTargetTypeRequest::new().set_request_id("example");
7181    /// ```
7182    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7183        self.request_id = v.into();
7184        self
7185    }
7186
7187    /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
7188    ///
7189    /// # Example
7190    /// ```ignore,no_run
7191    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7192    /// let x = UpdateCustomTargetTypeRequest::new().set_allow_missing(true);
7193    /// ```
7194    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7195        self.allow_missing = v.into();
7196        self
7197    }
7198
7199    /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
7200    ///
7201    /// # Example
7202    /// ```ignore,no_run
7203    /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7204    /// let x = UpdateCustomTargetTypeRequest::new().set_validate_only(true);
7205    /// ```
7206    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7207        self.validate_only = v.into();
7208        self
7209    }
7210}
7211
7212impl wkt::message::Message for UpdateCustomTargetTypeRequest {
7213    fn typename() -> &'static str {
7214        "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
7215    }
7216}
7217
7218/// The request object for `DeleteCustomTargetType`.
7219#[derive(Clone, Default, PartialEq)]
7220#[non_exhaustive]
7221pub struct DeleteCustomTargetTypeRequest {
7222    /// Required. The name of the `CustomTargetType` to delete. Format must be
7223    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
7224    pub name: std::string::String,
7225
7226    /// Optional. A request ID to identify requests. Specify a unique request ID
7227    /// so that if you must retry your request, the server knows to ignore the
7228    /// request if it has already been completed. The server guarantees that for
7229    /// at least 60 minutes after the first request.
7230    ///
7231    /// For example, consider a situation where you make an initial request and the
7232    /// request times out. If you make the request again with the same request ID,
7233    /// the server can check if original operation with the same request ID was
7234    /// received, and if so, will ignore the second request. This prevents clients
7235    /// from accidentally creating duplicate commitments.
7236    ///
7237    /// The request ID must be a valid UUID with the exception that zero UUID is
7238    /// not supported (00000000-0000-0000-0000-000000000000).
7239    pub request_id: std::string::String,
7240
7241    /// Optional. If set to true, then deleting an already deleted or non-existing
7242    /// `CustomTargetType` will succeed.
7243    pub allow_missing: bool,
7244
7245    /// Optional. If set to true, the request is validated but no actual change is
7246    /// made.
7247    pub validate_only: bool,
7248
7249    /// Optional. This checksum is computed by the server based on the value of
7250    /// other fields, and may be sent on update and delete requests to ensure the
7251    /// client has an up-to-date value before proceeding.
7252    pub etag: std::string::String,
7253
7254    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7255}
7256
7257impl DeleteCustomTargetTypeRequest {
7258    /// Creates a new default instance.
7259    pub fn new() -> Self {
7260        std::default::Default::default()
7261    }
7262
7263    /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
7264    ///
7265    /// # Example
7266    /// ```ignore,no_run
7267    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7268    /// # let project_id = "project_id";
7269    /// # let location_id = "location_id";
7270    /// # let custom_target_type_id = "custom_target_type_id";
7271    /// let x = DeleteCustomTargetTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
7272    /// ```
7273    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7274        self.name = v.into();
7275        self
7276    }
7277
7278    /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
7279    ///
7280    /// # Example
7281    /// ```ignore,no_run
7282    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7283    /// let x = DeleteCustomTargetTypeRequest::new().set_request_id("example");
7284    /// ```
7285    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7286        self.request_id = v.into();
7287        self
7288    }
7289
7290    /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
7291    ///
7292    /// # Example
7293    /// ```ignore,no_run
7294    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7295    /// let x = DeleteCustomTargetTypeRequest::new().set_allow_missing(true);
7296    /// ```
7297    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7298        self.allow_missing = v.into();
7299        self
7300    }
7301
7302    /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
7303    ///
7304    /// # Example
7305    /// ```ignore,no_run
7306    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7307    /// let x = DeleteCustomTargetTypeRequest::new().set_validate_only(true);
7308    /// ```
7309    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7310        self.validate_only = v.into();
7311        self
7312    }
7313
7314    /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
7315    ///
7316    /// # Example
7317    /// ```ignore,no_run
7318    /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7319    /// let x = DeleteCustomTargetTypeRequest::new().set_etag("example");
7320    /// ```
7321    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7322        self.etag = v.into();
7323        self
7324    }
7325}
7326
7327impl wkt::message::Message for DeleteCustomTargetTypeRequest {
7328    fn typename() -> &'static str {
7329        "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
7330    }
7331}
7332
7333/// A `DeployPolicy` resource in the Cloud Deploy API.
7334///
7335/// A `DeployPolicy` inhibits manual or automation-driven actions within a
7336/// Delivery Pipeline or Target.
7337#[derive(Clone, Default, PartialEq)]
7338#[non_exhaustive]
7339pub struct DeployPolicy {
7340    /// Output only. Name of the `DeployPolicy`. Format is
7341    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
7342    /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
7343    pub name: std::string::String,
7344
7345    /// Output only. Unique identifier of the `DeployPolicy`.
7346    pub uid: std::string::String,
7347
7348    /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
7349    pub description: std::string::String,
7350
7351    /// Optional. User annotations. These attributes can only be set and used by
7352    /// the user, and not by Cloud Deploy. Annotations must meet the following
7353    /// constraints:
7354    ///
7355    /// * Annotations are key/value pairs.
7356    /// * Valid annotation keys have two segments: an optional prefix and name,
7357    ///   separated by a slash (`/`).
7358    /// * The name segment is required and must be 63 characters or less,
7359    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
7360    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
7361    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
7362    ///   a series of DNS labels separated by dots(`.`), not longer than 253
7363    ///   characters in total, followed by a slash (`/`).
7364    ///
7365    /// See
7366    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
7367    /// for more details.
7368    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7369
7370    /// Labels are attributes that can be set and used by both the
7371    /// user and by Cloud Deploy. Labels must meet the following constraints:
7372    ///
7373    /// * Keys and values can contain only lowercase letters, numeric characters,
7374    ///   underscores, and dashes.
7375    /// * All characters must use UTF-8 encoding, and international characters are
7376    ///   allowed.
7377    /// * Keys must start with a lowercase letter or international character.
7378    /// * Each resource is limited to a maximum of 64 labels.
7379    ///
7380    /// Both keys and values are additionally constrained to be <= 128 bytes.
7381    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7382
7383    /// Output only. Time at which the deploy policy was created.
7384    pub create_time: std::option::Option<wkt::Timestamp>,
7385
7386    /// Output only. Most recent time at which the deploy policy was updated.
7387    pub update_time: std::option::Option<wkt::Timestamp>,
7388
7389    /// Optional. When suspended, the policy will not prevent actions from
7390    /// occurring, even if the action violates the policy.
7391    pub suspended: bool,
7392
7393    /// Required. Selected resources to which the policy will be applied. At least
7394    /// one selector is required. If one selector matches the resource the policy
7395    /// applies. For example, if there are two selectors and the action being
7396    /// attempted matches one of them, the policy will apply to that action.
7397    pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
7398
7399    /// Required. Rules to apply. At least one rule must be present.
7400    pub rules: std::vec::Vec<crate::model::PolicyRule>,
7401
7402    /// The weak etag of the `DeployPolicy` resource.
7403    /// This checksum is computed by the server based on the value of other
7404    /// fields, and may be sent on update and delete requests to ensure the
7405    /// client has an up-to-date value before proceeding.
7406    pub etag: std::string::String,
7407
7408    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7409}
7410
7411impl DeployPolicy {
7412    /// Creates a new default instance.
7413    pub fn new() -> Self {
7414        std::default::Default::default()
7415    }
7416
7417    /// Sets the value of [name][crate::model::DeployPolicy::name].
7418    ///
7419    /// # Example
7420    /// ```ignore,no_run
7421    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7422    /// # let project_id = "project_id";
7423    /// # let location_id = "location_id";
7424    /// # let deploy_policy_id = "deploy_policy_id";
7425    /// let x = DeployPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployPolicies/{deploy_policy_id}"));
7426    /// ```
7427    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7428        self.name = v.into();
7429        self
7430    }
7431
7432    /// Sets the value of [uid][crate::model::DeployPolicy::uid].
7433    ///
7434    /// # Example
7435    /// ```ignore,no_run
7436    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7437    /// let x = DeployPolicy::new().set_uid("example");
7438    /// ```
7439    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7440        self.uid = v.into();
7441        self
7442    }
7443
7444    /// Sets the value of [description][crate::model::DeployPolicy::description].
7445    ///
7446    /// # Example
7447    /// ```ignore,no_run
7448    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7449    /// let x = DeployPolicy::new().set_description("example");
7450    /// ```
7451    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7452        self.description = v.into();
7453        self
7454    }
7455
7456    /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
7457    ///
7458    /// # Example
7459    /// ```ignore,no_run
7460    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7461    /// let x = DeployPolicy::new().set_annotations([
7462    ///     ("key0", "abc"),
7463    ///     ("key1", "xyz"),
7464    /// ]);
7465    /// ```
7466    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7467    where
7468        T: std::iter::IntoIterator<Item = (K, V)>,
7469        K: std::convert::Into<std::string::String>,
7470        V: std::convert::Into<std::string::String>,
7471    {
7472        use std::iter::Iterator;
7473        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7474        self
7475    }
7476
7477    /// Sets the value of [labels][crate::model::DeployPolicy::labels].
7478    ///
7479    /// # Example
7480    /// ```ignore,no_run
7481    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7482    /// let x = DeployPolicy::new().set_labels([
7483    ///     ("key0", "abc"),
7484    ///     ("key1", "xyz"),
7485    /// ]);
7486    /// ```
7487    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7488    where
7489        T: std::iter::IntoIterator<Item = (K, V)>,
7490        K: std::convert::Into<std::string::String>,
7491        V: std::convert::Into<std::string::String>,
7492    {
7493        use std::iter::Iterator;
7494        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7495        self
7496    }
7497
7498    /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
7499    ///
7500    /// # Example
7501    /// ```ignore,no_run
7502    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7503    /// use wkt::Timestamp;
7504    /// let x = DeployPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7505    /// ```
7506    pub fn set_create_time<T>(mut self, v: T) -> Self
7507    where
7508        T: std::convert::Into<wkt::Timestamp>,
7509    {
7510        self.create_time = std::option::Option::Some(v.into());
7511        self
7512    }
7513
7514    /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
7515    ///
7516    /// # Example
7517    /// ```ignore,no_run
7518    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7519    /// use wkt::Timestamp;
7520    /// let x = DeployPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7521    /// let x = DeployPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7522    /// ```
7523    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7524    where
7525        T: std::convert::Into<wkt::Timestamp>,
7526    {
7527        self.create_time = v.map(|x| x.into());
7528        self
7529    }
7530
7531    /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
7532    ///
7533    /// # Example
7534    /// ```ignore,no_run
7535    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7536    /// use wkt::Timestamp;
7537    /// let x = DeployPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7538    /// ```
7539    pub fn set_update_time<T>(mut self, v: T) -> Self
7540    where
7541        T: std::convert::Into<wkt::Timestamp>,
7542    {
7543        self.update_time = std::option::Option::Some(v.into());
7544        self
7545    }
7546
7547    /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
7548    ///
7549    /// # Example
7550    /// ```ignore,no_run
7551    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7552    /// use wkt::Timestamp;
7553    /// let x = DeployPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7554    /// let x = DeployPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7555    /// ```
7556    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7557    where
7558        T: std::convert::Into<wkt::Timestamp>,
7559    {
7560        self.update_time = v.map(|x| x.into());
7561        self
7562    }
7563
7564    /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
7565    ///
7566    /// # Example
7567    /// ```ignore,no_run
7568    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7569    /// let x = DeployPolicy::new().set_suspended(true);
7570    /// ```
7571    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7572        self.suspended = v.into();
7573        self
7574    }
7575
7576    /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
7577    ///
7578    /// # Example
7579    /// ```ignore,no_run
7580    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7581    /// use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7582    /// let x = DeployPolicy::new()
7583    ///     .set_selectors([
7584    ///         DeployPolicyResourceSelector::default()/* use setters */,
7585    ///         DeployPolicyResourceSelector::default()/* use (different) setters */,
7586    ///     ]);
7587    /// ```
7588    pub fn set_selectors<T, V>(mut self, v: T) -> Self
7589    where
7590        T: std::iter::IntoIterator<Item = V>,
7591        V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
7592    {
7593        use std::iter::Iterator;
7594        self.selectors = v.into_iter().map(|i| i.into()).collect();
7595        self
7596    }
7597
7598    /// Sets the value of [rules][crate::model::DeployPolicy::rules].
7599    ///
7600    /// # Example
7601    /// ```ignore,no_run
7602    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7603    /// use google_cloud_deploy_v1::model::PolicyRule;
7604    /// let x = DeployPolicy::new()
7605    ///     .set_rules([
7606    ///         PolicyRule::default()/* use setters */,
7607    ///         PolicyRule::default()/* use (different) setters */,
7608    ///     ]);
7609    /// ```
7610    pub fn set_rules<T, V>(mut self, v: T) -> Self
7611    where
7612        T: std::iter::IntoIterator<Item = V>,
7613        V: std::convert::Into<crate::model::PolicyRule>,
7614    {
7615        use std::iter::Iterator;
7616        self.rules = v.into_iter().map(|i| i.into()).collect();
7617        self
7618    }
7619
7620    /// Sets the value of [etag][crate::model::DeployPolicy::etag].
7621    ///
7622    /// # Example
7623    /// ```ignore,no_run
7624    /// # use google_cloud_deploy_v1::model::DeployPolicy;
7625    /// let x = DeployPolicy::new().set_etag("example");
7626    /// ```
7627    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7628        self.etag = v.into();
7629        self
7630    }
7631}
7632
7633impl wkt::message::Message for DeployPolicy {
7634    fn typename() -> &'static str {
7635        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
7636    }
7637}
7638
7639/// Defines additional types related to [DeployPolicy].
7640pub mod deploy_policy {
7641    #[allow(unused_imports)]
7642    use super::*;
7643
7644    /// What invoked the action. Filters enforcing the policy depending on what
7645    /// invoked the action.
7646    ///
7647    /// # Working with unknown values
7648    ///
7649    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7650    /// additional enum variants at any time. Adding new variants is not considered
7651    /// a breaking change. Applications should write their code in anticipation of:
7652    ///
7653    /// - New values appearing in future releases of the client library, **and**
7654    /// - New values received dynamically, without application changes.
7655    ///
7656    /// Please consult the [Working with enums] section in the user guide for some
7657    /// guidelines.
7658    ///
7659    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7660    #[derive(Clone, Debug, PartialEq)]
7661    #[non_exhaustive]
7662    pub enum Invoker {
7663        /// Unspecified.
7664        Unspecified,
7665        /// The action is user-driven. For example, creating a rollout manually via a
7666        /// gcloud create command.
7667        User,
7668        /// Automated action by Cloud Deploy.
7669        DeployAutomation,
7670        /// If set, the enum was initialized with an unknown value.
7671        ///
7672        /// Applications can examine the value using [Invoker::value] or
7673        /// [Invoker::name].
7674        UnknownValue(invoker::UnknownValue),
7675    }
7676
7677    #[doc(hidden)]
7678    pub mod invoker {
7679        #[allow(unused_imports)]
7680        use super::*;
7681        #[derive(Clone, Debug, PartialEq)]
7682        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7683    }
7684
7685    impl Invoker {
7686        /// Gets the enum value.
7687        ///
7688        /// Returns `None` if the enum contains an unknown value deserialized from
7689        /// the string representation of enums.
7690        pub fn value(&self) -> std::option::Option<i32> {
7691            match self {
7692                Self::Unspecified => std::option::Option::Some(0),
7693                Self::User => std::option::Option::Some(1),
7694                Self::DeployAutomation => std::option::Option::Some(2),
7695                Self::UnknownValue(u) => u.0.value(),
7696            }
7697        }
7698
7699        /// Gets the enum value as a string.
7700        ///
7701        /// Returns `None` if the enum contains an unknown value deserialized from
7702        /// the integer representation of enums.
7703        pub fn name(&self) -> std::option::Option<&str> {
7704            match self {
7705                Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
7706                Self::User => std::option::Option::Some("USER"),
7707                Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
7708                Self::UnknownValue(u) => u.0.name(),
7709            }
7710        }
7711    }
7712
7713    impl std::default::Default for Invoker {
7714        fn default() -> Self {
7715            use std::convert::From;
7716            Self::from(0)
7717        }
7718    }
7719
7720    impl std::fmt::Display for Invoker {
7721        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7722            wkt::internal::display_enum(f, self.name(), self.value())
7723        }
7724    }
7725
7726    impl std::convert::From<i32> for Invoker {
7727        fn from(value: i32) -> Self {
7728            match value {
7729                0 => Self::Unspecified,
7730                1 => Self::User,
7731                2 => Self::DeployAutomation,
7732                _ => Self::UnknownValue(invoker::UnknownValue(
7733                    wkt::internal::UnknownEnumValue::Integer(value),
7734                )),
7735            }
7736        }
7737    }
7738
7739    impl std::convert::From<&str> for Invoker {
7740        fn from(value: &str) -> Self {
7741            use std::string::ToString;
7742            match value {
7743                "INVOKER_UNSPECIFIED" => Self::Unspecified,
7744                "USER" => Self::User,
7745                "DEPLOY_AUTOMATION" => Self::DeployAutomation,
7746                _ => Self::UnknownValue(invoker::UnknownValue(
7747                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7748                )),
7749            }
7750        }
7751    }
7752
7753    impl serde::ser::Serialize for Invoker {
7754        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7755        where
7756            S: serde::Serializer,
7757        {
7758            match self {
7759                Self::Unspecified => serializer.serialize_i32(0),
7760                Self::User => serializer.serialize_i32(1),
7761                Self::DeployAutomation => serializer.serialize_i32(2),
7762                Self::UnknownValue(u) => u.0.serialize(serializer),
7763            }
7764        }
7765    }
7766
7767    impl<'de> serde::de::Deserialize<'de> for Invoker {
7768        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7769        where
7770            D: serde::Deserializer<'de>,
7771        {
7772            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
7773                ".google.cloud.deploy.v1.DeployPolicy.Invoker",
7774            ))
7775        }
7776    }
7777}
7778
7779/// Contains information on the resources to select for a deploy policy.
7780/// Attributes provided must all match the resource in order for policy
7781/// restrictions to apply. For example, if delivery pipelines attributes given
7782/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
7783/// match both that id and have that label in order to be subject to the policy.
7784#[derive(Clone, Default, PartialEq)]
7785#[non_exhaustive]
7786pub struct DeployPolicyResourceSelector {
7787    /// Optional. Contains attributes about a delivery pipeline.
7788    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
7789
7790    /// Optional. Contains attributes about a target.
7791    pub target: std::option::Option<crate::model::TargetAttribute>,
7792
7793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7794}
7795
7796impl DeployPolicyResourceSelector {
7797    /// Creates a new default instance.
7798    pub fn new() -> Self {
7799        std::default::Default::default()
7800    }
7801
7802    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7803    ///
7804    /// # Example
7805    /// ```ignore,no_run
7806    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7807    /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7808    /// let x = DeployPolicyResourceSelector::new().set_delivery_pipeline(DeliveryPipelineAttribute::default()/* use setters */);
7809    /// ```
7810    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
7811    where
7812        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7813    {
7814        self.delivery_pipeline = std::option::Option::Some(v.into());
7815        self
7816    }
7817
7818    /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7819    ///
7820    /// # Example
7821    /// ```ignore,no_run
7822    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7823    /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7824    /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(Some(DeliveryPipelineAttribute::default()/* use setters */));
7825    /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(None::<DeliveryPipelineAttribute>);
7826    /// ```
7827    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
7828    where
7829        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7830    {
7831        self.delivery_pipeline = v.map(|x| x.into());
7832        self
7833    }
7834
7835    /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
7836    ///
7837    /// # Example
7838    /// ```ignore,no_run
7839    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7840    /// use google_cloud_deploy_v1::model::TargetAttribute;
7841    /// let x = DeployPolicyResourceSelector::new().set_target(TargetAttribute::default()/* use setters */);
7842    /// ```
7843    pub fn set_target<T>(mut self, v: T) -> Self
7844    where
7845        T: std::convert::Into<crate::model::TargetAttribute>,
7846    {
7847        self.target = std::option::Option::Some(v.into());
7848        self
7849    }
7850
7851    /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
7852    ///
7853    /// # Example
7854    /// ```ignore,no_run
7855    /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7856    /// use google_cloud_deploy_v1::model::TargetAttribute;
7857    /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(Some(TargetAttribute::default()/* use setters */));
7858    /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(None::<TargetAttribute>);
7859    /// ```
7860    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7861    where
7862        T: std::convert::Into<crate::model::TargetAttribute>,
7863    {
7864        self.target = v.map(|x| x.into());
7865        self
7866    }
7867}
7868
7869impl wkt::message::Message for DeployPolicyResourceSelector {
7870    fn typename() -> &'static str {
7871        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
7872    }
7873}
7874
7875/// Contains criteria for selecting DeliveryPipelines.
7876#[derive(Clone, Default, PartialEq)]
7877#[non_exhaustive]
7878pub struct DeliveryPipelineAttribute {
7879    /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
7880    /// one of the following:
7881    ///
7882    /// * The last segment of a pipeline name
7883    /// * "*", all delivery pipelines in a location
7884    pub id: std::string::String,
7885
7886    /// DeliveryPipeline labels.
7887    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7888
7889    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7890}
7891
7892impl DeliveryPipelineAttribute {
7893    /// Creates a new default instance.
7894    pub fn new() -> Self {
7895        std::default::Default::default()
7896    }
7897
7898    /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
7899    ///
7900    /// # Example
7901    /// ```ignore,no_run
7902    /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7903    /// let x = DeliveryPipelineAttribute::new().set_id("example");
7904    /// ```
7905    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7906        self.id = v.into();
7907        self
7908    }
7909
7910    /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
7911    ///
7912    /// # Example
7913    /// ```ignore,no_run
7914    /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7915    /// let x = DeliveryPipelineAttribute::new().set_labels([
7916    ///     ("key0", "abc"),
7917    ///     ("key1", "xyz"),
7918    /// ]);
7919    /// ```
7920    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7921    where
7922        T: std::iter::IntoIterator<Item = (K, V)>,
7923        K: std::convert::Into<std::string::String>,
7924        V: std::convert::Into<std::string::String>,
7925    {
7926        use std::iter::Iterator;
7927        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7928        self
7929    }
7930}
7931
7932impl wkt::message::Message for DeliveryPipelineAttribute {
7933    fn typename() -> &'static str {
7934        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
7935    }
7936}
7937
7938/// Contains criteria for selecting Targets. This could be used to select targets
7939/// for a Deploy Policy or for an Automation.
7940#[derive(Clone, Default, PartialEq)]
7941#[non_exhaustive]
7942pub struct TargetAttribute {
7943    /// Optional. ID of the `Target`. The value of this field could be one of the
7944    /// following:
7945    ///
7946    /// * The last segment of a target name
7947    /// * "*", all targets in a location
7948    pub id: std::string::String,
7949
7950    /// Target labels.
7951    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7952
7953    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7954}
7955
7956impl TargetAttribute {
7957    /// Creates a new default instance.
7958    pub fn new() -> Self {
7959        std::default::Default::default()
7960    }
7961
7962    /// Sets the value of [id][crate::model::TargetAttribute::id].
7963    ///
7964    /// # Example
7965    /// ```ignore,no_run
7966    /// # use google_cloud_deploy_v1::model::TargetAttribute;
7967    /// let x = TargetAttribute::new().set_id("example");
7968    /// ```
7969    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7970        self.id = v.into();
7971        self
7972    }
7973
7974    /// Sets the value of [labels][crate::model::TargetAttribute::labels].
7975    ///
7976    /// # Example
7977    /// ```ignore,no_run
7978    /// # use google_cloud_deploy_v1::model::TargetAttribute;
7979    /// let x = TargetAttribute::new().set_labels([
7980    ///     ("key0", "abc"),
7981    ///     ("key1", "xyz"),
7982    /// ]);
7983    /// ```
7984    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7985    where
7986        T: std::iter::IntoIterator<Item = (K, V)>,
7987        K: std::convert::Into<std::string::String>,
7988        V: std::convert::Into<std::string::String>,
7989    {
7990        use std::iter::Iterator;
7991        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7992        self
7993    }
7994}
7995
7996impl wkt::message::Message for TargetAttribute {
7997    fn typename() -> &'static str {
7998        "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
7999    }
8000}
8001
8002/// Deploy Policy rule.
8003#[derive(Clone, Default, PartialEq)]
8004#[non_exhaustive]
8005pub struct PolicyRule {
8006    #[allow(missing_docs)]
8007    pub rule: std::option::Option<crate::model::policy_rule::Rule>,
8008
8009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8010}
8011
8012impl PolicyRule {
8013    /// Creates a new default instance.
8014    pub fn new() -> Self {
8015        std::default::Default::default()
8016    }
8017
8018    /// Sets the value of [rule][crate::model::PolicyRule::rule].
8019    ///
8020    /// Note that all the setters affecting `rule` are mutually
8021    /// exclusive.
8022    ///
8023    /// # Example
8024    /// ```ignore,no_run
8025    /// # use google_cloud_deploy_v1::model::PolicyRule;
8026    /// use google_cloud_deploy_v1::model::RolloutRestriction;
8027    /// let x = PolicyRule::new().set_rule(Some(
8028    ///     google_cloud_deploy_v1::model::policy_rule::Rule::RolloutRestriction(RolloutRestriction::default().into())));
8029    /// ```
8030    pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
8031        mut self,
8032        v: T,
8033    ) -> Self {
8034        self.rule = v.into();
8035        self
8036    }
8037
8038    /// The value of [rule][crate::model::PolicyRule::rule]
8039    /// if it holds a `RolloutRestriction`, `None` if the field is not set or
8040    /// holds a different branch.
8041    pub fn rollout_restriction(
8042        &self,
8043    ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
8044        #[allow(unreachable_patterns)]
8045        self.rule.as_ref().and_then(|v| match v {
8046            crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
8047            _ => std::option::Option::None,
8048        })
8049    }
8050
8051    /// Sets the value of [rule][crate::model::PolicyRule::rule]
8052    /// to hold a `RolloutRestriction`.
8053    ///
8054    /// Note that all the setters affecting `rule` are
8055    /// mutually exclusive.
8056    ///
8057    /// # Example
8058    /// ```ignore,no_run
8059    /// # use google_cloud_deploy_v1::model::PolicyRule;
8060    /// use google_cloud_deploy_v1::model::RolloutRestriction;
8061    /// let x = PolicyRule::new().set_rollout_restriction(RolloutRestriction::default()/* use setters */);
8062    /// assert!(x.rollout_restriction().is_some());
8063    /// ```
8064    pub fn set_rollout_restriction<
8065        T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
8066    >(
8067        mut self,
8068        v: T,
8069    ) -> Self {
8070        self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
8071            v.into(),
8072        ));
8073        self
8074    }
8075}
8076
8077impl wkt::message::Message for PolicyRule {
8078    fn typename() -> &'static str {
8079        "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
8080    }
8081}
8082
8083/// Defines additional types related to [PolicyRule].
8084pub mod policy_rule {
8085    #[allow(unused_imports)]
8086    use super::*;
8087
8088    #[allow(missing_docs)]
8089    #[derive(Clone, Debug, PartialEq)]
8090    #[non_exhaustive]
8091    pub enum Rule {
8092        /// Optional. Rollout restrictions.
8093        RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
8094    }
8095}
8096
8097/// Rollout restrictions.
8098#[derive(Clone, Default, PartialEq)]
8099#[non_exhaustive]
8100pub struct RolloutRestriction {
8101    /// Required. Restriction rule ID. Required and must be unique within a
8102    /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
8103    pub id: std::string::String,
8104
8105    /// Optional. What invoked the action. If left empty, all invoker types will be
8106    /// restricted.
8107    pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
8108
8109    /// Optional. Rollout actions to be restricted as part of the policy. If left
8110    /// empty, all actions will be restricted.
8111    pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
8112
8113    /// Required. Time window within which actions are restricted.
8114    pub time_windows: std::option::Option<crate::model::TimeWindows>,
8115
8116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8117}
8118
8119impl RolloutRestriction {
8120    /// Creates a new default instance.
8121    pub fn new() -> Self {
8122        std::default::Default::default()
8123    }
8124
8125    /// Sets the value of [id][crate::model::RolloutRestriction::id].
8126    ///
8127    /// # Example
8128    /// ```ignore,no_run
8129    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8130    /// let x = RolloutRestriction::new().set_id("example");
8131    /// ```
8132    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8133        self.id = v.into();
8134        self
8135    }
8136
8137    /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
8138    ///
8139    /// # Example
8140    /// ```ignore,no_run
8141    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8142    /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
8143    /// let x = RolloutRestriction::new().set_invokers([
8144    ///     Invoker::User,
8145    ///     Invoker::DeployAutomation,
8146    /// ]);
8147    /// ```
8148    pub fn set_invokers<T, V>(mut self, v: T) -> Self
8149    where
8150        T: std::iter::IntoIterator<Item = V>,
8151        V: std::convert::Into<crate::model::deploy_policy::Invoker>,
8152    {
8153        use std::iter::Iterator;
8154        self.invokers = v.into_iter().map(|i| i.into()).collect();
8155        self
8156    }
8157
8158    /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
8159    ///
8160    /// # Example
8161    /// ```ignore,no_run
8162    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8163    /// use google_cloud_deploy_v1::model::rollout_restriction::RolloutActions;
8164    /// let x = RolloutRestriction::new().set_actions([
8165    ///     RolloutActions::Advance,
8166    ///     RolloutActions::Approve,
8167    ///     RolloutActions::Cancel,
8168    /// ]);
8169    /// ```
8170    pub fn set_actions<T, V>(mut self, v: T) -> Self
8171    where
8172        T: std::iter::IntoIterator<Item = V>,
8173        V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
8174    {
8175        use std::iter::Iterator;
8176        self.actions = v.into_iter().map(|i| i.into()).collect();
8177        self
8178    }
8179
8180    /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8181    ///
8182    /// # Example
8183    /// ```ignore,no_run
8184    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8185    /// use google_cloud_deploy_v1::model::TimeWindows;
8186    /// let x = RolloutRestriction::new().set_time_windows(TimeWindows::default()/* use setters */);
8187    /// ```
8188    pub fn set_time_windows<T>(mut self, v: T) -> Self
8189    where
8190        T: std::convert::Into<crate::model::TimeWindows>,
8191    {
8192        self.time_windows = std::option::Option::Some(v.into());
8193        self
8194    }
8195
8196    /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8197    ///
8198    /// # Example
8199    /// ```ignore,no_run
8200    /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8201    /// use google_cloud_deploy_v1::model::TimeWindows;
8202    /// let x = RolloutRestriction::new().set_or_clear_time_windows(Some(TimeWindows::default()/* use setters */));
8203    /// let x = RolloutRestriction::new().set_or_clear_time_windows(None::<TimeWindows>);
8204    /// ```
8205    pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
8206    where
8207        T: std::convert::Into<crate::model::TimeWindows>,
8208    {
8209        self.time_windows = v.map(|x| x.into());
8210        self
8211    }
8212}
8213
8214impl wkt::message::Message for RolloutRestriction {
8215    fn typename() -> &'static str {
8216        "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
8217    }
8218}
8219
8220/// Defines additional types related to [RolloutRestriction].
8221pub mod rollout_restriction {
8222    #[allow(unused_imports)]
8223    use super::*;
8224
8225    /// Rollout actions to be restricted as part of the policy.
8226    ///
8227    /// # Working with unknown values
8228    ///
8229    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8230    /// additional enum variants at any time. Adding new variants is not considered
8231    /// a breaking change. Applications should write their code in anticipation of:
8232    ///
8233    /// - New values appearing in future releases of the client library, **and**
8234    /// - New values received dynamically, without application changes.
8235    ///
8236    /// Please consult the [Working with enums] section in the user guide for some
8237    /// guidelines.
8238    ///
8239    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8240    #[derive(Clone, Debug, PartialEq)]
8241    #[non_exhaustive]
8242    pub enum RolloutActions {
8243        /// Unspecified.
8244        Unspecified,
8245        /// Advance the rollout to the next phase.
8246        Advance,
8247        /// Approve the rollout.
8248        Approve,
8249        /// Cancel the rollout.
8250        Cancel,
8251        /// Create a rollout.
8252        Create,
8253        /// Ignore a job result on the rollout.
8254        IgnoreJob,
8255        /// Retry a job for a rollout.
8256        RetryJob,
8257        /// Rollback a rollout.
8258        Rollback,
8259        /// Terminate a jobrun.
8260        TerminateJobrun,
8261        /// If set, the enum was initialized with an unknown value.
8262        ///
8263        /// Applications can examine the value using [RolloutActions::value] or
8264        /// [RolloutActions::name].
8265        UnknownValue(rollout_actions::UnknownValue),
8266    }
8267
8268    #[doc(hidden)]
8269    pub mod rollout_actions {
8270        #[allow(unused_imports)]
8271        use super::*;
8272        #[derive(Clone, Debug, PartialEq)]
8273        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8274    }
8275
8276    impl RolloutActions {
8277        /// Gets the enum value.
8278        ///
8279        /// Returns `None` if the enum contains an unknown value deserialized from
8280        /// the string representation of enums.
8281        pub fn value(&self) -> std::option::Option<i32> {
8282            match self {
8283                Self::Unspecified => std::option::Option::Some(0),
8284                Self::Advance => std::option::Option::Some(1),
8285                Self::Approve => std::option::Option::Some(2),
8286                Self::Cancel => std::option::Option::Some(3),
8287                Self::Create => std::option::Option::Some(4),
8288                Self::IgnoreJob => std::option::Option::Some(5),
8289                Self::RetryJob => std::option::Option::Some(6),
8290                Self::Rollback => std::option::Option::Some(7),
8291                Self::TerminateJobrun => std::option::Option::Some(8),
8292                Self::UnknownValue(u) => u.0.value(),
8293            }
8294        }
8295
8296        /// Gets the enum value as a string.
8297        ///
8298        /// Returns `None` if the enum contains an unknown value deserialized from
8299        /// the integer representation of enums.
8300        pub fn name(&self) -> std::option::Option<&str> {
8301            match self {
8302                Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
8303                Self::Advance => std::option::Option::Some("ADVANCE"),
8304                Self::Approve => std::option::Option::Some("APPROVE"),
8305                Self::Cancel => std::option::Option::Some("CANCEL"),
8306                Self::Create => std::option::Option::Some("CREATE"),
8307                Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
8308                Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
8309                Self::Rollback => std::option::Option::Some("ROLLBACK"),
8310                Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
8311                Self::UnknownValue(u) => u.0.name(),
8312            }
8313        }
8314    }
8315
8316    impl std::default::Default for RolloutActions {
8317        fn default() -> Self {
8318            use std::convert::From;
8319            Self::from(0)
8320        }
8321    }
8322
8323    impl std::fmt::Display for RolloutActions {
8324        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8325            wkt::internal::display_enum(f, self.name(), self.value())
8326        }
8327    }
8328
8329    impl std::convert::From<i32> for RolloutActions {
8330        fn from(value: i32) -> Self {
8331            match value {
8332                0 => Self::Unspecified,
8333                1 => Self::Advance,
8334                2 => Self::Approve,
8335                3 => Self::Cancel,
8336                4 => Self::Create,
8337                5 => Self::IgnoreJob,
8338                6 => Self::RetryJob,
8339                7 => Self::Rollback,
8340                8 => Self::TerminateJobrun,
8341                _ => Self::UnknownValue(rollout_actions::UnknownValue(
8342                    wkt::internal::UnknownEnumValue::Integer(value),
8343                )),
8344            }
8345        }
8346    }
8347
8348    impl std::convert::From<&str> for RolloutActions {
8349        fn from(value: &str) -> Self {
8350            use std::string::ToString;
8351            match value {
8352                "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
8353                "ADVANCE" => Self::Advance,
8354                "APPROVE" => Self::Approve,
8355                "CANCEL" => Self::Cancel,
8356                "CREATE" => Self::Create,
8357                "IGNORE_JOB" => Self::IgnoreJob,
8358                "RETRY_JOB" => Self::RetryJob,
8359                "ROLLBACK" => Self::Rollback,
8360                "TERMINATE_JOBRUN" => Self::TerminateJobrun,
8361                _ => Self::UnknownValue(rollout_actions::UnknownValue(
8362                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8363                )),
8364            }
8365        }
8366    }
8367
8368    impl serde::ser::Serialize for RolloutActions {
8369        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8370        where
8371            S: serde::Serializer,
8372        {
8373            match self {
8374                Self::Unspecified => serializer.serialize_i32(0),
8375                Self::Advance => serializer.serialize_i32(1),
8376                Self::Approve => serializer.serialize_i32(2),
8377                Self::Cancel => serializer.serialize_i32(3),
8378                Self::Create => serializer.serialize_i32(4),
8379                Self::IgnoreJob => serializer.serialize_i32(5),
8380                Self::RetryJob => serializer.serialize_i32(6),
8381                Self::Rollback => serializer.serialize_i32(7),
8382                Self::TerminateJobrun => serializer.serialize_i32(8),
8383                Self::UnknownValue(u) => u.0.serialize(serializer),
8384            }
8385        }
8386    }
8387
8388    impl<'de> serde::de::Deserialize<'de> for RolloutActions {
8389        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8390        where
8391            D: serde::Deserializer<'de>,
8392        {
8393            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
8394                ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
8395            ))
8396        }
8397    }
8398}
8399
8400/// Time windows within which actions are restricted. See the
8401/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
8402/// for more information on how to configure dates/times.
8403#[derive(Clone, Default, PartialEq)]
8404#[non_exhaustive]
8405pub struct TimeWindows {
8406    /// Required. The time zone in IANA format [IANA Time Zone
8407    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
8408    pub time_zone: std::string::String,
8409
8410    /// Optional. One-time windows within which actions are restricted.
8411    pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
8412
8413    /// Optional. Recurring weekly windows within which actions are restricted.
8414    pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
8415
8416    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8417}
8418
8419impl TimeWindows {
8420    /// Creates a new default instance.
8421    pub fn new() -> Self {
8422        std::default::Default::default()
8423    }
8424
8425    /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
8426    ///
8427    /// # Example
8428    /// ```ignore,no_run
8429    /// # use google_cloud_deploy_v1::model::TimeWindows;
8430    /// let x = TimeWindows::new().set_time_zone("example");
8431    /// ```
8432    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8433        self.time_zone = v.into();
8434        self
8435    }
8436
8437    /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
8438    ///
8439    /// # Example
8440    /// ```ignore,no_run
8441    /// # use google_cloud_deploy_v1::model::TimeWindows;
8442    /// use google_cloud_deploy_v1::model::OneTimeWindow;
8443    /// let x = TimeWindows::new()
8444    ///     .set_one_time_windows([
8445    ///         OneTimeWindow::default()/* use setters */,
8446    ///         OneTimeWindow::default()/* use (different) setters */,
8447    ///     ]);
8448    /// ```
8449    pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
8450    where
8451        T: std::iter::IntoIterator<Item = V>,
8452        V: std::convert::Into<crate::model::OneTimeWindow>,
8453    {
8454        use std::iter::Iterator;
8455        self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
8456        self
8457    }
8458
8459    /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
8460    ///
8461    /// # Example
8462    /// ```ignore,no_run
8463    /// # use google_cloud_deploy_v1::model::TimeWindows;
8464    /// use google_cloud_deploy_v1::model::WeeklyWindow;
8465    /// let x = TimeWindows::new()
8466    ///     .set_weekly_windows([
8467    ///         WeeklyWindow::default()/* use setters */,
8468    ///         WeeklyWindow::default()/* use (different) setters */,
8469    ///     ]);
8470    /// ```
8471    pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
8472    where
8473        T: std::iter::IntoIterator<Item = V>,
8474        V: std::convert::Into<crate::model::WeeklyWindow>,
8475    {
8476        use std::iter::Iterator;
8477        self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
8478        self
8479    }
8480}
8481
8482impl wkt::message::Message for TimeWindows {
8483    fn typename() -> &'static str {
8484        "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
8485    }
8486}
8487
8488/// One-time window within which actions are restricted. For example, blocking
8489/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
8490#[derive(Clone, Default, PartialEq)]
8491#[non_exhaustive]
8492pub struct OneTimeWindow {
8493    /// Required. Start date.
8494    pub start_date: std::option::Option<google_cloud_type::model::Date>,
8495
8496    /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
8497    pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8498
8499    /// Required. End date.
8500    pub end_date: std::option::Option<google_cloud_type::model::Date>,
8501
8502    /// Required. End time (exclusive). You may use 24:00 for the end of the day.
8503    pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8504
8505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8506}
8507
8508impl OneTimeWindow {
8509    /// Creates a new default instance.
8510    pub fn new() -> Self {
8511        std::default::Default::default()
8512    }
8513
8514    /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
8515    ///
8516    /// # Example
8517    /// ```ignore,no_run
8518    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8519    /// use google_cloud_type::model::Date;
8520    /// let x = OneTimeWindow::new().set_start_date(Date::default()/* use setters */);
8521    /// ```
8522    pub fn set_start_date<T>(mut self, v: T) -> Self
8523    where
8524        T: std::convert::Into<google_cloud_type::model::Date>,
8525    {
8526        self.start_date = std::option::Option::Some(v.into());
8527        self
8528    }
8529
8530    /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
8531    ///
8532    /// # Example
8533    /// ```ignore,no_run
8534    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8535    /// use google_cloud_type::model::Date;
8536    /// let x = OneTimeWindow::new().set_or_clear_start_date(Some(Date::default()/* use setters */));
8537    /// let x = OneTimeWindow::new().set_or_clear_start_date(None::<Date>);
8538    /// ```
8539    pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
8540    where
8541        T: std::convert::Into<google_cloud_type::model::Date>,
8542    {
8543        self.start_date = v.map(|x| x.into());
8544        self
8545    }
8546
8547    /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
8548    ///
8549    /// # Example
8550    /// ```ignore,no_run
8551    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8552    /// use google_cloud_type::model::TimeOfDay;
8553    /// let x = OneTimeWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8554    /// ```
8555    pub fn set_start_time<T>(mut self, v: T) -> Self
8556    where
8557        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8558    {
8559        self.start_time = std::option::Option::Some(v.into());
8560        self
8561    }
8562
8563    /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
8564    ///
8565    /// # Example
8566    /// ```ignore,no_run
8567    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8568    /// use google_cloud_type::model::TimeOfDay;
8569    /// let x = OneTimeWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8570    /// let x = OneTimeWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8571    /// ```
8572    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8573    where
8574        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8575    {
8576        self.start_time = v.map(|x| x.into());
8577        self
8578    }
8579
8580    /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
8581    ///
8582    /// # Example
8583    /// ```ignore,no_run
8584    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8585    /// use google_cloud_type::model::Date;
8586    /// let x = OneTimeWindow::new().set_end_date(Date::default()/* use setters */);
8587    /// ```
8588    pub fn set_end_date<T>(mut self, v: T) -> Self
8589    where
8590        T: std::convert::Into<google_cloud_type::model::Date>,
8591    {
8592        self.end_date = std::option::Option::Some(v.into());
8593        self
8594    }
8595
8596    /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
8597    ///
8598    /// # Example
8599    /// ```ignore,no_run
8600    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8601    /// use google_cloud_type::model::Date;
8602    /// let x = OneTimeWindow::new().set_or_clear_end_date(Some(Date::default()/* use setters */));
8603    /// let x = OneTimeWindow::new().set_or_clear_end_date(None::<Date>);
8604    /// ```
8605    pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
8606    where
8607        T: std::convert::Into<google_cloud_type::model::Date>,
8608    {
8609        self.end_date = v.map(|x| x.into());
8610        self
8611    }
8612
8613    /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
8614    ///
8615    /// # Example
8616    /// ```ignore,no_run
8617    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8618    /// use google_cloud_type::model::TimeOfDay;
8619    /// let x = OneTimeWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8620    /// ```
8621    pub fn set_end_time<T>(mut self, v: T) -> Self
8622    where
8623        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8624    {
8625        self.end_time = std::option::Option::Some(v.into());
8626        self
8627    }
8628
8629    /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
8630    ///
8631    /// # Example
8632    /// ```ignore,no_run
8633    /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8634    /// use google_cloud_type::model::TimeOfDay;
8635    /// let x = OneTimeWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8636    /// let x = OneTimeWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8637    /// ```
8638    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8639    where
8640        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8641    {
8642        self.end_time = v.map(|x| x.into());
8643        self
8644    }
8645}
8646
8647impl wkt::message::Message for OneTimeWindow {
8648    fn typename() -> &'static str {
8649        "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
8650    }
8651}
8652
8653/// Weekly windows. For example, blocking actions every Saturday and Sunday.
8654/// Another example would be blocking actions every weekday from 5pm to midnight.
8655#[derive(Clone, Default, PartialEq)]
8656#[non_exhaustive]
8657pub struct WeeklyWindow {
8658    /// Optional. Days of week. If left empty, all days of the week will be
8659    /// included.
8660    pub days_of_week: std::vec::Vec<google_cloud_type::model::DayOfWeek>,
8661
8662    /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
8663    /// If you specify start_time you must also specify end_time. If left empty,
8664    /// this will block for the entire day for the days specified in days_of_week.
8665    pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8666
8667    /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
8668    /// specify end_time you must also specify start_time. If left empty, this will
8669    /// block for the entire day for the days specified in days_of_week.
8670    pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8671
8672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8673}
8674
8675impl WeeklyWindow {
8676    /// Creates a new default instance.
8677    pub fn new() -> Self {
8678        std::default::Default::default()
8679    }
8680
8681    /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
8682    ///
8683    /// # Example
8684    /// ```ignore,no_run
8685    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8686    /// use google_cloud_type::model::DayOfWeek;
8687    /// let x = WeeklyWindow::new().set_days_of_week([
8688    ///     DayOfWeek::Monday,
8689    ///     DayOfWeek::Tuesday,
8690    ///     DayOfWeek::Wednesday,
8691    /// ]);
8692    /// ```
8693    pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
8694    where
8695        T: std::iter::IntoIterator<Item = V>,
8696        V: std::convert::Into<google_cloud_type::model::DayOfWeek>,
8697    {
8698        use std::iter::Iterator;
8699        self.days_of_week = v.into_iter().map(|i| i.into()).collect();
8700        self
8701    }
8702
8703    /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
8704    ///
8705    /// # Example
8706    /// ```ignore,no_run
8707    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8708    /// use google_cloud_type::model::TimeOfDay;
8709    /// let x = WeeklyWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8710    /// ```
8711    pub fn set_start_time<T>(mut self, v: T) -> Self
8712    where
8713        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8714    {
8715        self.start_time = std::option::Option::Some(v.into());
8716        self
8717    }
8718
8719    /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
8720    ///
8721    /// # Example
8722    /// ```ignore,no_run
8723    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8724    /// use google_cloud_type::model::TimeOfDay;
8725    /// let x = WeeklyWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8726    /// let x = WeeklyWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8727    /// ```
8728    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8729    where
8730        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8731    {
8732        self.start_time = v.map(|x| x.into());
8733        self
8734    }
8735
8736    /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
8737    ///
8738    /// # Example
8739    /// ```ignore,no_run
8740    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8741    /// use google_cloud_type::model::TimeOfDay;
8742    /// let x = WeeklyWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8743    /// ```
8744    pub fn set_end_time<T>(mut self, v: T) -> Self
8745    where
8746        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8747    {
8748        self.end_time = std::option::Option::Some(v.into());
8749        self
8750    }
8751
8752    /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
8753    ///
8754    /// # Example
8755    /// ```ignore,no_run
8756    /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8757    /// use google_cloud_type::model::TimeOfDay;
8758    /// let x = WeeklyWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8759    /// let x = WeeklyWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8760    /// ```
8761    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8762    where
8763        T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8764    {
8765        self.end_time = v.map(|x| x.into());
8766        self
8767    }
8768}
8769
8770impl wkt::message::Message for WeeklyWindow {
8771    fn typename() -> &'static str {
8772        "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
8773    }
8774}
8775
8776/// Returned from an action if one or more policies were
8777/// violated, and therefore the action was prevented. Contains information about
8778/// what policies were violated and why.
8779#[derive(Clone, Default, PartialEq)]
8780#[non_exhaustive]
8781pub struct PolicyViolation {
8782    /// Policy violation details.
8783    pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
8784
8785    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8786}
8787
8788impl PolicyViolation {
8789    /// Creates a new default instance.
8790    pub fn new() -> Self {
8791        std::default::Default::default()
8792    }
8793
8794    /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
8795    ///
8796    /// # Example
8797    /// ```ignore,no_run
8798    /// # use google_cloud_deploy_v1::model::PolicyViolation;
8799    /// use google_cloud_deploy_v1::model::PolicyViolationDetails;
8800    /// let x = PolicyViolation::new()
8801    ///     .set_policy_violation_details([
8802    ///         PolicyViolationDetails::default()/* use setters */,
8803    ///         PolicyViolationDetails::default()/* use (different) setters */,
8804    ///     ]);
8805    /// ```
8806    pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
8807    where
8808        T: std::iter::IntoIterator<Item = V>,
8809        V: std::convert::Into<crate::model::PolicyViolationDetails>,
8810    {
8811        use std::iter::Iterator;
8812        self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
8813        self
8814    }
8815}
8816
8817impl wkt::message::Message for PolicyViolation {
8818    fn typename() -> &'static str {
8819        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
8820    }
8821}
8822
8823/// Policy violation details.
8824#[derive(Clone, Default, PartialEq)]
8825#[non_exhaustive]
8826pub struct PolicyViolationDetails {
8827    /// Name of the policy that was violated.
8828    /// Policy resource will be in the format of
8829    /// `projects/{project}/locations/{location}/policies/{policy}`.
8830    pub policy: std::string::String,
8831
8832    /// Id of the rule that triggered the policy violation.
8833    pub rule_id: std::string::String,
8834
8835    /// User readable message about why the request violated a policy. This is not
8836    /// intended for machine parsing.
8837    pub failure_message: std::string::String,
8838
8839    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8840}
8841
8842impl PolicyViolationDetails {
8843    /// Creates a new default instance.
8844    pub fn new() -> Self {
8845        std::default::Default::default()
8846    }
8847
8848    /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
8849    ///
8850    /// # Example
8851    /// ```ignore,no_run
8852    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8853    /// let x = PolicyViolationDetails::new().set_policy("example");
8854    /// ```
8855    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8856        self.policy = v.into();
8857        self
8858    }
8859
8860    /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
8861    ///
8862    /// # Example
8863    /// ```ignore,no_run
8864    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8865    /// let x = PolicyViolationDetails::new().set_rule_id("example");
8866    /// ```
8867    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8868        self.rule_id = v.into();
8869        self
8870    }
8871
8872    /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
8873    ///
8874    /// # Example
8875    /// ```ignore,no_run
8876    /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8877    /// let x = PolicyViolationDetails::new().set_failure_message("example");
8878    /// ```
8879    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8880        self.failure_message = v.into();
8881        self
8882    }
8883}
8884
8885impl wkt::message::Message for PolicyViolationDetails {
8886    fn typename() -> &'static str {
8887        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
8888    }
8889}
8890
8891/// A `Release` resource in the Cloud Deploy API.
8892///
8893/// A `Release` defines a specific Skaffold configuration instance
8894/// that can be deployed.
8895#[derive(Clone, Default, PartialEq)]
8896#[non_exhaustive]
8897pub struct Release {
8898    /// Identifier. Name of the `Release`. Format is
8899    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
8900    /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8901    pub name: std::string::String,
8902
8903    /// Output only. Unique identifier of the `Release`.
8904    pub uid: std::string::String,
8905
8906    /// Optional. Description of the `Release`. Max length is 255 characters.
8907    pub description: std::string::String,
8908
8909    /// Optional. User annotations. These attributes can only be set and used by
8910    /// the user, and not by Cloud Deploy. See
8911    /// <https://google.aip.dev/128#annotations> for more details such as format and
8912    /// size limitations.
8913    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8914
8915    /// Labels are attributes that can be set and used by both the
8916    /// user and by Cloud Deploy. Labels must meet the following constraints:
8917    ///
8918    /// * Keys and values can contain only lowercase letters, numeric characters,
8919    ///   underscores, and dashes.
8920    /// * All characters must use UTF-8 encoding, and international characters are
8921    ///   allowed.
8922    /// * Keys must start with a lowercase letter or international character.
8923    /// * Each resource is limited to a maximum of 64 labels.
8924    ///
8925    /// Both keys and values are additionally constrained to be <= 128 bytes.
8926    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8927
8928    /// Output only. Indicates whether this is an abandoned release.
8929    pub abandoned: bool,
8930
8931    /// Output only. Time at which the `Release` was created.
8932    pub create_time: std::option::Option<wkt::Timestamp>,
8933
8934    /// Output only. Time at which the render began.
8935    pub render_start_time: std::option::Option<wkt::Timestamp>,
8936
8937    /// Output only. Time at which the render completed.
8938    pub render_end_time: std::option::Option<wkt::Timestamp>,
8939
8940    /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
8941    /// configuration.
8942    pub skaffold_config_uri: std::string::String,
8943
8944    /// Optional. Filepath of the Skaffold config inside of the config URI.
8945    pub skaffold_config_path: std::string::String,
8946
8947    /// Optional. List of artifacts to pass through to Skaffold command.
8948    pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
8949
8950    /// Output only. Snapshot of the parent pipeline taken at release creation
8951    /// time.
8952    pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
8953
8954    /// Output only. Snapshot of the targets taken at release creation time.
8955    pub target_snapshots: std::vec::Vec<crate::model::Target>,
8956
8957    /// Output only. Snapshot of the custom target types referenced by the targets
8958    /// taken at release creation time.
8959    pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
8960
8961    /// Output only. Current state of the render operation.
8962    pub render_state: crate::model::release::RenderState,
8963
8964    /// This checksum is computed by the server based on the value of other
8965    /// fields, and may be sent on update and delete requests to ensure the
8966    /// client has an up-to-date value before proceeding.
8967    pub etag: std::string::String,
8968
8969    /// Optional. The Skaffold version to use when operating on this release, such
8970    /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
8971    /// set of versions.
8972    ///
8973    /// If unset, the most recent supported Skaffold version will be used.
8974    pub skaffold_version: std::string::String,
8975
8976    /// Output only. Map from target ID to the target artifacts created
8977    /// during the render operation.
8978    pub target_artifacts:
8979        std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
8980
8981    /// Output only. Map from target ID to details of the render operation for that
8982    /// target.
8983    pub target_renders:
8984        std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
8985
8986    /// Output only. Information around the state of the Release.
8987    pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
8988
8989    /// Optional. The deploy parameters to use for all targets in this release.
8990    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
8991
8992    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8993}
8994
8995impl Release {
8996    /// Creates a new default instance.
8997    pub fn new() -> Self {
8998        std::default::Default::default()
8999    }
9000
9001    /// Sets the value of [name][crate::model::Release::name].
9002    ///
9003    /// # Example
9004    /// ```ignore,no_run
9005    /// # use google_cloud_deploy_v1::model::Release;
9006    /// # let project_id = "project_id";
9007    /// # let location_id = "location_id";
9008    /// # let delivery_pipeline_id = "delivery_pipeline_id";
9009    /// # let release_id = "release_id";
9010    /// let x = Release::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
9011    /// ```
9012    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9013        self.name = v.into();
9014        self
9015    }
9016
9017    /// Sets the value of [uid][crate::model::Release::uid].
9018    ///
9019    /// # Example
9020    /// ```ignore,no_run
9021    /// # use google_cloud_deploy_v1::model::Release;
9022    /// let x = Release::new().set_uid("example");
9023    /// ```
9024    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9025        self.uid = v.into();
9026        self
9027    }
9028
9029    /// Sets the value of [description][crate::model::Release::description].
9030    ///
9031    /// # Example
9032    /// ```ignore,no_run
9033    /// # use google_cloud_deploy_v1::model::Release;
9034    /// let x = Release::new().set_description("example");
9035    /// ```
9036    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9037        self.description = v.into();
9038        self
9039    }
9040
9041    /// Sets the value of [annotations][crate::model::Release::annotations].
9042    ///
9043    /// # Example
9044    /// ```ignore,no_run
9045    /// # use google_cloud_deploy_v1::model::Release;
9046    /// let x = Release::new().set_annotations([
9047    ///     ("key0", "abc"),
9048    ///     ("key1", "xyz"),
9049    /// ]);
9050    /// ```
9051    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
9052    where
9053        T: std::iter::IntoIterator<Item = (K, V)>,
9054        K: std::convert::Into<std::string::String>,
9055        V: std::convert::Into<std::string::String>,
9056    {
9057        use std::iter::Iterator;
9058        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9059        self
9060    }
9061
9062    /// Sets the value of [labels][crate::model::Release::labels].
9063    ///
9064    /// # Example
9065    /// ```ignore,no_run
9066    /// # use google_cloud_deploy_v1::model::Release;
9067    /// let x = Release::new().set_labels([
9068    ///     ("key0", "abc"),
9069    ///     ("key1", "xyz"),
9070    /// ]);
9071    /// ```
9072    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9073    where
9074        T: std::iter::IntoIterator<Item = (K, V)>,
9075        K: std::convert::Into<std::string::String>,
9076        V: std::convert::Into<std::string::String>,
9077    {
9078        use std::iter::Iterator;
9079        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9080        self
9081    }
9082
9083    /// Sets the value of [abandoned][crate::model::Release::abandoned].
9084    ///
9085    /// # Example
9086    /// ```ignore,no_run
9087    /// # use google_cloud_deploy_v1::model::Release;
9088    /// let x = Release::new().set_abandoned(true);
9089    /// ```
9090    pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9091        self.abandoned = v.into();
9092        self
9093    }
9094
9095    /// Sets the value of [create_time][crate::model::Release::create_time].
9096    ///
9097    /// # Example
9098    /// ```ignore,no_run
9099    /// # use google_cloud_deploy_v1::model::Release;
9100    /// use wkt::Timestamp;
9101    /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
9102    /// ```
9103    pub fn set_create_time<T>(mut self, v: T) -> Self
9104    where
9105        T: std::convert::Into<wkt::Timestamp>,
9106    {
9107        self.create_time = std::option::Option::Some(v.into());
9108        self
9109    }
9110
9111    /// Sets or clears the value of [create_time][crate::model::Release::create_time].
9112    ///
9113    /// # Example
9114    /// ```ignore,no_run
9115    /// # use google_cloud_deploy_v1::model::Release;
9116    /// use wkt::Timestamp;
9117    /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9118    /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
9119    /// ```
9120    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9121    where
9122        T: std::convert::Into<wkt::Timestamp>,
9123    {
9124        self.create_time = v.map(|x| x.into());
9125        self
9126    }
9127
9128    /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
9129    ///
9130    /// # Example
9131    /// ```ignore,no_run
9132    /// # use google_cloud_deploy_v1::model::Release;
9133    /// use wkt::Timestamp;
9134    /// let x = Release::new().set_render_start_time(Timestamp::default()/* use setters */);
9135    /// ```
9136    pub fn set_render_start_time<T>(mut self, v: T) -> Self
9137    where
9138        T: std::convert::Into<wkt::Timestamp>,
9139    {
9140        self.render_start_time = std::option::Option::Some(v.into());
9141        self
9142    }
9143
9144    /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
9145    ///
9146    /// # Example
9147    /// ```ignore,no_run
9148    /// # use google_cloud_deploy_v1::model::Release;
9149    /// use wkt::Timestamp;
9150    /// let x = Release::new().set_or_clear_render_start_time(Some(Timestamp::default()/* use setters */));
9151    /// let x = Release::new().set_or_clear_render_start_time(None::<Timestamp>);
9152    /// ```
9153    pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9154    where
9155        T: std::convert::Into<wkt::Timestamp>,
9156    {
9157        self.render_start_time = v.map(|x| x.into());
9158        self
9159    }
9160
9161    /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
9162    ///
9163    /// # Example
9164    /// ```ignore,no_run
9165    /// # use google_cloud_deploy_v1::model::Release;
9166    /// use wkt::Timestamp;
9167    /// let x = Release::new().set_render_end_time(Timestamp::default()/* use setters */);
9168    /// ```
9169    pub fn set_render_end_time<T>(mut self, v: T) -> Self
9170    where
9171        T: std::convert::Into<wkt::Timestamp>,
9172    {
9173        self.render_end_time = std::option::Option::Some(v.into());
9174        self
9175    }
9176
9177    /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
9178    ///
9179    /// # Example
9180    /// ```ignore,no_run
9181    /// # use google_cloud_deploy_v1::model::Release;
9182    /// use wkt::Timestamp;
9183    /// let x = Release::new().set_or_clear_render_end_time(Some(Timestamp::default()/* use setters */));
9184    /// let x = Release::new().set_or_clear_render_end_time(None::<Timestamp>);
9185    /// ```
9186    pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9187    where
9188        T: std::convert::Into<wkt::Timestamp>,
9189    {
9190        self.render_end_time = v.map(|x| x.into());
9191        self
9192    }
9193
9194    /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
9195    ///
9196    /// # Example
9197    /// ```ignore,no_run
9198    /// # use google_cloud_deploy_v1::model::Release;
9199    /// let x = Release::new().set_skaffold_config_uri("example");
9200    /// ```
9201    pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
9202        mut self,
9203        v: T,
9204    ) -> Self {
9205        self.skaffold_config_uri = v.into();
9206        self
9207    }
9208
9209    /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
9210    ///
9211    /// # Example
9212    /// ```ignore,no_run
9213    /// # use google_cloud_deploy_v1::model::Release;
9214    /// let x = Release::new().set_skaffold_config_path("example");
9215    /// ```
9216    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
9217        mut self,
9218        v: T,
9219    ) -> Self {
9220        self.skaffold_config_path = v.into();
9221        self
9222    }
9223
9224    /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
9225    ///
9226    /// # Example
9227    /// ```ignore,no_run
9228    /// # use google_cloud_deploy_v1::model::Release;
9229    /// use google_cloud_deploy_v1::model::BuildArtifact;
9230    /// let x = Release::new()
9231    ///     .set_build_artifacts([
9232    ///         BuildArtifact::default()/* use setters */,
9233    ///         BuildArtifact::default()/* use (different) setters */,
9234    ///     ]);
9235    /// ```
9236    pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
9237    where
9238        T: std::iter::IntoIterator<Item = V>,
9239        V: std::convert::Into<crate::model::BuildArtifact>,
9240    {
9241        use std::iter::Iterator;
9242        self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
9243        self
9244    }
9245
9246    /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9247    ///
9248    /// # Example
9249    /// ```ignore,no_run
9250    /// # use google_cloud_deploy_v1::model::Release;
9251    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9252    /// let x = Release::new().set_delivery_pipeline_snapshot(DeliveryPipeline::default()/* use setters */);
9253    /// ```
9254    pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
9255    where
9256        T: std::convert::Into<crate::model::DeliveryPipeline>,
9257    {
9258        self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
9259        self
9260    }
9261
9262    /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9263    ///
9264    /// # Example
9265    /// ```ignore,no_run
9266    /// # use google_cloud_deploy_v1::model::Release;
9267    /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9268    /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(Some(DeliveryPipeline::default()/* use setters */));
9269    /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(None::<DeliveryPipeline>);
9270    /// ```
9271    pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9272    where
9273        T: std::convert::Into<crate::model::DeliveryPipeline>,
9274    {
9275        self.delivery_pipeline_snapshot = v.map(|x| x.into());
9276        self
9277    }
9278
9279    /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
9280    ///
9281    /// # Example
9282    /// ```ignore,no_run
9283    /// # use google_cloud_deploy_v1::model::Release;
9284    /// use google_cloud_deploy_v1::model::Target;
9285    /// let x = Release::new()
9286    ///     .set_target_snapshots([
9287    ///         Target::default()/* use setters */,
9288    ///         Target::default()/* use (different) setters */,
9289    ///     ]);
9290    /// ```
9291    pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
9292    where
9293        T: std::iter::IntoIterator<Item = V>,
9294        V: std::convert::Into<crate::model::Target>,
9295    {
9296        use std::iter::Iterator;
9297        self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
9298        self
9299    }
9300
9301    /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
9302    ///
9303    /// # Example
9304    /// ```ignore,no_run
9305    /// # use google_cloud_deploy_v1::model::Release;
9306    /// use google_cloud_deploy_v1::model::CustomTargetType;
9307    /// let x = Release::new()
9308    ///     .set_custom_target_type_snapshots([
9309    ///         CustomTargetType::default()/* use setters */,
9310    ///         CustomTargetType::default()/* use (different) setters */,
9311    ///     ]);
9312    /// ```
9313    pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
9314    where
9315        T: std::iter::IntoIterator<Item = V>,
9316        V: std::convert::Into<crate::model::CustomTargetType>,
9317    {
9318        use std::iter::Iterator;
9319        self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
9320        self
9321    }
9322
9323    /// Sets the value of [render_state][crate::model::Release::render_state].
9324    ///
9325    /// # Example
9326    /// ```ignore,no_run
9327    /// # use google_cloud_deploy_v1::model::Release;
9328    /// use google_cloud_deploy_v1::model::release::RenderState;
9329    /// let x0 = Release::new().set_render_state(RenderState::Succeeded);
9330    /// let x1 = Release::new().set_render_state(RenderState::Failed);
9331    /// let x2 = Release::new().set_render_state(RenderState::InProgress);
9332    /// ```
9333    pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
9334        mut self,
9335        v: T,
9336    ) -> Self {
9337        self.render_state = v.into();
9338        self
9339    }
9340
9341    /// Sets the value of [etag][crate::model::Release::etag].
9342    ///
9343    /// # Example
9344    /// ```ignore,no_run
9345    /// # use google_cloud_deploy_v1::model::Release;
9346    /// let x = Release::new().set_etag("example");
9347    /// ```
9348    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9349        self.etag = v.into();
9350        self
9351    }
9352
9353    /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
9354    ///
9355    /// # Example
9356    /// ```ignore,no_run
9357    /// # use google_cloud_deploy_v1::model::Release;
9358    /// let x = Release::new().set_skaffold_version("example");
9359    /// ```
9360    pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
9361        mut self,
9362        v: T,
9363    ) -> Self {
9364        self.skaffold_version = v.into();
9365        self
9366    }
9367
9368    /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
9369    ///
9370    /// # Example
9371    /// ```ignore,no_run
9372    /// # use google_cloud_deploy_v1::model::Release;
9373    /// use google_cloud_deploy_v1::model::TargetArtifact;
9374    /// let x = Release::new().set_target_artifacts([
9375    ///     ("key0", TargetArtifact::default()/* use setters */),
9376    ///     ("key1", TargetArtifact::default()/* use (different) setters */),
9377    /// ]);
9378    /// ```
9379    pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
9380    where
9381        T: std::iter::IntoIterator<Item = (K, V)>,
9382        K: std::convert::Into<std::string::String>,
9383        V: std::convert::Into<crate::model::TargetArtifact>,
9384    {
9385        use std::iter::Iterator;
9386        self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9387        self
9388    }
9389
9390    /// Sets the value of [target_renders][crate::model::Release::target_renders].
9391    ///
9392    /// # Example
9393    /// ```ignore,no_run
9394    /// # use google_cloud_deploy_v1::model::Release;
9395    /// use google_cloud_deploy_v1::model::release::TargetRender;
9396    /// let x = Release::new().set_target_renders([
9397    ///     ("key0", TargetRender::default()/* use setters */),
9398    ///     ("key1", TargetRender::default()/* use (different) setters */),
9399    /// ]);
9400    /// ```
9401    pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
9402    where
9403        T: std::iter::IntoIterator<Item = (K, V)>,
9404        K: std::convert::Into<std::string::String>,
9405        V: std::convert::Into<crate::model::release::TargetRender>,
9406    {
9407        use std::iter::Iterator;
9408        self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9409        self
9410    }
9411
9412    /// Sets the value of [condition][crate::model::Release::condition].
9413    ///
9414    /// # Example
9415    /// ```ignore,no_run
9416    /// # use google_cloud_deploy_v1::model::Release;
9417    /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9418    /// let x = Release::new().set_condition(ReleaseCondition::default()/* use setters */);
9419    /// ```
9420    pub fn set_condition<T>(mut self, v: T) -> Self
9421    where
9422        T: std::convert::Into<crate::model::release::ReleaseCondition>,
9423    {
9424        self.condition = std::option::Option::Some(v.into());
9425        self
9426    }
9427
9428    /// Sets or clears the value of [condition][crate::model::Release::condition].
9429    ///
9430    /// # Example
9431    /// ```ignore,no_run
9432    /// # use google_cloud_deploy_v1::model::Release;
9433    /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9434    /// let x = Release::new().set_or_clear_condition(Some(ReleaseCondition::default()/* use setters */));
9435    /// let x = Release::new().set_or_clear_condition(None::<ReleaseCondition>);
9436    /// ```
9437    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
9438    where
9439        T: std::convert::Into<crate::model::release::ReleaseCondition>,
9440    {
9441        self.condition = v.map(|x| x.into());
9442        self
9443    }
9444
9445    /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
9446    ///
9447    /// # Example
9448    /// ```ignore,no_run
9449    /// # use google_cloud_deploy_v1::model::Release;
9450    /// let x = Release::new().set_deploy_parameters([
9451    ///     ("key0", "abc"),
9452    ///     ("key1", "xyz"),
9453    /// ]);
9454    /// ```
9455    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
9456    where
9457        T: std::iter::IntoIterator<Item = (K, V)>,
9458        K: std::convert::Into<std::string::String>,
9459        V: std::convert::Into<std::string::String>,
9460    {
9461        use std::iter::Iterator;
9462        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9463        self
9464    }
9465}
9466
9467impl wkt::message::Message for Release {
9468    fn typename() -> &'static str {
9469        "type.googleapis.com/google.cloud.deploy.v1.Release"
9470    }
9471}
9472
9473/// Defines additional types related to [Release].
9474pub mod release {
9475    #[allow(unused_imports)]
9476    use super::*;
9477
9478    /// Details of rendering for a single target.
9479    #[derive(Clone, Default, PartialEq)]
9480    #[non_exhaustive]
9481    pub struct TargetRender {
9482        /// Output only. The resource name of the Cloud Build `Build` object that is
9483        /// used to render the manifest for this target. Format is
9484        /// `projects/{project}/locations/{location}/builds/{build}`.
9485        pub rendering_build: std::string::String,
9486
9487        /// Output only. Current state of the render operation for this Target.
9488        pub rendering_state: crate::model::release::target_render::TargetRenderState,
9489
9490        /// Output only. Metadata related to the `Release` render for this Target.
9491        pub metadata: std::option::Option<crate::model::RenderMetadata>,
9492
9493        /// Output only. Reason this render failed. This will always be unspecified
9494        /// while the render in progress.
9495        pub failure_cause: crate::model::release::target_render::FailureCause,
9496
9497        /// Output only. Additional information about the render failure, if
9498        /// available.
9499        pub failure_message: std::string::String,
9500
9501        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9502    }
9503
9504    impl TargetRender {
9505        /// Creates a new default instance.
9506        pub fn new() -> Self {
9507            std::default::Default::default()
9508        }
9509
9510        /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
9511        ///
9512        /// # Example
9513        /// ```ignore,no_run
9514        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9515        /// let x = TargetRender::new().set_rendering_build("example");
9516        /// ```
9517        pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
9518            mut self,
9519            v: T,
9520        ) -> Self {
9521            self.rendering_build = v.into();
9522            self
9523        }
9524
9525        /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
9526        ///
9527        /// # Example
9528        /// ```ignore,no_run
9529        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9530        /// use google_cloud_deploy_v1::model::release::target_render::TargetRenderState;
9531        /// let x0 = TargetRender::new().set_rendering_state(TargetRenderState::Succeeded);
9532        /// let x1 = TargetRender::new().set_rendering_state(TargetRenderState::Failed);
9533        /// let x2 = TargetRender::new().set_rendering_state(TargetRenderState::InProgress);
9534        /// ```
9535        pub fn set_rendering_state<
9536            T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
9537        >(
9538            mut self,
9539            v: T,
9540        ) -> Self {
9541            self.rendering_state = v.into();
9542            self
9543        }
9544
9545        /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
9546        ///
9547        /// # Example
9548        /// ```ignore,no_run
9549        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9550        /// use google_cloud_deploy_v1::model::RenderMetadata;
9551        /// let x = TargetRender::new().set_metadata(RenderMetadata::default()/* use setters */);
9552        /// ```
9553        pub fn set_metadata<T>(mut self, v: T) -> Self
9554        where
9555            T: std::convert::Into<crate::model::RenderMetadata>,
9556        {
9557            self.metadata = std::option::Option::Some(v.into());
9558            self
9559        }
9560
9561        /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
9562        ///
9563        /// # Example
9564        /// ```ignore,no_run
9565        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9566        /// use google_cloud_deploy_v1::model::RenderMetadata;
9567        /// let x = TargetRender::new().set_or_clear_metadata(Some(RenderMetadata::default()/* use setters */));
9568        /// let x = TargetRender::new().set_or_clear_metadata(None::<RenderMetadata>);
9569        /// ```
9570        pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9571        where
9572            T: std::convert::Into<crate::model::RenderMetadata>,
9573        {
9574            self.metadata = v.map(|x| x.into());
9575            self
9576        }
9577
9578        /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
9579        ///
9580        /// # Example
9581        /// ```ignore,no_run
9582        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9583        /// use google_cloud_deploy_v1::model::release::target_render::FailureCause;
9584        /// let x0 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
9585        /// let x1 = TargetRender::new().set_failure_cause(FailureCause::ExecutionFailed);
9586        /// let x2 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildRequestFailed);
9587        /// ```
9588        pub fn set_failure_cause<
9589            T: std::convert::Into<crate::model::release::target_render::FailureCause>,
9590        >(
9591            mut self,
9592            v: T,
9593        ) -> Self {
9594            self.failure_cause = v.into();
9595            self
9596        }
9597
9598        /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
9599        ///
9600        /// # Example
9601        /// ```ignore,no_run
9602        /// # use google_cloud_deploy_v1::model::release::TargetRender;
9603        /// let x = TargetRender::new().set_failure_message("example");
9604        /// ```
9605        pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
9606            mut self,
9607            v: T,
9608        ) -> Self {
9609            self.failure_message = v.into();
9610            self
9611        }
9612    }
9613
9614    impl wkt::message::Message for TargetRender {
9615        fn typename() -> &'static str {
9616            "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
9617        }
9618    }
9619
9620    /// Defines additional types related to [TargetRender].
9621    pub mod target_render {
9622        #[allow(unused_imports)]
9623        use super::*;
9624
9625        /// Valid states of the render operation.
9626        ///
9627        /// # Working with unknown values
9628        ///
9629        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9630        /// additional enum variants at any time. Adding new variants is not considered
9631        /// a breaking change. Applications should write their code in anticipation of:
9632        ///
9633        /// - New values appearing in future releases of the client library, **and**
9634        /// - New values received dynamically, without application changes.
9635        ///
9636        /// Please consult the [Working with enums] section in the user guide for some
9637        /// guidelines.
9638        ///
9639        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9640        #[derive(Clone, Debug, PartialEq)]
9641        #[non_exhaustive]
9642        pub enum TargetRenderState {
9643            /// The render operation state is unspecified.
9644            Unspecified,
9645            /// The render operation has completed successfully.
9646            Succeeded,
9647            /// The render operation has failed.
9648            Failed,
9649            /// The render operation is in progress.
9650            InProgress,
9651            /// If set, the enum was initialized with an unknown value.
9652            ///
9653            /// Applications can examine the value using [TargetRenderState::value] or
9654            /// [TargetRenderState::name].
9655            UnknownValue(target_render_state::UnknownValue),
9656        }
9657
9658        #[doc(hidden)]
9659        pub mod target_render_state {
9660            #[allow(unused_imports)]
9661            use super::*;
9662            #[derive(Clone, Debug, PartialEq)]
9663            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9664        }
9665
9666        impl TargetRenderState {
9667            /// Gets the enum value.
9668            ///
9669            /// Returns `None` if the enum contains an unknown value deserialized from
9670            /// the string representation of enums.
9671            pub fn value(&self) -> std::option::Option<i32> {
9672                match self {
9673                    Self::Unspecified => std::option::Option::Some(0),
9674                    Self::Succeeded => std::option::Option::Some(1),
9675                    Self::Failed => std::option::Option::Some(2),
9676                    Self::InProgress => std::option::Option::Some(3),
9677                    Self::UnknownValue(u) => u.0.value(),
9678                }
9679            }
9680
9681            /// Gets the enum value as a string.
9682            ///
9683            /// Returns `None` if the enum contains an unknown value deserialized from
9684            /// the integer representation of enums.
9685            pub fn name(&self) -> std::option::Option<&str> {
9686                match self {
9687                    Self::Unspecified => {
9688                        std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
9689                    }
9690                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9691                    Self::Failed => std::option::Option::Some("FAILED"),
9692                    Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9693                    Self::UnknownValue(u) => u.0.name(),
9694                }
9695            }
9696        }
9697
9698        impl std::default::Default for TargetRenderState {
9699            fn default() -> Self {
9700                use std::convert::From;
9701                Self::from(0)
9702            }
9703        }
9704
9705        impl std::fmt::Display for TargetRenderState {
9706            fn fmt(
9707                &self,
9708                f: &mut std::fmt::Formatter<'_>,
9709            ) -> std::result::Result<(), std::fmt::Error> {
9710                wkt::internal::display_enum(f, self.name(), self.value())
9711            }
9712        }
9713
9714        impl std::convert::From<i32> for TargetRenderState {
9715            fn from(value: i32) -> Self {
9716                match value {
9717                    0 => Self::Unspecified,
9718                    1 => Self::Succeeded,
9719                    2 => Self::Failed,
9720                    3 => Self::InProgress,
9721                    _ => Self::UnknownValue(target_render_state::UnknownValue(
9722                        wkt::internal::UnknownEnumValue::Integer(value),
9723                    )),
9724                }
9725            }
9726        }
9727
9728        impl std::convert::From<&str> for TargetRenderState {
9729            fn from(value: &str) -> Self {
9730                use std::string::ToString;
9731                match value {
9732                    "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
9733                    "SUCCEEDED" => Self::Succeeded,
9734                    "FAILED" => Self::Failed,
9735                    "IN_PROGRESS" => Self::InProgress,
9736                    _ => Self::UnknownValue(target_render_state::UnknownValue(
9737                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9738                    )),
9739                }
9740            }
9741        }
9742
9743        impl serde::ser::Serialize for TargetRenderState {
9744            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9745            where
9746                S: serde::Serializer,
9747            {
9748                match self {
9749                    Self::Unspecified => serializer.serialize_i32(0),
9750                    Self::Succeeded => serializer.serialize_i32(1),
9751                    Self::Failed => serializer.serialize_i32(2),
9752                    Self::InProgress => serializer.serialize_i32(3),
9753                    Self::UnknownValue(u) => u.0.serialize(serializer),
9754                }
9755            }
9756        }
9757
9758        impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
9759            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9760            where
9761                D: serde::Deserializer<'de>,
9762            {
9763                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
9764                    ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
9765                ))
9766            }
9767        }
9768
9769        /// Well-known rendering failures.
9770        ///
9771        /// # Working with unknown values
9772        ///
9773        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9774        /// additional enum variants at any time. Adding new variants is not considered
9775        /// a breaking change. Applications should write their code in anticipation of:
9776        ///
9777        /// - New values appearing in future releases of the client library, **and**
9778        /// - New values received dynamically, without application changes.
9779        ///
9780        /// Please consult the [Working with enums] section in the user guide for some
9781        /// guidelines.
9782        ///
9783        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9784        #[derive(Clone, Debug, PartialEq)]
9785        #[non_exhaustive]
9786        pub enum FailureCause {
9787            /// No reason for failure is specified.
9788            Unspecified,
9789            /// Cloud Build is not available, either because it is not enabled or
9790            /// because Cloud Deploy has insufficient permissions. See [required
9791            /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9792            CloudBuildUnavailable,
9793            /// The render operation did not complete successfully; check Cloud Build
9794            /// logs.
9795            ExecutionFailed,
9796            /// Cloud Build failed to fulfill Cloud Deploy's request. See
9797            /// failure_message for additional details.
9798            CloudBuildRequestFailed,
9799            /// The render operation did not complete successfully because the
9800            /// verification stanza required for verify was not found on the Skaffold
9801            /// configuration.
9802            VerificationConfigNotFound,
9803            /// The render operation did not complete successfully because the custom
9804            /// action(s) required for Rollout jobs were not found in the Skaffold
9805            /// configuration. See failure_message for additional details.
9806            CustomActionNotFound,
9807            /// Release failed during rendering because the release configuration is
9808            /// not supported with the specified deployment strategy.
9809            DeploymentStrategyNotSupported,
9810            /// The render operation had a feature configured that is not supported.
9811            RenderFeatureNotSupported,
9812            /// If set, the enum was initialized with an unknown value.
9813            ///
9814            /// Applications can examine the value using [FailureCause::value] or
9815            /// [FailureCause::name].
9816            UnknownValue(failure_cause::UnknownValue),
9817        }
9818
9819        #[doc(hidden)]
9820        pub mod failure_cause {
9821            #[allow(unused_imports)]
9822            use super::*;
9823            #[derive(Clone, Debug, PartialEq)]
9824            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9825        }
9826
9827        impl FailureCause {
9828            /// Gets the enum value.
9829            ///
9830            /// Returns `None` if the enum contains an unknown value deserialized from
9831            /// the string representation of enums.
9832            pub fn value(&self) -> std::option::Option<i32> {
9833                match self {
9834                    Self::Unspecified => std::option::Option::Some(0),
9835                    Self::CloudBuildUnavailable => std::option::Option::Some(1),
9836                    Self::ExecutionFailed => std::option::Option::Some(2),
9837                    Self::CloudBuildRequestFailed => std::option::Option::Some(3),
9838                    Self::VerificationConfigNotFound => std::option::Option::Some(4),
9839                    Self::CustomActionNotFound => std::option::Option::Some(5),
9840                    Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
9841                    Self::RenderFeatureNotSupported => std::option::Option::Some(7),
9842                    Self::UnknownValue(u) => u.0.value(),
9843                }
9844            }
9845
9846            /// Gets the enum value as a string.
9847            ///
9848            /// Returns `None` if the enum contains an unknown value deserialized from
9849            /// the integer representation of enums.
9850            pub fn name(&self) -> std::option::Option<&str> {
9851                match self {
9852                    Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9853                    Self::CloudBuildUnavailable => {
9854                        std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
9855                    }
9856                    Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9857                    Self::CloudBuildRequestFailed => {
9858                        std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9859                    }
9860                    Self::VerificationConfigNotFound => {
9861                        std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9862                    }
9863                    Self::CustomActionNotFound => {
9864                        std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
9865                    }
9866                    Self::DeploymentStrategyNotSupported => {
9867                        std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
9868                    }
9869                    Self::RenderFeatureNotSupported => {
9870                        std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
9871                    }
9872                    Self::UnknownValue(u) => u.0.name(),
9873                }
9874            }
9875        }
9876
9877        impl std::default::Default for FailureCause {
9878            fn default() -> Self {
9879                use std::convert::From;
9880                Self::from(0)
9881            }
9882        }
9883
9884        impl std::fmt::Display for FailureCause {
9885            fn fmt(
9886                &self,
9887                f: &mut std::fmt::Formatter<'_>,
9888            ) -> std::result::Result<(), std::fmt::Error> {
9889                wkt::internal::display_enum(f, self.name(), self.value())
9890            }
9891        }
9892
9893        impl std::convert::From<i32> for FailureCause {
9894            fn from(value: i32) -> Self {
9895                match value {
9896                    0 => Self::Unspecified,
9897                    1 => Self::CloudBuildUnavailable,
9898                    2 => Self::ExecutionFailed,
9899                    3 => Self::CloudBuildRequestFailed,
9900                    4 => Self::VerificationConfigNotFound,
9901                    5 => Self::CustomActionNotFound,
9902                    6 => Self::DeploymentStrategyNotSupported,
9903                    7 => Self::RenderFeatureNotSupported,
9904                    _ => Self::UnknownValue(failure_cause::UnknownValue(
9905                        wkt::internal::UnknownEnumValue::Integer(value),
9906                    )),
9907                }
9908            }
9909        }
9910
9911        impl std::convert::From<&str> for FailureCause {
9912            fn from(value: &str) -> Self {
9913                use std::string::ToString;
9914                match value {
9915                    "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9916                    "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9917                    "EXECUTION_FAILED" => Self::ExecutionFailed,
9918                    "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9919                    "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9920                    "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
9921                    "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
9922                    "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
9923                    _ => Self::UnknownValue(failure_cause::UnknownValue(
9924                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9925                    )),
9926                }
9927            }
9928        }
9929
9930        impl serde::ser::Serialize for FailureCause {
9931            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9932            where
9933                S: serde::Serializer,
9934            {
9935                match self {
9936                    Self::Unspecified => serializer.serialize_i32(0),
9937                    Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9938                    Self::ExecutionFailed => serializer.serialize_i32(2),
9939                    Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
9940                    Self::VerificationConfigNotFound => serializer.serialize_i32(4),
9941                    Self::CustomActionNotFound => serializer.serialize_i32(5),
9942                    Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
9943                    Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
9944                    Self::UnknownValue(u) => u.0.serialize(serializer),
9945                }
9946            }
9947        }
9948
9949        impl<'de> serde::de::Deserialize<'de> for FailureCause {
9950            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9951            where
9952                D: serde::Deserializer<'de>,
9953            {
9954                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9955                    ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
9956                ))
9957            }
9958        }
9959    }
9960
9961    /// ReleaseReadyCondition contains information around the status of the
9962    /// Release. If a release is not ready, you cannot create a rollout with the
9963    /// release.
9964    #[derive(Clone, Default, PartialEq)]
9965    #[non_exhaustive]
9966    pub struct ReleaseReadyCondition {
9967        /// True if the Release is in a valid state. Otherwise at least one condition
9968        /// in `ReleaseCondition` is in an invalid state. Iterate over those
9969        /// conditions and see which condition(s) has status = false to find out what
9970        /// is wrong with the Release.
9971        pub status: bool,
9972
9973        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9974    }
9975
9976    impl ReleaseReadyCondition {
9977        /// Creates a new default instance.
9978        pub fn new() -> Self {
9979            std::default::Default::default()
9980        }
9981
9982        /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
9983        ///
9984        /// # Example
9985        /// ```ignore,no_run
9986        /// # use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
9987        /// let x = ReleaseReadyCondition::new().set_status(true);
9988        /// ```
9989        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9990            self.status = v.into();
9991            self
9992        }
9993    }
9994
9995    impl wkt::message::Message for ReleaseReadyCondition {
9996        fn typename() -> &'static str {
9997            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
9998        }
9999    }
10000
10001    /// SkaffoldSupportedCondition contains information about when support for the
10002    /// release's version of Skaffold ends.
10003    #[derive(Clone, Default, PartialEq)]
10004    #[non_exhaustive]
10005    pub struct SkaffoldSupportedCondition {
10006        /// True if the version of Skaffold used by this release is supported.
10007        pub status: bool,
10008
10009        /// The Skaffold support state for this release's version of Skaffold.
10010        pub skaffold_support_state: crate::model::SkaffoldSupportState,
10011
10012        /// The time at which this release's version of Skaffold will enter
10013        /// maintenance mode.
10014        pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
10015
10016        /// The time at which this release's version of Skaffold will no longer be
10017        /// supported.
10018        pub support_expiration_time: std::option::Option<wkt::Timestamp>,
10019
10020        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10021    }
10022
10023    impl SkaffoldSupportedCondition {
10024        /// Creates a new default instance.
10025        pub fn new() -> Self {
10026            std::default::Default::default()
10027        }
10028
10029        /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
10030        ///
10031        /// # Example
10032        /// ```ignore,no_run
10033        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10034        /// let x = SkaffoldSupportedCondition::new().set_status(true);
10035        /// ```
10036        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10037            self.status = v.into();
10038            self
10039        }
10040
10041        /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
10042        ///
10043        /// # Example
10044        /// ```ignore,no_run
10045        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10046        /// use google_cloud_deploy_v1::model::SkaffoldSupportState;
10047        /// let x0 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Supported);
10048        /// let x1 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::MaintenanceMode);
10049        /// let x2 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Unsupported);
10050        /// ```
10051        pub fn set_skaffold_support_state<
10052            T: std::convert::Into<crate::model::SkaffoldSupportState>,
10053        >(
10054            mut self,
10055            v: T,
10056        ) -> Self {
10057            self.skaffold_support_state = v.into();
10058            self
10059        }
10060
10061        /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
10062        ///
10063        /// # Example
10064        /// ```ignore,no_run
10065        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10066        /// use wkt::Timestamp;
10067        /// let x = SkaffoldSupportedCondition::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
10068        /// ```
10069        pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
10070        where
10071            T: std::convert::Into<wkt::Timestamp>,
10072        {
10073            self.maintenance_mode_time = std::option::Option::Some(v.into());
10074            self
10075        }
10076
10077        /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
10078        ///
10079        /// # Example
10080        /// ```ignore,no_run
10081        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10082        /// use wkt::Timestamp;
10083        /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
10084        /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
10085        /// ```
10086        pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
10087        where
10088            T: std::convert::Into<wkt::Timestamp>,
10089        {
10090            self.maintenance_mode_time = v.map(|x| x.into());
10091            self
10092        }
10093
10094        /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
10095        ///
10096        /// # Example
10097        /// ```ignore,no_run
10098        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10099        /// use wkt::Timestamp;
10100        /// let x = SkaffoldSupportedCondition::new().set_support_expiration_time(Timestamp::default()/* use setters */);
10101        /// ```
10102        pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
10103        where
10104            T: std::convert::Into<wkt::Timestamp>,
10105        {
10106            self.support_expiration_time = std::option::Option::Some(v.into());
10107            self
10108        }
10109
10110        /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
10111        ///
10112        /// # Example
10113        /// ```ignore,no_run
10114        /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10115        /// use wkt::Timestamp;
10116        /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
10117        /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(None::<Timestamp>);
10118        /// ```
10119        pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
10120        where
10121            T: std::convert::Into<wkt::Timestamp>,
10122        {
10123            self.support_expiration_time = v.map(|x| x.into());
10124            self
10125        }
10126    }
10127
10128    impl wkt::message::Message for SkaffoldSupportedCondition {
10129        fn typename() -> &'static str {
10130            "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
10131        }
10132    }
10133
10134    /// ReleaseCondition contains all conditions relevant to a Release.
10135    #[derive(Clone, Default, PartialEq)]
10136    #[non_exhaustive]
10137    pub struct ReleaseCondition {
10138        /// Details around the Releases's overall status.
10139        pub release_ready_condition:
10140            std::option::Option<crate::model::release::ReleaseReadyCondition>,
10141
10142        /// Details around the support state of the release's Skaffold
10143        /// version.
10144        pub skaffold_supported_condition:
10145            std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
10146
10147        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10148    }
10149
10150    impl ReleaseCondition {
10151        /// Creates a new default instance.
10152        pub fn new() -> Self {
10153            std::default::Default::default()
10154        }
10155
10156        /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10157        ///
10158        /// # Example
10159        /// ```ignore,no_run
10160        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10161        /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10162        /// let x = ReleaseCondition::new().set_release_ready_condition(ReleaseReadyCondition::default()/* use setters */);
10163        /// ```
10164        pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
10165        where
10166            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10167        {
10168            self.release_ready_condition = std::option::Option::Some(v.into());
10169            self
10170        }
10171
10172        /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10173        ///
10174        /// # Example
10175        /// ```ignore,no_run
10176        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10177        /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10178        /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(Some(ReleaseReadyCondition::default()/* use setters */));
10179        /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(None::<ReleaseReadyCondition>);
10180        /// ```
10181        pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
10182        where
10183            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10184        {
10185            self.release_ready_condition = v.map(|x| x.into());
10186            self
10187        }
10188
10189        /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10190        ///
10191        /// # Example
10192        /// ```ignore,no_run
10193        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10194        /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10195        /// let x = ReleaseCondition::new().set_skaffold_supported_condition(SkaffoldSupportedCondition::default()/* use setters */);
10196        /// ```
10197        pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
10198        where
10199            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10200        {
10201            self.skaffold_supported_condition = std::option::Option::Some(v.into());
10202            self
10203        }
10204
10205        /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10206        ///
10207        /// # Example
10208        /// ```ignore,no_run
10209        /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10210        /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10211        /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(Some(SkaffoldSupportedCondition::default()/* use setters */));
10212        /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(None::<SkaffoldSupportedCondition>);
10213        /// ```
10214        pub fn set_or_clear_skaffold_supported_condition<T>(
10215            mut self,
10216            v: std::option::Option<T>,
10217        ) -> Self
10218        where
10219            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10220        {
10221            self.skaffold_supported_condition = v.map(|x| x.into());
10222            self
10223        }
10224    }
10225
10226    impl wkt::message::Message for ReleaseCondition {
10227        fn typename() -> &'static str {
10228            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
10229        }
10230    }
10231
10232    /// Valid states of the render operation.
10233    ///
10234    /// # Working with unknown values
10235    ///
10236    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10237    /// additional enum variants at any time. Adding new variants is not considered
10238    /// a breaking change. Applications should write their code in anticipation of:
10239    ///
10240    /// - New values appearing in future releases of the client library, **and**
10241    /// - New values received dynamically, without application changes.
10242    ///
10243    /// Please consult the [Working with enums] section in the user guide for some
10244    /// guidelines.
10245    ///
10246    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10247    #[derive(Clone, Debug, PartialEq)]
10248    #[non_exhaustive]
10249    pub enum RenderState {
10250        /// The render state is unspecified.
10251        Unspecified,
10252        /// All rendering operations have completed successfully.
10253        Succeeded,
10254        /// All rendering operations have completed, and one or more have failed.
10255        Failed,
10256        /// Rendering has started and is not complete.
10257        InProgress,
10258        /// If set, the enum was initialized with an unknown value.
10259        ///
10260        /// Applications can examine the value using [RenderState::value] or
10261        /// [RenderState::name].
10262        UnknownValue(render_state::UnknownValue),
10263    }
10264
10265    #[doc(hidden)]
10266    pub mod render_state {
10267        #[allow(unused_imports)]
10268        use super::*;
10269        #[derive(Clone, Debug, PartialEq)]
10270        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10271    }
10272
10273    impl RenderState {
10274        /// Gets the enum value.
10275        ///
10276        /// Returns `None` if the enum contains an unknown value deserialized from
10277        /// the string representation of enums.
10278        pub fn value(&self) -> std::option::Option<i32> {
10279            match self {
10280                Self::Unspecified => std::option::Option::Some(0),
10281                Self::Succeeded => std::option::Option::Some(1),
10282                Self::Failed => std::option::Option::Some(2),
10283                Self::InProgress => std::option::Option::Some(3),
10284                Self::UnknownValue(u) => u.0.value(),
10285            }
10286        }
10287
10288        /// Gets the enum value as a string.
10289        ///
10290        /// Returns `None` if the enum contains an unknown value deserialized from
10291        /// the integer representation of enums.
10292        pub fn name(&self) -> std::option::Option<&str> {
10293            match self {
10294                Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
10295                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10296                Self::Failed => std::option::Option::Some("FAILED"),
10297                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10298                Self::UnknownValue(u) => u.0.name(),
10299            }
10300        }
10301    }
10302
10303    impl std::default::Default for RenderState {
10304        fn default() -> Self {
10305            use std::convert::From;
10306            Self::from(0)
10307        }
10308    }
10309
10310    impl std::fmt::Display for RenderState {
10311        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10312            wkt::internal::display_enum(f, self.name(), self.value())
10313        }
10314    }
10315
10316    impl std::convert::From<i32> for RenderState {
10317        fn from(value: i32) -> Self {
10318            match value {
10319                0 => Self::Unspecified,
10320                1 => Self::Succeeded,
10321                2 => Self::Failed,
10322                3 => Self::InProgress,
10323                _ => Self::UnknownValue(render_state::UnknownValue(
10324                    wkt::internal::UnknownEnumValue::Integer(value),
10325                )),
10326            }
10327        }
10328    }
10329
10330    impl std::convert::From<&str> for RenderState {
10331        fn from(value: &str) -> Self {
10332            use std::string::ToString;
10333            match value {
10334                "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
10335                "SUCCEEDED" => Self::Succeeded,
10336                "FAILED" => Self::Failed,
10337                "IN_PROGRESS" => Self::InProgress,
10338                _ => Self::UnknownValue(render_state::UnknownValue(
10339                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10340                )),
10341            }
10342        }
10343    }
10344
10345    impl serde::ser::Serialize for RenderState {
10346        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10347        where
10348            S: serde::Serializer,
10349        {
10350            match self {
10351                Self::Unspecified => serializer.serialize_i32(0),
10352                Self::Succeeded => serializer.serialize_i32(1),
10353                Self::Failed => serializer.serialize_i32(2),
10354                Self::InProgress => serializer.serialize_i32(3),
10355                Self::UnknownValue(u) => u.0.serialize(serializer),
10356            }
10357        }
10358    }
10359
10360    impl<'de> serde::de::Deserialize<'de> for RenderState {
10361        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10362        where
10363            D: serde::Deserializer<'de>,
10364        {
10365            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
10366                ".google.cloud.deploy.v1.Release.RenderState",
10367            ))
10368        }
10369    }
10370}
10371
10372/// The request object for `CreateDeployPolicy`.
10373#[derive(Clone, Default, PartialEq)]
10374#[non_exhaustive]
10375pub struct CreateDeployPolicyRequest {
10376    /// Required. The parent collection in which the `DeployPolicy` must be
10377    /// created. The format is `projects/{project_id}/locations/{location_name}`.
10378    pub parent: std::string::String,
10379
10380    /// Required. ID of the `DeployPolicy`.
10381    pub deploy_policy_id: std::string::String,
10382
10383    /// Required. The `DeployPolicy` to create.
10384    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10385
10386    /// Optional. A request ID to identify requests. Specify a unique request ID
10387    /// so that if you must retry your request, the server knows to ignore the
10388    /// request if it has already been completed. The server guarantees that for
10389    /// at least 60 minutes after the first request.
10390    ///
10391    /// For example, consider a situation where you make an initial request and the
10392    /// request times out. If you make the request again with the same request ID,
10393    /// the server can check if original operation with the same request ID was
10394    /// received, and if so, will ignore the second request. This prevents clients
10395    /// from accidentally creating duplicate commitments.
10396    ///
10397    /// The request ID must be a valid UUID with the exception that zero UUID is
10398    /// not supported (00000000-0000-0000-0000-000000000000).
10399    pub request_id: std::string::String,
10400
10401    /// Optional. If set to true, the request is validated and the user is provided
10402    /// with an expected result, but no actual change is made.
10403    pub validate_only: bool,
10404
10405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10406}
10407
10408impl CreateDeployPolicyRequest {
10409    /// Creates a new default instance.
10410    pub fn new() -> Self {
10411        std::default::Default::default()
10412    }
10413
10414    /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
10415    ///
10416    /// # Example
10417    /// ```ignore,no_run
10418    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10419    /// # let project_id = "project_id";
10420    /// # let location_id = "location_id";
10421    /// let x = CreateDeployPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10422    /// ```
10423    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10424        self.parent = v.into();
10425        self
10426    }
10427
10428    /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
10429    ///
10430    /// # Example
10431    /// ```ignore,no_run
10432    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10433    /// let x = CreateDeployPolicyRequest::new().set_deploy_policy_id("example");
10434    /// ```
10435    pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
10436        mut self,
10437        v: T,
10438    ) -> Self {
10439        self.deploy_policy_id = v.into();
10440        self
10441    }
10442
10443    /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10444    ///
10445    /// # Example
10446    /// ```ignore,no_run
10447    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10448    /// use google_cloud_deploy_v1::model::DeployPolicy;
10449    /// let x = CreateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10450    /// ```
10451    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10452    where
10453        T: std::convert::Into<crate::model::DeployPolicy>,
10454    {
10455        self.deploy_policy = std::option::Option::Some(v.into());
10456        self
10457    }
10458
10459    /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10460    ///
10461    /// # Example
10462    /// ```ignore,no_run
10463    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10464    /// use google_cloud_deploy_v1::model::DeployPolicy;
10465    /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10466    /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10467    /// ```
10468    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10469    where
10470        T: std::convert::Into<crate::model::DeployPolicy>,
10471    {
10472        self.deploy_policy = v.map(|x| x.into());
10473        self
10474    }
10475
10476    /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
10477    ///
10478    /// # Example
10479    /// ```ignore,no_run
10480    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10481    /// let x = CreateDeployPolicyRequest::new().set_request_id("example");
10482    /// ```
10483    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10484        self.request_id = v.into();
10485        self
10486    }
10487
10488    /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
10489    ///
10490    /// # Example
10491    /// ```ignore,no_run
10492    /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10493    /// let x = CreateDeployPolicyRequest::new().set_validate_only(true);
10494    /// ```
10495    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10496        self.validate_only = v.into();
10497        self
10498    }
10499}
10500
10501impl wkt::message::Message for CreateDeployPolicyRequest {
10502    fn typename() -> &'static str {
10503        "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
10504    }
10505}
10506
10507/// The request object for `UpdateDeployPolicy`.
10508#[derive(Clone, Default, PartialEq)]
10509#[non_exhaustive]
10510pub struct UpdateDeployPolicyRequest {
10511    /// Required. Field mask is used to specify the fields to be overwritten by the
10512    /// update in the `DeployPolicy` resource. The fields specified in the
10513    /// update_mask are relative to the resource, not the full request. A field
10514    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
10515    /// then all fields are overwritten.
10516    pub update_mask: std::option::Option<wkt::FieldMask>,
10517
10518    /// Required. The `DeployPolicy` to update.
10519    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10520
10521    /// Optional. A request ID to identify requests. Specify a unique request ID
10522    /// so that if you must retry your request, the server knows to ignore the
10523    /// request if it has already been completed. The server guarantees that for
10524    /// at least 60 minutes after the first request.
10525    ///
10526    /// For example, consider a situation where you make an initial request and the
10527    /// request times out. If you make the request again with the same request ID,
10528    /// the server can check if original operation with the same request ID was
10529    /// received, and if so, will ignore the second request. This prevents clients
10530    /// from accidentally creating duplicate commitments.
10531    ///
10532    /// The request ID must be a valid UUID with the exception that zero UUID is
10533    /// not supported (00000000-0000-0000-0000-000000000000).
10534    pub request_id: std::string::String,
10535
10536    /// Optional. If set to true, updating a `DeployPolicy` that does not exist
10537    /// will result in the creation of a new `DeployPolicy`.
10538    pub allow_missing: bool,
10539
10540    /// Optional. If set to true, the request is validated and the user is provided
10541    /// with an expected result, but no actual change is made.
10542    pub validate_only: bool,
10543
10544    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10545}
10546
10547impl UpdateDeployPolicyRequest {
10548    /// Creates a new default instance.
10549    pub fn new() -> Self {
10550        std::default::Default::default()
10551    }
10552
10553    /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10554    ///
10555    /// # Example
10556    /// ```ignore,no_run
10557    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10558    /// use wkt::FieldMask;
10559    /// let x = UpdateDeployPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10560    /// ```
10561    pub fn set_update_mask<T>(mut self, v: T) -> Self
10562    where
10563        T: std::convert::Into<wkt::FieldMask>,
10564    {
10565        self.update_mask = std::option::Option::Some(v.into());
10566        self
10567    }
10568
10569    /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10570    ///
10571    /// # Example
10572    /// ```ignore,no_run
10573    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10574    /// use wkt::FieldMask;
10575    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10576    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10577    /// ```
10578    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10579    where
10580        T: std::convert::Into<wkt::FieldMask>,
10581    {
10582        self.update_mask = v.map(|x| x.into());
10583        self
10584    }
10585
10586    /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10587    ///
10588    /// # Example
10589    /// ```ignore,no_run
10590    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10591    /// use google_cloud_deploy_v1::model::DeployPolicy;
10592    /// let x = UpdateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10593    /// ```
10594    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10595    where
10596        T: std::convert::Into<crate::model::DeployPolicy>,
10597    {
10598        self.deploy_policy = std::option::Option::Some(v.into());
10599        self
10600    }
10601
10602    /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10603    ///
10604    /// # Example
10605    /// ```ignore,no_run
10606    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10607    /// use google_cloud_deploy_v1::model::DeployPolicy;
10608    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10609    /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10610    /// ```
10611    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10612    where
10613        T: std::convert::Into<crate::model::DeployPolicy>,
10614    {
10615        self.deploy_policy = v.map(|x| x.into());
10616        self
10617    }
10618
10619    /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
10620    ///
10621    /// # Example
10622    /// ```ignore,no_run
10623    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10624    /// let x = UpdateDeployPolicyRequest::new().set_request_id("example");
10625    /// ```
10626    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10627        self.request_id = v.into();
10628        self
10629    }
10630
10631    /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
10632    ///
10633    /// # Example
10634    /// ```ignore,no_run
10635    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10636    /// let x = UpdateDeployPolicyRequest::new().set_allow_missing(true);
10637    /// ```
10638    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10639        self.allow_missing = v.into();
10640        self
10641    }
10642
10643    /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
10644    ///
10645    /// # Example
10646    /// ```ignore,no_run
10647    /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10648    /// let x = UpdateDeployPolicyRequest::new().set_validate_only(true);
10649    /// ```
10650    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10651        self.validate_only = v.into();
10652        self
10653    }
10654}
10655
10656impl wkt::message::Message for UpdateDeployPolicyRequest {
10657    fn typename() -> &'static str {
10658        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
10659    }
10660}
10661
10662/// The request object for `DeleteDeployPolicy`.
10663#[derive(Clone, Default, PartialEq)]
10664#[non_exhaustive]
10665pub struct DeleteDeployPolicyRequest {
10666    /// Required. The name of the `DeployPolicy` to delete. The format is
10667    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10668    pub name: std::string::String,
10669
10670    /// Optional. A request ID to identify requests. Specify a unique request ID
10671    /// so that if you must retry your request, the server knows to ignore the
10672    /// request if it has already been completed. The server guarantees that for
10673    /// at least 60 minutes after the first request.
10674    ///
10675    /// For example, consider a situation where you make an initial request and the
10676    /// request times out. If you make the request again with the same request ID,
10677    /// the server can check if original operation with the same request ID was
10678    /// received, and if so, will ignore the second request. This prevents clients
10679    /// from accidentally creating duplicate commitments.
10680    ///
10681    /// The request ID must be a valid UUID with the exception that zero UUID is
10682    /// not supported (00000000-0000-0000-0000-000000000000).
10683    pub request_id: std::string::String,
10684
10685    /// Optional. If set to true, then deleting an already deleted or non-existing
10686    /// `DeployPolicy` will succeed.
10687    pub allow_missing: bool,
10688
10689    /// Optional. If set, validate the request and preview the review, but do not
10690    /// actually post it.
10691    pub validate_only: bool,
10692
10693    /// Optional. This checksum is computed by the server based on the value of
10694    /// other fields, and may be sent on update and delete requests to ensure the
10695    /// client has an up-to-date value before proceeding.
10696    pub etag: std::string::String,
10697
10698    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10699}
10700
10701impl DeleteDeployPolicyRequest {
10702    /// Creates a new default instance.
10703    pub fn new() -> Self {
10704        std::default::Default::default()
10705    }
10706
10707    /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
10708    ///
10709    /// # Example
10710    /// ```ignore,no_run
10711    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10712    /// # let project_id = "project_id";
10713    /// # let location_id = "location_id";
10714    /// # let deploy_policy_id = "deploy_policy_id";
10715    /// let x = DeleteDeployPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployPolicies/{deploy_policy_id}"));
10716    /// ```
10717    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10718        self.name = v.into();
10719        self
10720    }
10721
10722    /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
10723    ///
10724    /// # Example
10725    /// ```ignore,no_run
10726    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10727    /// let x = DeleteDeployPolicyRequest::new().set_request_id("example");
10728    /// ```
10729    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10730        self.request_id = v.into();
10731        self
10732    }
10733
10734    /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
10735    ///
10736    /// # Example
10737    /// ```ignore,no_run
10738    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10739    /// let x = DeleteDeployPolicyRequest::new().set_allow_missing(true);
10740    /// ```
10741    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10742        self.allow_missing = v.into();
10743        self
10744    }
10745
10746    /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
10747    ///
10748    /// # Example
10749    /// ```ignore,no_run
10750    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10751    /// let x = DeleteDeployPolicyRequest::new().set_validate_only(true);
10752    /// ```
10753    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10754        self.validate_only = v.into();
10755        self
10756    }
10757
10758    /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
10759    ///
10760    /// # Example
10761    /// ```ignore,no_run
10762    /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10763    /// let x = DeleteDeployPolicyRequest::new().set_etag("example");
10764    /// ```
10765    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10766        self.etag = v.into();
10767        self
10768    }
10769}
10770
10771impl wkt::message::Message for DeleteDeployPolicyRequest {
10772    fn typename() -> &'static str {
10773        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
10774    }
10775}
10776
10777/// The request object for `ListDeployPolicies`.
10778#[derive(Clone, Default, PartialEq)]
10779#[non_exhaustive]
10780pub struct ListDeployPoliciesRequest {
10781    /// Required. The parent, which owns this collection of deploy policies. Format
10782    /// must be `projects/{project_id}/locations/{location_name}`.
10783    pub parent: std::string::String,
10784
10785    /// The maximum number of deploy policies to return. The service may return
10786    /// fewer than this value. If unspecified, at most 50 deploy policies will
10787    /// be returned. The maximum value is 1000; values above 1000 will be set
10788    /// to 1000.
10789    pub page_size: i32,
10790
10791    /// A page token, received from a previous `ListDeployPolicies` call.
10792    /// Provide this to retrieve the subsequent page.
10793    ///
10794    /// When paginating, all other provided parameters match
10795    /// the call that provided the page token.
10796    pub page_token: std::string::String,
10797
10798    /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
10799    /// more details. All fields can be used in the filter.
10800    pub filter: std::string::String,
10801
10802    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
10803    pub order_by: std::string::String,
10804
10805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10806}
10807
10808impl ListDeployPoliciesRequest {
10809    /// Creates a new default instance.
10810    pub fn new() -> Self {
10811        std::default::Default::default()
10812    }
10813
10814    /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
10815    ///
10816    /// # Example
10817    /// ```ignore,no_run
10818    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10819    /// # let project_id = "project_id";
10820    /// # let location_id = "location_id";
10821    /// let x = ListDeployPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10822    /// ```
10823    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10824        self.parent = v.into();
10825        self
10826    }
10827
10828    /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
10829    ///
10830    /// # Example
10831    /// ```ignore,no_run
10832    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10833    /// let x = ListDeployPoliciesRequest::new().set_page_size(42);
10834    /// ```
10835    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10836        self.page_size = v.into();
10837        self
10838    }
10839
10840    /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
10841    ///
10842    /// # Example
10843    /// ```ignore,no_run
10844    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10845    /// let x = ListDeployPoliciesRequest::new().set_page_token("example");
10846    /// ```
10847    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10848        self.page_token = v.into();
10849        self
10850    }
10851
10852    /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
10853    ///
10854    /// # Example
10855    /// ```ignore,no_run
10856    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10857    /// let x = ListDeployPoliciesRequest::new().set_filter("example");
10858    /// ```
10859    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10860        self.filter = v.into();
10861        self
10862    }
10863
10864    /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
10865    ///
10866    /// # Example
10867    /// ```ignore,no_run
10868    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10869    /// let x = ListDeployPoliciesRequest::new().set_order_by("example");
10870    /// ```
10871    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10872        self.order_by = v.into();
10873        self
10874    }
10875}
10876
10877impl wkt::message::Message for ListDeployPoliciesRequest {
10878    fn typename() -> &'static str {
10879        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
10880    }
10881}
10882
10883/// The response object from `ListDeployPolicies`.
10884#[derive(Clone, Default, PartialEq)]
10885#[non_exhaustive]
10886pub struct ListDeployPoliciesResponse {
10887    /// The `DeployPolicy` objects.
10888    pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
10889
10890    /// A token, which can be sent as `page_token` to retrieve the next page.
10891    /// If this field is omitted, there are no subsequent pages.
10892    pub next_page_token: std::string::String,
10893
10894    /// Locations that could not be reached.
10895    pub unreachable: std::vec::Vec<std::string::String>,
10896
10897    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10898}
10899
10900impl ListDeployPoliciesResponse {
10901    /// Creates a new default instance.
10902    pub fn new() -> Self {
10903        std::default::Default::default()
10904    }
10905
10906    /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
10907    ///
10908    /// # Example
10909    /// ```ignore,no_run
10910    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10911    /// use google_cloud_deploy_v1::model::DeployPolicy;
10912    /// let x = ListDeployPoliciesResponse::new()
10913    ///     .set_deploy_policies([
10914    ///         DeployPolicy::default()/* use setters */,
10915    ///         DeployPolicy::default()/* use (different) setters */,
10916    ///     ]);
10917    /// ```
10918    pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
10919    where
10920        T: std::iter::IntoIterator<Item = V>,
10921        V: std::convert::Into<crate::model::DeployPolicy>,
10922    {
10923        use std::iter::Iterator;
10924        self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
10925        self
10926    }
10927
10928    /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
10929    ///
10930    /// # Example
10931    /// ```ignore,no_run
10932    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10933    /// let x = ListDeployPoliciesResponse::new().set_next_page_token("example");
10934    /// ```
10935    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10936        self.next_page_token = v.into();
10937        self
10938    }
10939
10940    /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
10941    ///
10942    /// # Example
10943    /// ```ignore,no_run
10944    /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10945    /// let x = ListDeployPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10946    /// ```
10947    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10948    where
10949        T: std::iter::IntoIterator<Item = V>,
10950        V: std::convert::Into<std::string::String>,
10951    {
10952        use std::iter::Iterator;
10953        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10954        self
10955    }
10956}
10957
10958impl wkt::message::Message for ListDeployPoliciesResponse {
10959    fn typename() -> &'static str {
10960        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
10961    }
10962}
10963
10964#[doc(hidden)]
10965impl google_cloud_gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
10966    type PageItem = crate::model::DeployPolicy;
10967
10968    fn items(self) -> std::vec::Vec<Self::PageItem> {
10969        self.deploy_policies
10970    }
10971
10972    fn next_page_token(&self) -> std::string::String {
10973        use std::clone::Clone;
10974        self.next_page_token.clone()
10975    }
10976}
10977
10978/// The request object for `GetDeployPolicy`
10979#[derive(Clone, Default, PartialEq)]
10980#[non_exhaustive]
10981pub struct GetDeployPolicyRequest {
10982    /// Required. Name of the `DeployPolicy`. Format must be
10983    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10984    pub name: std::string::String,
10985
10986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10987}
10988
10989impl GetDeployPolicyRequest {
10990    /// Creates a new default instance.
10991    pub fn new() -> Self {
10992        std::default::Default::default()
10993    }
10994
10995    /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
10996    ///
10997    /// # Example
10998    /// ```ignore,no_run
10999    /// # use google_cloud_deploy_v1::model::GetDeployPolicyRequest;
11000    /// # let project_id = "project_id";
11001    /// # let location_id = "location_id";
11002    /// # let deploy_policy_id = "deploy_policy_id";
11003    /// let x = GetDeployPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployPolicies/{deploy_policy_id}"));
11004    /// ```
11005    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11006        self.name = v.into();
11007        self
11008    }
11009}
11010
11011impl wkt::message::Message for GetDeployPolicyRequest {
11012    fn typename() -> &'static str {
11013        "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
11014    }
11015}
11016
11017/// Description of an a image to use during Skaffold rendering.
11018#[derive(Clone, Default, PartialEq)]
11019#[non_exhaustive]
11020pub struct BuildArtifact {
11021    /// Optional. Image name in Skaffold configuration.
11022    pub image: std::string::String,
11023
11024    /// Optional. Image tag to use. This will generally be the full path to an
11025    /// image, such as "gcr.io/my-project/busybox:1.2.3" or
11026    /// "gcr.io/my-project/busybox@sha256:abc123".
11027    pub tag: std::string::String,
11028
11029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11030}
11031
11032impl BuildArtifact {
11033    /// Creates a new default instance.
11034    pub fn new() -> Self {
11035        std::default::Default::default()
11036    }
11037
11038    /// Sets the value of [image][crate::model::BuildArtifact::image].
11039    ///
11040    /// # Example
11041    /// ```ignore,no_run
11042    /// # use google_cloud_deploy_v1::model::BuildArtifact;
11043    /// let x = BuildArtifact::new().set_image("example");
11044    /// ```
11045    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11046        self.image = v.into();
11047        self
11048    }
11049
11050    /// Sets the value of [tag][crate::model::BuildArtifact::tag].
11051    ///
11052    /// # Example
11053    /// ```ignore,no_run
11054    /// # use google_cloud_deploy_v1::model::BuildArtifact;
11055    /// let x = BuildArtifact::new().set_tag("example");
11056    /// ```
11057    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11058        self.tag = v.into();
11059        self
11060    }
11061}
11062
11063impl wkt::message::Message for BuildArtifact {
11064    fn typename() -> &'static str {
11065        "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
11066    }
11067}
11068
11069/// The artifacts produced by a target render operation.
11070#[derive(Clone, Default, PartialEq)]
11071#[non_exhaustive]
11072pub struct TargetArtifact {
11073    /// Output only. File path of the resolved Skaffold configuration for the
11074    /// stable phase, relative to the URI.
11075    pub skaffold_config_path: std::string::String,
11076
11077    /// Output only. File path of the rendered manifest relative to the URI for the
11078    /// stable phase.
11079    pub manifest_path: std::string::String,
11080
11081    /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
11082    pub phase_artifacts: std::collections::HashMap<
11083        std::string::String,
11084        crate::model::target_artifact::PhaseArtifact,
11085    >,
11086
11087    #[allow(missing_docs)]
11088    pub uri: std::option::Option<crate::model::target_artifact::Uri>,
11089
11090    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11091}
11092
11093impl TargetArtifact {
11094    /// Creates a new default instance.
11095    pub fn new() -> Self {
11096        std::default::Default::default()
11097    }
11098
11099    /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
11100    ///
11101    /// # Example
11102    /// ```ignore,no_run
11103    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11104    /// let x = TargetArtifact::new().set_skaffold_config_path("example");
11105    /// ```
11106    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11107        mut self,
11108        v: T,
11109    ) -> Self {
11110        self.skaffold_config_path = v.into();
11111        self
11112    }
11113
11114    /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
11115    ///
11116    /// # Example
11117    /// ```ignore,no_run
11118    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11119    /// let x = TargetArtifact::new().set_manifest_path("example");
11120    /// ```
11121    pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11122        self.manifest_path = v.into();
11123        self
11124    }
11125
11126    /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
11127    ///
11128    /// # Example
11129    /// ```ignore,no_run
11130    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11131    /// use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11132    /// let x = TargetArtifact::new().set_phase_artifacts([
11133    ///     ("key0", PhaseArtifact::default()/* use setters */),
11134    ///     ("key1", PhaseArtifact::default()/* use (different) setters */),
11135    /// ]);
11136    /// ```
11137    pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
11138    where
11139        T: std::iter::IntoIterator<Item = (K, V)>,
11140        K: std::convert::Into<std::string::String>,
11141        V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
11142    {
11143        use std::iter::Iterator;
11144        self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11145        self
11146    }
11147
11148    /// Sets the value of [uri][crate::model::TargetArtifact::uri].
11149    ///
11150    /// Note that all the setters affecting `uri` are mutually
11151    /// exclusive.
11152    ///
11153    /// # Example
11154    /// ```ignore,no_run
11155    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11156    /// use google_cloud_deploy_v1::model::target_artifact::Uri;
11157    /// let x = TargetArtifact::new().set_uri(Some(Uri::ArtifactUri("example".to_string())));
11158    /// ```
11159    pub fn set_uri<
11160        T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
11161    >(
11162        mut self,
11163        v: T,
11164    ) -> Self {
11165        self.uri = v.into();
11166        self
11167    }
11168
11169    /// The value of [uri][crate::model::TargetArtifact::uri]
11170    /// if it holds a `ArtifactUri`, `None` if the field is not set or
11171    /// holds a different branch.
11172    pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
11173        #[allow(unreachable_patterns)]
11174        self.uri.as_ref().and_then(|v| match v {
11175            crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
11176            _ => std::option::Option::None,
11177        })
11178    }
11179
11180    /// Sets the value of [uri][crate::model::TargetArtifact::uri]
11181    /// to hold a `ArtifactUri`.
11182    ///
11183    /// Note that all the setters affecting `uri` are
11184    /// mutually exclusive.
11185    ///
11186    /// # Example
11187    /// ```ignore,no_run
11188    /// # use google_cloud_deploy_v1::model::TargetArtifact;
11189    /// let x = TargetArtifact::new().set_artifact_uri("example");
11190    /// assert!(x.artifact_uri().is_some());
11191    /// ```
11192    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11193        self.uri =
11194            std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
11195        self
11196    }
11197}
11198
11199impl wkt::message::Message for TargetArtifact {
11200    fn typename() -> &'static str {
11201        "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
11202    }
11203}
11204
11205/// Defines additional types related to [TargetArtifact].
11206pub mod target_artifact {
11207    #[allow(unused_imports)]
11208    use super::*;
11209
11210    /// Contains the paths to the artifacts, relative to the URI, for a phase.
11211    #[derive(Clone, Default, PartialEq)]
11212    #[non_exhaustive]
11213    pub struct PhaseArtifact {
11214        /// Output only. File path of the resolved Skaffold configuration relative to
11215        /// the URI.
11216        pub skaffold_config_path: std::string::String,
11217
11218        /// Output only. File path of the rendered manifest relative to the URI.
11219        pub manifest_path: std::string::String,
11220
11221        /// Output only. File path of the directory of rendered job manifests
11222        /// relative to the URI. This is only set if it is applicable.
11223        pub job_manifests_path: std::string::String,
11224
11225        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11226    }
11227
11228    impl PhaseArtifact {
11229        /// Creates a new default instance.
11230        pub fn new() -> Self {
11231            std::default::Default::default()
11232        }
11233
11234        /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
11235        ///
11236        /// # Example
11237        /// ```ignore,no_run
11238        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11239        /// let x = PhaseArtifact::new().set_skaffold_config_path("example");
11240        /// ```
11241        pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11242            mut self,
11243            v: T,
11244        ) -> Self {
11245            self.skaffold_config_path = v.into();
11246            self
11247        }
11248
11249        /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
11250        ///
11251        /// # Example
11252        /// ```ignore,no_run
11253        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11254        /// let x = PhaseArtifact::new().set_manifest_path("example");
11255        /// ```
11256        pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
11257            mut self,
11258            v: T,
11259        ) -> Self {
11260            self.manifest_path = v.into();
11261            self
11262        }
11263
11264        /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
11265        ///
11266        /// # Example
11267        /// ```ignore,no_run
11268        /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11269        /// let x = PhaseArtifact::new().set_job_manifests_path("example");
11270        /// ```
11271        pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
11272            mut self,
11273            v: T,
11274        ) -> Self {
11275            self.job_manifests_path = v.into();
11276            self
11277        }
11278    }
11279
11280    impl wkt::message::Message for PhaseArtifact {
11281        fn typename() -> &'static str {
11282            "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
11283        }
11284    }
11285
11286    #[allow(missing_docs)]
11287    #[derive(Clone, Debug, PartialEq)]
11288    #[non_exhaustive]
11289    pub enum Uri {
11290        /// Output only. URI of a directory containing the artifacts. This contains
11291        /// deployment configuration used by Skaffold during a rollout, and all
11292        /// paths are relative to this location.
11293        ArtifactUri(std::string::String),
11294    }
11295}
11296
11297/// The artifacts produced by a deploy operation.
11298#[derive(Clone, Default, PartialEq)]
11299#[non_exhaustive]
11300pub struct DeployArtifact {
11301    /// Output only. URI of a directory containing the artifacts. All paths are
11302    /// relative to this location.
11303    pub artifact_uri: std::string::String,
11304
11305    /// Output only. File paths of the manifests applied during the deploy
11306    /// operation relative to the URI.
11307    pub manifest_paths: std::vec::Vec<std::string::String>,
11308
11309    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11310}
11311
11312impl DeployArtifact {
11313    /// Creates a new default instance.
11314    pub fn new() -> Self {
11315        std::default::Default::default()
11316    }
11317
11318    /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
11319    ///
11320    /// # Example
11321    /// ```ignore,no_run
11322    /// # use google_cloud_deploy_v1::model::DeployArtifact;
11323    /// let x = DeployArtifact::new().set_artifact_uri("example");
11324    /// ```
11325    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11326        self.artifact_uri = v.into();
11327        self
11328    }
11329
11330    /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
11331    ///
11332    /// # Example
11333    /// ```ignore,no_run
11334    /// # use google_cloud_deploy_v1::model::DeployArtifact;
11335    /// let x = DeployArtifact::new().set_manifest_paths(["a", "b", "c"]);
11336    /// ```
11337    pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
11338    where
11339        T: std::iter::IntoIterator<Item = V>,
11340        V: std::convert::Into<std::string::String>,
11341    {
11342        use std::iter::Iterator;
11343        self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
11344        self
11345    }
11346}
11347
11348impl wkt::message::Message for DeployArtifact {
11349    fn typename() -> &'static str {
11350        "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
11351    }
11352}
11353
11354/// CloudRunRenderMetadata contains Cloud Run information associated with a
11355/// `Release` render.
11356#[derive(Clone, Default, PartialEq)]
11357#[non_exhaustive]
11358pub struct CloudRunRenderMetadata {
11359    /// Output only. The name of the Cloud Run Service in the rendered manifest.
11360    /// Format is `projects/{project}/locations/{location}/services/{service}`.
11361    pub service: std::string::String,
11362
11363    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11364}
11365
11366impl CloudRunRenderMetadata {
11367    /// Creates a new default instance.
11368    pub fn new() -> Self {
11369        std::default::Default::default()
11370    }
11371
11372    /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
11373    ///
11374    /// # Example
11375    /// ```ignore,no_run
11376    /// # use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11377    /// let x = CloudRunRenderMetadata::new().set_service("example");
11378    /// ```
11379    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11380        self.service = v.into();
11381        self
11382    }
11383}
11384
11385impl wkt::message::Message for CloudRunRenderMetadata {
11386    fn typename() -> &'static str {
11387        "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
11388    }
11389}
11390
11391/// RenderMetadata includes information associated with a `Release` render.
11392#[derive(Clone, Default, PartialEq)]
11393#[non_exhaustive]
11394pub struct RenderMetadata {
11395    /// Output only. Metadata associated with rendering for Cloud Run.
11396    pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
11397
11398    /// Output only. Custom metadata provided by user-defined render operation.
11399    pub custom: std::option::Option<crate::model::CustomMetadata>,
11400
11401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11402}
11403
11404impl RenderMetadata {
11405    /// Creates a new default instance.
11406    pub fn new() -> Self {
11407        std::default::Default::default()
11408    }
11409
11410    /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11411    ///
11412    /// # Example
11413    /// ```ignore,no_run
11414    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11415    /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11416    /// let x = RenderMetadata::new().set_cloud_run(CloudRunRenderMetadata::default()/* use setters */);
11417    /// ```
11418    pub fn set_cloud_run<T>(mut self, v: T) -> Self
11419    where
11420        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11421    {
11422        self.cloud_run = std::option::Option::Some(v.into());
11423        self
11424    }
11425
11426    /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11427    ///
11428    /// # Example
11429    /// ```ignore,no_run
11430    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11431    /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11432    /// let x = RenderMetadata::new().set_or_clear_cloud_run(Some(CloudRunRenderMetadata::default()/* use setters */));
11433    /// let x = RenderMetadata::new().set_or_clear_cloud_run(None::<CloudRunRenderMetadata>);
11434    /// ```
11435    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
11436    where
11437        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11438    {
11439        self.cloud_run = v.map(|x| x.into());
11440        self
11441    }
11442
11443    /// Sets the value of [custom][crate::model::RenderMetadata::custom].
11444    ///
11445    /// # Example
11446    /// ```ignore,no_run
11447    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11448    /// use google_cloud_deploy_v1::model::CustomMetadata;
11449    /// let x = RenderMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
11450    /// ```
11451    pub fn set_custom<T>(mut self, v: T) -> Self
11452    where
11453        T: std::convert::Into<crate::model::CustomMetadata>,
11454    {
11455        self.custom = std::option::Option::Some(v.into());
11456        self
11457    }
11458
11459    /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
11460    ///
11461    /// # Example
11462    /// ```ignore,no_run
11463    /// # use google_cloud_deploy_v1::model::RenderMetadata;
11464    /// use google_cloud_deploy_v1::model::CustomMetadata;
11465    /// let x = RenderMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
11466    /// let x = RenderMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
11467    /// ```
11468    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
11469    where
11470        T: std::convert::Into<crate::model::CustomMetadata>,
11471    {
11472        self.custom = v.map(|x| x.into());
11473        self
11474    }
11475}
11476
11477impl wkt::message::Message for RenderMetadata {
11478    fn typename() -> &'static str {
11479        "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
11480    }
11481}
11482
11483/// The request object for `ListReleases`.
11484#[derive(Clone, Default, PartialEq)]
11485#[non_exhaustive]
11486pub struct ListReleasesRequest {
11487    /// Required. The `DeliveryPipeline` which owns this collection of `Release`
11488    /// objects.
11489    pub parent: std::string::String,
11490
11491    /// Optional. The maximum number of `Release` objects to return. The service
11492    /// may return fewer than this value. If unspecified, at most 50 `Release`
11493    /// objects will be returned. The maximum value is 1000; values above 1000 will
11494    /// be set to 1000.
11495    pub page_size: i32,
11496
11497    /// Optional. A page token, received from a previous `ListReleases` call.
11498    /// Provide this to retrieve the subsequent page.
11499    ///
11500    /// When paginating, all other provided parameters match
11501    /// the call that provided the page token.
11502    pub page_token: std::string::String,
11503
11504    /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
11505    /// for more details.
11506    pub filter: std::string::String,
11507
11508    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
11509    /// more details.
11510    pub order_by: std::string::String,
11511
11512    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11513}
11514
11515impl ListReleasesRequest {
11516    /// Creates a new default instance.
11517    pub fn new() -> Self {
11518        std::default::Default::default()
11519    }
11520
11521    /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
11522    ///
11523    /// # Example
11524    /// ```ignore,no_run
11525    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11526    /// # let project_id = "project_id";
11527    /// # let location_id = "location_id";
11528    /// # let delivery_pipeline_id = "delivery_pipeline_id";
11529    /// let x = ListReleasesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
11530    /// ```
11531    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11532        self.parent = v.into();
11533        self
11534    }
11535
11536    /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
11537    ///
11538    /// # Example
11539    /// ```ignore,no_run
11540    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11541    /// let x = ListReleasesRequest::new().set_page_size(42);
11542    /// ```
11543    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11544        self.page_size = v.into();
11545        self
11546    }
11547
11548    /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
11549    ///
11550    /// # Example
11551    /// ```ignore,no_run
11552    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11553    /// let x = ListReleasesRequest::new().set_page_token("example");
11554    /// ```
11555    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11556        self.page_token = v.into();
11557        self
11558    }
11559
11560    /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
11561    ///
11562    /// # Example
11563    /// ```ignore,no_run
11564    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11565    /// let x = ListReleasesRequest::new().set_filter("example");
11566    /// ```
11567    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11568        self.filter = v.into();
11569        self
11570    }
11571
11572    /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
11573    ///
11574    /// # Example
11575    /// ```ignore,no_run
11576    /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11577    /// let x = ListReleasesRequest::new().set_order_by("example");
11578    /// ```
11579    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11580        self.order_by = v.into();
11581        self
11582    }
11583}
11584
11585impl wkt::message::Message for ListReleasesRequest {
11586    fn typename() -> &'static str {
11587        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
11588    }
11589}
11590
11591/// The response object from `ListReleases`.
11592#[derive(Clone, Default, PartialEq)]
11593#[non_exhaustive]
11594pub struct ListReleasesResponse {
11595    /// The `Release` objects.
11596    pub releases: std::vec::Vec<crate::model::Release>,
11597
11598    /// A token, which can be sent as `page_token` to retrieve the next page.
11599    /// If this field is omitted, there are no subsequent pages.
11600    pub next_page_token: std::string::String,
11601
11602    /// Locations that could not be reached.
11603    pub unreachable: std::vec::Vec<std::string::String>,
11604
11605    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11606}
11607
11608impl ListReleasesResponse {
11609    /// Creates a new default instance.
11610    pub fn new() -> Self {
11611        std::default::Default::default()
11612    }
11613
11614    /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
11615    ///
11616    /// # Example
11617    /// ```ignore,no_run
11618    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11619    /// use google_cloud_deploy_v1::model::Release;
11620    /// let x = ListReleasesResponse::new()
11621    ///     .set_releases([
11622    ///         Release::default()/* use setters */,
11623    ///         Release::default()/* use (different) setters */,
11624    ///     ]);
11625    /// ```
11626    pub fn set_releases<T, V>(mut self, v: T) -> Self
11627    where
11628        T: std::iter::IntoIterator<Item = V>,
11629        V: std::convert::Into<crate::model::Release>,
11630    {
11631        use std::iter::Iterator;
11632        self.releases = v.into_iter().map(|i| i.into()).collect();
11633        self
11634    }
11635
11636    /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
11637    ///
11638    /// # Example
11639    /// ```ignore,no_run
11640    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11641    /// let x = ListReleasesResponse::new().set_next_page_token("example");
11642    /// ```
11643    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11644        self.next_page_token = v.into();
11645        self
11646    }
11647
11648    /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
11649    ///
11650    /// # Example
11651    /// ```ignore,no_run
11652    /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11653    /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
11654    /// ```
11655    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11656    where
11657        T: std::iter::IntoIterator<Item = V>,
11658        V: std::convert::Into<std::string::String>,
11659    {
11660        use std::iter::Iterator;
11661        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11662        self
11663    }
11664}
11665
11666impl wkt::message::Message for ListReleasesResponse {
11667    fn typename() -> &'static str {
11668        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
11669    }
11670}
11671
11672#[doc(hidden)]
11673impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
11674    type PageItem = crate::model::Release;
11675
11676    fn items(self) -> std::vec::Vec<Self::PageItem> {
11677        self.releases
11678    }
11679
11680    fn next_page_token(&self) -> std::string::String {
11681        use std::clone::Clone;
11682        self.next_page_token.clone()
11683    }
11684}
11685
11686/// The request object for `GetRelease`.
11687#[derive(Clone, Default, PartialEq)]
11688#[non_exhaustive]
11689pub struct GetReleaseRequest {
11690    /// Required. Name of the `Release`. Format must be
11691    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11692    pub name: std::string::String,
11693
11694    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11695}
11696
11697impl GetReleaseRequest {
11698    /// Creates a new default instance.
11699    pub fn new() -> Self {
11700        std::default::Default::default()
11701    }
11702
11703    /// Sets the value of [name][crate::model::GetReleaseRequest::name].
11704    ///
11705    /// # Example
11706    /// ```ignore,no_run
11707    /// # use google_cloud_deploy_v1::model::GetReleaseRequest;
11708    /// # let project_id = "project_id";
11709    /// # let location_id = "location_id";
11710    /// # let delivery_pipeline_id = "delivery_pipeline_id";
11711    /// # let release_id = "release_id";
11712    /// let x = GetReleaseRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
11713    /// ```
11714    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11715        self.name = v.into();
11716        self
11717    }
11718}
11719
11720impl wkt::message::Message for GetReleaseRequest {
11721    fn typename() -> &'static str {
11722        "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
11723    }
11724}
11725
11726/// The request object for `CreateRelease`,
11727#[derive(Clone, Default, PartialEq)]
11728#[non_exhaustive]
11729pub struct CreateReleaseRequest {
11730    /// Required. The parent collection in which the `Release` is created.
11731    /// The format is
11732    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
11733    pub parent: std::string::String,
11734
11735    /// Required. ID of the `Release`.
11736    pub release_id: std::string::String,
11737
11738    /// Required. The `Release` to create.
11739    pub release: std::option::Option<crate::model::Release>,
11740
11741    /// Optional. A request ID to identify requests. Specify a unique request ID
11742    /// so that if you must retry your request, the server knows to ignore the
11743    /// request if it has already been completed. The server guarantees that for
11744    /// at least 60 minutes after the first request.
11745    ///
11746    /// For example, consider a situation where you make an initial request and the
11747    /// request times out. If you make the request again with the same request ID,
11748    /// the server can check if original operation with the same request ID was
11749    /// received, and if so, will ignore the second request. This prevents clients
11750    /// from accidentally creating duplicate commitments.
11751    ///
11752    /// The request ID must be a valid UUID with the exception that zero UUID is
11753    /// not supported (00000000-0000-0000-0000-000000000000).
11754    pub request_id: std::string::String,
11755
11756    /// Optional. If set to true, the request is validated and the user is provided
11757    /// with an expected result, but no actual change is made.
11758    pub validate_only: bool,
11759
11760    /// Optional. Deploy policies to override. Format is
11761    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11762    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11763
11764    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11765}
11766
11767impl CreateReleaseRequest {
11768    /// Creates a new default instance.
11769    pub fn new() -> Self {
11770        std::default::Default::default()
11771    }
11772
11773    /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
11774    ///
11775    /// # Example
11776    /// ```ignore,no_run
11777    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11778    /// # let project_id = "project_id";
11779    /// # let location_id = "location_id";
11780    /// # let delivery_pipeline_id = "delivery_pipeline_id";
11781    /// let x = CreateReleaseRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
11782    /// ```
11783    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11784        self.parent = v.into();
11785        self
11786    }
11787
11788    /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
11789    ///
11790    /// # Example
11791    /// ```ignore,no_run
11792    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11793    /// let x = CreateReleaseRequest::new().set_release_id("example");
11794    /// ```
11795    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11796        self.release_id = v.into();
11797        self
11798    }
11799
11800    /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
11801    ///
11802    /// # Example
11803    /// ```ignore,no_run
11804    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11805    /// use google_cloud_deploy_v1::model::Release;
11806    /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
11807    /// ```
11808    pub fn set_release<T>(mut self, v: T) -> Self
11809    where
11810        T: std::convert::Into<crate::model::Release>,
11811    {
11812        self.release = std::option::Option::Some(v.into());
11813        self
11814    }
11815
11816    /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
11817    ///
11818    /// # Example
11819    /// ```ignore,no_run
11820    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11821    /// use google_cloud_deploy_v1::model::Release;
11822    /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
11823    /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
11824    /// ```
11825    pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
11826    where
11827        T: std::convert::Into<crate::model::Release>,
11828    {
11829        self.release = v.map(|x| x.into());
11830        self
11831    }
11832
11833    /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
11834    ///
11835    /// # Example
11836    /// ```ignore,no_run
11837    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11838    /// let x = CreateReleaseRequest::new().set_request_id("example");
11839    /// ```
11840    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11841        self.request_id = v.into();
11842        self
11843    }
11844
11845    /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
11846    ///
11847    /// # Example
11848    /// ```ignore,no_run
11849    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11850    /// let x = CreateReleaseRequest::new().set_validate_only(true);
11851    /// ```
11852    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11853        self.validate_only = v.into();
11854        self
11855    }
11856
11857    /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
11858    ///
11859    /// # Example
11860    /// ```ignore,no_run
11861    /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11862    /// let x = CreateReleaseRequest::new().set_override_deploy_policy(["a", "b", "c"]);
11863    /// ```
11864    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11865    where
11866        T: std::iter::IntoIterator<Item = V>,
11867        V: std::convert::Into<std::string::String>,
11868    {
11869        use std::iter::Iterator;
11870        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11871        self
11872    }
11873}
11874
11875impl wkt::message::Message for CreateReleaseRequest {
11876    fn typename() -> &'static str {
11877        "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
11878    }
11879}
11880
11881/// A `Rollout` resource in the Cloud Deploy API.
11882///
11883/// A `Rollout` contains information around a specific deployment to a `Target`.
11884#[derive(Clone, Default, PartialEq)]
11885#[non_exhaustive]
11886pub struct Rollout {
11887    /// Identifier. Name of the `Rollout`. Format is
11888    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11889    /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
11890    pub name: std::string::String,
11891
11892    /// Output only. Unique identifier of the `Rollout`.
11893    pub uid: std::string::String,
11894
11895    /// Optional. Description of the `Rollout` for user purposes. Max length is 255
11896    /// characters.
11897    pub description: std::string::String,
11898
11899    /// Optional. User annotations. These attributes can only be set and used by
11900    /// the user, and not by Cloud Deploy. See
11901    /// <https://google.aip.dev/128#annotations> for more details such as format and
11902    /// size limitations.
11903    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11904
11905    /// Labels are attributes that can be set and used by both the
11906    /// user and by Cloud Deploy. Labels must meet the following constraints:
11907    ///
11908    /// * Keys and values can contain only lowercase letters, numeric characters,
11909    ///   underscores, and dashes.
11910    /// * All characters must use UTF-8 encoding, and international characters are
11911    ///   allowed.
11912    /// * Keys must start with a lowercase letter or international character.
11913    /// * Each resource is limited to a maximum of 64 labels.
11914    ///
11915    /// Both keys and values are additionally constrained to be <= 128 bytes.
11916    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11917
11918    /// Output only. Time at which the `Rollout` was created.
11919    pub create_time: std::option::Option<wkt::Timestamp>,
11920
11921    /// Output only. Time at which the `Rollout` was approved.
11922    pub approve_time: std::option::Option<wkt::Timestamp>,
11923
11924    /// Output only. Time at which the `Rollout` was enqueued.
11925    pub enqueue_time: std::option::Option<wkt::Timestamp>,
11926
11927    /// Output only. Time at which the `Rollout` started deploying.
11928    pub deploy_start_time: std::option::Option<wkt::Timestamp>,
11929
11930    /// Output only. Time at which the `Rollout` finished deploying.
11931    pub deploy_end_time: std::option::Option<wkt::Timestamp>,
11932
11933    /// Required. The ID of Target to which this `Rollout` is deploying.
11934    pub target_id: std::string::String,
11935
11936    /// Output only. Approval state of the `Rollout`.
11937    pub approval_state: crate::model::rollout::ApprovalState,
11938
11939    /// Output only. Current state of the `Rollout`.
11940    pub state: crate::model::rollout::State,
11941
11942    /// Output only. Additional information about the rollout failure, if
11943    /// available.
11944    pub failure_reason: std::string::String,
11945
11946    /// Output only. The resource name of the Cloud Build `Build` object that is
11947    /// used to deploy the Rollout. Format is
11948    /// `projects/{project}/locations/{location}/builds/{build}`.
11949    pub deploying_build: std::string::String,
11950
11951    /// This checksum is computed by the server based on the value of other
11952    /// fields, and may be sent on update and delete requests to ensure the
11953    /// client has an up-to-date value before proceeding.
11954    pub etag: std::string::String,
11955
11956    /// Output only. The reason this rollout failed. This will always be
11957    /// unspecified while the rollout is in progress.
11958    pub deploy_failure_cause: crate::model::rollout::FailureCause,
11959
11960    /// Output only. The phases that represent the workflows of this `Rollout`.
11961    pub phases: std::vec::Vec<crate::model::Phase>,
11962
11963    /// Output only. Metadata contains information about the rollout.
11964    pub metadata: std::option::Option<crate::model::Metadata>,
11965
11966    /// Output only. Name of the `ControllerRollout`. Format is
11967    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11968    pub controller_rollout: std::string::String,
11969
11970    /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
11971    /// Empty if this `Rollout` wasn't created as a rollback.
11972    pub rollback_of_rollout: std::string::String,
11973
11974    /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
11975    pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
11976
11977    /// Output only. The AutomationRun actively repairing the rollout.
11978    pub active_repair_automation_run: std::string::String,
11979
11980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11981}
11982
11983impl Rollout {
11984    /// Creates a new default instance.
11985    pub fn new() -> Self {
11986        std::default::Default::default()
11987    }
11988
11989    /// Sets the value of [name][crate::model::Rollout::name].
11990    ///
11991    /// # Example
11992    /// ```ignore,no_run
11993    /// # use google_cloud_deploy_v1::model::Rollout;
11994    /// # let project_id = "project_id";
11995    /// # let location_id = "location_id";
11996    /// # let delivery_pipeline_id = "delivery_pipeline_id";
11997    /// # let release_id = "release_id";
11998    /// # let rollout_id = "rollout_id";
11999    /// let x = Rollout::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
12000    /// ```
12001    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12002        self.name = v.into();
12003        self
12004    }
12005
12006    /// Sets the value of [uid][crate::model::Rollout::uid].
12007    ///
12008    /// # Example
12009    /// ```ignore,no_run
12010    /// # use google_cloud_deploy_v1::model::Rollout;
12011    /// let x = Rollout::new().set_uid("example");
12012    /// ```
12013    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12014        self.uid = v.into();
12015        self
12016    }
12017
12018    /// Sets the value of [description][crate::model::Rollout::description].
12019    ///
12020    /// # Example
12021    /// ```ignore,no_run
12022    /// # use google_cloud_deploy_v1::model::Rollout;
12023    /// let x = Rollout::new().set_description("example");
12024    /// ```
12025    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12026        self.description = v.into();
12027        self
12028    }
12029
12030    /// Sets the value of [annotations][crate::model::Rollout::annotations].
12031    ///
12032    /// # Example
12033    /// ```ignore,no_run
12034    /// # use google_cloud_deploy_v1::model::Rollout;
12035    /// let x = Rollout::new().set_annotations([
12036    ///     ("key0", "abc"),
12037    ///     ("key1", "xyz"),
12038    /// ]);
12039    /// ```
12040    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
12041    where
12042        T: std::iter::IntoIterator<Item = (K, V)>,
12043        K: std::convert::Into<std::string::String>,
12044        V: std::convert::Into<std::string::String>,
12045    {
12046        use std::iter::Iterator;
12047        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12048        self
12049    }
12050
12051    /// Sets the value of [labels][crate::model::Rollout::labels].
12052    ///
12053    /// # Example
12054    /// ```ignore,no_run
12055    /// # use google_cloud_deploy_v1::model::Rollout;
12056    /// let x = Rollout::new().set_labels([
12057    ///     ("key0", "abc"),
12058    ///     ("key1", "xyz"),
12059    /// ]);
12060    /// ```
12061    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12062    where
12063        T: std::iter::IntoIterator<Item = (K, V)>,
12064        K: std::convert::Into<std::string::String>,
12065        V: std::convert::Into<std::string::String>,
12066    {
12067        use std::iter::Iterator;
12068        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12069        self
12070    }
12071
12072    /// Sets the value of [create_time][crate::model::Rollout::create_time].
12073    ///
12074    /// # Example
12075    /// ```ignore,no_run
12076    /// # use google_cloud_deploy_v1::model::Rollout;
12077    /// use wkt::Timestamp;
12078    /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
12079    /// ```
12080    pub fn set_create_time<T>(mut self, v: T) -> Self
12081    where
12082        T: std::convert::Into<wkt::Timestamp>,
12083    {
12084        self.create_time = std::option::Option::Some(v.into());
12085        self
12086    }
12087
12088    /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
12089    ///
12090    /// # Example
12091    /// ```ignore,no_run
12092    /// # use google_cloud_deploy_v1::model::Rollout;
12093    /// use wkt::Timestamp;
12094    /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12095    /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
12096    /// ```
12097    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12098    where
12099        T: std::convert::Into<wkt::Timestamp>,
12100    {
12101        self.create_time = v.map(|x| x.into());
12102        self
12103    }
12104
12105    /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
12106    ///
12107    /// # Example
12108    /// ```ignore,no_run
12109    /// # use google_cloud_deploy_v1::model::Rollout;
12110    /// use wkt::Timestamp;
12111    /// let x = Rollout::new().set_approve_time(Timestamp::default()/* use setters */);
12112    /// ```
12113    pub fn set_approve_time<T>(mut self, v: T) -> Self
12114    where
12115        T: std::convert::Into<wkt::Timestamp>,
12116    {
12117        self.approve_time = std::option::Option::Some(v.into());
12118        self
12119    }
12120
12121    /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
12122    ///
12123    /// # Example
12124    /// ```ignore,no_run
12125    /// # use google_cloud_deploy_v1::model::Rollout;
12126    /// use wkt::Timestamp;
12127    /// let x = Rollout::new().set_or_clear_approve_time(Some(Timestamp::default()/* use setters */));
12128    /// let x = Rollout::new().set_or_clear_approve_time(None::<Timestamp>);
12129    /// ```
12130    pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
12131    where
12132        T: std::convert::Into<wkt::Timestamp>,
12133    {
12134        self.approve_time = v.map(|x| x.into());
12135        self
12136    }
12137
12138    /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
12139    ///
12140    /// # Example
12141    /// ```ignore,no_run
12142    /// # use google_cloud_deploy_v1::model::Rollout;
12143    /// use wkt::Timestamp;
12144    /// let x = Rollout::new().set_enqueue_time(Timestamp::default()/* use setters */);
12145    /// ```
12146    pub fn set_enqueue_time<T>(mut self, v: T) -> Self
12147    where
12148        T: std::convert::Into<wkt::Timestamp>,
12149    {
12150        self.enqueue_time = std::option::Option::Some(v.into());
12151        self
12152    }
12153
12154    /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
12155    ///
12156    /// # Example
12157    /// ```ignore,no_run
12158    /// # use google_cloud_deploy_v1::model::Rollout;
12159    /// use wkt::Timestamp;
12160    /// let x = Rollout::new().set_or_clear_enqueue_time(Some(Timestamp::default()/* use setters */));
12161    /// let x = Rollout::new().set_or_clear_enqueue_time(None::<Timestamp>);
12162    /// ```
12163    pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
12164    where
12165        T: std::convert::Into<wkt::Timestamp>,
12166    {
12167        self.enqueue_time = v.map(|x| x.into());
12168        self
12169    }
12170
12171    /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12172    ///
12173    /// # Example
12174    /// ```ignore,no_run
12175    /// # use google_cloud_deploy_v1::model::Rollout;
12176    /// use wkt::Timestamp;
12177    /// let x = Rollout::new().set_deploy_start_time(Timestamp::default()/* use setters */);
12178    /// ```
12179    pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
12180    where
12181        T: std::convert::Into<wkt::Timestamp>,
12182    {
12183        self.deploy_start_time = std::option::Option::Some(v.into());
12184        self
12185    }
12186
12187    /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12188    ///
12189    /// # Example
12190    /// ```ignore,no_run
12191    /// # use google_cloud_deploy_v1::model::Rollout;
12192    /// use wkt::Timestamp;
12193    /// let x = Rollout::new().set_or_clear_deploy_start_time(Some(Timestamp::default()/* use setters */));
12194    /// let x = Rollout::new().set_or_clear_deploy_start_time(None::<Timestamp>);
12195    /// ```
12196    pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12197    where
12198        T: std::convert::Into<wkt::Timestamp>,
12199    {
12200        self.deploy_start_time = v.map(|x| x.into());
12201        self
12202    }
12203
12204    /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12205    ///
12206    /// # Example
12207    /// ```ignore,no_run
12208    /// # use google_cloud_deploy_v1::model::Rollout;
12209    /// use wkt::Timestamp;
12210    /// let x = Rollout::new().set_deploy_end_time(Timestamp::default()/* use setters */);
12211    /// ```
12212    pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
12213    where
12214        T: std::convert::Into<wkt::Timestamp>,
12215    {
12216        self.deploy_end_time = std::option::Option::Some(v.into());
12217        self
12218    }
12219
12220    /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12221    ///
12222    /// # Example
12223    /// ```ignore,no_run
12224    /// # use google_cloud_deploy_v1::model::Rollout;
12225    /// use wkt::Timestamp;
12226    /// let x = Rollout::new().set_or_clear_deploy_end_time(Some(Timestamp::default()/* use setters */));
12227    /// let x = Rollout::new().set_or_clear_deploy_end_time(None::<Timestamp>);
12228    /// ```
12229    pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12230    where
12231        T: std::convert::Into<wkt::Timestamp>,
12232    {
12233        self.deploy_end_time = v.map(|x| x.into());
12234        self
12235    }
12236
12237    /// Sets the value of [target_id][crate::model::Rollout::target_id].
12238    ///
12239    /// # Example
12240    /// ```ignore,no_run
12241    /// # use google_cloud_deploy_v1::model::Rollout;
12242    /// let x = Rollout::new().set_target_id("example");
12243    /// ```
12244    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12245        self.target_id = v.into();
12246        self
12247    }
12248
12249    /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
12250    ///
12251    /// # Example
12252    /// ```ignore,no_run
12253    /// # use google_cloud_deploy_v1::model::Rollout;
12254    /// use google_cloud_deploy_v1::model::rollout::ApprovalState;
12255    /// let x0 = Rollout::new().set_approval_state(ApprovalState::NeedsApproval);
12256    /// let x1 = Rollout::new().set_approval_state(ApprovalState::DoesNotNeedApproval);
12257    /// let x2 = Rollout::new().set_approval_state(ApprovalState::Approved);
12258    /// ```
12259    pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
12260        mut self,
12261        v: T,
12262    ) -> Self {
12263        self.approval_state = v.into();
12264        self
12265    }
12266
12267    /// Sets the value of [state][crate::model::Rollout::state].
12268    ///
12269    /// # Example
12270    /// ```ignore,no_run
12271    /// # use google_cloud_deploy_v1::model::Rollout;
12272    /// use google_cloud_deploy_v1::model::rollout::State;
12273    /// let x0 = Rollout::new().set_state(State::Succeeded);
12274    /// let x1 = Rollout::new().set_state(State::Failed);
12275    /// let x2 = Rollout::new().set_state(State::InProgress);
12276    /// ```
12277    pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
12278        self.state = v.into();
12279        self
12280    }
12281
12282    /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
12283    ///
12284    /// # Example
12285    /// ```ignore,no_run
12286    /// # use google_cloud_deploy_v1::model::Rollout;
12287    /// let x = Rollout::new().set_failure_reason("example");
12288    /// ```
12289    pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12290        self.failure_reason = v.into();
12291        self
12292    }
12293
12294    /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
12295    ///
12296    /// # Example
12297    /// ```ignore,no_run
12298    /// # use google_cloud_deploy_v1::model::Rollout;
12299    /// let x = Rollout::new().set_deploying_build("example");
12300    /// ```
12301    pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12302        self.deploying_build = v.into();
12303        self
12304    }
12305
12306    /// Sets the value of [etag][crate::model::Rollout::etag].
12307    ///
12308    /// # Example
12309    /// ```ignore,no_run
12310    /// # use google_cloud_deploy_v1::model::Rollout;
12311    /// let x = Rollout::new().set_etag("example");
12312    /// ```
12313    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12314        self.etag = v.into();
12315        self
12316    }
12317
12318    /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
12319    ///
12320    /// # Example
12321    /// ```ignore,no_run
12322    /// # use google_cloud_deploy_v1::model::Rollout;
12323    /// use google_cloud_deploy_v1::model::rollout::FailureCause;
12324    /// let x0 = Rollout::new().set_deploy_failure_cause(FailureCause::CloudBuildUnavailable);
12325    /// let x1 = Rollout::new().set_deploy_failure_cause(FailureCause::ExecutionFailed);
12326    /// let x2 = Rollout::new().set_deploy_failure_cause(FailureCause::DeadlineExceeded);
12327    /// ```
12328    pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
12329        mut self,
12330        v: T,
12331    ) -> Self {
12332        self.deploy_failure_cause = v.into();
12333        self
12334    }
12335
12336    /// Sets the value of [phases][crate::model::Rollout::phases].
12337    ///
12338    /// # Example
12339    /// ```ignore,no_run
12340    /// # use google_cloud_deploy_v1::model::Rollout;
12341    /// use google_cloud_deploy_v1::model::Phase;
12342    /// let x = Rollout::new()
12343    ///     .set_phases([
12344    ///         Phase::default()/* use setters */,
12345    ///         Phase::default()/* use (different) setters */,
12346    ///     ]);
12347    /// ```
12348    pub fn set_phases<T, V>(mut self, v: T) -> Self
12349    where
12350        T: std::iter::IntoIterator<Item = V>,
12351        V: std::convert::Into<crate::model::Phase>,
12352    {
12353        use std::iter::Iterator;
12354        self.phases = v.into_iter().map(|i| i.into()).collect();
12355        self
12356    }
12357
12358    /// Sets the value of [metadata][crate::model::Rollout::metadata].
12359    ///
12360    /// # Example
12361    /// ```ignore,no_run
12362    /// # use google_cloud_deploy_v1::model::Rollout;
12363    /// use google_cloud_deploy_v1::model::Metadata;
12364    /// let x = Rollout::new().set_metadata(Metadata::default()/* use setters */);
12365    /// ```
12366    pub fn set_metadata<T>(mut self, v: T) -> Self
12367    where
12368        T: std::convert::Into<crate::model::Metadata>,
12369    {
12370        self.metadata = std::option::Option::Some(v.into());
12371        self
12372    }
12373
12374    /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
12375    ///
12376    /// # Example
12377    /// ```ignore,no_run
12378    /// # use google_cloud_deploy_v1::model::Rollout;
12379    /// use google_cloud_deploy_v1::model::Metadata;
12380    /// let x = Rollout::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
12381    /// let x = Rollout::new().set_or_clear_metadata(None::<Metadata>);
12382    /// ```
12383    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12384    where
12385        T: std::convert::Into<crate::model::Metadata>,
12386    {
12387        self.metadata = v.map(|x| x.into());
12388        self
12389    }
12390
12391    /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
12392    ///
12393    /// # Example
12394    /// ```ignore,no_run
12395    /// # use google_cloud_deploy_v1::model::Rollout;
12396    /// let x = Rollout::new().set_controller_rollout("example");
12397    /// ```
12398    pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
12399        mut self,
12400        v: T,
12401    ) -> Self {
12402        self.controller_rollout = v.into();
12403        self
12404    }
12405
12406    /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
12407    ///
12408    /// # Example
12409    /// ```ignore,no_run
12410    /// # use google_cloud_deploy_v1::model::Rollout;
12411    /// let x = Rollout::new().set_rollback_of_rollout("example");
12412    /// ```
12413    pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
12414        mut self,
12415        v: T,
12416    ) -> Self {
12417        self.rollback_of_rollout = v.into();
12418        self
12419    }
12420
12421    /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
12422    ///
12423    /// # Example
12424    /// ```ignore,no_run
12425    /// # use google_cloud_deploy_v1::model::Rollout;
12426    /// let x = Rollout::new().set_rolled_back_by_rollouts(["a", "b", "c"]);
12427    /// ```
12428    pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
12429    where
12430        T: std::iter::IntoIterator<Item = V>,
12431        V: std::convert::Into<std::string::String>,
12432    {
12433        use std::iter::Iterator;
12434        self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
12435        self
12436    }
12437
12438    /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
12439    ///
12440    /// # Example
12441    /// ```ignore,no_run
12442    /// # use google_cloud_deploy_v1::model::Rollout;
12443    /// let x = Rollout::new().set_active_repair_automation_run("example");
12444    /// ```
12445    pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
12446        mut self,
12447        v: T,
12448    ) -> Self {
12449        self.active_repair_automation_run = v.into();
12450        self
12451    }
12452}
12453
12454impl wkt::message::Message for Rollout {
12455    fn typename() -> &'static str {
12456        "type.googleapis.com/google.cloud.deploy.v1.Rollout"
12457    }
12458}
12459
12460/// Defines additional types related to [Rollout].
12461pub mod rollout {
12462    #[allow(unused_imports)]
12463    use super::*;
12464
12465    /// Valid approval states of a `Rollout`.
12466    ///
12467    /// # Working with unknown values
12468    ///
12469    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12470    /// additional enum variants at any time. Adding new variants is not considered
12471    /// a breaking change. Applications should write their code in anticipation of:
12472    ///
12473    /// - New values appearing in future releases of the client library, **and**
12474    /// - New values received dynamically, without application changes.
12475    ///
12476    /// Please consult the [Working with enums] section in the user guide for some
12477    /// guidelines.
12478    ///
12479    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12480    #[derive(Clone, Debug, PartialEq)]
12481    #[non_exhaustive]
12482    pub enum ApprovalState {
12483        /// The `Rollout` has an unspecified approval state.
12484        Unspecified,
12485        /// The `Rollout` requires approval.
12486        NeedsApproval,
12487        /// The `Rollout` does not require approval.
12488        DoesNotNeedApproval,
12489        /// The `Rollout` has been approved.
12490        Approved,
12491        /// The `Rollout` has been rejected.
12492        Rejected,
12493        /// If set, the enum was initialized with an unknown value.
12494        ///
12495        /// Applications can examine the value using [ApprovalState::value] or
12496        /// [ApprovalState::name].
12497        UnknownValue(approval_state::UnknownValue),
12498    }
12499
12500    #[doc(hidden)]
12501    pub mod approval_state {
12502        #[allow(unused_imports)]
12503        use super::*;
12504        #[derive(Clone, Debug, PartialEq)]
12505        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12506    }
12507
12508    impl ApprovalState {
12509        /// Gets the enum value.
12510        ///
12511        /// Returns `None` if the enum contains an unknown value deserialized from
12512        /// the string representation of enums.
12513        pub fn value(&self) -> std::option::Option<i32> {
12514            match self {
12515                Self::Unspecified => std::option::Option::Some(0),
12516                Self::NeedsApproval => std::option::Option::Some(1),
12517                Self::DoesNotNeedApproval => std::option::Option::Some(2),
12518                Self::Approved => std::option::Option::Some(3),
12519                Self::Rejected => std::option::Option::Some(4),
12520                Self::UnknownValue(u) => u.0.value(),
12521            }
12522        }
12523
12524        /// Gets the enum value as a string.
12525        ///
12526        /// Returns `None` if the enum contains an unknown value deserialized from
12527        /// the integer representation of enums.
12528        pub fn name(&self) -> std::option::Option<&str> {
12529            match self {
12530                Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
12531                Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
12532                Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
12533                Self::Approved => std::option::Option::Some("APPROVED"),
12534                Self::Rejected => std::option::Option::Some("REJECTED"),
12535                Self::UnknownValue(u) => u.0.name(),
12536            }
12537        }
12538    }
12539
12540    impl std::default::Default for ApprovalState {
12541        fn default() -> Self {
12542            use std::convert::From;
12543            Self::from(0)
12544        }
12545    }
12546
12547    impl std::fmt::Display for ApprovalState {
12548        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12549            wkt::internal::display_enum(f, self.name(), self.value())
12550        }
12551    }
12552
12553    impl std::convert::From<i32> for ApprovalState {
12554        fn from(value: i32) -> Self {
12555            match value {
12556                0 => Self::Unspecified,
12557                1 => Self::NeedsApproval,
12558                2 => Self::DoesNotNeedApproval,
12559                3 => Self::Approved,
12560                4 => Self::Rejected,
12561                _ => Self::UnknownValue(approval_state::UnknownValue(
12562                    wkt::internal::UnknownEnumValue::Integer(value),
12563                )),
12564            }
12565        }
12566    }
12567
12568    impl std::convert::From<&str> for ApprovalState {
12569        fn from(value: &str) -> Self {
12570            use std::string::ToString;
12571            match value {
12572                "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
12573                "NEEDS_APPROVAL" => Self::NeedsApproval,
12574                "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
12575                "APPROVED" => Self::Approved,
12576                "REJECTED" => Self::Rejected,
12577                _ => Self::UnknownValue(approval_state::UnknownValue(
12578                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12579                )),
12580            }
12581        }
12582    }
12583
12584    impl serde::ser::Serialize for ApprovalState {
12585        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12586        where
12587            S: serde::Serializer,
12588        {
12589            match self {
12590                Self::Unspecified => serializer.serialize_i32(0),
12591                Self::NeedsApproval => serializer.serialize_i32(1),
12592                Self::DoesNotNeedApproval => serializer.serialize_i32(2),
12593                Self::Approved => serializer.serialize_i32(3),
12594                Self::Rejected => serializer.serialize_i32(4),
12595                Self::UnknownValue(u) => u.0.serialize(serializer),
12596            }
12597        }
12598    }
12599
12600    impl<'de> serde::de::Deserialize<'de> for ApprovalState {
12601        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12602        where
12603            D: serde::Deserializer<'de>,
12604        {
12605            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
12606                ".google.cloud.deploy.v1.Rollout.ApprovalState",
12607            ))
12608        }
12609    }
12610
12611    /// Valid states of a `Rollout`.
12612    ///
12613    /// # Working with unknown values
12614    ///
12615    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12616    /// additional enum variants at any time. Adding new variants is not considered
12617    /// a breaking change. Applications should write their code in anticipation of:
12618    ///
12619    /// - New values appearing in future releases of the client library, **and**
12620    /// - New values received dynamically, without application changes.
12621    ///
12622    /// Please consult the [Working with enums] section in the user guide for some
12623    /// guidelines.
12624    ///
12625    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12626    #[derive(Clone, Debug, PartialEq)]
12627    #[non_exhaustive]
12628    pub enum State {
12629        /// The `Rollout` has an unspecified state.
12630        Unspecified,
12631        /// The `Rollout` has completed successfully.
12632        Succeeded,
12633        /// The `Rollout` has failed.
12634        Failed,
12635        /// The `Rollout` is being deployed.
12636        InProgress,
12637        /// The `Rollout` needs approval.
12638        PendingApproval,
12639        /// An approver rejected the `Rollout`.
12640        ApprovalRejected,
12641        /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
12642        /// `Target`.
12643        Pending,
12644        /// The `Rollout` is waiting for the `Release` to be fully rendered.
12645        PendingRelease,
12646        /// The `Rollout` is in the process of being cancelled.
12647        Cancelling,
12648        /// The `Rollout` has been cancelled.
12649        Cancelled,
12650        /// The `Rollout` is halted.
12651        Halted,
12652        /// If set, the enum was initialized with an unknown value.
12653        ///
12654        /// Applications can examine the value using [State::value] or
12655        /// [State::name].
12656        UnknownValue(state::UnknownValue),
12657    }
12658
12659    #[doc(hidden)]
12660    pub mod state {
12661        #[allow(unused_imports)]
12662        use super::*;
12663        #[derive(Clone, Debug, PartialEq)]
12664        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12665    }
12666
12667    impl State {
12668        /// Gets the enum value.
12669        ///
12670        /// Returns `None` if the enum contains an unknown value deserialized from
12671        /// the string representation of enums.
12672        pub fn value(&self) -> std::option::Option<i32> {
12673            match self {
12674                Self::Unspecified => std::option::Option::Some(0),
12675                Self::Succeeded => std::option::Option::Some(1),
12676                Self::Failed => std::option::Option::Some(2),
12677                Self::InProgress => std::option::Option::Some(3),
12678                Self::PendingApproval => std::option::Option::Some(4),
12679                Self::ApprovalRejected => std::option::Option::Some(5),
12680                Self::Pending => std::option::Option::Some(6),
12681                Self::PendingRelease => std::option::Option::Some(7),
12682                Self::Cancelling => std::option::Option::Some(8),
12683                Self::Cancelled => std::option::Option::Some(9),
12684                Self::Halted => std::option::Option::Some(10),
12685                Self::UnknownValue(u) => u.0.value(),
12686            }
12687        }
12688
12689        /// Gets the enum value as a string.
12690        ///
12691        /// Returns `None` if the enum contains an unknown value deserialized from
12692        /// the integer representation of enums.
12693        pub fn name(&self) -> std::option::Option<&str> {
12694            match self {
12695                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12696                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12697                Self::Failed => std::option::Option::Some("FAILED"),
12698                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12699                Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
12700                Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
12701                Self::Pending => std::option::Option::Some("PENDING"),
12702                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
12703                Self::Cancelling => std::option::Option::Some("CANCELLING"),
12704                Self::Cancelled => std::option::Option::Some("CANCELLED"),
12705                Self::Halted => std::option::Option::Some("HALTED"),
12706                Self::UnknownValue(u) => u.0.name(),
12707            }
12708        }
12709    }
12710
12711    impl std::default::Default for State {
12712        fn default() -> Self {
12713            use std::convert::From;
12714            Self::from(0)
12715        }
12716    }
12717
12718    impl std::fmt::Display for State {
12719        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12720            wkt::internal::display_enum(f, self.name(), self.value())
12721        }
12722    }
12723
12724    impl std::convert::From<i32> for State {
12725        fn from(value: i32) -> Self {
12726            match value {
12727                0 => Self::Unspecified,
12728                1 => Self::Succeeded,
12729                2 => Self::Failed,
12730                3 => Self::InProgress,
12731                4 => Self::PendingApproval,
12732                5 => Self::ApprovalRejected,
12733                6 => Self::Pending,
12734                7 => Self::PendingRelease,
12735                8 => Self::Cancelling,
12736                9 => Self::Cancelled,
12737                10 => Self::Halted,
12738                _ => Self::UnknownValue(state::UnknownValue(
12739                    wkt::internal::UnknownEnumValue::Integer(value),
12740                )),
12741            }
12742        }
12743    }
12744
12745    impl std::convert::From<&str> for State {
12746        fn from(value: &str) -> Self {
12747            use std::string::ToString;
12748            match value {
12749                "STATE_UNSPECIFIED" => Self::Unspecified,
12750                "SUCCEEDED" => Self::Succeeded,
12751                "FAILED" => Self::Failed,
12752                "IN_PROGRESS" => Self::InProgress,
12753                "PENDING_APPROVAL" => Self::PendingApproval,
12754                "APPROVAL_REJECTED" => Self::ApprovalRejected,
12755                "PENDING" => Self::Pending,
12756                "PENDING_RELEASE" => Self::PendingRelease,
12757                "CANCELLING" => Self::Cancelling,
12758                "CANCELLED" => Self::Cancelled,
12759                "HALTED" => Self::Halted,
12760                _ => Self::UnknownValue(state::UnknownValue(
12761                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12762                )),
12763            }
12764        }
12765    }
12766
12767    impl serde::ser::Serialize for State {
12768        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12769        where
12770            S: serde::Serializer,
12771        {
12772            match self {
12773                Self::Unspecified => serializer.serialize_i32(0),
12774                Self::Succeeded => serializer.serialize_i32(1),
12775                Self::Failed => serializer.serialize_i32(2),
12776                Self::InProgress => serializer.serialize_i32(3),
12777                Self::PendingApproval => serializer.serialize_i32(4),
12778                Self::ApprovalRejected => serializer.serialize_i32(5),
12779                Self::Pending => serializer.serialize_i32(6),
12780                Self::PendingRelease => serializer.serialize_i32(7),
12781                Self::Cancelling => serializer.serialize_i32(8),
12782                Self::Cancelled => serializer.serialize_i32(9),
12783                Self::Halted => serializer.serialize_i32(10),
12784                Self::UnknownValue(u) => u.0.serialize(serializer),
12785            }
12786        }
12787    }
12788
12789    impl<'de> serde::de::Deserialize<'de> for State {
12790        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12791        where
12792            D: serde::Deserializer<'de>,
12793        {
12794            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12795                ".google.cloud.deploy.v1.Rollout.State",
12796            ))
12797        }
12798    }
12799
12800    /// Well-known rollout failures.
12801    ///
12802    /// # Working with unknown values
12803    ///
12804    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12805    /// additional enum variants at any time. Adding new variants is not considered
12806    /// a breaking change. Applications should write their code in anticipation of:
12807    ///
12808    /// - New values appearing in future releases of the client library, **and**
12809    /// - New values received dynamically, without application changes.
12810    ///
12811    /// Please consult the [Working with enums] section in the user guide for some
12812    /// guidelines.
12813    ///
12814    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12815    #[derive(Clone, Debug, PartialEq)]
12816    #[non_exhaustive]
12817    pub enum FailureCause {
12818        /// No reason for failure is specified.
12819        Unspecified,
12820        /// Cloud Build is not available, either because it is not enabled or because
12821        /// Cloud Deploy has insufficient permissions. See [required
12822        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12823        CloudBuildUnavailable,
12824        /// The deploy operation did not complete successfully; check Cloud Build
12825        /// logs.
12826        ExecutionFailed,
12827        /// Deployment did not complete within the allotted time.
12828        DeadlineExceeded,
12829        /// Release is in a failed state.
12830        ReleaseFailed,
12831        /// Release is abandoned.
12832        ReleaseAbandoned,
12833        /// No Skaffold verify configuration was found.
12834        VerificationConfigNotFound,
12835        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12836        /// for additional details.
12837        CloudBuildRequestFailed,
12838        /// A Rollout operation had a feature configured that is not supported.
12839        OperationFeatureNotSupported,
12840        /// If set, the enum was initialized with an unknown value.
12841        ///
12842        /// Applications can examine the value using [FailureCause::value] or
12843        /// [FailureCause::name].
12844        UnknownValue(failure_cause::UnknownValue),
12845    }
12846
12847    #[doc(hidden)]
12848    pub mod failure_cause {
12849        #[allow(unused_imports)]
12850        use super::*;
12851        #[derive(Clone, Debug, PartialEq)]
12852        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12853    }
12854
12855    impl FailureCause {
12856        /// Gets the enum value.
12857        ///
12858        /// Returns `None` if the enum contains an unknown value deserialized from
12859        /// the string representation of enums.
12860        pub fn value(&self) -> std::option::Option<i32> {
12861            match self {
12862                Self::Unspecified => std::option::Option::Some(0),
12863                Self::CloudBuildUnavailable => std::option::Option::Some(1),
12864                Self::ExecutionFailed => std::option::Option::Some(2),
12865                Self::DeadlineExceeded => std::option::Option::Some(3),
12866                Self::ReleaseFailed => std::option::Option::Some(4),
12867                Self::ReleaseAbandoned => std::option::Option::Some(5),
12868                Self::VerificationConfigNotFound => std::option::Option::Some(6),
12869                Self::CloudBuildRequestFailed => std::option::Option::Some(7),
12870                Self::OperationFeatureNotSupported => std::option::Option::Some(8),
12871                Self::UnknownValue(u) => u.0.value(),
12872            }
12873        }
12874
12875        /// Gets the enum value as a string.
12876        ///
12877        /// Returns `None` if the enum contains an unknown value deserialized from
12878        /// the integer representation of enums.
12879        pub fn name(&self) -> std::option::Option<&str> {
12880            match self {
12881                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12882                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12883                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12884                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12885                Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
12886                Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
12887                Self::VerificationConfigNotFound => {
12888                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12889                }
12890                Self::CloudBuildRequestFailed => {
12891                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12892                }
12893                Self::OperationFeatureNotSupported => {
12894                    std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
12895                }
12896                Self::UnknownValue(u) => u.0.name(),
12897            }
12898        }
12899    }
12900
12901    impl std::default::Default for FailureCause {
12902        fn default() -> Self {
12903            use std::convert::From;
12904            Self::from(0)
12905        }
12906    }
12907
12908    impl std::fmt::Display for FailureCause {
12909        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12910            wkt::internal::display_enum(f, self.name(), self.value())
12911        }
12912    }
12913
12914    impl std::convert::From<i32> for FailureCause {
12915        fn from(value: i32) -> Self {
12916            match value {
12917                0 => Self::Unspecified,
12918                1 => Self::CloudBuildUnavailable,
12919                2 => Self::ExecutionFailed,
12920                3 => Self::DeadlineExceeded,
12921                4 => Self::ReleaseFailed,
12922                5 => Self::ReleaseAbandoned,
12923                6 => Self::VerificationConfigNotFound,
12924                7 => Self::CloudBuildRequestFailed,
12925                8 => Self::OperationFeatureNotSupported,
12926                _ => Self::UnknownValue(failure_cause::UnknownValue(
12927                    wkt::internal::UnknownEnumValue::Integer(value),
12928                )),
12929            }
12930        }
12931    }
12932
12933    impl std::convert::From<&str> for FailureCause {
12934        fn from(value: &str) -> Self {
12935            use std::string::ToString;
12936            match value {
12937                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12938                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12939                "EXECUTION_FAILED" => Self::ExecutionFailed,
12940                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12941                "RELEASE_FAILED" => Self::ReleaseFailed,
12942                "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
12943                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12944                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12945                "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
12946                _ => Self::UnknownValue(failure_cause::UnknownValue(
12947                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12948                )),
12949            }
12950        }
12951    }
12952
12953    impl serde::ser::Serialize for FailureCause {
12954        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12955        where
12956            S: serde::Serializer,
12957        {
12958            match self {
12959                Self::Unspecified => serializer.serialize_i32(0),
12960                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12961                Self::ExecutionFailed => serializer.serialize_i32(2),
12962                Self::DeadlineExceeded => serializer.serialize_i32(3),
12963                Self::ReleaseFailed => serializer.serialize_i32(4),
12964                Self::ReleaseAbandoned => serializer.serialize_i32(5),
12965                Self::VerificationConfigNotFound => serializer.serialize_i32(6),
12966                Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
12967                Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
12968                Self::UnknownValue(u) => u.0.serialize(serializer),
12969            }
12970        }
12971    }
12972
12973    impl<'de> serde::de::Deserialize<'de> for FailureCause {
12974        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12975        where
12976            D: serde::Deserializer<'de>,
12977        {
12978            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12979                ".google.cloud.deploy.v1.Rollout.FailureCause",
12980            ))
12981        }
12982    }
12983}
12984
12985/// Metadata includes information associated with a `Rollout`.
12986#[derive(Clone, Default, PartialEq)]
12987#[non_exhaustive]
12988pub struct Metadata {
12989    /// Output only. The name of the Cloud Run Service that is associated with a
12990    /// `Rollout`.
12991    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12992
12993    /// Output only. AutomationRolloutMetadata contains the information about the
12994    /// interactions between Automation service and this rollout.
12995    pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
12996
12997    /// Output only. Custom metadata provided by user-defined `Rollout` operations.
12998    pub custom: std::option::Option<crate::model::CustomMetadata>,
12999
13000    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13001}
13002
13003impl Metadata {
13004    /// Creates a new default instance.
13005    pub fn new() -> Self {
13006        std::default::Default::default()
13007    }
13008
13009    /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
13010    ///
13011    /// # Example
13012    /// ```ignore,no_run
13013    /// # use google_cloud_deploy_v1::model::Metadata;
13014    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13015    /// let x = Metadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
13016    /// ```
13017    pub fn set_cloud_run<T>(mut self, v: T) -> Self
13018    where
13019        T: std::convert::Into<crate::model::CloudRunMetadata>,
13020    {
13021        self.cloud_run = std::option::Option::Some(v.into());
13022        self
13023    }
13024
13025    /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
13026    ///
13027    /// # Example
13028    /// ```ignore,no_run
13029    /// # use google_cloud_deploy_v1::model::Metadata;
13030    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13031    /// let x = Metadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
13032    /// let x = Metadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
13033    /// ```
13034    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
13035    where
13036        T: std::convert::Into<crate::model::CloudRunMetadata>,
13037    {
13038        self.cloud_run = v.map(|x| x.into());
13039        self
13040    }
13041
13042    /// Sets the value of [automation][crate::model::Metadata::automation].
13043    ///
13044    /// # Example
13045    /// ```ignore,no_run
13046    /// # use google_cloud_deploy_v1::model::Metadata;
13047    /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13048    /// let x = Metadata::new().set_automation(AutomationRolloutMetadata::default()/* use setters */);
13049    /// ```
13050    pub fn set_automation<T>(mut self, v: T) -> Self
13051    where
13052        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
13053    {
13054        self.automation = std::option::Option::Some(v.into());
13055        self
13056    }
13057
13058    /// Sets or clears the value of [automation][crate::model::Metadata::automation].
13059    ///
13060    /// # Example
13061    /// ```ignore,no_run
13062    /// # use google_cloud_deploy_v1::model::Metadata;
13063    /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13064    /// let x = Metadata::new().set_or_clear_automation(Some(AutomationRolloutMetadata::default()/* use setters */));
13065    /// let x = Metadata::new().set_or_clear_automation(None::<AutomationRolloutMetadata>);
13066    /// ```
13067    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
13068    where
13069        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
13070    {
13071        self.automation = v.map(|x| x.into());
13072        self
13073    }
13074
13075    /// Sets the value of [custom][crate::model::Metadata::custom].
13076    ///
13077    /// # Example
13078    /// ```ignore,no_run
13079    /// # use google_cloud_deploy_v1::model::Metadata;
13080    /// use google_cloud_deploy_v1::model::CustomMetadata;
13081    /// let x = Metadata::new().set_custom(CustomMetadata::default()/* use setters */);
13082    /// ```
13083    pub fn set_custom<T>(mut self, v: T) -> Self
13084    where
13085        T: std::convert::Into<crate::model::CustomMetadata>,
13086    {
13087        self.custom = std::option::Option::Some(v.into());
13088        self
13089    }
13090
13091    /// Sets or clears the value of [custom][crate::model::Metadata::custom].
13092    ///
13093    /// # Example
13094    /// ```ignore,no_run
13095    /// # use google_cloud_deploy_v1::model::Metadata;
13096    /// use google_cloud_deploy_v1::model::CustomMetadata;
13097    /// let x = Metadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13098    /// let x = Metadata::new().set_or_clear_custom(None::<CustomMetadata>);
13099    /// ```
13100    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13101    where
13102        T: std::convert::Into<crate::model::CustomMetadata>,
13103    {
13104        self.custom = v.map(|x| x.into());
13105        self
13106    }
13107}
13108
13109impl wkt::message::Message for Metadata {
13110    fn typename() -> &'static str {
13111        "type.googleapis.com/google.cloud.deploy.v1.Metadata"
13112    }
13113}
13114
13115/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
13116/// the user.
13117#[derive(Clone, Default, PartialEq)]
13118#[non_exhaustive]
13119pub struct DeployJobRunMetadata {
13120    /// Output only. The name of the Cloud Run Service that is associated with a
13121    /// `DeployJobRun`.
13122    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
13123
13124    /// Output only. Custom Target metadata associated with a `DeployJobRun`.
13125    pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
13126
13127    /// Output only. Custom metadata provided by user-defined deploy operation.
13128    pub custom: std::option::Option<crate::model::CustomMetadata>,
13129
13130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13131}
13132
13133impl DeployJobRunMetadata {
13134    /// Creates a new default instance.
13135    pub fn new() -> Self {
13136        std::default::Default::default()
13137    }
13138
13139    /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
13140    ///
13141    /// # Example
13142    /// ```ignore,no_run
13143    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13144    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13145    /// let x = DeployJobRunMetadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
13146    /// ```
13147    pub fn set_cloud_run<T>(mut self, v: T) -> Self
13148    where
13149        T: std::convert::Into<crate::model::CloudRunMetadata>,
13150    {
13151        self.cloud_run = std::option::Option::Some(v.into());
13152        self
13153    }
13154
13155    /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
13156    ///
13157    /// # Example
13158    /// ```ignore,no_run
13159    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13160    /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13161    /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
13162    /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
13163    /// ```
13164    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
13165    where
13166        T: std::convert::Into<crate::model::CloudRunMetadata>,
13167    {
13168        self.cloud_run = v.map(|x| x.into());
13169        self
13170    }
13171
13172    /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13173    ///
13174    /// # Example
13175    /// ```ignore,no_run
13176    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13177    /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13178    /// let x = DeployJobRunMetadata::new().set_custom_target(CustomTargetDeployMetadata::default()/* use setters */);
13179    /// ```
13180    pub fn set_custom_target<T>(mut self, v: T) -> Self
13181    where
13182        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13183    {
13184        self.custom_target = std::option::Option::Some(v.into());
13185        self
13186    }
13187
13188    /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13189    ///
13190    /// # Example
13191    /// ```ignore,no_run
13192    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13193    /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13194    /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(Some(CustomTargetDeployMetadata::default()/* use setters */));
13195    /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(None::<CustomTargetDeployMetadata>);
13196    /// ```
13197    pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
13198    where
13199        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13200    {
13201        self.custom_target = v.map(|x| x.into());
13202        self
13203    }
13204
13205    /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
13206    ///
13207    /// # Example
13208    /// ```ignore,no_run
13209    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13210    /// use google_cloud_deploy_v1::model::CustomMetadata;
13211    /// let x = DeployJobRunMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
13212    /// ```
13213    pub fn set_custom<T>(mut self, v: T) -> Self
13214    where
13215        T: std::convert::Into<crate::model::CustomMetadata>,
13216    {
13217        self.custom = std::option::Option::Some(v.into());
13218        self
13219    }
13220
13221    /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
13222    ///
13223    /// # Example
13224    /// ```ignore,no_run
13225    /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13226    /// use google_cloud_deploy_v1::model::CustomMetadata;
13227    /// let x = DeployJobRunMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13228    /// let x = DeployJobRunMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
13229    /// ```
13230    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13231    where
13232        T: std::convert::Into<crate::model::CustomMetadata>,
13233    {
13234        self.custom = v.map(|x| x.into());
13235        self
13236    }
13237}
13238
13239impl wkt::message::Message for DeployJobRunMetadata {
13240    fn typename() -> &'static str {
13241        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
13242    }
13243}
13244
13245/// CloudRunMetadata contains information from a Cloud Run deployment.
13246#[derive(Clone, Default, PartialEq)]
13247#[non_exhaustive]
13248pub struct CloudRunMetadata {
13249    /// Output only. The name of the Cloud Run Service that is associated with a
13250    /// `Rollout`. Format is
13251    /// `projects/{project}/locations/{location}/services/{service}`.
13252    pub service: std::string::String,
13253
13254    /// Output only. The Cloud Run Service urls that are associated with a
13255    /// `Rollout`.
13256    pub service_urls: std::vec::Vec<std::string::String>,
13257
13258    /// Output only. The Cloud Run Revision id associated with a `Rollout`.
13259    pub revision: std::string::String,
13260
13261    /// Output only. The name of the Cloud Run job that is associated with a
13262    /// `Rollout`. Format is
13263    /// `projects/{project}/locations/{location}/jobs/{job_name}`.
13264    pub job: std::string::String,
13265
13266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13267}
13268
13269impl CloudRunMetadata {
13270    /// Creates a new default instance.
13271    pub fn new() -> Self {
13272        std::default::Default::default()
13273    }
13274
13275    /// Sets the value of [service][crate::model::CloudRunMetadata::service].
13276    ///
13277    /// # Example
13278    /// ```ignore,no_run
13279    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13280    /// let x = CloudRunMetadata::new().set_service("example");
13281    /// ```
13282    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13283        self.service = v.into();
13284        self
13285    }
13286
13287    /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
13288    ///
13289    /// # Example
13290    /// ```ignore,no_run
13291    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13292    /// let x = CloudRunMetadata::new().set_service_urls(["a", "b", "c"]);
13293    /// ```
13294    pub fn set_service_urls<T, V>(mut self, v: T) -> Self
13295    where
13296        T: std::iter::IntoIterator<Item = V>,
13297        V: std::convert::Into<std::string::String>,
13298    {
13299        use std::iter::Iterator;
13300        self.service_urls = v.into_iter().map(|i| i.into()).collect();
13301        self
13302    }
13303
13304    /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
13305    ///
13306    /// # Example
13307    /// ```ignore,no_run
13308    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13309    /// let x = CloudRunMetadata::new().set_revision("example");
13310    /// ```
13311    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13312        self.revision = v.into();
13313        self
13314    }
13315
13316    /// Sets the value of [job][crate::model::CloudRunMetadata::job].
13317    ///
13318    /// # Example
13319    /// ```ignore,no_run
13320    /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13321    /// let x = CloudRunMetadata::new().set_job("example");
13322    /// ```
13323    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13324        self.job = v.into();
13325        self
13326    }
13327}
13328
13329impl wkt::message::Message for CloudRunMetadata {
13330    fn typename() -> &'static str {
13331        "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
13332    }
13333}
13334
13335/// CustomTargetDeployMetadata contains information from a Custom Target
13336/// deploy operation.
13337#[derive(Clone, Default, PartialEq)]
13338#[non_exhaustive]
13339pub struct CustomTargetDeployMetadata {
13340    /// Output only. Skip message provided in the results of a custom deploy
13341    /// operation.
13342    pub skip_message: std::string::String,
13343
13344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13345}
13346
13347impl CustomTargetDeployMetadata {
13348    /// Creates a new default instance.
13349    pub fn new() -> Self {
13350        std::default::Default::default()
13351    }
13352
13353    /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
13354    ///
13355    /// # Example
13356    /// ```ignore,no_run
13357    /// # use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13358    /// let x = CustomTargetDeployMetadata::new().set_skip_message("example");
13359    /// ```
13360    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13361        self.skip_message = v.into();
13362        self
13363    }
13364}
13365
13366impl wkt::message::Message for CustomTargetDeployMetadata {
13367    fn typename() -> &'static str {
13368        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
13369    }
13370}
13371
13372/// AutomationRolloutMetadata contains Automation-related actions that
13373/// were performed on a rollout.
13374#[derive(Clone, Default, PartialEq)]
13375#[non_exhaustive]
13376pub struct AutomationRolloutMetadata {
13377    /// Output only. The name of the AutomationRun initiated by a promote release
13378    /// rule.
13379    pub promote_automation_run: std::string::String,
13380
13381    /// Output only. The names of the AutomationRuns initiated by an advance
13382    /// rollout rule.
13383    pub advance_automation_runs: std::vec::Vec<std::string::String>,
13384
13385    /// Output only. The names of the AutomationRuns initiated by a repair rollout
13386    /// rule.
13387    pub repair_automation_runs: std::vec::Vec<std::string::String>,
13388
13389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13390}
13391
13392impl AutomationRolloutMetadata {
13393    /// Creates a new default instance.
13394    pub fn new() -> Self {
13395        std::default::Default::default()
13396    }
13397
13398    /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
13399    ///
13400    /// # Example
13401    /// ```ignore,no_run
13402    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13403    /// let x = AutomationRolloutMetadata::new().set_promote_automation_run("example");
13404    /// ```
13405    pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
13406        mut self,
13407        v: T,
13408    ) -> Self {
13409        self.promote_automation_run = v.into();
13410        self
13411    }
13412
13413    /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
13414    ///
13415    /// # Example
13416    /// ```ignore,no_run
13417    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13418    /// let x = AutomationRolloutMetadata::new().set_advance_automation_runs(["a", "b", "c"]);
13419    /// ```
13420    pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
13421    where
13422        T: std::iter::IntoIterator<Item = V>,
13423        V: std::convert::Into<std::string::String>,
13424    {
13425        use std::iter::Iterator;
13426        self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
13427        self
13428    }
13429
13430    /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
13431    ///
13432    /// # Example
13433    /// ```ignore,no_run
13434    /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13435    /// let x = AutomationRolloutMetadata::new().set_repair_automation_runs(["a", "b", "c"]);
13436    /// ```
13437    pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
13438    where
13439        T: std::iter::IntoIterator<Item = V>,
13440        V: std::convert::Into<std::string::String>,
13441    {
13442        use std::iter::Iterator;
13443        self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
13444        self
13445    }
13446}
13447
13448impl wkt::message::Message for AutomationRolloutMetadata {
13449    fn typename() -> &'static str {
13450        "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
13451    }
13452}
13453
13454/// CustomMetadata contains information from a user-defined operation.
13455#[derive(Clone, Default, PartialEq)]
13456#[non_exhaustive]
13457pub struct CustomMetadata {
13458    /// Output only. Key-value pairs provided by the user-defined operation.
13459    pub values: std::collections::HashMap<std::string::String, std::string::String>,
13460
13461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13462}
13463
13464impl CustomMetadata {
13465    /// Creates a new default instance.
13466    pub fn new() -> Self {
13467        std::default::Default::default()
13468    }
13469
13470    /// Sets the value of [values][crate::model::CustomMetadata::values].
13471    ///
13472    /// # Example
13473    /// ```ignore,no_run
13474    /// # use google_cloud_deploy_v1::model::CustomMetadata;
13475    /// let x = CustomMetadata::new().set_values([
13476    ///     ("key0", "abc"),
13477    ///     ("key1", "xyz"),
13478    /// ]);
13479    /// ```
13480    pub fn set_values<T, K, V>(mut self, v: T) -> Self
13481    where
13482        T: std::iter::IntoIterator<Item = (K, V)>,
13483        K: std::convert::Into<std::string::String>,
13484        V: std::convert::Into<std::string::String>,
13485    {
13486        use std::iter::Iterator;
13487        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13488        self
13489    }
13490}
13491
13492impl wkt::message::Message for CustomMetadata {
13493    fn typename() -> &'static str {
13494        "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
13495    }
13496}
13497
13498/// Phase represents a collection of jobs that are logically grouped together
13499/// for a `Rollout`.
13500#[derive(Clone, Default, PartialEq)]
13501#[non_exhaustive]
13502pub struct Phase {
13503    /// Output only. The ID of the Phase.
13504    pub id: std::string::String,
13505
13506    /// Output only. Current state of the Phase.
13507    pub state: crate::model::phase::State,
13508
13509    /// Output only. Additional information on why the Phase was skipped, if
13510    /// available.
13511    pub skip_message: std::string::String,
13512
13513    /// The job composition of this Phase.
13514    pub jobs: std::option::Option<crate::model::phase::Jobs>,
13515
13516    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13517}
13518
13519impl Phase {
13520    /// Creates a new default instance.
13521    pub fn new() -> Self {
13522        std::default::Default::default()
13523    }
13524
13525    /// Sets the value of [id][crate::model::Phase::id].
13526    ///
13527    /// # Example
13528    /// ```ignore,no_run
13529    /// # use google_cloud_deploy_v1::model::Phase;
13530    /// let x = Phase::new().set_id("example");
13531    /// ```
13532    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13533        self.id = v.into();
13534        self
13535    }
13536
13537    /// Sets the value of [state][crate::model::Phase::state].
13538    ///
13539    /// # Example
13540    /// ```ignore,no_run
13541    /// # use google_cloud_deploy_v1::model::Phase;
13542    /// use google_cloud_deploy_v1::model::phase::State;
13543    /// let x0 = Phase::new().set_state(State::Pending);
13544    /// let x1 = Phase::new().set_state(State::InProgress);
13545    /// let x2 = Phase::new().set_state(State::Succeeded);
13546    /// ```
13547    pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
13548        self.state = v.into();
13549        self
13550    }
13551
13552    /// Sets the value of [skip_message][crate::model::Phase::skip_message].
13553    ///
13554    /// # Example
13555    /// ```ignore,no_run
13556    /// # use google_cloud_deploy_v1::model::Phase;
13557    /// let x = Phase::new().set_skip_message("example");
13558    /// ```
13559    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13560        self.skip_message = v.into();
13561        self
13562    }
13563
13564    /// Sets the value of [jobs][crate::model::Phase::jobs].
13565    ///
13566    /// Note that all the setters affecting `jobs` are mutually
13567    /// exclusive.
13568    ///
13569    /// # Example
13570    /// ```ignore,no_run
13571    /// # use google_cloud_deploy_v1::model::Phase;
13572    /// use google_cloud_deploy_v1::model::DeploymentJobs;
13573    /// let x = Phase::new().set_jobs(Some(
13574    ///     google_cloud_deploy_v1::model::phase::Jobs::DeploymentJobs(DeploymentJobs::default().into())));
13575    /// ```
13576    pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
13577        mut self,
13578        v: T,
13579    ) -> Self {
13580        self.jobs = v.into();
13581        self
13582    }
13583
13584    /// The value of [jobs][crate::model::Phase::jobs]
13585    /// if it holds a `DeploymentJobs`, `None` if the field is not set or
13586    /// holds a different branch.
13587    pub fn deployment_jobs(
13588        &self,
13589    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
13590        #[allow(unreachable_patterns)]
13591        self.jobs.as_ref().and_then(|v| match v {
13592            crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
13593            _ => std::option::Option::None,
13594        })
13595    }
13596
13597    /// Sets the value of [jobs][crate::model::Phase::jobs]
13598    /// to hold a `DeploymentJobs`.
13599    ///
13600    /// Note that all the setters affecting `jobs` are
13601    /// mutually exclusive.
13602    ///
13603    /// # Example
13604    /// ```ignore,no_run
13605    /// # use google_cloud_deploy_v1::model::Phase;
13606    /// use google_cloud_deploy_v1::model::DeploymentJobs;
13607    /// let x = Phase::new().set_deployment_jobs(DeploymentJobs::default()/* use setters */);
13608    /// assert!(x.deployment_jobs().is_some());
13609    /// assert!(x.child_rollout_jobs().is_none());
13610    /// ```
13611    pub fn set_deployment_jobs<
13612        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
13613    >(
13614        mut self,
13615        v: T,
13616    ) -> Self {
13617        self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
13618        self
13619    }
13620
13621    /// The value of [jobs][crate::model::Phase::jobs]
13622    /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
13623    /// holds a different branch.
13624    pub fn child_rollout_jobs(
13625        &self,
13626    ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
13627        #[allow(unreachable_patterns)]
13628        self.jobs.as_ref().and_then(|v| match v {
13629            crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
13630            _ => std::option::Option::None,
13631        })
13632    }
13633
13634    /// Sets the value of [jobs][crate::model::Phase::jobs]
13635    /// to hold a `ChildRolloutJobs`.
13636    ///
13637    /// Note that all the setters affecting `jobs` are
13638    /// mutually exclusive.
13639    ///
13640    /// # Example
13641    /// ```ignore,no_run
13642    /// # use google_cloud_deploy_v1::model::Phase;
13643    /// use google_cloud_deploy_v1::model::ChildRolloutJobs;
13644    /// let x = Phase::new().set_child_rollout_jobs(ChildRolloutJobs::default()/* use setters */);
13645    /// assert!(x.child_rollout_jobs().is_some());
13646    /// assert!(x.deployment_jobs().is_none());
13647    /// ```
13648    pub fn set_child_rollout_jobs<
13649        T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
13650    >(
13651        mut self,
13652        v: T,
13653    ) -> Self {
13654        self.jobs =
13655            std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
13656        self
13657    }
13658}
13659
13660impl wkt::message::Message for Phase {
13661    fn typename() -> &'static str {
13662        "type.googleapis.com/google.cloud.deploy.v1.Phase"
13663    }
13664}
13665
13666/// Defines additional types related to [Phase].
13667pub mod phase {
13668    #[allow(unused_imports)]
13669    use super::*;
13670
13671    /// Valid states of a Phase.
13672    ///
13673    /// # Working with unknown values
13674    ///
13675    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13676    /// additional enum variants at any time. Adding new variants is not considered
13677    /// a breaking change. Applications should write their code in anticipation of:
13678    ///
13679    /// - New values appearing in future releases of the client library, **and**
13680    /// - New values received dynamically, without application changes.
13681    ///
13682    /// Please consult the [Working with enums] section in the user guide for some
13683    /// guidelines.
13684    ///
13685    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13686    #[derive(Clone, Debug, PartialEq)]
13687    #[non_exhaustive]
13688    pub enum State {
13689        /// The Phase has an unspecified state.
13690        Unspecified,
13691        /// The Phase is waiting for an earlier Phase(s) to complete.
13692        Pending,
13693        /// The Phase is in progress.
13694        InProgress,
13695        /// The Phase has succeeded.
13696        Succeeded,
13697        /// The Phase has failed.
13698        Failed,
13699        /// The Phase was aborted.
13700        Aborted,
13701        /// The Phase was skipped.
13702        Skipped,
13703        /// If set, the enum was initialized with an unknown value.
13704        ///
13705        /// Applications can examine the value using [State::value] or
13706        /// [State::name].
13707        UnknownValue(state::UnknownValue),
13708    }
13709
13710    #[doc(hidden)]
13711    pub mod state {
13712        #[allow(unused_imports)]
13713        use super::*;
13714        #[derive(Clone, Debug, PartialEq)]
13715        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13716    }
13717
13718    impl State {
13719        /// Gets the enum value.
13720        ///
13721        /// Returns `None` if the enum contains an unknown value deserialized from
13722        /// the string representation of enums.
13723        pub fn value(&self) -> std::option::Option<i32> {
13724            match self {
13725                Self::Unspecified => std::option::Option::Some(0),
13726                Self::Pending => std::option::Option::Some(1),
13727                Self::InProgress => std::option::Option::Some(2),
13728                Self::Succeeded => std::option::Option::Some(3),
13729                Self::Failed => std::option::Option::Some(4),
13730                Self::Aborted => std::option::Option::Some(5),
13731                Self::Skipped => std::option::Option::Some(6),
13732                Self::UnknownValue(u) => u.0.value(),
13733            }
13734        }
13735
13736        /// Gets the enum value as a string.
13737        ///
13738        /// Returns `None` if the enum contains an unknown value deserialized from
13739        /// the integer representation of enums.
13740        pub fn name(&self) -> std::option::Option<&str> {
13741            match self {
13742                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13743                Self::Pending => std::option::Option::Some("PENDING"),
13744                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
13745                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13746                Self::Failed => std::option::Option::Some("FAILED"),
13747                Self::Aborted => std::option::Option::Some("ABORTED"),
13748                Self::Skipped => std::option::Option::Some("SKIPPED"),
13749                Self::UnknownValue(u) => u.0.name(),
13750            }
13751        }
13752    }
13753
13754    impl std::default::Default for State {
13755        fn default() -> Self {
13756            use std::convert::From;
13757            Self::from(0)
13758        }
13759    }
13760
13761    impl std::fmt::Display for State {
13762        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13763            wkt::internal::display_enum(f, self.name(), self.value())
13764        }
13765    }
13766
13767    impl std::convert::From<i32> for State {
13768        fn from(value: i32) -> Self {
13769            match value {
13770                0 => Self::Unspecified,
13771                1 => Self::Pending,
13772                2 => Self::InProgress,
13773                3 => Self::Succeeded,
13774                4 => Self::Failed,
13775                5 => Self::Aborted,
13776                6 => Self::Skipped,
13777                _ => Self::UnknownValue(state::UnknownValue(
13778                    wkt::internal::UnknownEnumValue::Integer(value),
13779                )),
13780            }
13781        }
13782    }
13783
13784    impl std::convert::From<&str> for State {
13785        fn from(value: &str) -> Self {
13786            use std::string::ToString;
13787            match value {
13788                "STATE_UNSPECIFIED" => Self::Unspecified,
13789                "PENDING" => Self::Pending,
13790                "IN_PROGRESS" => Self::InProgress,
13791                "SUCCEEDED" => Self::Succeeded,
13792                "FAILED" => Self::Failed,
13793                "ABORTED" => Self::Aborted,
13794                "SKIPPED" => Self::Skipped,
13795                _ => Self::UnknownValue(state::UnknownValue(
13796                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13797                )),
13798            }
13799        }
13800    }
13801
13802    impl serde::ser::Serialize for State {
13803        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13804        where
13805            S: serde::Serializer,
13806        {
13807            match self {
13808                Self::Unspecified => serializer.serialize_i32(0),
13809                Self::Pending => serializer.serialize_i32(1),
13810                Self::InProgress => serializer.serialize_i32(2),
13811                Self::Succeeded => serializer.serialize_i32(3),
13812                Self::Failed => serializer.serialize_i32(4),
13813                Self::Aborted => serializer.serialize_i32(5),
13814                Self::Skipped => serializer.serialize_i32(6),
13815                Self::UnknownValue(u) => u.0.serialize(serializer),
13816            }
13817        }
13818    }
13819
13820    impl<'de> serde::de::Deserialize<'de> for State {
13821        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13822        where
13823            D: serde::Deserializer<'de>,
13824        {
13825            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13826                ".google.cloud.deploy.v1.Phase.State",
13827            ))
13828        }
13829    }
13830
13831    /// The job composition of this Phase.
13832    #[derive(Clone, Debug, PartialEq)]
13833    #[non_exhaustive]
13834    pub enum Jobs {
13835        /// Output only. Deployment job composition.
13836        DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
13837        /// Output only. ChildRollout job composition.
13838        ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
13839    }
13840}
13841
13842/// Deployment job composition.
13843#[derive(Clone, Default, PartialEq)]
13844#[non_exhaustive]
13845pub struct DeploymentJobs {
13846    /// Output only. The predeploy Job, which is the first job on the phase.
13847    pub predeploy_job: std::option::Option<crate::model::Job>,
13848
13849    /// Output only. The deploy Job. This is the deploy job in the phase.
13850    pub deploy_job: std::option::Option<crate::model::Job>,
13851
13852    /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
13853    pub verify_job: std::option::Option<crate::model::Job>,
13854
13855    /// Output only. The postdeploy Job, which is the last job on the phase.
13856    pub postdeploy_job: std::option::Option<crate::model::Job>,
13857
13858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13859}
13860
13861impl DeploymentJobs {
13862    /// Creates a new default instance.
13863    pub fn new() -> Self {
13864        std::default::Default::default()
13865    }
13866
13867    /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13868    ///
13869    /// # Example
13870    /// ```ignore,no_run
13871    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13872    /// use google_cloud_deploy_v1::model::Job;
13873    /// let x = DeploymentJobs::new().set_predeploy_job(Job::default()/* use setters */);
13874    /// ```
13875    pub fn set_predeploy_job<T>(mut self, v: T) -> Self
13876    where
13877        T: std::convert::Into<crate::model::Job>,
13878    {
13879        self.predeploy_job = std::option::Option::Some(v.into());
13880        self
13881    }
13882
13883    /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13884    ///
13885    /// # Example
13886    /// ```ignore,no_run
13887    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13888    /// use google_cloud_deploy_v1::model::Job;
13889    /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(Some(Job::default()/* use setters */));
13890    /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(None::<Job>);
13891    /// ```
13892    pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13893    where
13894        T: std::convert::Into<crate::model::Job>,
13895    {
13896        self.predeploy_job = v.map(|x| x.into());
13897        self
13898    }
13899
13900    /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13901    ///
13902    /// # Example
13903    /// ```ignore,no_run
13904    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13905    /// use google_cloud_deploy_v1::model::Job;
13906    /// let x = DeploymentJobs::new().set_deploy_job(Job::default()/* use setters */);
13907    /// ```
13908    pub fn set_deploy_job<T>(mut self, v: T) -> Self
13909    where
13910        T: std::convert::Into<crate::model::Job>,
13911    {
13912        self.deploy_job = std::option::Option::Some(v.into());
13913        self
13914    }
13915
13916    /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13917    ///
13918    /// # Example
13919    /// ```ignore,no_run
13920    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13921    /// use google_cloud_deploy_v1::model::Job;
13922    /// let x = DeploymentJobs::new().set_or_clear_deploy_job(Some(Job::default()/* use setters */));
13923    /// let x = DeploymentJobs::new().set_or_clear_deploy_job(None::<Job>);
13924    /// ```
13925    pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13926    where
13927        T: std::convert::Into<crate::model::Job>,
13928    {
13929        self.deploy_job = v.map(|x| x.into());
13930        self
13931    }
13932
13933    /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13934    ///
13935    /// # Example
13936    /// ```ignore,no_run
13937    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13938    /// use google_cloud_deploy_v1::model::Job;
13939    /// let x = DeploymentJobs::new().set_verify_job(Job::default()/* use setters */);
13940    /// ```
13941    pub fn set_verify_job<T>(mut self, v: T) -> Self
13942    where
13943        T: std::convert::Into<crate::model::Job>,
13944    {
13945        self.verify_job = std::option::Option::Some(v.into());
13946        self
13947    }
13948
13949    /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13950    ///
13951    /// # Example
13952    /// ```ignore,no_run
13953    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13954    /// use google_cloud_deploy_v1::model::Job;
13955    /// let x = DeploymentJobs::new().set_or_clear_verify_job(Some(Job::default()/* use setters */));
13956    /// let x = DeploymentJobs::new().set_or_clear_verify_job(None::<Job>);
13957    /// ```
13958    pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
13959    where
13960        T: std::convert::Into<crate::model::Job>,
13961    {
13962        self.verify_job = v.map(|x| x.into());
13963        self
13964    }
13965
13966    /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13967    ///
13968    /// # Example
13969    /// ```ignore,no_run
13970    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13971    /// use google_cloud_deploy_v1::model::Job;
13972    /// let x = DeploymentJobs::new().set_postdeploy_job(Job::default()/* use setters */);
13973    /// ```
13974    pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
13975    where
13976        T: std::convert::Into<crate::model::Job>,
13977    {
13978        self.postdeploy_job = std::option::Option::Some(v.into());
13979        self
13980    }
13981
13982    /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13983    ///
13984    /// # Example
13985    /// ```ignore,no_run
13986    /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13987    /// use google_cloud_deploy_v1::model::Job;
13988    /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(Some(Job::default()/* use setters */));
13989    /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(None::<Job>);
13990    /// ```
13991    pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13992    where
13993        T: std::convert::Into<crate::model::Job>,
13994    {
13995        self.postdeploy_job = v.map(|x| x.into());
13996        self
13997    }
13998}
13999
14000impl wkt::message::Message for DeploymentJobs {
14001    fn typename() -> &'static str {
14002        "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
14003    }
14004}
14005
14006/// ChildRollouts job composition
14007#[derive(Clone, Default, PartialEq)]
14008#[non_exhaustive]
14009pub struct ChildRolloutJobs {
14010    /// Output only. List of CreateChildRolloutJobs
14011    pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
14012
14013    /// Output only. List of AdvanceChildRolloutJobs
14014    pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
14015
14016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14017}
14018
14019impl ChildRolloutJobs {
14020    /// Creates a new default instance.
14021    pub fn new() -> Self {
14022        std::default::Default::default()
14023    }
14024
14025    /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
14026    ///
14027    /// # Example
14028    /// ```ignore,no_run
14029    /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
14030    /// use google_cloud_deploy_v1::model::Job;
14031    /// let x = ChildRolloutJobs::new()
14032    ///     .set_create_rollout_jobs([
14033    ///         Job::default()/* use setters */,
14034    ///         Job::default()/* use (different) setters */,
14035    ///     ]);
14036    /// ```
14037    pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
14038    where
14039        T: std::iter::IntoIterator<Item = V>,
14040        V: std::convert::Into<crate::model::Job>,
14041    {
14042        use std::iter::Iterator;
14043        self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
14044        self
14045    }
14046
14047    /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
14048    ///
14049    /// # Example
14050    /// ```ignore,no_run
14051    /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
14052    /// use google_cloud_deploy_v1::model::Job;
14053    /// let x = ChildRolloutJobs::new()
14054    ///     .set_advance_rollout_jobs([
14055    ///         Job::default()/* use setters */,
14056    ///         Job::default()/* use (different) setters */,
14057    ///     ]);
14058    /// ```
14059    pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
14060    where
14061        T: std::iter::IntoIterator<Item = V>,
14062        V: std::convert::Into<crate::model::Job>,
14063    {
14064        use std::iter::Iterator;
14065        self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
14066        self
14067    }
14068}
14069
14070impl wkt::message::Message for ChildRolloutJobs {
14071    fn typename() -> &'static str {
14072        "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
14073    }
14074}
14075
14076/// Job represents an operation for a `Rollout`.
14077#[derive(Clone, Default, PartialEq)]
14078#[non_exhaustive]
14079pub struct Job {
14080    /// Output only. The ID of the Job.
14081    pub id: std::string::String,
14082
14083    /// Output only. The current state of the Job.
14084    pub state: crate::model::job::State,
14085
14086    /// Output only. Additional information on why the Job was skipped, if
14087    /// available.
14088    pub skip_message: std::string::String,
14089
14090    /// Output only. The name of the `JobRun` responsible for the most recent
14091    /// invocation of this Job.
14092    pub job_run: std::string::String,
14093
14094    /// The type of Job.
14095    pub job_type: std::option::Option<crate::model::job::JobType>,
14096
14097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14098}
14099
14100impl Job {
14101    /// Creates a new default instance.
14102    pub fn new() -> Self {
14103        std::default::Default::default()
14104    }
14105
14106    /// Sets the value of [id][crate::model::Job::id].
14107    ///
14108    /// # Example
14109    /// ```ignore,no_run
14110    /// # use google_cloud_deploy_v1::model::Job;
14111    /// let x = Job::new().set_id("example");
14112    /// ```
14113    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14114        self.id = v.into();
14115        self
14116    }
14117
14118    /// Sets the value of [state][crate::model::Job::state].
14119    ///
14120    /// # Example
14121    /// ```ignore,no_run
14122    /// # use google_cloud_deploy_v1::model::Job;
14123    /// use google_cloud_deploy_v1::model::job::State;
14124    /// let x0 = Job::new().set_state(State::Pending);
14125    /// let x1 = Job::new().set_state(State::Disabled);
14126    /// let x2 = Job::new().set_state(State::InProgress);
14127    /// ```
14128    pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
14129        self.state = v.into();
14130        self
14131    }
14132
14133    /// Sets the value of [skip_message][crate::model::Job::skip_message].
14134    ///
14135    /// # Example
14136    /// ```ignore,no_run
14137    /// # use google_cloud_deploy_v1::model::Job;
14138    /// let x = Job::new().set_skip_message("example");
14139    /// ```
14140    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14141        self.skip_message = v.into();
14142        self
14143    }
14144
14145    /// Sets the value of [job_run][crate::model::Job::job_run].
14146    ///
14147    /// # Example
14148    /// ```ignore,no_run
14149    /// # use google_cloud_deploy_v1::model::Job;
14150    /// # let project_id = "project_id";
14151    /// # let location_id = "location_id";
14152    /// # let delivery_pipeline_id = "delivery_pipeline_id";
14153    /// # let release_id = "release_id";
14154    /// # let rollout_id = "rollout_id";
14155    /// # let job_run_id = "job_run_id";
14156    /// let x = Job::new().set_job_run(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
14157    /// ```
14158    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14159        self.job_run = v.into();
14160        self
14161    }
14162
14163    /// Sets the value of [job_type][crate::model::Job::job_type].
14164    ///
14165    /// Note that all the setters affecting `job_type` are mutually
14166    /// exclusive.
14167    ///
14168    /// # Example
14169    /// ```ignore,no_run
14170    /// # use google_cloud_deploy_v1::model::Job;
14171    /// use google_cloud_deploy_v1::model::DeployJob;
14172    /// let x = Job::new().set_job_type(Some(
14173    ///     google_cloud_deploy_v1::model::job::JobType::DeployJob(DeployJob::default().into())));
14174    /// ```
14175    pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
14176        mut self,
14177        v: T,
14178    ) -> Self {
14179        self.job_type = v.into();
14180        self
14181    }
14182
14183    /// The value of [job_type][crate::model::Job::job_type]
14184    /// if it holds a `DeployJob`, `None` if the field is not set or
14185    /// holds a different branch.
14186    pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
14187        #[allow(unreachable_patterns)]
14188        self.job_type.as_ref().and_then(|v| match v {
14189            crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
14190            _ => std::option::Option::None,
14191        })
14192    }
14193
14194    /// Sets the value of [job_type][crate::model::Job::job_type]
14195    /// to hold a `DeployJob`.
14196    ///
14197    /// Note that all the setters affecting `job_type` are
14198    /// mutually exclusive.
14199    ///
14200    /// # Example
14201    /// ```ignore,no_run
14202    /// # use google_cloud_deploy_v1::model::Job;
14203    /// use google_cloud_deploy_v1::model::DeployJob;
14204    /// let x = Job::new().set_deploy_job(DeployJob::default()/* use setters */);
14205    /// assert!(x.deploy_job().is_some());
14206    /// assert!(x.verify_job().is_none());
14207    /// assert!(x.predeploy_job().is_none());
14208    /// assert!(x.postdeploy_job().is_none());
14209    /// assert!(x.create_child_rollout_job().is_none());
14210    /// assert!(x.advance_child_rollout_job().is_none());
14211    /// ```
14212    pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
14213        mut self,
14214        v: T,
14215    ) -> Self {
14216        self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
14217        self
14218    }
14219
14220    /// The value of [job_type][crate::model::Job::job_type]
14221    /// if it holds a `VerifyJob`, `None` if the field is not set or
14222    /// holds a different branch.
14223    pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
14224        #[allow(unreachable_patterns)]
14225        self.job_type.as_ref().and_then(|v| match v {
14226            crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
14227            _ => std::option::Option::None,
14228        })
14229    }
14230
14231    /// Sets the value of [job_type][crate::model::Job::job_type]
14232    /// to hold a `VerifyJob`.
14233    ///
14234    /// Note that all the setters affecting `job_type` are
14235    /// mutually exclusive.
14236    ///
14237    /// # Example
14238    /// ```ignore,no_run
14239    /// # use google_cloud_deploy_v1::model::Job;
14240    /// use google_cloud_deploy_v1::model::VerifyJob;
14241    /// let x = Job::new().set_verify_job(VerifyJob::default()/* use setters */);
14242    /// assert!(x.verify_job().is_some());
14243    /// assert!(x.deploy_job().is_none());
14244    /// assert!(x.predeploy_job().is_none());
14245    /// assert!(x.postdeploy_job().is_none());
14246    /// assert!(x.create_child_rollout_job().is_none());
14247    /// assert!(x.advance_child_rollout_job().is_none());
14248    /// ```
14249    pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
14250        mut self,
14251        v: T,
14252    ) -> Self {
14253        self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
14254        self
14255    }
14256
14257    /// The value of [job_type][crate::model::Job::job_type]
14258    /// if it holds a `PredeployJob`, `None` if the field is not set or
14259    /// holds a different branch.
14260    pub fn predeploy_job(
14261        &self,
14262    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
14263        #[allow(unreachable_patterns)]
14264        self.job_type.as_ref().and_then(|v| match v {
14265            crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
14266            _ => std::option::Option::None,
14267        })
14268    }
14269
14270    /// Sets the value of [job_type][crate::model::Job::job_type]
14271    /// to hold a `PredeployJob`.
14272    ///
14273    /// Note that all the setters affecting `job_type` are
14274    /// mutually exclusive.
14275    ///
14276    /// # Example
14277    /// ```ignore,no_run
14278    /// # use google_cloud_deploy_v1::model::Job;
14279    /// use google_cloud_deploy_v1::model::PredeployJob;
14280    /// let x = Job::new().set_predeploy_job(PredeployJob::default()/* use setters */);
14281    /// assert!(x.predeploy_job().is_some());
14282    /// assert!(x.deploy_job().is_none());
14283    /// assert!(x.verify_job().is_none());
14284    /// assert!(x.postdeploy_job().is_none());
14285    /// assert!(x.create_child_rollout_job().is_none());
14286    /// assert!(x.advance_child_rollout_job().is_none());
14287    /// ```
14288    pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
14289        mut self,
14290        v: T,
14291    ) -> Self {
14292        self.job_type =
14293            std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
14294        self
14295    }
14296
14297    /// The value of [job_type][crate::model::Job::job_type]
14298    /// if it holds a `PostdeployJob`, `None` if the field is not set or
14299    /// holds a different branch.
14300    pub fn postdeploy_job(
14301        &self,
14302    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
14303        #[allow(unreachable_patterns)]
14304        self.job_type.as_ref().and_then(|v| match v {
14305            crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
14306            _ => std::option::Option::None,
14307        })
14308    }
14309
14310    /// Sets the value of [job_type][crate::model::Job::job_type]
14311    /// to hold a `PostdeployJob`.
14312    ///
14313    /// Note that all the setters affecting `job_type` are
14314    /// mutually exclusive.
14315    ///
14316    /// # Example
14317    /// ```ignore,no_run
14318    /// # use google_cloud_deploy_v1::model::Job;
14319    /// use google_cloud_deploy_v1::model::PostdeployJob;
14320    /// let x = Job::new().set_postdeploy_job(PostdeployJob::default()/* use setters */);
14321    /// assert!(x.postdeploy_job().is_some());
14322    /// assert!(x.deploy_job().is_none());
14323    /// assert!(x.verify_job().is_none());
14324    /// assert!(x.predeploy_job().is_none());
14325    /// assert!(x.create_child_rollout_job().is_none());
14326    /// assert!(x.advance_child_rollout_job().is_none());
14327    /// ```
14328    pub fn set_postdeploy_job<
14329        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
14330    >(
14331        mut self,
14332        v: T,
14333    ) -> Self {
14334        self.job_type =
14335            std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
14336        self
14337    }
14338
14339    /// The value of [job_type][crate::model::Job::job_type]
14340    /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
14341    /// holds a different branch.
14342    pub fn create_child_rollout_job(
14343        &self,
14344    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
14345        #[allow(unreachable_patterns)]
14346        self.job_type.as_ref().and_then(|v| match v {
14347            crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
14348            _ => std::option::Option::None,
14349        })
14350    }
14351
14352    /// Sets the value of [job_type][crate::model::Job::job_type]
14353    /// to hold a `CreateChildRolloutJob`.
14354    ///
14355    /// Note that all the setters affecting `job_type` are
14356    /// mutually exclusive.
14357    ///
14358    /// # Example
14359    /// ```ignore,no_run
14360    /// # use google_cloud_deploy_v1::model::Job;
14361    /// use google_cloud_deploy_v1::model::CreateChildRolloutJob;
14362    /// let x = Job::new().set_create_child_rollout_job(CreateChildRolloutJob::default()/* use setters */);
14363    /// assert!(x.create_child_rollout_job().is_some());
14364    /// assert!(x.deploy_job().is_none());
14365    /// assert!(x.verify_job().is_none());
14366    /// assert!(x.predeploy_job().is_none());
14367    /// assert!(x.postdeploy_job().is_none());
14368    /// assert!(x.advance_child_rollout_job().is_none());
14369    /// ```
14370    pub fn set_create_child_rollout_job<
14371        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
14372    >(
14373        mut self,
14374        v: T,
14375    ) -> Self {
14376        self.job_type =
14377            std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
14378        self
14379    }
14380
14381    /// The value of [job_type][crate::model::Job::job_type]
14382    /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
14383    /// holds a different branch.
14384    pub fn advance_child_rollout_job(
14385        &self,
14386    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
14387        #[allow(unreachable_patterns)]
14388        self.job_type.as_ref().and_then(|v| match v {
14389            crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
14390            _ => std::option::Option::None,
14391        })
14392    }
14393
14394    /// Sets the value of [job_type][crate::model::Job::job_type]
14395    /// to hold a `AdvanceChildRolloutJob`.
14396    ///
14397    /// Note that all the setters affecting `job_type` are
14398    /// mutually exclusive.
14399    ///
14400    /// # Example
14401    /// ```ignore,no_run
14402    /// # use google_cloud_deploy_v1::model::Job;
14403    /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJob;
14404    /// let x = Job::new().set_advance_child_rollout_job(AdvanceChildRolloutJob::default()/* use setters */);
14405    /// assert!(x.advance_child_rollout_job().is_some());
14406    /// assert!(x.deploy_job().is_none());
14407    /// assert!(x.verify_job().is_none());
14408    /// assert!(x.predeploy_job().is_none());
14409    /// assert!(x.postdeploy_job().is_none());
14410    /// assert!(x.create_child_rollout_job().is_none());
14411    /// ```
14412    pub fn set_advance_child_rollout_job<
14413        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
14414    >(
14415        mut self,
14416        v: T,
14417    ) -> Self {
14418        self.job_type =
14419            std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
14420        self
14421    }
14422}
14423
14424impl wkt::message::Message for Job {
14425    fn typename() -> &'static str {
14426        "type.googleapis.com/google.cloud.deploy.v1.Job"
14427    }
14428}
14429
14430/// Defines additional types related to [Job].
14431pub mod job {
14432    #[allow(unused_imports)]
14433    use super::*;
14434
14435    /// Valid states of a Job.
14436    ///
14437    /// # Working with unknown values
14438    ///
14439    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14440    /// additional enum variants at any time. Adding new variants is not considered
14441    /// a breaking change. Applications should write their code in anticipation of:
14442    ///
14443    /// - New values appearing in future releases of the client library, **and**
14444    /// - New values received dynamically, without application changes.
14445    ///
14446    /// Please consult the [Working with enums] section in the user guide for some
14447    /// guidelines.
14448    ///
14449    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14450    #[derive(Clone, Debug, PartialEq)]
14451    #[non_exhaustive]
14452    pub enum State {
14453        /// The Job has an unspecified state.
14454        Unspecified,
14455        /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
14456        Pending,
14457        /// The Job is disabled.
14458        Disabled,
14459        /// The Job is in progress.
14460        InProgress,
14461        /// The Job succeeded.
14462        Succeeded,
14463        /// The Job failed.
14464        Failed,
14465        /// The Job was aborted.
14466        Aborted,
14467        /// The Job was skipped.
14468        Skipped,
14469        /// The Job was ignored.
14470        Ignored,
14471        /// If set, the enum was initialized with an unknown value.
14472        ///
14473        /// Applications can examine the value using [State::value] or
14474        /// [State::name].
14475        UnknownValue(state::UnknownValue),
14476    }
14477
14478    #[doc(hidden)]
14479    pub mod state {
14480        #[allow(unused_imports)]
14481        use super::*;
14482        #[derive(Clone, Debug, PartialEq)]
14483        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14484    }
14485
14486    impl State {
14487        /// Gets the enum value.
14488        ///
14489        /// Returns `None` if the enum contains an unknown value deserialized from
14490        /// the string representation of enums.
14491        pub fn value(&self) -> std::option::Option<i32> {
14492            match self {
14493                Self::Unspecified => std::option::Option::Some(0),
14494                Self::Pending => std::option::Option::Some(1),
14495                Self::Disabled => std::option::Option::Some(2),
14496                Self::InProgress => std::option::Option::Some(3),
14497                Self::Succeeded => std::option::Option::Some(4),
14498                Self::Failed => std::option::Option::Some(5),
14499                Self::Aborted => std::option::Option::Some(6),
14500                Self::Skipped => std::option::Option::Some(7),
14501                Self::Ignored => std::option::Option::Some(8),
14502                Self::UnknownValue(u) => u.0.value(),
14503            }
14504        }
14505
14506        /// Gets the enum value as a string.
14507        ///
14508        /// Returns `None` if the enum contains an unknown value deserialized from
14509        /// the integer representation of enums.
14510        pub fn name(&self) -> std::option::Option<&str> {
14511            match self {
14512                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14513                Self::Pending => std::option::Option::Some("PENDING"),
14514                Self::Disabled => std::option::Option::Some("DISABLED"),
14515                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
14516                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14517                Self::Failed => std::option::Option::Some("FAILED"),
14518                Self::Aborted => std::option::Option::Some("ABORTED"),
14519                Self::Skipped => std::option::Option::Some("SKIPPED"),
14520                Self::Ignored => std::option::Option::Some("IGNORED"),
14521                Self::UnknownValue(u) => u.0.name(),
14522            }
14523        }
14524    }
14525
14526    impl std::default::Default for State {
14527        fn default() -> Self {
14528            use std::convert::From;
14529            Self::from(0)
14530        }
14531    }
14532
14533    impl std::fmt::Display for State {
14534        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14535            wkt::internal::display_enum(f, self.name(), self.value())
14536        }
14537    }
14538
14539    impl std::convert::From<i32> for State {
14540        fn from(value: i32) -> Self {
14541            match value {
14542                0 => Self::Unspecified,
14543                1 => Self::Pending,
14544                2 => Self::Disabled,
14545                3 => Self::InProgress,
14546                4 => Self::Succeeded,
14547                5 => Self::Failed,
14548                6 => Self::Aborted,
14549                7 => Self::Skipped,
14550                8 => Self::Ignored,
14551                _ => Self::UnknownValue(state::UnknownValue(
14552                    wkt::internal::UnknownEnumValue::Integer(value),
14553                )),
14554            }
14555        }
14556    }
14557
14558    impl std::convert::From<&str> for State {
14559        fn from(value: &str) -> Self {
14560            use std::string::ToString;
14561            match value {
14562                "STATE_UNSPECIFIED" => Self::Unspecified,
14563                "PENDING" => Self::Pending,
14564                "DISABLED" => Self::Disabled,
14565                "IN_PROGRESS" => Self::InProgress,
14566                "SUCCEEDED" => Self::Succeeded,
14567                "FAILED" => Self::Failed,
14568                "ABORTED" => Self::Aborted,
14569                "SKIPPED" => Self::Skipped,
14570                "IGNORED" => Self::Ignored,
14571                _ => Self::UnknownValue(state::UnknownValue(
14572                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14573                )),
14574            }
14575        }
14576    }
14577
14578    impl serde::ser::Serialize for State {
14579        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14580        where
14581            S: serde::Serializer,
14582        {
14583            match self {
14584                Self::Unspecified => serializer.serialize_i32(0),
14585                Self::Pending => serializer.serialize_i32(1),
14586                Self::Disabled => serializer.serialize_i32(2),
14587                Self::InProgress => serializer.serialize_i32(3),
14588                Self::Succeeded => serializer.serialize_i32(4),
14589                Self::Failed => serializer.serialize_i32(5),
14590                Self::Aborted => serializer.serialize_i32(6),
14591                Self::Skipped => serializer.serialize_i32(7),
14592                Self::Ignored => serializer.serialize_i32(8),
14593                Self::UnknownValue(u) => u.0.serialize(serializer),
14594            }
14595        }
14596    }
14597
14598    impl<'de> serde::de::Deserialize<'de> for State {
14599        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14600        where
14601            D: serde::Deserializer<'de>,
14602        {
14603            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14604                ".google.cloud.deploy.v1.Job.State",
14605            ))
14606        }
14607    }
14608
14609    /// The type of Job.
14610    #[derive(Clone, Debug, PartialEq)]
14611    #[non_exhaustive]
14612    pub enum JobType {
14613        /// Output only. A deploy Job.
14614        DeployJob(std::boxed::Box<crate::model::DeployJob>),
14615        /// Output only. A verify Job.
14616        VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
14617        /// Output only. A predeploy Job.
14618        PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
14619        /// Output only. A postdeploy Job.
14620        PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
14621        /// Output only. A createChildRollout Job.
14622        CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
14623        /// Output only. An advanceChildRollout Job.
14624        AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
14625    }
14626}
14627
14628/// A deploy Job.
14629#[derive(Clone, Default, PartialEq)]
14630#[non_exhaustive]
14631pub struct DeployJob {
14632    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14633}
14634
14635impl DeployJob {
14636    /// Creates a new default instance.
14637    pub fn new() -> Self {
14638        std::default::Default::default()
14639    }
14640}
14641
14642impl wkt::message::Message for DeployJob {
14643    fn typename() -> &'static str {
14644        "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
14645    }
14646}
14647
14648/// A verify Job.
14649#[derive(Clone, Default, PartialEq)]
14650#[non_exhaustive]
14651pub struct VerifyJob {
14652    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14653}
14654
14655impl VerifyJob {
14656    /// Creates a new default instance.
14657    pub fn new() -> Self {
14658        std::default::Default::default()
14659    }
14660}
14661
14662impl wkt::message::Message for VerifyJob {
14663    fn typename() -> &'static str {
14664        "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
14665    }
14666}
14667
14668/// A predeploy Job.
14669#[derive(Clone, Default, PartialEq)]
14670#[non_exhaustive]
14671pub struct PredeployJob {
14672    /// Output only. The custom actions that the predeploy Job executes.
14673    pub actions: std::vec::Vec<std::string::String>,
14674
14675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14676}
14677
14678impl PredeployJob {
14679    /// Creates a new default instance.
14680    pub fn new() -> Self {
14681        std::default::Default::default()
14682    }
14683
14684    /// Sets the value of [actions][crate::model::PredeployJob::actions].
14685    ///
14686    /// # Example
14687    /// ```ignore,no_run
14688    /// # use google_cloud_deploy_v1::model::PredeployJob;
14689    /// let x = PredeployJob::new().set_actions(["a", "b", "c"]);
14690    /// ```
14691    pub fn set_actions<T, V>(mut self, v: T) -> Self
14692    where
14693        T: std::iter::IntoIterator<Item = V>,
14694        V: std::convert::Into<std::string::String>,
14695    {
14696        use std::iter::Iterator;
14697        self.actions = v.into_iter().map(|i| i.into()).collect();
14698        self
14699    }
14700}
14701
14702impl wkt::message::Message for PredeployJob {
14703    fn typename() -> &'static str {
14704        "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
14705    }
14706}
14707
14708/// A postdeploy Job.
14709#[derive(Clone, Default, PartialEq)]
14710#[non_exhaustive]
14711pub struct PostdeployJob {
14712    /// Output only. The custom actions that the postdeploy Job executes.
14713    pub actions: std::vec::Vec<std::string::String>,
14714
14715    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14716}
14717
14718impl PostdeployJob {
14719    /// Creates a new default instance.
14720    pub fn new() -> Self {
14721        std::default::Default::default()
14722    }
14723
14724    /// Sets the value of [actions][crate::model::PostdeployJob::actions].
14725    ///
14726    /// # Example
14727    /// ```ignore,no_run
14728    /// # use google_cloud_deploy_v1::model::PostdeployJob;
14729    /// let x = PostdeployJob::new().set_actions(["a", "b", "c"]);
14730    /// ```
14731    pub fn set_actions<T, V>(mut self, v: T) -> Self
14732    where
14733        T: std::iter::IntoIterator<Item = V>,
14734        V: std::convert::Into<std::string::String>,
14735    {
14736        use std::iter::Iterator;
14737        self.actions = v.into_iter().map(|i| i.into()).collect();
14738        self
14739    }
14740}
14741
14742impl wkt::message::Message for PostdeployJob {
14743    fn typename() -> &'static str {
14744        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
14745    }
14746}
14747
14748/// A createChildRollout Job.
14749#[derive(Clone, Default, PartialEq)]
14750#[non_exhaustive]
14751pub struct CreateChildRolloutJob {
14752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14753}
14754
14755impl CreateChildRolloutJob {
14756    /// Creates a new default instance.
14757    pub fn new() -> Self {
14758        std::default::Default::default()
14759    }
14760}
14761
14762impl wkt::message::Message for CreateChildRolloutJob {
14763    fn typename() -> &'static str {
14764        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
14765    }
14766}
14767
14768/// An advanceChildRollout Job.
14769#[derive(Clone, Default, PartialEq)]
14770#[non_exhaustive]
14771pub struct AdvanceChildRolloutJob {
14772    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14773}
14774
14775impl AdvanceChildRolloutJob {
14776    /// Creates a new default instance.
14777    pub fn new() -> Self {
14778        std::default::Default::default()
14779    }
14780}
14781
14782impl wkt::message::Message for AdvanceChildRolloutJob {
14783    fn typename() -> &'static str {
14784        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
14785    }
14786}
14787
14788/// ListRolloutsRequest is the request object used by `ListRollouts`.
14789#[derive(Clone, Default, PartialEq)]
14790#[non_exhaustive]
14791pub struct ListRolloutsRequest {
14792    /// Required. The `Release` which owns this collection of `Rollout` objects.
14793    pub parent: std::string::String,
14794
14795    /// Optional. The maximum number of `Rollout` objects to return. The service
14796    /// may return fewer than this value. If unspecified, at most 50 `Rollout`
14797    /// objects will be returned. The maximum value is 1000; values above 1000 will
14798    /// be set to 1000.
14799    pub page_size: i32,
14800
14801    /// Optional. A page token, received from a previous `ListRollouts` call.
14802    /// Provide this to retrieve the subsequent page.
14803    ///
14804    /// When paginating, all other provided parameters match
14805    /// the call that provided the page token.
14806    pub page_token: std::string::String,
14807
14808    /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
14809    /// for more details.
14810    pub filter: std::string::String,
14811
14812    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
14813    /// more details.
14814    pub order_by: std::string::String,
14815
14816    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14817}
14818
14819impl ListRolloutsRequest {
14820    /// Creates a new default instance.
14821    pub fn new() -> Self {
14822        std::default::Default::default()
14823    }
14824
14825    /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
14826    ///
14827    /// # Example
14828    /// ```ignore,no_run
14829    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14830    /// # let project_id = "project_id";
14831    /// # let location_id = "location_id";
14832    /// # let delivery_pipeline_id = "delivery_pipeline_id";
14833    /// # let release_id = "release_id";
14834    /// let x = ListRolloutsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
14835    /// ```
14836    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14837        self.parent = v.into();
14838        self
14839    }
14840
14841    /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
14842    ///
14843    /// # Example
14844    /// ```ignore,no_run
14845    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14846    /// let x = ListRolloutsRequest::new().set_page_size(42);
14847    /// ```
14848    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14849        self.page_size = v.into();
14850        self
14851    }
14852
14853    /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
14854    ///
14855    /// # Example
14856    /// ```ignore,no_run
14857    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14858    /// let x = ListRolloutsRequest::new().set_page_token("example");
14859    /// ```
14860    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14861        self.page_token = v.into();
14862        self
14863    }
14864
14865    /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
14866    ///
14867    /// # Example
14868    /// ```ignore,no_run
14869    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14870    /// let x = ListRolloutsRequest::new().set_filter("example");
14871    /// ```
14872    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14873        self.filter = v.into();
14874        self
14875    }
14876
14877    /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
14878    ///
14879    /// # Example
14880    /// ```ignore,no_run
14881    /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14882    /// let x = ListRolloutsRequest::new().set_order_by("example");
14883    /// ```
14884    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14885        self.order_by = v.into();
14886        self
14887    }
14888}
14889
14890impl wkt::message::Message for ListRolloutsRequest {
14891    fn typename() -> &'static str {
14892        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
14893    }
14894}
14895
14896/// ListRolloutsResponse is the response object returned by `ListRollouts`.
14897#[derive(Clone, Default, PartialEq)]
14898#[non_exhaustive]
14899pub struct ListRolloutsResponse {
14900    /// The `Rollout` objects.
14901    pub rollouts: std::vec::Vec<crate::model::Rollout>,
14902
14903    /// A token, which can be sent as `page_token` to retrieve the next page.
14904    /// If this field is omitted, there are no subsequent pages.
14905    pub next_page_token: std::string::String,
14906
14907    /// Locations that could not be reached.
14908    pub unreachable: std::vec::Vec<std::string::String>,
14909
14910    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14911}
14912
14913impl ListRolloutsResponse {
14914    /// Creates a new default instance.
14915    pub fn new() -> Self {
14916        std::default::Default::default()
14917    }
14918
14919    /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
14920    ///
14921    /// # Example
14922    /// ```ignore,no_run
14923    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14924    /// use google_cloud_deploy_v1::model::Rollout;
14925    /// let x = ListRolloutsResponse::new()
14926    ///     .set_rollouts([
14927    ///         Rollout::default()/* use setters */,
14928    ///         Rollout::default()/* use (different) setters */,
14929    ///     ]);
14930    /// ```
14931    pub fn set_rollouts<T, V>(mut self, v: T) -> Self
14932    where
14933        T: std::iter::IntoIterator<Item = V>,
14934        V: std::convert::Into<crate::model::Rollout>,
14935    {
14936        use std::iter::Iterator;
14937        self.rollouts = v.into_iter().map(|i| i.into()).collect();
14938        self
14939    }
14940
14941    /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
14942    ///
14943    /// # Example
14944    /// ```ignore,no_run
14945    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14946    /// let x = ListRolloutsResponse::new().set_next_page_token("example");
14947    /// ```
14948    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14949        self.next_page_token = v.into();
14950        self
14951    }
14952
14953    /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
14954    ///
14955    /// # Example
14956    /// ```ignore,no_run
14957    /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14958    /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
14959    /// ```
14960    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14961    where
14962        T: std::iter::IntoIterator<Item = V>,
14963        V: std::convert::Into<std::string::String>,
14964    {
14965        use std::iter::Iterator;
14966        self.unreachable = v.into_iter().map(|i| i.into()).collect();
14967        self
14968    }
14969}
14970
14971impl wkt::message::Message for ListRolloutsResponse {
14972    fn typename() -> &'static str {
14973        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
14974    }
14975}
14976
14977#[doc(hidden)]
14978impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
14979    type PageItem = crate::model::Rollout;
14980
14981    fn items(self) -> std::vec::Vec<Self::PageItem> {
14982        self.rollouts
14983    }
14984
14985    fn next_page_token(&self) -> std::string::String {
14986        use std::clone::Clone;
14987        self.next_page_token.clone()
14988    }
14989}
14990
14991/// GetRolloutRequest is the request object used by `GetRollout`.
14992#[derive(Clone, Default, PartialEq)]
14993#[non_exhaustive]
14994pub struct GetRolloutRequest {
14995    /// Required. Name of the `Rollout`. Format must be
14996    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
14997    pub name: std::string::String,
14998
14999    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15000}
15001
15002impl GetRolloutRequest {
15003    /// Creates a new default instance.
15004    pub fn new() -> Self {
15005        std::default::Default::default()
15006    }
15007
15008    /// Sets the value of [name][crate::model::GetRolloutRequest::name].
15009    ///
15010    /// # Example
15011    /// ```ignore,no_run
15012    /// # use google_cloud_deploy_v1::model::GetRolloutRequest;
15013    /// # let project_id = "project_id";
15014    /// # let location_id = "location_id";
15015    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15016    /// # let release_id = "release_id";
15017    /// # let rollout_id = "rollout_id";
15018    /// let x = GetRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15019    /// ```
15020    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15021        self.name = v.into();
15022        self
15023    }
15024}
15025
15026impl wkt::message::Message for GetRolloutRequest {
15027    fn typename() -> &'static str {
15028        "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
15029    }
15030}
15031
15032/// CreateRolloutRequest is the request object used by `CreateRollout`.
15033#[derive(Clone, Default, PartialEq)]
15034#[non_exhaustive]
15035pub struct CreateRolloutRequest {
15036    /// Required. The parent collection in which the `Rollout` must be created.
15037    /// The format is
15038    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
15039    pub parent: std::string::String,
15040
15041    /// Required. ID of the `Rollout`.
15042    pub rollout_id: std::string::String,
15043
15044    /// Required. The `Rollout` to create.
15045    pub rollout: std::option::Option<crate::model::Rollout>,
15046
15047    /// Optional. A request ID to identify requests. Specify a unique request ID
15048    /// so that if you must retry your request, the server knows to ignore the
15049    /// request if it has already been completed. The server guarantees that for
15050    /// at least 60 minutes after the first request.
15051    ///
15052    /// For example, consider a situation where you make an initial request and the
15053    /// request times out. If you make the request again with the same request ID,
15054    /// the server can check if original operation with the same request ID was
15055    /// received, and if so, will ignore the second request. This prevents clients
15056    /// from accidentally creating duplicate commitments.
15057    ///
15058    /// The request ID must be a valid UUID with the exception that zero UUID is
15059    /// not supported (00000000-0000-0000-0000-000000000000).
15060    pub request_id: std::string::String,
15061
15062    /// Optional. If set to true, the request is validated and the user is provided
15063    /// with an expected result, but no actual change is made.
15064    pub validate_only: bool,
15065
15066    /// Optional. Deploy policies to override. Format is
15067    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15068    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15069
15070    /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
15071    /// will start at the first phase.
15072    pub starting_phase_id: std::string::String,
15073
15074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15075}
15076
15077impl CreateRolloutRequest {
15078    /// Creates a new default instance.
15079    pub fn new() -> Self {
15080        std::default::Default::default()
15081    }
15082
15083    /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
15084    ///
15085    /// # Example
15086    /// ```ignore,no_run
15087    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15088    /// # let project_id = "project_id";
15089    /// # let location_id = "location_id";
15090    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15091    /// # let release_id = "release_id";
15092    /// let x = CreateRolloutRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
15093    /// ```
15094    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15095        self.parent = v.into();
15096        self
15097    }
15098
15099    /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
15100    ///
15101    /// # Example
15102    /// ```ignore,no_run
15103    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15104    /// let x = CreateRolloutRequest::new().set_rollout_id("example");
15105    /// ```
15106    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15107        self.rollout_id = v.into();
15108        self
15109    }
15110
15111    /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
15112    ///
15113    /// # Example
15114    /// ```ignore,no_run
15115    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15116    /// use google_cloud_deploy_v1::model::Rollout;
15117    /// let x = CreateRolloutRequest::new().set_rollout(Rollout::default()/* use setters */);
15118    /// ```
15119    pub fn set_rollout<T>(mut self, v: T) -> Self
15120    where
15121        T: std::convert::Into<crate::model::Rollout>,
15122    {
15123        self.rollout = std::option::Option::Some(v.into());
15124        self
15125    }
15126
15127    /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
15128    ///
15129    /// # Example
15130    /// ```ignore,no_run
15131    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15132    /// use google_cloud_deploy_v1::model::Rollout;
15133    /// let x = CreateRolloutRequest::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
15134    /// let x = CreateRolloutRequest::new().set_or_clear_rollout(None::<Rollout>);
15135    /// ```
15136    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
15137    where
15138        T: std::convert::Into<crate::model::Rollout>,
15139    {
15140        self.rollout = v.map(|x| x.into());
15141        self
15142    }
15143
15144    /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
15145    ///
15146    /// # Example
15147    /// ```ignore,no_run
15148    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15149    /// let x = CreateRolloutRequest::new().set_request_id("example");
15150    /// ```
15151    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15152        self.request_id = v.into();
15153        self
15154    }
15155
15156    /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
15157    ///
15158    /// # Example
15159    /// ```ignore,no_run
15160    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15161    /// let x = CreateRolloutRequest::new().set_validate_only(true);
15162    /// ```
15163    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15164        self.validate_only = v.into();
15165        self
15166    }
15167
15168    /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
15169    ///
15170    /// # Example
15171    /// ```ignore,no_run
15172    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15173    /// let x = CreateRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15174    /// ```
15175    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15176    where
15177        T: std::iter::IntoIterator<Item = V>,
15178        V: std::convert::Into<std::string::String>,
15179    {
15180        use std::iter::Iterator;
15181        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15182        self
15183    }
15184
15185    /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
15186    ///
15187    /// # Example
15188    /// ```ignore,no_run
15189    /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15190    /// let x = CreateRolloutRequest::new().set_starting_phase_id("example");
15191    /// ```
15192    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
15193        mut self,
15194        v: T,
15195    ) -> Self {
15196        self.starting_phase_id = v.into();
15197        self
15198    }
15199}
15200
15201impl wkt::message::Message for CreateRolloutRequest {
15202    fn typename() -> &'static str {
15203        "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
15204    }
15205}
15206
15207/// Represents the metadata of the long-running operation.
15208#[derive(Clone, Default, PartialEq)]
15209#[non_exhaustive]
15210pub struct OperationMetadata {
15211    /// Output only. The time the operation was created.
15212    pub create_time: std::option::Option<wkt::Timestamp>,
15213
15214    /// Output only. The time the operation finished running.
15215    pub end_time: std::option::Option<wkt::Timestamp>,
15216
15217    /// Output only. Server-defined resource path for the target of the operation.
15218    pub target: std::string::String,
15219
15220    /// Output only. Name of the verb executed by the operation.
15221    pub verb: std::string::String,
15222
15223    /// Output only. Human-readable status of the operation, if any.
15224    pub status_message: std::string::String,
15225
15226    /// Output only. Identifies whether the user has requested cancellation
15227    /// of the operation. Operations that have successfully been cancelled
15228    /// have
15229    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
15230    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
15231    /// corresponding to `Code.CANCELLED`.
15232    ///
15233    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
15234    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
15235    pub requested_cancellation: bool,
15236
15237    /// Output only. API version used to start the operation.
15238    pub api_version: std::string::String,
15239
15240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15241}
15242
15243impl OperationMetadata {
15244    /// Creates a new default instance.
15245    pub fn new() -> Self {
15246        std::default::Default::default()
15247    }
15248
15249    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
15250    ///
15251    /// # Example
15252    /// ```ignore,no_run
15253    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15254    /// use wkt::Timestamp;
15255    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15256    /// ```
15257    pub fn set_create_time<T>(mut self, v: T) -> Self
15258    where
15259        T: std::convert::Into<wkt::Timestamp>,
15260    {
15261        self.create_time = std::option::Option::Some(v.into());
15262        self
15263    }
15264
15265    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
15266    ///
15267    /// # Example
15268    /// ```ignore,no_run
15269    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15270    /// use wkt::Timestamp;
15271    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15272    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15273    /// ```
15274    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15275    where
15276        T: std::convert::Into<wkt::Timestamp>,
15277    {
15278        self.create_time = v.map(|x| x.into());
15279        self
15280    }
15281
15282    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
15283    ///
15284    /// # Example
15285    /// ```ignore,no_run
15286    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15287    /// use wkt::Timestamp;
15288    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15289    /// ```
15290    pub fn set_end_time<T>(mut self, v: T) -> Self
15291    where
15292        T: std::convert::Into<wkt::Timestamp>,
15293    {
15294        self.end_time = std::option::Option::Some(v.into());
15295        self
15296    }
15297
15298    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
15299    ///
15300    /// # Example
15301    /// ```ignore,no_run
15302    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15303    /// use wkt::Timestamp;
15304    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15305    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15306    /// ```
15307    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15308    where
15309        T: std::convert::Into<wkt::Timestamp>,
15310    {
15311        self.end_time = v.map(|x| x.into());
15312        self
15313    }
15314
15315    /// Sets the value of [target][crate::model::OperationMetadata::target].
15316    ///
15317    /// # Example
15318    /// ```ignore,no_run
15319    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15320    /// let x = OperationMetadata::new().set_target("example");
15321    /// ```
15322    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15323        self.target = v.into();
15324        self
15325    }
15326
15327    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
15328    ///
15329    /// # Example
15330    /// ```ignore,no_run
15331    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15332    /// let x = OperationMetadata::new().set_verb("example");
15333    /// ```
15334    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15335        self.verb = v.into();
15336        self
15337    }
15338
15339    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
15340    ///
15341    /// # Example
15342    /// ```ignore,no_run
15343    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15344    /// let x = OperationMetadata::new().set_status_message("example");
15345    /// ```
15346    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15347        self.status_message = v.into();
15348        self
15349    }
15350
15351    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
15352    ///
15353    /// # Example
15354    /// ```ignore,no_run
15355    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15356    /// let x = OperationMetadata::new().set_requested_cancellation(true);
15357    /// ```
15358    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15359        self.requested_cancellation = v.into();
15360        self
15361    }
15362
15363    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
15364    ///
15365    /// # Example
15366    /// ```ignore,no_run
15367    /// # use google_cloud_deploy_v1::model::OperationMetadata;
15368    /// let x = OperationMetadata::new().set_api_version("example");
15369    /// ```
15370    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15371        self.api_version = v.into();
15372        self
15373    }
15374}
15375
15376impl wkt::message::Message for OperationMetadata {
15377    fn typename() -> &'static str {
15378        "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
15379    }
15380}
15381
15382/// The request object used by `ApproveRollout`.
15383#[derive(Clone, Default, PartialEq)]
15384#[non_exhaustive]
15385pub struct ApproveRolloutRequest {
15386    /// Required. Name of the Rollout. Format is
15387    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15388    pub name: std::string::String,
15389
15390    /// Required. True = approve; false = reject
15391    pub approved: bool,
15392
15393    /// Optional. Deploy policies to override. Format is
15394    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15395    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15396
15397    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15398}
15399
15400impl ApproveRolloutRequest {
15401    /// Creates a new default instance.
15402    pub fn new() -> Self {
15403        std::default::Default::default()
15404    }
15405
15406    /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
15407    ///
15408    /// # Example
15409    /// ```ignore,no_run
15410    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15411    /// # let project_id = "project_id";
15412    /// # let location_id = "location_id";
15413    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15414    /// # let release_id = "release_id";
15415    /// # let rollout_id = "rollout_id";
15416    /// let x = ApproveRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15417    /// ```
15418    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15419        self.name = v.into();
15420        self
15421    }
15422
15423    /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
15424    ///
15425    /// # Example
15426    /// ```ignore,no_run
15427    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15428    /// let x = ApproveRolloutRequest::new().set_approved(true);
15429    /// ```
15430    pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15431        self.approved = v.into();
15432        self
15433    }
15434
15435    /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
15436    ///
15437    /// # Example
15438    /// ```ignore,no_run
15439    /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15440    /// let x = ApproveRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15441    /// ```
15442    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15443    where
15444        T: std::iter::IntoIterator<Item = V>,
15445        V: std::convert::Into<std::string::String>,
15446    {
15447        use std::iter::Iterator;
15448        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15449        self
15450    }
15451}
15452
15453impl wkt::message::Message for ApproveRolloutRequest {
15454    fn typename() -> &'static str {
15455        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
15456    }
15457}
15458
15459/// The response object from `ApproveRollout`.
15460#[derive(Clone, Default, PartialEq)]
15461#[non_exhaustive]
15462pub struct ApproveRolloutResponse {
15463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15464}
15465
15466impl ApproveRolloutResponse {
15467    /// Creates a new default instance.
15468    pub fn new() -> Self {
15469        std::default::Default::default()
15470    }
15471}
15472
15473impl wkt::message::Message for ApproveRolloutResponse {
15474    fn typename() -> &'static str {
15475        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
15476    }
15477}
15478
15479/// The request object used by `AdvanceRollout`.
15480#[derive(Clone, Default, PartialEq)]
15481#[non_exhaustive]
15482pub struct AdvanceRolloutRequest {
15483    /// Required. Name of the Rollout. Format is
15484    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15485    pub name: std::string::String,
15486
15487    /// Required. The phase ID to advance the `Rollout` to.
15488    pub phase_id: std::string::String,
15489
15490    /// Optional. Deploy policies to override. Format is
15491    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15492    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15493
15494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15495}
15496
15497impl AdvanceRolloutRequest {
15498    /// Creates a new default instance.
15499    pub fn new() -> Self {
15500        std::default::Default::default()
15501    }
15502
15503    /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
15504    ///
15505    /// # Example
15506    /// ```ignore,no_run
15507    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15508    /// # let project_id = "project_id";
15509    /// # let location_id = "location_id";
15510    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15511    /// # let release_id = "release_id";
15512    /// # let rollout_id = "rollout_id";
15513    /// let x = AdvanceRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15514    /// ```
15515    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15516        self.name = v.into();
15517        self
15518    }
15519
15520    /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
15521    ///
15522    /// # Example
15523    /// ```ignore,no_run
15524    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15525    /// let x = AdvanceRolloutRequest::new().set_phase_id("example");
15526    /// ```
15527    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15528        self.phase_id = v.into();
15529        self
15530    }
15531
15532    /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
15533    ///
15534    /// # Example
15535    /// ```ignore,no_run
15536    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15537    /// let x = AdvanceRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15538    /// ```
15539    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15540    where
15541        T: std::iter::IntoIterator<Item = V>,
15542        V: std::convert::Into<std::string::String>,
15543    {
15544        use std::iter::Iterator;
15545        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15546        self
15547    }
15548}
15549
15550impl wkt::message::Message for AdvanceRolloutRequest {
15551    fn typename() -> &'static str {
15552        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
15553    }
15554}
15555
15556/// The response object from `AdvanceRollout`.
15557#[derive(Clone, Default, PartialEq)]
15558#[non_exhaustive]
15559pub struct AdvanceRolloutResponse {
15560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15561}
15562
15563impl AdvanceRolloutResponse {
15564    /// Creates a new default instance.
15565    pub fn new() -> Self {
15566        std::default::Default::default()
15567    }
15568}
15569
15570impl wkt::message::Message for AdvanceRolloutResponse {
15571    fn typename() -> &'static str {
15572        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
15573    }
15574}
15575
15576/// The request object used by `CancelRollout`.
15577#[derive(Clone, Default, PartialEq)]
15578#[non_exhaustive]
15579pub struct CancelRolloutRequest {
15580    /// Required. Name of the Rollout. Format is
15581    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15582    pub name: std::string::String,
15583
15584    /// Optional. Deploy policies to override. Format is
15585    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15586    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15587
15588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15589}
15590
15591impl CancelRolloutRequest {
15592    /// Creates a new default instance.
15593    pub fn new() -> Self {
15594        std::default::Default::default()
15595    }
15596
15597    /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
15598    ///
15599    /// # Example
15600    /// ```ignore,no_run
15601    /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15602    /// # let project_id = "project_id";
15603    /// # let location_id = "location_id";
15604    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15605    /// # let release_id = "release_id";
15606    /// # let rollout_id = "rollout_id";
15607    /// let x = CancelRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15608    /// ```
15609    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15610        self.name = v.into();
15611        self
15612    }
15613
15614    /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
15615    ///
15616    /// # Example
15617    /// ```ignore,no_run
15618    /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15619    /// let x = CancelRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15620    /// ```
15621    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15622    where
15623        T: std::iter::IntoIterator<Item = V>,
15624        V: std::convert::Into<std::string::String>,
15625    {
15626        use std::iter::Iterator;
15627        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15628        self
15629    }
15630}
15631
15632impl wkt::message::Message for CancelRolloutRequest {
15633    fn typename() -> &'static str {
15634        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
15635    }
15636}
15637
15638/// The response object from `CancelRollout`.
15639#[derive(Clone, Default, PartialEq)]
15640#[non_exhaustive]
15641pub struct CancelRolloutResponse {
15642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15643}
15644
15645impl CancelRolloutResponse {
15646    /// Creates a new default instance.
15647    pub fn new() -> Self {
15648        std::default::Default::default()
15649    }
15650}
15651
15652impl wkt::message::Message for CancelRolloutResponse {
15653    fn typename() -> &'static str {
15654        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
15655    }
15656}
15657
15658/// The request object used by `IgnoreJob`.
15659#[derive(Clone, Default, PartialEq)]
15660#[non_exhaustive]
15661pub struct IgnoreJobRequest {
15662    /// Required. Name of the Rollout. Format is
15663    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15664    pub rollout: std::string::String,
15665
15666    /// Required. The phase ID the Job to ignore belongs to.
15667    pub phase_id: std::string::String,
15668
15669    /// Required. The job ID for the Job to ignore.
15670    pub job_id: std::string::String,
15671
15672    /// Optional. Deploy policies to override. Format is
15673    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15674    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15675
15676    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15677}
15678
15679impl IgnoreJobRequest {
15680    /// Creates a new default instance.
15681    pub fn new() -> Self {
15682        std::default::Default::default()
15683    }
15684
15685    /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
15686    ///
15687    /// # Example
15688    /// ```ignore,no_run
15689    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15690    /// # let project_id = "project_id";
15691    /// # let location_id = "location_id";
15692    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15693    /// # let release_id = "release_id";
15694    /// # let rollout_id = "rollout_id";
15695    /// let x = IgnoreJobRequest::new().set_rollout(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15696    /// ```
15697    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15698        self.rollout = v.into();
15699        self
15700    }
15701
15702    /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
15703    ///
15704    /// # Example
15705    /// ```ignore,no_run
15706    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15707    /// let x = IgnoreJobRequest::new().set_phase_id("example");
15708    /// ```
15709    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15710        self.phase_id = v.into();
15711        self
15712    }
15713
15714    /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
15715    ///
15716    /// # Example
15717    /// ```ignore,no_run
15718    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15719    /// let x = IgnoreJobRequest::new().set_job_id("example");
15720    /// ```
15721    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15722        self.job_id = v.into();
15723        self
15724    }
15725
15726    /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
15727    ///
15728    /// # Example
15729    /// ```ignore,no_run
15730    /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15731    /// let x = IgnoreJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15732    /// ```
15733    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15734    where
15735        T: std::iter::IntoIterator<Item = V>,
15736        V: std::convert::Into<std::string::String>,
15737    {
15738        use std::iter::Iterator;
15739        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15740        self
15741    }
15742}
15743
15744impl wkt::message::Message for IgnoreJobRequest {
15745    fn typename() -> &'static str {
15746        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
15747    }
15748}
15749
15750/// The response object from `IgnoreJob`.
15751#[derive(Clone, Default, PartialEq)]
15752#[non_exhaustive]
15753pub struct IgnoreJobResponse {
15754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15755}
15756
15757impl IgnoreJobResponse {
15758    /// Creates a new default instance.
15759    pub fn new() -> Self {
15760        std::default::Default::default()
15761    }
15762}
15763
15764impl wkt::message::Message for IgnoreJobResponse {
15765    fn typename() -> &'static str {
15766        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
15767    }
15768}
15769
15770/// RetryJobRequest is the request object used by `RetryJob`.
15771#[derive(Clone, Default, PartialEq)]
15772#[non_exhaustive]
15773pub struct RetryJobRequest {
15774    /// Required. Name of the Rollout. Format is
15775    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15776    pub rollout: std::string::String,
15777
15778    /// Required. The phase ID the Job to retry belongs to.
15779    pub phase_id: std::string::String,
15780
15781    /// Required. The job ID for the Job to retry.
15782    pub job_id: std::string::String,
15783
15784    /// Optional. Deploy policies to override. Format is
15785    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15786    pub override_deploy_policy: std::vec::Vec<std::string::String>,
15787
15788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15789}
15790
15791impl RetryJobRequest {
15792    /// Creates a new default instance.
15793    pub fn new() -> Self {
15794        std::default::Default::default()
15795    }
15796
15797    /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
15798    ///
15799    /// # Example
15800    /// ```ignore,no_run
15801    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15802    /// # let project_id = "project_id";
15803    /// # let location_id = "location_id";
15804    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15805    /// # let release_id = "release_id";
15806    /// # let rollout_id = "rollout_id";
15807    /// let x = RetryJobRequest::new().set_rollout(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15808    /// ```
15809    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15810        self.rollout = v.into();
15811        self
15812    }
15813
15814    /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
15815    ///
15816    /// # Example
15817    /// ```ignore,no_run
15818    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15819    /// let x = RetryJobRequest::new().set_phase_id("example");
15820    /// ```
15821    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15822        self.phase_id = v.into();
15823        self
15824    }
15825
15826    /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
15827    ///
15828    /// # Example
15829    /// ```ignore,no_run
15830    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15831    /// let x = RetryJobRequest::new().set_job_id("example");
15832    /// ```
15833    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15834        self.job_id = v.into();
15835        self
15836    }
15837
15838    /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
15839    ///
15840    /// # Example
15841    /// ```ignore,no_run
15842    /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15843    /// let x = RetryJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15844    /// ```
15845    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15846    where
15847        T: std::iter::IntoIterator<Item = V>,
15848        V: std::convert::Into<std::string::String>,
15849    {
15850        use std::iter::Iterator;
15851        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15852        self
15853    }
15854}
15855
15856impl wkt::message::Message for RetryJobRequest {
15857    fn typename() -> &'static str {
15858        "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
15859    }
15860}
15861
15862/// The response object from 'RetryJob'.
15863#[derive(Clone, Default, PartialEq)]
15864#[non_exhaustive]
15865pub struct RetryJobResponse {
15866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15867}
15868
15869impl RetryJobResponse {
15870    /// Creates a new default instance.
15871    pub fn new() -> Self {
15872        std::default::Default::default()
15873    }
15874}
15875
15876impl wkt::message::Message for RetryJobResponse {
15877    fn typename() -> &'static str {
15878        "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
15879    }
15880}
15881
15882/// The request object used by `AbandonRelease`.
15883#[derive(Clone, Default, PartialEq)]
15884#[non_exhaustive]
15885pub struct AbandonReleaseRequest {
15886    /// Required. Name of the Release. Format is
15887    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
15888    pub name: std::string::String,
15889
15890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15891}
15892
15893impl AbandonReleaseRequest {
15894    /// Creates a new default instance.
15895    pub fn new() -> Self {
15896        std::default::Default::default()
15897    }
15898
15899    /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
15900    ///
15901    /// # Example
15902    /// ```ignore,no_run
15903    /// # use google_cloud_deploy_v1::model::AbandonReleaseRequest;
15904    /// # let project_id = "project_id";
15905    /// # let location_id = "location_id";
15906    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15907    /// # let release_id = "release_id";
15908    /// let x = AbandonReleaseRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
15909    /// ```
15910    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15911        self.name = v.into();
15912        self
15913    }
15914}
15915
15916impl wkt::message::Message for AbandonReleaseRequest {
15917    fn typename() -> &'static str {
15918        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
15919    }
15920}
15921
15922/// The response object for `AbandonRelease`.
15923#[derive(Clone, Default, PartialEq)]
15924#[non_exhaustive]
15925pub struct AbandonReleaseResponse {
15926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15927}
15928
15929impl AbandonReleaseResponse {
15930    /// Creates a new default instance.
15931    pub fn new() -> Self {
15932        std::default::Default::default()
15933    }
15934}
15935
15936impl wkt::message::Message for AbandonReleaseResponse {
15937    fn typename() -> &'static str {
15938        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
15939    }
15940}
15941
15942/// A `JobRun` resource in the Cloud Deploy API.
15943///
15944/// A `JobRun` contains information of a single `Rollout` job evaluation.
15945#[derive(Clone, Default, PartialEq)]
15946#[non_exhaustive]
15947pub struct JobRun {
15948    /// Output only. Name of the `JobRun`. Format is
15949    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
15950    pub name: std::string::String,
15951
15952    /// Output only. Unique identifier of the `JobRun`.
15953    pub uid: std::string::String,
15954
15955    /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
15956    pub phase_id: std::string::String,
15957
15958    /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
15959    pub job_id: std::string::String,
15960
15961    /// Output only. Time at which the `JobRun` was created.
15962    pub create_time: std::option::Option<wkt::Timestamp>,
15963
15964    /// Output only. Time at which the `JobRun` was started.
15965    pub start_time: std::option::Option<wkt::Timestamp>,
15966
15967    /// Output only. Time at which the `JobRun` ended.
15968    pub end_time: std::option::Option<wkt::Timestamp>,
15969
15970    /// Output only. The current state of the `JobRun`.
15971    pub state: crate::model::job_run::State,
15972
15973    /// Output only. This checksum is computed by the server based on the value of
15974    /// other fields, and may be sent on update and delete requests to ensure the
15975    /// client has an up-to-date value before proceeding.
15976    pub etag: std::string::String,
15977
15978    /// The `JobRun` type and the information for that type.
15979    pub job_run: std::option::Option<crate::model::job_run::JobRun>,
15980
15981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15982}
15983
15984impl JobRun {
15985    /// Creates a new default instance.
15986    pub fn new() -> Self {
15987        std::default::Default::default()
15988    }
15989
15990    /// Sets the value of [name][crate::model::JobRun::name].
15991    ///
15992    /// # Example
15993    /// ```ignore,no_run
15994    /// # use google_cloud_deploy_v1::model::JobRun;
15995    /// # let project_id = "project_id";
15996    /// # let location_id = "location_id";
15997    /// # let delivery_pipeline_id = "delivery_pipeline_id";
15998    /// # let release_id = "release_id";
15999    /// # let rollout_id = "rollout_id";
16000    /// # let job_run_id = "job_run_id";
16001    /// let x = JobRun::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
16002    /// ```
16003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16004        self.name = v.into();
16005        self
16006    }
16007
16008    /// Sets the value of [uid][crate::model::JobRun::uid].
16009    ///
16010    /// # Example
16011    /// ```ignore,no_run
16012    /// # use google_cloud_deploy_v1::model::JobRun;
16013    /// let x = JobRun::new().set_uid("example");
16014    /// ```
16015    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16016        self.uid = v.into();
16017        self
16018    }
16019
16020    /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
16021    ///
16022    /// # Example
16023    /// ```ignore,no_run
16024    /// # use google_cloud_deploy_v1::model::JobRun;
16025    /// let x = JobRun::new().set_phase_id("example");
16026    /// ```
16027    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16028        self.phase_id = v.into();
16029        self
16030    }
16031
16032    /// Sets the value of [job_id][crate::model::JobRun::job_id].
16033    ///
16034    /// # Example
16035    /// ```ignore,no_run
16036    /// # use google_cloud_deploy_v1::model::JobRun;
16037    /// let x = JobRun::new().set_job_id("example");
16038    /// ```
16039    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16040        self.job_id = v.into();
16041        self
16042    }
16043
16044    /// Sets the value of [create_time][crate::model::JobRun::create_time].
16045    ///
16046    /// # Example
16047    /// ```ignore,no_run
16048    /// # use google_cloud_deploy_v1::model::JobRun;
16049    /// use wkt::Timestamp;
16050    /// let x = JobRun::new().set_create_time(Timestamp::default()/* use setters */);
16051    /// ```
16052    pub fn set_create_time<T>(mut self, v: T) -> Self
16053    where
16054        T: std::convert::Into<wkt::Timestamp>,
16055    {
16056        self.create_time = std::option::Option::Some(v.into());
16057        self
16058    }
16059
16060    /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
16061    ///
16062    /// # Example
16063    /// ```ignore,no_run
16064    /// # use google_cloud_deploy_v1::model::JobRun;
16065    /// use wkt::Timestamp;
16066    /// let x = JobRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16067    /// let x = JobRun::new().set_or_clear_create_time(None::<Timestamp>);
16068    /// ```
16069    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16070    where
16071        T: std::convert::Into<wkt::Timestamp>,
16072    {
16073        self.create_time = v.map(|x| x.into());
16074        self
16075    }
16076
16077    /// Sets the value of [start_time][crate::model::JobRun::start_time].
16078    ///
16079    /// # Example
16080    /// ```ignore,no_run
16081    /// # use google_cloud_deploy_v1::model::JobRun;
16082    /// use wkt::Timestamp;
16083    /// let x = JobRun::new().set_start_time(Timestamp::default()/* use setters */);
16084    /// ```
16085    pub fn set_start_time<T>(mut self, v: T) -> Self
16086    where
16087        T: std::convert::Into<wkt::Timestamp>,
16088    {
16089        self.start_time = std::option::Option::Some(v.into());
16090        self
16091    }
16092
16093    /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
16094    ///
16095    /// # Example
16096    /// ```ignore,no_run
16097    /// # use google_cloud_deploy_v1::model::JobRun;
16098    /// use wkt::Timestamp;
16099    /// let x = JobRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
16100    /// let x = JobRun::new().set_or_clear_start_time(None::<Timestamp>);
16101    /// ```
16102    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
16103    where
16104        T: std::convert::Into<wkt::Timestamp>,
16105    {
16106        self.start_time = v.map(|x| x.into());
16107        self
16108    }
16109
16110    /// Sets the value of [end_time][crate::model::JobRun::end_time].
16111    ///
16112    /// # Example
16113    /// ```ignore,no_run
16114    /// # use google_cloud_deploy_v1::model::JobRun;
16115    /// use wkt::Timestamp;
16116    /// let x = JobRun::new().set_end_time(Timestamp::default()/* use setters */);
16117    /// ```
16118    pub fn set_end_time<T>(mut self, v: T) -> Self
16119    where
16120        T: std::convert::Into<wkt::Timestamp>,
16121    {
16122        self.end_time = std::option::Option::Some(v.into());
16123        self
16124    }
16125
16126    /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
16127    ///
16128    /// # Example
16129    /// ```ignore,no_run
16130    /// # use google_cloud_deploy_v1::model::JobRun;
16131    /// use wkt::Timestamp;
16132    /// let x = JobRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16133    /// let x = JobRun::new().set_or_clear_end_time(None::<Timestamp>);
16134    /// ```
16135    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16136    where
16137        T: std::convert::Into<wkt::Timestamp>,
16138    {
16139        self.end_time = v.map(|x| x.into());
16140        self
16141    }
16142
16143    /// Sets the value of [state][crate::model::JobRun::state].
16144    ///
16145    /// # Example
16146    /// ```ignore,no_run
16147    /// # use google_cloud_deploy_v1::model::JobRun;
16148    /// use google_cloud_deploy_v1::model::job_run::State;
16149    /// let x0 = JobRun::new().set_state(State::InProgress);
16150    /// let x1 = JobRun::new().set_state(State::Succeeded);
16151    /// let x2 = JobRun::new().set_state(State::Failed);
16152    /// ```
16153    pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
16154        self.state = v.into();
16155        self
16156    }
16157
16158    /// Sets the value of [etag][crate::model::JobRun::etag].
16159    ///
16160    /// # Example
16161    /// ```ignore,no_run
16162    /// # use google_cloud_deploy_v1::model::JobRun;
16163    /// let x = JobRun::new().set_etag("example");
16164    /// ```
16165    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16166        self.etag = v.into();
16167        self
16168    }
16169
16170    /// Sets the value of [job_run][crate::model::JobRun::job_run].
16171    ///
16172    /// Note that all the setters affecting `job_run` are mutually
16173    /// exclusive.
16174    ///
16175    /// # Example
16176    /// ```ignore,no_run
16177    /// # use google_cloud_deploy_v1::model::JobRun;
16178    /// use google_cloud_deploy_v1::model::DeployJobRun;
16179    /// let x = JobRun::new().set_job_run(Some(
16180    ///     google_cloud_deploy_v1::model::job_run::JobRun::DeployJobRun(DeployJobRun::default().into())));
16181    /// ```
16182    pub fn set_job_run<
16183        T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
16184    >(
16185        mut self,
16186        v: T,
16187    ) -> Self {
16188        self.job_run = v.into();
16189        self
16190    }
16191
16192    /// The value of [job_run][crate::model::JobRun::job_run]
16193    /// if it holds a `DeployJobRun`, `None` if the field is not set or
16194    /// holds a different branch.
16195    pub fn deploy_job_run(
16196        &self,
16197    ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
16198        #[allow(unreachable_patterns)]
16199        self.job_run.as_ref().and_then(|v| match v {
16200            crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
16201            _ => std::option::Option::None,
16202        })
16203    }
16204
16205    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16206    /// to hold a `DeployJobRun`.
16207    ///
16208    /// Note that all the setters affecting `job_run` are
16209    /// mutually exclusive.
16210    ///
16211    /// # Example
16212    /// ```ignore,no_run
16213    /// # use google_cloud_deploy_v1::model::JobRun;
16214    /// use google_cloud_deploy_v1::model::DeployJobRun;
16215    /// let x = JobRun::new().set_deploy_job_run(DeployJobRun::default()/* use setters */);
16216    /// assert!(x.deploy_job_run().is_some());
16217    /// assert!(x.verify_job_run().is_none());
16218    /// assert!(x.predeploy_job_run().is_none());
16219    /// assert!(x.postdeploy_job_run().is_none());
16220    /// assert!(x.create_child_rollout_job_run().is_none());
16221    /// assert!(x.advance_child_rollout_job_run().is_none());
16222    /// ```
16223    pub fn set_deploy_job_run<
16224        T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
16225    >(
16226        mut self,
16227        v: T,
16228    ) -> Self {
16229        self.job_run =
16230            std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
16231        self
16232    }
16233
16234    /// The value of [job_run][crate::model::JobRun::job_run]
16235    /// if it holds a `VerifyJobRun`, `None` if the field is not set or
16236    /// holds a different branch.
16237    pub fn verify_job_run(
16238        &self,
16239    ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
16240        #[allow(unreachable_patterns)]
16241        self.job_run.as_ref().and_then(|v| match v {
16242            crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
16243            _ => std::option::Option::None,
16244        })
16245    }
16246
16247    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16248    /// to hold a `VerifyJobRun`.
16249    ///
16250    /// Note that all the setters affecting `job_run` are
16251    /// mutually exclusive.
16252    ///
16253    /// # Example
16254    /// ```ignore,no_run
16255    /// # use google_cloud_deploy_v1::model::JobRun;
16256    /// use google_cloud_deploy_v1::model::VerifyJobRun;
16257    /// let x = JobRun::new().set_verify_job_run(VerifyJobRun::default()/* use setters */);
16258    /// assert!(x.verify_job_run().is_some());
16259    /// assert!(x.deploy_job_run().is_none());
16260    /// assert!(x.predeploy_job_run().is_none());
16261    /// assert!(x.postdeploy_job_run().is_none());
16262    /// assert!(x.create_child_rollout_job_run().is_none());
16263    /// assert!(x.advance_child_rollout_job_run().is_none());
16264    /// ```
16265    pub fn set_verify_job_run<
16266        T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
16267    >(
16268        mut self,
16269        v: T,
16270    ) -> Self {
16271        self.job_run =
16272            std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
16273        self
16274    }
16275
16276    /// The value of [job_run][crate::model::JobRun::job_run]
16277    /// if it holds a `PredeployJobRun`, `None` if the field is not set or
16278    /// holds a different branch.
16279    pub fn predeploy_job_run(
16280        &self,
16281    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
16282        #[allow(unreachable_patterns)]
16283        self.job_run.as_ref().and_then(|v| match v {
16284            crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
16285            _ => std::option::Option::None,
16286        })
16287    }
16288
16289    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16290    /// to hold a `PredeployJobRun`.
16291    ///
16292    /// Note that all the setters affecting `job_run` are
16293    /// mutually exclusive.
16294    ///
16295    /// # Example
16296    /// ```ignore,no_run
16297    /// # use google_cloud_deploy_v1::model::JobRun;
16298    /// use google_cloud_deploy_v1::model::PredeployJobRun;
16299    /// let x = JobRun::new().set_predeploy_job_run(PredeployJobRun::default()/* use setters */);
16300    /// assert!(x.predeploy_job_run().is_some());
16301    /// assert!(x.deploy_job_run().is_none());
16302    /// assert!(x.verify_job_run().is_none());
16303    /// assert!(x.postdeploy_job_run().is_none());
16304    /// assert!(x.create_child_rollout_job_run().is_none());
16305    /// assert!(x.advance_child_rollout_job_run().is_none());
16306    /// ```
16307    pub fn set_predeploy_job_run<
16308        T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
16309    >(
16310        mut self,
16311        v: T,
16312    ) -> Self {
16313        self.job_run =
16314            std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
16315        self
16316    }
16317
16318    /// The value of [job_run][crate::model::JobRun::job_run]
16319    /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
16320    /// holds a different branch.
16321    pub fn postdeploy_job_run(
16322        &self,
16323    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
16324        #[allow(unreachable_patterns)]
16325        self.job_run.as_ref().and_then(|v| match v {
16326            crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
16327            _ => std::option::Option::None,
16328        })
16329    }
16330
16331    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16332    /// to hold a `PostdeployJobRun`.
16333    ///
16334    /// Note that all the setters affecting `job_run` are
16335    /// mutually exclusive.
16336    ///
16337    /// # Example
16338    /// ```ignore,no_run
16339    /// # use google_cloud_deploy_v1::model::JobRun;
16340    /// use google_cloud_deploy_v1::model::PostdeployJobRun;
16341    /// let x = JobRun::new().set_postdeploy_job_run(PostdeployJobRun::default()/* use setters */);
16342    /// assert!(x.postdeploy_job_run().is_some());
16343    /// assert!(x.deploy_job_run().is_none());
16344    /// assert!(x.verify_job_run().is_none());
16345    /// assert!(x.predeploy_job_run().is_none());
16346    /// assert!(x.create_child_rollout_job_run().is_none());
16347    /// assert!(x.advance_child_rollout_job_run().is_none());
16348    /// ```
16349    pub fn set_postdeploy_job_run<
16350        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
16351    >(
16352        mut self,
16353        v: T,
16354    ) -> Self {
16355        self.job_run =
16356            std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
16357        self
16358    }
16359
16360    /// The value of [job_run][crate::model::JobRun::job_run]
16361    /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
16362    /// holds a different branch.
16363    pub fn create_child_rollout_job_run(
16364        &self,
16365    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
16366        #[allow(unreachable_patterns)]
16367        self.job_run.as_ref().and_then(|v| match v {
16368            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
16369                std::option::Option::Some(v)
16370            }
16371            _ => std::option::Option::None,
16372        })
16373    }
16374
16375    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16376    /// to hold a `CreateChildRolloutJobRun`.
16377    ///
16378    /// Note that all the setters affecting `job_run` are
16379    /// mutually exclusive.
16380    ///
16381    /// # Example
16382    /// ```ignore,no_run
16383    /// # use google_cloud_deploy_v1::model::JobRun;
16384    /// use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
16385    /// let x = JobRun::new().set_create_child_rollout_job_run(CreateChildRolloutJobRun::default()/* use setters */);
16386    /// assert!(x.create_child_rollout_job_run().is_some());
16387    /// assert!(x.deploy_job_run().is_none());
16388    /// assert!(x.verify_job_run().is_none());
16389    /// assert!(x.predeploy_job_run().is_none());
16390    /// assert!(x.postdeploy_job_run().is_none());
16391    /// assert!(x.advance_child_rollout_job_run().is_none());
16392    /// ```
16393    pub fn set_create_child_rollout_job_run<
16394        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
16395    >(
16396        mut self,
16397        v: T,
16398    ) -> Self {
16399        self.job_run = std::option::Option::Some(
16400            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
16401        );
16402        self
16403    }
16404
16405    /// The value of [job_run][crate::model::JobRun::job_run]
16406    /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
16407    /// holds a different branch.
16408    pub fn advance_child_rollout_job_run(
16409        &self,
16410    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
16411        #[allow(unreachable_patterns)]
16412        self.job_run.as_ref().and_then(|v| match v {
16413            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
16414                std::option::Option::Some(v)
16415            }
16416            _ => std::option::Option::None,
16417        })
16418    }
16419
16420    /// Sets the value of [job_run][crate::model::JobRun::job_run]
16421    /// to hold a `AdvanceChildRolloutJobRun`.
16422    ///
16423    /// Note that all the setters affecting `job_run` are
16424    /// mutually exclusive.
16425    ///
16426    /// # Example
16427    /// ```ignore,no_run
16428    /// # use google_cloud_deploy_v1::model::JobRun;
16429    /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
16430    /// let x = JobRun::new().set_advance_child_rollout_job_run(AdvanceChildRolloutJobRun::default()/* use setters */);
16431    /// assert!(x.advance_child_rollout_job_run().is_some());
16432    /// assert!(x.deploy_job_run().is_none());
16433    /// assert!(x.verify_job_run().is_none());
16434    /// assert!(x.predeploy_job_run().is_none());
16435    /// assert!(x.postdeploy_job_run().is_none());
16436    /// assert!(x.create_child_rollout_job_run().is_none());
16437    /// ```
16438    pub fn set_advance_child_rollout_job_run<
16439        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
16440    >(
16441        mut self,
16442        v: T,
16443    ) -> Self {
16444        self.job_run = std::option::Option::Some(
16445            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
16446        );
16447        self
16448    }
16449}
16450
16451impl wkt::message::Message for JobRun {
16452    fn typename() -> &'static str {
16453        "type.googleapis.com/google.cloud.deploy.v1.JobRun"
16454    }
16455}
16456
16457/// Defines additional types related to [JobRun].
16458pub mod job_run {
16459    #[allow(unused_imports)]
16460    use super::*;
16461
16462    /// Valid states of a `JobRun`.
16463    ///
16464    /// # Working with unknown values
16465    ///
16466    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16467    /// additional enum variants at any time. Adding new variants is not considered
16468    /// a breaking change. Applications should write their code in anticipation of:
16469    ///
16470    /// - New values appearing in future releases of the client library, **and**
16471    /// - New values received dynamically, without application changes.
16472    ///
16473    /// Please consult the [Working with enums] section in the user guide for some
16474    /// guidelines.
16475    ///
16476    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16477    #[derive(Clone, Debug, PartialEq)]
16478    #[non_exhaustive]
16479    pub enum State {
16480        /// The `JobRun` has an unspecified state.
16481        Unspecified,
16482        /// The `JobRun` is in progress.
16483        InProgress,
16484        /// The `JobRun` has succeeded.
16485        Succeeded,
16486        /// The `JobRun` has failed.
16487        Failed,
16488        /// The `JobRun` is terminating.
16489        Terminating,
16490        /// The `JobRun` was terminated.
16491        Terminated,
16492        /// If set, the enum was initialized with an unknown value.
16493        ///
16494        /// Applications can examine the value using [State::value] or
16495        /// [State::name].
16496        UnknownValue(state::UnknownValue),
16497    }
16498
16499    #[doc(hidden)]
16500    pub mod state {
16501        #[allow(unused_imports)]
16502        use super::*;
16503        #[derive(Clone, Debug, PartialEq)]
16504        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16505    }
16506
16507    impl State {
16508        /// Gets the enum value.
16509        ///
16510        /// Returns `None` if the enum contains an unknown value deserialized from
16511        /// the string representation of enums.
16512        pub fn value(&self) -> std::option::Option<i32> {
16513            match self {
16514                Self::Unspecified => std::option::Option::Some(0),
16515                Self::InProgress => std::option::Option::Some(1),
16516                Self::Succeeded => std::option::Option::Some(2),
16517                Self::Failed => std::option::Option::Some(3),
16518                Self::Terminating => std::option::Option::Some(4),
16519                Self::Terminated => std::option::Option::Some(5),
16520                Self::UnknownValue(u) => u.0.value(),
16521            }
16522        }
16523
16524        /// Gets the enum value as a string.
16525        ///
16526        /// Returns `None` if the enum contains an unknown value deserialized from
16527        /// the integer representation of enums.
16528        pub fn name(&self) -> std::option::Option<&str> {
16529            match self {
16530                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16531                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16532                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16533                Self::Failed => std::option::Option::Some("FAILED"),
16534                Self::Terminating => std::option::Option::Some("TERMINATING"),
16535                Self::Terminated => std::option::Option::Some("TERMINATED"),
16536                Self::UnknownValue(u) => u.0.name(),
16537            }
16538        }
16539    }
16540
16541    impl std::default::Default for State {
16542        fn default() -> Self {
16543            use std::convert::From;
16544            Self::from(0)
16545        }
16546    }
16547
16548    impl std::fmt::Display for State {
16549        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16550            wkt::internal::display_enum(f, self.name(), self.value())
16551        }
16552    }
16553
16554    impl std::convert::From<i32> for State {
16555        fn from(value: i32) -> Self {
16556            match value {
16557                0 => Self::Unspecified,
16558                1 => Self::InProgress,
16559                2 => Self::Succeeded,
16560                3 => Self::Failed,
16561                4 => Self::Terminating,
16562                5 => Self::Terminated,
16563                _ => Self::UnknownValue(state::UnknownValue(
16564                    wkt::internal::UnknownEnumValue::Integer(value),
16565                )),
16566            }
16567        }
16568    }
16569
16570    impl std::convert::From<&str> for State {
16571        fn from(value: &str) -> Self {
16572            use std::string::ToString;
16573            match value {
16574                "STATE_UNSPECIFIED" => Self::Unspecified,
16575                "IN_PROGRESS" => Self::InProgress,
16576                "SUCCEEDED" => Self::Succeeded,
16577                "FAILED" => Self::Failed,
16578                "TERMINATING" => Self::Terminating,
16579                "TERMINATED" => Self::Terminated,
16580                _ => Self::UnknownValue(state::UnknownValue(
16581                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16582                )),
16583            }
16584        }
16585    }
16586
16587    impl serde::ser::Serialize for State {
16588        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16589        where
16590            S: serde::Serializer,
16591        {
16592            match self {
16593                Self::Unspecified => serializer.serialize_i32(0),
16594                Self::InProgress => serializer.serialize_i32(1),
16595                Self::Succeeded => serializer.serialize_i32(2),
16596                Self::Failed => serializer.serialize_i32(3),
16597                Self::Terminating => serializer.serialize_i32(4),
16598                Self::Terminated => serializer.serialize_i32(5),
16599                Self::UnknownValue(u) => u.0.serialize(serializer),
16600            }
16601        }
16602    }
16603
16604    impl<'de> serde::de::Deserialize<'de> for State {
16605        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16606        where
16607            D: serde::Deserializer<'de>,
16608        {
16609            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16610                ".google.cloud.deploy.v1.JobRun.State",
16611            ))
16612        }
16613    }
16614
16615    /// The `JobRun` type and the information for that type.
16616    #[derive(Clone, Debug, PartialEq)]
16617    #[non_exhaustive]
16618    pub enum JobRun {
16619        /// Output only. Information specific to a deploy `JobRun`.
16620        DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
16621        /// Output only. Information specific to a verify `JobRun`.
16622        VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
16623        /// Output only. Information specific to a predeploy `JobRun`.
16624        PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
16625        /// Output only. Information specific to a postdeploy `JobRun`.
16626        PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
16627        /// Output only. Information specific to a createChildRollout `JobRun`.
16628        CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
16629        /// Output only. Information specific to an advanceChildRollout `JobRun`
16630        AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
16631    }
16632}
16633
16634/// DeployJobRun contains information specific to a deploy `JobRun`.
16635#[derive(Clone, Default, PartialEq)]
16636#[non_exhaustive]
16637pub struct DeployJobRun {
16638    /// Output only. The resource name of the Cloud Build `Build` object that is
16639    /// used to deploy. Format is
16640    /// `projects/{project}/locations/{location}/builds/{build}`.
16641    pub build: std::string::String,
16642
16643    /// Output only. The reason the deploy failed. This will always be unspecified
16644    /// while the deploy is in progress or if it succeeded.
16645    pub failure_cause: crate::model::deploy_job_run::FailureCause,
16646
16647    /// Output only. Additional information about the deploy failure, if available.
16648    pub failure_message: std::string::String,
16649
16650    /// Output only. Metadata containing information about the deploy job run.
16651    pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
16652
16653    /// Output only. The artifact of a deploy job run, if available.
16654    pub artifact: std::option::Option<crate::model::DeployArtifact>,
16655
16656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16657}
16658
16659impl DeployJobRun {
16660    /// Creates a new default instance.
16661    pub fn new() -> Self {
16662        std::default::Default::default()
16663    }
16664
16665    /// Sets the value of [build][crate::model::DeployJobRun::build].
16666    ///
16667    /// # Example
16668    /// ```ignore,no_run
16669    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16670    /// let x = DeployJobRun::new().set_build("example");
16671    /// ```
16672    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16673        self.build = v.into();
16674        self
16675    }
16676
16677    /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
16678    ///
16679    /// # Example
16680    /// ```ignore,no_run
16681    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16682    /// use google_cloud_deploy_v1::model::deploy_job_run::FailureCause;
16683    /// let x0 = DeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16684    /// let x1 = DeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16685    /// let x2 = DeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16686    /// ```
16687    pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
16688        mut self,
16689        v: T,
16690    ) -> Self {
16691        self.failure_cause = v.into();
16692        self
16693    }
16694
16695    /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
16696    ///
16697    /// # Example
16698    /// ```ignore,no_run
16699    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16700    /// let x = DeployJobRun::new().set_failure_message("example");
16701    /// ```
16702    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16703        self.failure_message = v.into();
16704        self
16705    }
16706
16707    /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
16708    ///
16709    /// # Example
16710    /// ```ignore,no_run
16711    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16712    /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16713    /// let x = DeployJobRun::new().set_metadata(DeployJobRunMetadata::default()/* use setters */);
16714    /// ```
16715    pub fn set_metadata<T>(mut self, v: T) -> Self
16716    where
16717        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16718    {
16719        self.metadata = std::option::Option::Some(v.into());
16720        self
16721    }
16722
16723    /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
16724    ///
16725    /// # Example
16726    /// ```ignore,no_run
16727    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16728    /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16729    /// let x = DeployJobRun::new().set_or_clear_metadata(Some(DeployJobRunMetadata::default()/* use setters */));
16730    /// let x = DeployJobRun::new().set_or_clear_metadata(None::<DeployJobRunMetadata>);
16731    /// ```
16732    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16733    where
16734        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16735    {
16736        self.metadata = v.map(|x| x.into());
16737        self
16738    }
16739
16740    /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
16741    ///
16742    /// # Example
16743    /// ```ignore,no_run
16744    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16745    /// use google_cloud_deploy_v1::model::DeployArtifact;
16746    /// let x = DeployJobRun::new().set_artifact(DeployArtifact::default()/* use setters */);
16747    /// ```
16748    pub fn set_artifact<T>(mut self, v: T) -> Self
16749    where
16750        T: std::convert::Into<crate::model::DeployArtifact>,
16751    {
16752        self.artifact = std::option::Option::Some(v.into());
16753        self
16754    }
16755
16756    /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
16757    ///
16758    /// # Example
16759    /// ```ignore,no_run
16760    /// # use google_cloud_deploy_v1::model::DeployJobRun;
16761    /// use google_cloud_deploy_v1::model::DeployArtifact;
16762    /// let x = DeployJobRun::new().set_or_clear_artifact(Some(DeployArtifact::default()/* use setters */));
16763    /// let x = DeployJobRun::new().set_or_clear_artifact(None::<DeployArtifact>);
16764    /// ```
16765    pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
16766    where
16767        T: std::convert::Into<crate::model::DeployArtifact>,
16768    {
16769        self.artifact = v.map(|x| x.into());
16770        self
16771    }
16772}
16773
16774impl wkt::message::Message for DeployJobRun {
16775    fn typename() -> &'static str {
16776        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
16777    }
16778}
16779
16780/// Defines additional types related to [DeployJobRun].
16781pub mod deploy_job_run {
16782    #[allow(unused_imports)]
16783    use super::*;
16784
16785    /// Well-known deploy failures.
16786    ///
16787    /// # Working with unknown values
16788    ///
16789    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16790    /// additional enum variants at any time. Adding new variants is not considered
16791    /// a breaking change. Applications should write their code in anticipation of:
16792    ///
16793    /// - New values appearing in future releases of the client library, **and**
16794    /// - New values received dynamically, without application changes.
16795    ///
16796    /// Please consult the [Working with enums] section in the user guide for some
16797    /// guidelines.
16798    ///
16799    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16800    #[derive(Clone, Debug, PartialEq)]
16801    #[non_exhaustive]
16802    pub enum FailureCause {
16803        /// No reason for failure is specified.
16804        Unspecified,
16805        /// Cloud Build is not available, either because it is not enabled or because
16806        /// Cloud Deploy has insufficient permissions. See [Required
16807        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16808        CloudBuildUnavailable,
16809        /// The deploy operation did not complete successfully; check Cloud Build
16810        /// logs.
16811        ExecutionFailed,
16812        /// The deploy job run did not complete within the allotted time.
16813        DeadlineExceeded,
16814        /// There were missing resources in the runtime environment required for a
16815        /// canary deployment. Check the Cloud Build logs for more information.
16816        MissingResourcesForCanary,
16817        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16818        /// for additional details.
16819        CloudBuildRequestFailed,
16820        /// The deploy operation had a feature configured that is not supported.
16821        DeployFeatureNotSupported,
16822        /// If set, the enum was initialized with an unknown value.
16823        ///
16824        /// Applications can examine the value using [FailureCause::value] or
16825        /// [FailureCause::name].
16826        UnknownValue(failure_cause::UnknownValue),
16827    }
16828
16829    #[doc(hidden)]
16830    pub mod failure_cause {
16831        #[allow(unused_imports)]
16832        use super::*;
16833        #[derive(Clone, Debug, PartialEq)]
16834        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16835    }
16836
16837    impl FailureCause {
16838        /// Gets the enum value.
16839        ///
16840        /// Returns `None` if the enum contains an unknown value deserialized from
16841        /// the string representation of enums.
16842        pub fn value(&self) -> std::option::Option<i32> {
16843            match self {
16844                Self::Unspecified => std::option::Option::Some(0),
16845                Self::CloudBuildUnavailable => std::option::Option::Some(1),
16846                Self::ExecutionFailed => std::option::Option::Some(2),
16847                Self::DeadlineExceeded => std::option::Option::Some(3),
16848                Self::MissingResourcesForCanary => std::option::Option::Some(4),
16849                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16850                Self::DeployFeatureNotSupported => std::option::Option::Some(6),
16851                Self::UnknownValue(u) => u.0.value(),
16852            }
16853        }
16854
16855        /// Gets the enum value as a string.
16856        ///
16857        /// Returns `None` if the enum contains an unknown value deserialized from
16858        /// the integer representation of enums.
16859        pub fn name(&self) -> std::option::Option<&str> {
16860            match self {
16861                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16862                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16863                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16864                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16865                Self::MissingResourcesForCanary => {
16866                    std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
16867                }
16868                Self::CloudBuildRequestFailed => {
16869                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16870                }
16871                Self::DeployFeatureNotSupported => {
16872                    std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
16873                }
16874                Self::UnknownValue(u) => u.0.name(),
16875            }
16876        }
16877    }
16878
16879    impl std::default::Default for FailureCause {
16880        fn default() -> Self {
16881            use std::convert::From;
16882            Self::from(0)
16883        }
16884    }
16885
16886    impl std::fmt::Display for FailureCause {
16887        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16888            wkt::internal::display_enum(f, self.name(), self.value())
16889        }
16890    }
16891
16892    impl std::convert::From<i32> for FailureCause {
16893        fn from(value: i32) -> Self {
16894            match value {
16895                0 => Self::Unspecified,
16896                1 => Self::CloudBuildUnavailable,
16897                2 => Self::ExecutionFailed,
16898                3 => Self::DeadlineExceeded,
16899                4 => Self::MissingResourcesForCanary,
16900                5 => Self::CloudBuildRequestFailed,
16901                6 => Self::DeployFeatureNotSupported,
16902                _ => Self::UnknownValue(failure_cause::UnknownValue(
16903                    wkt::internal::UnknownEnumValue::Integer(value),
16904                )),
16905            }
16906        }
16907    }
16908
16909    impl std::convert::From<&str> for FailureCause {
16910        fn from(value: &str) -> Self {
16911            use std::string::ToString;
16912            match value {
16913                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16914                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16915                "EXECUTION_FAILED" => Self::ExecutionFailed,
16916                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16917                "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
16918                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16919                "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
16920                _ => Self::UnknownValue(failure_cause::UnknownValue(
16921                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16922                )),
16923            }
16924        }
16925    }
16926
16927    impl serde::ser::Serialize for FailureCause {
16928        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16929        where
16930            S: serde::Serializer,
16931        {
16932            match self {
16933                Self::Unspecified => serializer.serialize_i32(0),
16934                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16935                Self::ExecutionFailed => serializer.serialize_i32(2),
16936                Self::DeadlineExceeded => serializer.serialize_i32(3),
16937                Self::MissingResourcesForCanary => serializer.serialize_i32(4),
16938                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16939                Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
16940                Self::UnknownValue(u) => u.0.serialize(serializer),
16941            }
16942        }
16943    }
16944
16945    impl<'de> serde::de::Deserialize<'de> for FailureCause {
16946        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16947        where
16948            D: serde::Deserializer<'de>,
16949        {
16950            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16951                ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
16952            ))
16953        }
16954    }
16955}
16956
16957/// VerifyJobRun contains information specific to a verify `JobRun`.
16958#[derive(Clone, Default, PartialEq)]
16959#[non_exhaustive]
16960pub struct VerifyJobRun {
16961    /// Output only. The resource name of the Cloud Build `Build` object that is
16962    /// used to verify. Format is
16963    /// `projects/{project}/locations/{location}/builds/{build}`.
16964    pub build: std::string::String,
16965
16966    /// Output only. URI of a directory containing the verify artifacts. This
16967    /// contains the Skaffold event log.
16968    pub artifact_uri: std::string::String,
16969
16970    /// Output only. File path of the Skaffold event log relative to the artifact
16971    /// URI.
16972    pub event_log_path: std::string::String,
16973
16974    /// Output only. The reason the verify failed. This will always be unspecified
16975    /// while the verify is in progress or if it succeeded.
16976    pub failure_cause: crate::model::verify_job_run::FailureCause,
16977
16978    /// Output only. Additional information about the verify failure, if available.
16979    pub failure_message: std::string::String,
16980
16981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16982}
16983
16984impl VerifyJobRun {
16985    /// Creates a new default instance.
16986    pub fn new() -> Self {
16987        std::default::Default::default()
16988    }
16989
16990    /// Sets the value of [build][crate::model::VerifyJobRun::build].
16991    ///
16992    /// # Example
16993    /// ```ignore,no_run
16994    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16995    /// let x = VerifyJobRun::new().set_build("example");
16996    /// ```
16997    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16998        self.build = v.into();
16999        self
17000    }
17001
17002    /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
17003    ///
17004    /// # Example
17005    /// ```ignore,no_run
17006    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17007    /// let x = VerifyJobRun::new().set_artifact_uri("example");
17008    /// ```
17009    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17010        self.artifact_uri = v.into();
17011        self
17012    }
17013
17014    /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
17015    ///
17016    /// # Example
17017    /// ```ignore,no_run
17018    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17019    /// let x = VerifyJobRun::new().set_event_log_path("example");
17020    /// ```
17021    pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17022        self.event_log_path = v.into();
17023        self
17024    }
17025
17026    /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
17027    ///
17028    /// # Example
17029    /// ```ignore,no_run
17030    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17031    /// use google_cloud_deploy_v1::model::verify_job_run::FailureCause;
17032    /// let x0 = VerifyJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17033    /// let x1 = VerifyJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17034    /// let x2 = VerifyJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17035    /// ```
17036    pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
17037        mut self,
17038        v: T,
17039    ) -> Self {
17040        self.failure_cause = v.into();
17041        self
17042    }
17043
17044    /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
17045    ///
17046    /// # Example
17047    /// ```ignore,no_run
17048    /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17049    /// let x = VerifyJobRun::new().set_failure_message("example");
17050    /// ```
17051    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17052        self.failure_message = v.into();
17053        self
17054    }
17055}
17056
17057impl wkt::message::Message for VerifyJobRun {
17058    fn typename() -> &'static str {
17059        "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
17060    }
17061}
17062
17063/// Defines additional types related to [VerifyJobRun].
17064pub mod verify_job_run {
17065    #[allow(unused_imports)]
17066    use super::*;
17067
17068    /// Well-known verify failures.
17069    ///
17070    /// # Working with unknown values
17071    ///
17072    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17073    /// additional enum variants at any time. Adding new variants is not considered
17074    /// a breaking change. Applications should write their code in anticipation of:
17075    ///
17076    /// - New values appearing in future releases of the client library, **and**
17077    /// - New values received dynamically, without application changes.
17078    ///
17079    /// Please consult the [Working with enums] section in the user guide for some
17080    /// guidelines.
17081    ///
17082    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17083    #[derive(Clone, Debug, PartialEq)]
17084    #[non_exhaustive]
17085    pub enum FailureCause {
17086        /// No reason for failure is specified.
17087        Unspecified,
17088        /// Cloud Build is not available, either because it is not enabled or because
17089        /// Cloud Deploy has insufficient permissions. See [required
17090        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17091        CloudBuildUnavailable,
17092        /// The verify operation did not complete successfully; check Cloud Build
17093        /// logs.
17094        ExecutionFailed,
17095        /// The verify job run did not complete within the allotted time.
17096        DeadlineExceeded,
17097        /// No Skaffold verify configuration was found.
17098        VerificationConfigNotFound,
17099        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17100        /// for additional details.
17101        CloudBuildRequestFailed,
17102        /// If set, the enum was initialized with an unknown value.
17103        ///
17104        /// Applications can examine the value using [FailureCause::value] or
17105        /// [FailureCause::name].
17106        UnknownValue(failure_cause::UnknownValue),
17107    }
17108
17109    #[doc(hidden)]
17110    pub mod failure_cause {
17111        #[allow(unused_imports)]
17112        use super::*;
17113        #[derive(Clone, Debug, PartialEq)]
17114        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17115    }
17116
17117    impl FailureCause {
17118        /// Gets the enum value.
17119        ///
17120        /// Returns `None` if the enum contains an unknown value deserialized from
17121        /// the string representation of enums.
17122        pub fn value(&self) -> std::option::Option<i32> {
17123            match self {
17124                Self::Unspecified => std::option::Option::Some(0),
17125                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17126                Self::ExecutionFailed => std::option::Option::Some(2),
17127                Self::DeadlineExceeded => std::option::Option::Some(3),
17128                Self::VerificationConfigNotFound => std::option::Option::Some(4),
17129                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
17130                Self::UnknownValue(u) => u.0.value(),
17131            }
17132        }
17133
17134        /// Gets the enum value as a string.
17135        ///
17136        /// Returns `None` if the enum contains an unknown value deserialized from
17137        /// the integer representation of enums.
17138        pub fn name(&self) -> std::option::Option<&str> {
17139            match self {
17140                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17141                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17142                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17143                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17144                Self::VerificationConfigNotFound => {
17145                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
17146                }
17147                Self::CloudBuildRequestFailed => {
17148                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17149                }
17150                Self::UnknownValue(u) => u.0.name(),
17151            }
17152        }
17153    }
17154
17155    impl std::default::Default for FailureCause {
17156        fn default() -> Self {
17157            use std::convert::From;
17158            Self::from(0)
17159        }
17160    }
17161
17162    impl std::fmt::Display for FailureCause {
17163        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17164            wkt::internal::display_enum(f, self.name(), self.value())
17165        }
17166    }
17167
17168    impl std::convert::From<i32> for FailureCause {
17169        fn from(value: i32) -> Self {
17170            match value {
17171                0 => Self::Unspecified,
17172                1 => Self::CloudBuildUnavailable,
17173                2 => Self::ExecutionFailed,
17174                3 => Self::DeadlineExceeded,
17175                4 => Self::VerificationConfigNotFound,
17176                5 => Self::CloudBuildRequestFailed,
17177                _ => Self::UnknownValue(failure_cause::UnknownValue(
17178                    wkt::internal::UnknownEnumValue::Integer(value),
17179                )),
17180            }
17181        }
17182    }
17183
17184    impl std::convert::From<&str> for FailureCause {
17185        fn from(value: &str) -> Self {
17186            use std::string::ToString;
17187            match value {
17188                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17189                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17190                "EXECUTION_FAILED" => Self::ExecutionFailed,
17191                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17192                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
17193                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17194                _ => Self::UnknownValue(failure_cause::UnknownValue(
17195                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17196                )),
17197            }
17198        }
17199    }
17200
17201    impl serde::ser::Serialize for FailureCause {
17202        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17203        where
17204            S: serde::Serializer,
17205        {
17206            match self {
17207                Self::Unspecified => serializer.serialize_i32(0),
17208                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17209                Self::ExecutionFailed => serializer.serialize_i32(2),
17210                Self::DeadlineExceeded => serializer.serialize_i32(3),
17211                Self::VerificationConfigNotFound => serializer.serialize_i32(4),
17212                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
17213                Self::UnknownValue(u) => u.0.serialize(serializer),
17214            }
17215        }
17216    }
17217
17218    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17219        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17220        where
17221            D: serde::Deserializer<'de>,
17222        {
17223            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17224                ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
17225            ))
17226        }
17227    }
17228}
17229
17230/// PredeployJobRun contains information specific to a predeploy `JobRun`.
17231#[derive(Clone, Default, PartialEq)]
17232#[non_exhaustive]
17233pub struct PredeployJobRun {
17234    /// Output only. The resource name of the Cloud Build `Build` object that is
17235    /// used to execute the custom actions associated with the predeploy Job.
17236    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17237    pub build: std::string::String,
17238
17239    /// Output only. The reason the predeploy failed. This will always be
17240    /// unspecified while the predeploy is in progress or if it succeeded.
17241    pub failure_cause: crate::model::predeploy_job_run::FailureCause,
17242
17243    /// Output only. Additional information about the predeploy failure, if
17244    /// available.
17245    pub failure_message: std::string::String,
17246
17247    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17248}
17249
17250impl PredeployJobRun {
17251    /// Creates a new default instance.
17252    pub fn new() -> Self {
17253        std::default::Default::default()
17254    }
17255
17256    /// Sets the value of [build][crate::model::PredeployJobRun::build].
17257    ///
17258    /// # Example
17259    /// ```ignore,no_run
17260    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17261    /// let x = PredeployJobRun::new().set_build("example");
17262    /// ```
17263    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17264        self.build = v.into();
17265        self
17266    }
17267
17268    /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
17269    ///
17270    /// # Example
17271    /// ```ignore,no_run
17272    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17273    /// use google_cloud_deploy_v1::model::predeploy_job_run::FailureCause;
17274    /// let x0 = PredeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17275    /// let x1 = PredeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17276    /// let x2 = PredeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17277    /// ```
17278    pub fn set_failure_cause<
17279        T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
17280    >(
17281        mut self,
17282        v: T,
17283    ) -> Self {
17284        self.failure_cause = v.into();
17285        self
17286    }
17287
17288    /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
17289    ///
17290    /// # Example
17291    /// ```ignore,no_run
17292    /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17293    /// let x = PredeployJobRun::new().set_failure_message("example");
17294    /// ```
17295    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17296        self.failure_message = v.into();
17297        self
17298    }
17299}
17300
17301impl wkt::message::Message for PredeployJobRun {
17302    fn typename() -> &'static str {
17303        "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
17304    }
17305}
17306
17307/// Defines additional types related to [PredeployJobRun].
17308pub mod predeploy_job_run {
17309    #[allow(unused_imports)]
17310    use super::*;
17311
17312    /// Well-known predeploy failures.
17313    ///
17314    /// # Working with unknown values
17315    ///
17316    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17317    /// additional enum variants at any time. Adding new variants is not considered
17318    /// a breaking change. Applications should write their code in anticipation of:
17319    ///
17320    /// - New values appearing in future releases of the client library, **and**
17321    /// - New values received dynamically, without application changes.
17322    ///
17323    /// Please consult the [Working with enums] section in the user guide for some
17324    /// guidelines.
17325    ///
17326    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17327    #[derive(Clone, Debug, PartialEq)]
17328    #[non_exhaustive]
17329    pub enum FailureCause {
17330        /// No reason for failure is specified.
17331        Unspecified,
17332        /// Cloud Build is not available, either because it is not enabled or because
17333        /// Cloud Deploy has insufficient permissions. See [required
17334        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17335        CloudBuildUnavailable,
17336        /// The predeploy operation did not complete successfully; check Cloud Build
17337        /// logs.
17338        ExecutionFailed,
17339        /// The predeploy job run did not complete within the allotted time.
17340        DeadlineExceeded,
17341        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17342        /// for additional details.
17343        CloudBuildRequestFailed,
17344        /// If set, the enum was initialized with an unknown value.
17345        ///
17346        /// Applications can examine the value using [FailureCause::value] or
17347        /// [FailureCause::name].
17348        UnknownValue(failure_cause::UnknownValue),
17349    }
17350
17351    #[doc(hidden)]
17352    pub mod failure_cause {
17353        #[allow(unused_imports)]
17354        use super::*;
17355        #[derive(Clone, Debug, PartialEq)]
17356        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17357    }
17358
17359    impl FailureCause {
17360        /// Gets the enum value.
17361        ///
17362        /// Returns `None` if the enum contains an unknown value deserialized from
17363        /// the string representation of enums.
17364        pub fn value(&self) -> std::option::Option<i32> {
17365            match self {
17366                Self::Unspecified => std::option::Option::Some(0),
17367                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17368                Self::ExecutionFailed => std::option::Option::Some(2),
17369                Self::DeadlineExceeded => std::option::Option::Some(3),
17370                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17371                Self::UnknownValue(u) => u.0.value(),
17372            }
17373        }
17374
17375        /// Gets the enum value as a string.
17376        ///
17377        /// Returns `None` if the enum contains an unknown value deserialized from
17378        /// the integer representation of enums.
17379        pub fn name(&self) -> std::option::Option<&str> {
17380            match self {
17381                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17382                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17383                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17384                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17385                Self::CloudBuildRequestFailed => {
17386                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17387                }
17388                Self::UnknownValue(u) => u.0.name(),
17389            }
17390        }
17391    }
17392
17393    impl std::default::Default for FailureCause {
17394        fn default() -> Self {
17395            use std::convert::From;
17396            Self::from(0)
17397        }
17398    }
17399
17400    impl std::fmt::Display for FailureCause {
17401        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17402            wkt::internal::display_enum(f, self.name(), self.value())
17403        }
17404    }
17405
17406    impl std::convert::From<i32> for FailureCause {
17407        fn from(value: i32) -> Self {
17408            match value {
17409                0 => Self::Unspecified,
17410                1 => Self::CloudBuildUnavailable,
17411                2 => Self::ExecutionFailed,
17412                3 => Self::DeadlineExceeded,
17413                4 => Self::CloudBuildRequestFailed,
17414                _ => Self::UnknownValue(failure_cause::UnknownValue(
17415                    wkt::internal::UnknownEnumValue::Integer(value),
17416                )),
17417            }
17418        }
17419    }
17420
17421    impl std::convert::From<&str> for FailureCause {
17422        fn from(value: &str) -> Self {
17423            use std::string::ToString;
17424            match value {
17425                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17426                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17427                "EXECUTION_FAILED" => Self::ExecutionFailed,
17428                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17429                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17430                _ => Self::UnknownValue(failure_cause::UnknownValue(
17431                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17432                )),
17433            }
17434        }
17435    }
17436
17437    impl serde::ser::Serialize for FailureCause {
17438        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17439        where
17440            S: serde::Serializer,
17441        {
17442            match self {
17443                Self::Unspecified => serializer.serialize_i32(0),
17444                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17445                Self::ExecutionFailed => serializer.serialize_i32(2),
17446                Self::DeadlineExceeded => serializer.serialize_i32(3),
17447                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17448                Self::UnknownValue(u) => u.0.serialize(serializer),
17449            }
17450        }
17451    }
17452
17453    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17454        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17455        where
17456            D: serde::Deserializer<'de>,
17457        {
17458            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17459                ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
17460            ))
17461        }
17462    }
17463}
17464
17465/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
17466#[derive(Clone, Default, PartialEq)]
17467#[non_exhaustive]
17468pub struct PostdeployJobRun {
17469    /// Output only. The resource name of the Cloud Build `Build` object that is
17470    /// used to execute the custom actions associated with the postdeploy Job.
17471    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17472    pub build: std::string::String,
17473
17474    /// Output only. The reason the postdeploy failed. This will always be
17475    /// unspecified while the postdeploy is in progress or if it succeeded.
17476    pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
17477
17478    /// Output only. Additional information about the postdeploy failure, if
17479    /// available.
17480    pub failure_message: std::string::String,
17481
17482    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17483}
17484
17485impl PostdeployJobRun {
17486    /// Creates a new default instance.
17487    pub fn new() -> Self {
17488        std::default::Default::default()
17489    }
17490
17491    /// Sets the value of [build][crate::model::PostdeployJobRun::build].
17492    ///
17493    /// # Example
17494    /// ```ignore,no_run
17495    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17496    /// let x = PostdeployJobRun::new().set_build("example");
17497    /// ```
17498    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17499        self.build = v.into();
17500        self
17501    }
17502
17503    /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
17504    ///
17505    /// # Example
17506    /// ```ignore,no_run
17507    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17508    /// use google_cloud_deploy_v1::model::postdeploy_job_run::FailureCause;
17509    /// let x0 = PostdeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17510    /// let x1 = PostdeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17511    /// let x2 = PostdeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17512    /// ```
17513    pub fn set_failure_cause<
17514        T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
17515    >(
17516        mut self,
17517        v: T,
17518    ) -> Self {
17519        self.failure_cause = v.into();
17520        self
17521    }
17522
17523    /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
17524    ///
17525    /// # Example
17526    /// ```ignore,no_run
17527    /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17528    /// let x = PostdeployJobRun::new().set_failure_message("example");
17529    /// ```
17530    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17531        self.failure_message = v.into();
17532        self
17533    }
17534}
17535
17536impl wkt::message::Message for PostdeployJobRun {
17537    fn typename() -> &'static str {
17538        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
17539    }
17540}
17541
17542/// Defines additional types related to [PostdeployJobRun].
17543pub mod postdeploy_job_run {
17544    #[allow(unused_imports)]
17545    use super::*;
17546
17547    /// Well-known postdeploy failures.
17548    ///
17549    /// # Working with unknown values
17550    ///
17551    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17552    /// additional enum variants at any time. Adding new variants is not considered
17553    /// a breaking change. Applications should write their code in anticipation of:
17554    ///
17555    /// - New values appearing in future releases of the client library, **and**
17556    /// - New values received dynamically, without application changes.
17557    ///
17558    /// Please consult the [Working with enums] section in the user guide for some
17559    /// guidelines.
17560    ///
17561    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17562    #[derive(Clone, Debug, PartialEq)]
17563    #[non_exhaustive]
17564    pub enum FailureCause {
17565        /// No reason for failure is specified.
17566        Unspecified,
17567        /// Cloud Build is not available, either because it is not enabled or because
17568        /// Cloud Deploy has insufficient permissions. See [required
17569        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17570        CloudBuildUnavailable,
17571        /// The postdeploy operation did not complete successfully; check Cloud Build
17572        /// logs.
17573        ExecutionFailed,
17574        /// The postdeploy job run did not complete within the allotted time.
17575        DeadlineExceeded,
17576        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17577        /// for additional details.
17578        CloudBuildRequestFailed,
17579        /// If set, the enum was initialized with an unknown value.
17580        ///
17581        /// Applications can examine the value using [FailureCause::value] or
17582        /// [FailureCause::name].
17583        UnknownValue(failure_cause::UnknownValue),
17584    }
17585
17586    #[doc(hidden)]
17587    pub mod failure_cause {
17588        #[allow(unused_imports)]
17589        use super::*;
17590        #[derive(Clone, Debug, PartialEq)]
17591        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17592    }
17593
17594    impl FailureCause {
17595        /// Gets the enum value.
17596        ///
17597        /// Returns `None` if the enum contains an unknown value deserialized from
17598        /// the string representation of enums.
17599        pub fn value(&self) -> std::option::Option<i32> {
17600            match self {
17601                Self::Unspecified => std::option::Option::Some(0),
17602                Self::CloudBuildUnavailable => std::option::Option::Some(1),
17603                Self::ExecutionFailed => std::option::Option::Some(2),
17604                Self::DeadlineExceeded => std::option::Option::Some(3),
17605                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17606                Self::UnknownValue(u) => u.0.value(),
17607            }
17608        }
17609
17610        /// Gets the enum value as a string.
17611        ///
17612        /// Returns `None` if the enum contains an unknown value deserialized from
17613        /// the integer representation of enums.
17614        pub fn name(&self) -> std::option::Option<&str> {
17615            match self {
17616                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17617                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17618                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17619                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17620                Self::CloudBuildRequestFailed => {
17621                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17622                }
17623                Self::UnknownValue(u) => u.0.name(),
17624            }
17625        }
17626    }
17627
17628    impl std::default::Default for FailureCause {
17629        fn default() -> Self {
17630            use std::convert::From;
17631            Self::from(0)
17632        }
17633    }
17634
17635    impl std::fmt::Display for FailureCause {
17636        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17637            wkt::internal::display_enum(f, self.name(), self.value())
17638        }
17639    }
17640
17641    impl std::convert::From<i32> for FailureCause {
17642        fn from(value: i32) -> Self {
17643            match value {
17644                0 => Self::Unspecified,
17645                1 => Self::CloudBuildUnavailable,
17646                2 => Self::ExecutionFailed,
17647                3 => Self::DeadlineExceeded,
17648                4 => Self::CloudBuildRequestFailed,
17649                _ => Self::UnknownValue(failure_cause::UnknownValue(
17650                    wkt::internal::UnknownEnumValue::Integer(value),
17651                )),
17652            }
17653        }
17654    }
17655
17656    impl std::convert::From<&str> for FailureCause {
17657        fn from(value: &str) -> Self {
17658            use std::string::ToString;
17659            match value {
17660                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17661                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17662                "EXECUTION_FAILED" => Self::ExecutionFailed,
17663                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17664                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17665                _ => Self::UnknownValue(failure_cause::UnknownValue(
17666                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17667                )),
17668            }
17669        }
17670    }
17671
17672    impl serde::ser::Serialize for FailureCause {
17673        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17674        where
17675            S: serde::Serializer,
17676        {
17677            match self {
17678                Self::Unspecified => serializer.serialize_i32(0),
17679                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17680                Self::ExecutionFailed => serializer.serialize_i32(2),
17681                Self::DeadlineExceeded => serializer.serialize_i32(3),
17682                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17683                Self::UnknownValue(u) => u.0.serialize(serializer),
17684            }
17685        }
17686    }
17687
17688    impl<'de> serde::de::Deserialize<'de> for FailureCause {
17689        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17690        where
17691            D: serde::Deserializer<'de>,
17692        {
17693            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17694                ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
17695            ))
17696        }
17697    }
17698}
17699
17700/// CreateChildRolloutJobRun contains information specific to a
17701/// createChildRollout `JobRun`.
17702#[derive(Clone, Default, PartialEq)]
17703#[non_exhaustive]
17704pub struct CreateChildRolloutJobRun {
17705    /// Output only. Name of the `ChildRollout`. Format is
17706    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17707    pub rollout: std::string::String,
17708
17709    /// Output only. The ID of the childRollout Phase initiated by this JobRun.
17710    pub rollout_phase_id: std::string::String,
17711
17712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17713}
17714
17715impl CreateChildRolloutJobRun {
17716    /// Creates a new default instance.
17717    pub fn new() -> Self {
17718        std::default::Default::default()
17719    }
17720
17721    /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
17722    ///
17723    /// # Example
17724    /// ```ignore,no_run
17725    /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17726    /// let x = CreateChildRolloutJobRun::new().set_rollout("example");
17727    /// ```
17728    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17729        self.rollout = v.into();
17730        self
17731    }
17732
17733    /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
17734    ///
17735    /// # Example
17736    /// ```ignore,no_run
17737    /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17738    /// let x = CreateChildRolloutJobRun::new().set_rollout_phase_id("example");
17739    /// ```
17740    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17741        mut self,
17742        v: T,
17743    ) -> Self {
17744        self.rollout_phase_id = v.into();
17745        self
17746    }
17747}
17748
17749impl wkt::message::Message for CreateChildRolloutJobRun {
17750    fn typename() -> &'static str {
17751        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
17752    }
17753}
17754
17755/// AdvanceChildRolloutJobRun contains information specific to a
17756/// advanceChildRollout `JobRun`.
17757#[derive(Clone, Default, PartialEq)]
17758#[non_exhaustive]
17759pub struct AdvanceChildRolloutJobRun {
17760    /// Output only. Name of the `ChildRollout`. Format is
17761    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17762    pub rollout: std::string::String,
17763
17764    /// Output only. the ID of the ChildRollout's Phase.
17765    pub rollout_phase_id: std::string::String,
17766
17767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17768}
17769
17770impl AdvanceChildRolloutJobRun {
17771    /// Creates a new default instance.
17772    pub fn new() -> Self {
17773        std::default::Default::default()
17774    }
17775
17776    /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
17777    ///
17778    /// # Example
17779    /// ```ignore,no_run
17780    /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17781    /// let x = AdvanceChildRolloutJobRun::new().set_rollout("example");
17782    /// ```
17783    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17784        self.rollout = v.into();
17785        self
17786    }
17787
17788    /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
17789    ///
17790    /// # Example
17791    /// ```ignore,no_run
17792    /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17793    /// let x = AdvanceChildRolloutJobRun::new().set_rollout_phase_id("example");
17794    /// ```
17795    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17796        mut self,
17797        v: T,
17798    ) -> Self {
17799        self.rollout_phase_id = v.into();
17800        self
17801    }
17802}
17803
17804impl wkt::message::Message for AdvanceChildRolloutJobRun {
17805    fn typename() -> &'static str {
17806        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
17807    }
17808}
17809
17810/// ListJobRunsRequest is the request object used by `ListJobRuns`.
17811#[derive(Clone, Default, PartialEq)]
17812#[non_exhaustive]
17813pub struct ListJobRunsRequest {
17814    /// Required. The `Rollout` which owns this collection of `JobRun` objects.
17815    pub parent: std::string::String,
17816
17817    /// Optional. The maximum number of `JobRun` objects to return. The service may
17818    /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
17819    /// will be returned. The maximum value is 1000; values above 1000 will be set
17820    /// to 1000.
17821    pub page_size: i32,
17822
17823    /// Optional. A page token, received from a previous `ListJobRuns` call.
17824    /// Provide this to retrieve the subsequent page.
17825    ///
17826    /// When paginating, all other provided parameters match the call that provided
17827    /// the page token.
17828    pub page_token: std::string::String,
17829
17830    /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
17831    /// more details.
17832    pub filter: std::string::String,
17833
17834    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
17835    /// more details.
17836    pub order_by: std::string::String,
17837
17838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17839}
17840
17841impl ListJobRunsRequest {
17842    /// Creates a new default instance.
17843    pub fn new() -> Self {
17844        std::default::Default::default()
17845    }
17846
17847    /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
17848    ///
17849    /// # Example
17850    /// ```ignore,no_run
17851    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17852    /// # let project_id = "project_id";
17853    /// # let location_id = "location_id";
17854    /// # let delivery_pipeline_id = "delivery_pipeline_id";
17855    /// # let release_id = "release_id";
17856    /// # let rollout_id = "rollout_id";
17857    /// let x = ListJobRunsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
17858    /// ```
17859    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17860        self.parent = v.into();
17861        self
17862    }
17863
17864    /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
17865    ///
17866    /// # Example
17867    /// ```ignore,no_run
17868    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17869    /// let x = ListJobRunsRequest::new().set_page_size(42);
17870    /// ```
17871    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17872        self.page_size = v.into();
17873        self
17874    }
17875
17876    /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
17877    ///
17878    /// # Example
17879    /// ```ignore,no_run
17880    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17881    /// let x = ListJobRunsRequest::new().set_page_token("example");
17882    /// ```
17883    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17884        self.page_token = v.into();
17885        self
17886    }
17887
17888    /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
17889    ///
17890    /// # Example
17891    /// ```ignore,no_run
17892    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17893    /// let x = ListJobRunsRequest::new().set_filter("example");
17894    /// ```
17895    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17896        self.filter = v.into();
17897        self
17898    }
17899
17900    /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
17901    ///
17902    /// # Example
17903    /// ```ignore,no_run
17904    /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17905    /// let x = ListJobRunsRequest::new().set_order_by("example");
17906    /// ```
17907    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17908        self.order_by = v.into();
17909        self
17910    }
17911}
17912
17913impl wkt::message::Message for ListJobRunsRequest {
17914    fn typename() -> &'static str {
17915        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
17916    }
17917}
17918
17919/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
17920#[derive(Clone, Default, PartialEq)]
17921#[non_exhaustive]
17922pub struct ListJobRunsResponse {
17923    /// The `JobRun` objects.
17924    pub job_runs: std::vec::Vec<crate::model::JobRun>,
17925
17926    /// A token, which can be sent as `page_token` to retrieve the next page. If
17927    /// this field is omitted, there are no subsequent pages.
17928    pub next_page_token: std::string::String,
17929
17930    /// Locations that could not be reached
17931    pub unreachable: std::vec::Vec<std::string::String>,
17932
17933    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17934}
17935
17936impl ListJobRunsResponse {
17937    /// Creates a new default instance.
17938    pub fn new() -> Self {
17939        std::default::Default::default()
17940    }
17941
17942    /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
17943    ///
17944    /// # Example
17945    /// ```ignore,no_run
17946    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17947    /// use google_cloud_deploy_v1::model::JobRun;
17948    /// let x = ListJobRunsResponse::new()
17949    ///     .set_job_runs([
17950    ///         JobRun::default()/* use setters */,
17951    ///         JobRun::default()/* use (different) setters */,
17952    ///     ]);
17953    /// ```
17954    pub fn set_job_runs<T, V>(mut self, v: T) -> Self
17955    where
17956        T: std::iter::IntoIterator<Item = V>,
17957        V: std::convert::Into<crate::model::JobRun>,
17958    {
17959        use std::iter::Iterator;
17960        self.job_runs = v.into_iter().map(|i| i.into()).collect();
17961        self
17962    }
17963
17964    /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
17965    ///
17966    /// # Example
17967    /// ```ignore,no_run
17968    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17969    /// let x = ListJobRunsResponse::new().set_next_page_token("example");
17970    /// ```
17971    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17972        self.next_page_token = v.into();
17973        self
17974    }
17975
17976    /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
17977    ///
17978    /// # Example
17979    /// ```ignore,no_run
17980    /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17981    /// let x = ListJobRunsResponse::new().set_unreachable(["a", "b", "c"]);
17982    /// ```
17983    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17984    where
17985        T: std::iter::IntoIterator<Item = V>,
17986        V: std::convert::Into<std::string::String>,
17987    {
17988        use std::iter::Iterator;
17989        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17990        self
17991    }
17992}
17993
17994impl wkt::message::Message for ListJobRunsResponse {
17995    fn typename() -> &'static str {
17996        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
17997    }
17998}
17999
18000#[doc(hidden)]
18001impl google_cloud_gax::paginator::internal::PageableResponse for ListJobRunsResponse {
18002    type PageItem = crate::model::JobRun;
18003
18004    fn items(self) -> std::vec::Vec<Self::PageItem> {
18005        self.job_runs
18006    }
18007
18008    fn next_page_token(&self) -> std::string::String {
18009        use std::clone::Clone;
18010        self.next_page_token.clone()
18011    }
18012}
18013
18014/// GetJobRunRequest is the request object used by `GetJobRun`.
18015#[derive(Clone, Default, PartialEq)]
18016#[non_exhaustive]
18017pub struct GetJobRunRequest {
18018    /// Required. Name of the `JobRun`. Format must be
18019    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
18020    pub name: std::string::String,
18021
18022    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18023}
18024
18025impl GetJobRunRequest {
18026    /// Creates a new default instance.
18027    pub fn new() -> Self {
18028        std::default::Default::default()
18029    }
18030
18031    /// Sets the value of [name][crate::model::GetJobRunRequest::name].
18032    ///
18033    /// # Example
18034    /// ```ignore,no_run
18035    /// # use google_cloud_deploy_v1::model::GetJobRunRequest;
18036    /// # let project_id = "project_id";
18037    /// # let location_id = "location_id";
18038    /// # let delivery_pipeline_id = "delivery_pipeline_id";
18039    /// # let release_id = "release_id";
18040    /// # let rollout_id = "rollout_id";
18041    /// # let job_run_id = "job_run_id";
18042    /// let x = GetJobRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
18043    /// ```
18044    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18045        self.name = v.into();
18046        self
18047    }
18048}
18049
18050impl wkt::message::Message for GetJobRunRequest {
18051    fn typename() -> &'static str {
18052        "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
18053    }
18054}
18055
18056/// The request object used by `TerminateJobRun`.
18057#[derive(Clone, Default, PartialEq)]
18058#[non_exhaustive]
18059pub struct TerminateJobRunRequest {
18060    /// Required. Name of the `JobRun`. Format must be
18061    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
18062    pub name: std::string::String,
18063
18064    /// Optional. Deploy policies to override. Format is
18065    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
18066    pub override_deploy_policy: std::vec::Vec<std::string::String>,
18067
18068    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18069}
18070
18071impl TerminateJobRunRequest {
18072    /// Creates a new default instance.
18073    pub fn new() -> Self {
18074        std::default::Default::default()
18075    }
18076
18077    /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
18078    ///
18079    /// # Example
18080    /// ```ignore,no_run
18081    /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
18082    /// # let project_id = "project_id";
18083    /// # let location_id = "location_id";
18084    /// # let delivery_pipeline_id = "delivery_pipeline_id";
18085    /// # let release_id = "release_id";
18086    /// # let rollout_id = "rollout_id";
18087    /// # let job_run_id = "job_run_id";
18088    /// let x = TerminateJobRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
18089    /// ```
18090    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18091        self.name = v.into();
18092        self
18093    }
18094
18095    /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
18096    ///
18097    /// # Example
18098    /// ```ignore,no_run
18099    /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
18100    /// let x = TerminateJobRunRequest::new().set_override_deploy_policy(["a", "b", "c"]);
18101    /// ```
18102    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
18103    where
18104        T: std::iter::IntoIterator<Item = V>,
18105        V: std::convert::Into<std::string::String>,
18106    {
18107        use std::iter::Iterator;
18108        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
18109        self
18110    }
18111}
18112
18113impl wkt::message::Message for TerminateJobRunRequest {
18114    fn typename() -> &'static str {
18115        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
18116    }
18117}
18118
18119/// The response object from `TerminateJobRun`.
18120#[derive(Clone, Default, PartialEq)]
18121#[non_exhaustive]
18122pub struct TerminateJobRunResponse {
18123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18124}
18125
18126impl TerminateJobRunResponse {
18127    /// Creates a new default instance.
18128    pub fn new() -> Self {
18129        std::default::Default::default()
18130    }
18131}
18132
18133impl wkt::message::Message for TerminateJobRunResponse {
18134    fn typename() -> &'static str {
18135        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
18136    }
18137}
18138
18139/// Service-wide configuration.
18140#[derive(Clone, Default, PartialEq)]
18141#[non_exhaustive]
18142pub struct Config {
18143    /// Name of the configuration.
18144    pub name: std::string::String,
18145
18146    /// All supported versions of Skaffold.
18147    pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
18148
18149    /// Default Skaffold version that is assigned when a Release is created without
18150    /// specifying a Skaffold version.
18151    pub default_skaffold_version: std::string::String,
18152
18153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18154}
18155
18156impl Config {
18157    /// Creates a new default instance.
18158    pub fn new() -> Self {
18159        std::default::Default::default()
18160    }
18161
18162    /// Sets the value of [name][crate::model::Config::name].
18163    ///
18164    /// # Example
18165    /// ```ignore,no_run
18166    /// # use google_cloud_deploy_v1::model::Config;
18167    /// # let project_id = "project_id";
18168    /// # let location_id = "location_id";
18169    /// let x = Config::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
18170    /// ```
18171    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18172        self.name = v.into();
18173        self
18174    }
18175
18176    /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
18177    ///
18178    /// # Example
18179    /// ```ignore,no_run
18180    /// # use google_cloud_deploy_v1::model::Config;
18181    /// use google_cloud_deploy_v1::model::SkaffoldVersion;
18182    /// let x = Config::new()
18183    ///     .set_supported_versions([
18184    ///         SkaffoldVersion::default()/* use setters */,
18185    ///         SkaffoldVersion::default()/* use (different) setters */,
18186    ///     ]);
18187    /// ```
18188    pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
18189    where
18190        T: std::iter::IntoIterator<Item = V>,
18191        V: std::convert::Into<crate::model::SkaffoldVersion>,
18192    {
18193        use std::iter::Iterator;
18194        self.supported_versions = v.into_iter().map(|i| i.into()).collect();
18195        self
18196    }
18197
18198    /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
18199    ///
18200    /// # Example
18201    /// ```ignore,no_run
18202    /// # use google_cloud_deploy_v1::model::Config;
18203    /// let x = Config::new().set_default_skaffold_version("example");
18204    /// ```
18205    pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
18206        mut self,
18207        v: T,
18208    ) -> Self {
18209        self.default_skaffold_version = v.into();
18210        self
18211    }
18212}
18213
18214impl wkt::message::Message for Config {
18215    fn typename() -> &'static str {
18216        "type.googleapis.com/google.cloud.deploy.v1.Config"
18217    }
18218}
18219
18220/// Details of a supported Skaffold version.
18221#[derive(Clone, Default, PartialEq)]
18222#[non_exhaustive]
18223pub struct SkaffoldVersion {
18224    /// Release version number. For example, "1.20.3".
18225    pub version: std::string::String,
18226
18227    /// The time at which this version of Skaffold will enter maintenance mode.
18228    pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
18229
18230    /// The time at which this version of Skaffold will no longer be supported.
18231    pub support_expiration_time: std::option::Option<wkt::Timestamp>,
18232
18233    /// Date when this version is expected to no longer be supported.
18234    pub support_end_date: std::option::Option<google_cloud_type::model::Date>,
18235
18236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18237}
18238
18239impl SkaffoldVersion {
18240    /// Creates a new default instance.
18241    pub fn new() -> Self {
18242        std::default::Default::default()
18243    }
18244
18245    /// Sets the value of [version][crate::model::SkaffoldVersion::version].
18246    ///
18247    /// # Example
18248    /// ```ignore,no_run
18249    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18250    /// let x = SkaffoldVersion::new().set_version("example");
18251    /// ```
18252    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18253        self.version = v.into();
18254        self
18255    }
18256
18257    /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
18258    ///
18259    /// # Example
18260    /// ```ignore,no_run
18261    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18262    /// use wkt::Timestamp;
18263    /// let x = SkaffoldVersion::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
18264    /// ```
18265    pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
18266    where
18267        T: std::convert::Into<wkt::Timestamp>,
18268    {
18269        self.maintenance_mode_time = std::option::Option::Some(v.into());
18270        self
18271    }
18272
18273    /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
18274    ///
18275    /// # Example
18276    /// ```ignore,no_run
18277    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18278    /// use wkt::Timestamp;
18279    /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
18280    /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
18281    /// ```
18282    pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
18283    where
18284        T: std::convert::Into<wkt::Timestamp>,
18285    {
18286        self.maintenance_mode_time = v.map(|x| x.into());
18287        self
18288    }
18289
18290    /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18291    ///
18292    /// # Example
18293    /// ```ignore,no_run
18294    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18295    /// use wkt::Timestamp;
18296    /// let x = SkaffoldVersion::new().set_support_expiration_time(Timestamp::default()/* use setters */);
18297    /// ```
18298    pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
18299    where
18300        T: std::convert::Into<wkt::Timestamp>,
18301    {
18302        self.support_expiration_time = std::option::Option::Some(v.into());
18303        self
18304    }
18305
18306    /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18307    ///
18308    /// # Example
18309    /// ```ignore,no_run
18310    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18311    /// use wkt::Timestamp;
18312    /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
18313    /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(None::<Timestamp>);
18314    /// ```
18315    pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18316    where
18317        T: std::convert::Into<wkt::Timestamp>,
18318    {
18319        self.support_expiration_time = v.map(|x| x.into());
18320        self
18321    }
18322
18323    /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18324    ///
18325    /// # Example
18326    /// ```ignore,no_run
18327    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18328    /// use google_cloud_type::model::Date;
18329    /// let x = SkaffoldVersion::new().set_support_end_date(Date::default()/* use setters */);
18330    /// ```
18331    pub fn set_support_end_date<T>(mut self, v: T) -> Self
18332    where
18333        T: std::convert::Into<google_cloud_type::model::Date>,
18334    {
18335        self.support_end_date = std::option::Option::Some(v.into());
18336        self
18337    }
18338
18339    /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18340    ///
18341    /// # Example
18342    /// ```ignore,no_run
18343    /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18344    /// use google_cloud_type::model::Date;
18345    /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(Some(Date::default()/* use setters */));
18346    /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(None::<Date>);
18347    /// ```
18348    pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
18349    where
18350        T: std::convert::Into<google_cloud_type::model::Date>,
18351    {
18352        self.support_end_date = v.map(|x| x.into());
18353        self
18354    }
18355}
18356
18357impl wkt::message::Message for SkaffoldVersion {
18358    fn typename() -> &'static str {
18359        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
18360    }
18361}
18362
18363/// Request to get a configuration.
18364#[derive(Clone, Default, PartialEq)]
18365#[non_exhaustive]
18366pub struct GetConfigRequest {
18367    /// Required. Name of requested configuration.
18368    pub name: std::string::String,
18369
18370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18371}
18372
18373impl GetConfigRequest {
18374    /// Creates a new default instance.
18375    pub fn new() -> Self {
18376        std::default::Default::default()
18377    }
18378
18379    /// Sets the value of [name][crate::model::GetConfigRequest::name].
18380    ///
18381    /// # Example
18382    /// ```ignore,no_run
18383    /// # use google_cloud_deploy_v1::model::GetConfigRequest;
18384    /// # let project_id = "project_id";
18385    /// # let location_id = "location_id";
18386    /// let x = GetConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
18387    /// ```
18388    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18389        self.name = v.into();
18390        self
18391    }
18392}
18393
18394impl wkt::message::Message for GetConfigRequest {
18395    fn typename() -> &'static str {
18396        "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
18397    }
18398}
18399
18400/// An `Automation` resource in the Cloud Deploy API.
18401///
18402/// An `Automation` enables the automation of manually driven actions for
18403/// a Delivery Pipeline, which includes Release promotion among Targets,
18404/// Rollout repair and Rollout deployment strategy advancement. The intention
18405/// of Automation is to reduce manual intervention in the continuous delivery
18406/// process.
18407#[derive(Clone, Default, PartialEq)]
18408#[non_exhaustive]
18409pub struct Automation {
18410    /// Output only. Name of the `Automation`. Format is
18411    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
18412    pub name: std::string::String,
18413
18414    /// Output only. Unique identifier of the `Automation`.
18415    pub uid: std::string::String,
18416
18417    /// Optional. Description of the `Automation`. Max length is 255 characters.
18418    pub description: std::string::String,
18419
18420    /// Output only. Time at which the automation was created.
18421    pub create_time: std::option::Option<wkt::Timestamp>,
18422
18423    /// Output only. Time at which the automation was updated.
18424    pub update_time: std::option::Option<wkt::Timestamp>,
18425
18426    /// Optional. User annotations. These attributes can only be set and used by
18427    /// the user, and not by Cloud Deploy. Annotations must meet the following
18428    /// constraints:
18429    ///
18430    /// * Annotations are key/value pairs.
18431    /// * Valid annotation keys have two segments: an optional prefix and name,
18432    ///   separated by a slash (`/`).
18433    /// * The name segment is required and must be 63 characters or less,
18434    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
18435    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
18436    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
18437    ///   a series of DNS labels separated by dots(`.`), not longer than 253
18438    ///   characters in total, followed by a slash (`/`).
18439    ///
18440    /// See
18441    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
18442    /// for more details.
18443    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18444
18445    /// Optional. Labels are attributes that can be set and used by both the
18446    /// user and by Cloud Deploy. Labels must meet the following constraints:
18447    ///
18448    /// * Keys and values can contain only lowercase letters, numeric characters,
18449    ///   underscores, and dashes.
18450    /// * All characters must use UTF-8 encoding, and international characters are
18451    ///   allowed.
18452    /// * Keys must start with a lowercase letter or international character.
18453    /// * Each resource is limited to a maximum of 64 labels.
18454    ///
18455    /// Both keys and values are additionally constrained to be <= 63 characters.
18456    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18457
18458    /// Optional. The weak etag of the `Automation` resource.
18459    /// This checksum is computed by the server based on the value of other
18460    /// fields, and may be sent on update and delete requests to ensure the
18461    /// client has an up-to-date value before proceeding.
18462    pub etag: std::string::String,
18463
18464    /// Optional. When Suspended, automation is deactivated from execution.
18465    pub suspended: bool,
18466
18467    /// Required. Email address of the user-managed IAM service account that
18468    /// creates Cloud Deploy release and rollout resources.
18469    pub service_account: std::string::String,
18470
18471    /// Required. Selected resources to which the automation will be applied.
18472    pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
18473
18474    /// Required. List of Automation rules associated with the Automation resource.
18475    /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
18476    /// Note: the order of the rules here is not the same as the order of
18477    /// execution.
18478    pub rules: std::vec::Vec<crate::model::AutomationRule>,
18479
18480    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18481}
18482
18483impl Automation {
18484    /// Creates a new default instance.
18485    pub fn new() -> Self {
18486        std::default::Default::default()
18487    }
18488
18489    /// Sets the value of [name][crate::model::Automation::name].
18490    ///
18491    /// # Example
18492    /// ```ignore,no_run
18493    /// # use google_cloud_deploy_v1::model::Automation;
18494    /// # let project_id = "project_id";
18495    /// # let location_id = "location_id";
18496    /// # let delivery_pipeline_id = "delivery_pipeline_id";
18497    /// # let automation_id = "automation_id";
18498    /// let x = Automation::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automations/{automation_id}"));
18499    /// ```
18500    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18501        self.name = v.into();
18502        self
18503    }
18504
18505    /// Sets the value of [uid][crate::model::Automation::uid].
18506    ///
18507    /// # Example
18508    /// ```ignore,no_run
18509    /// # use google_cloud_deploy_v1::model::Automation;
18510    /// let x = Automation::new().set_uid("example");
18511    /// ```
18512    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18513        self.uid = v.into();
18514        self
18515    }
18516
18517    /// Sets the value of [description][crate::model::Automation::description].
18518    ///
18519    /// # Example
18520    /// ```ignore,no_run
18521    /// # use google_cloud_deploy_v1::model::Automation;
18522    /// let x = Automation::new().set_description("example");
18523    /// ```
18524    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18525        self.description = v.into();
18526        self
18527    }
18528
18529    /// Sets the value of [create_time][crate::model::Automation::create_time].
18530    ///
18531    /// # Example
18532    /// ```ignore,no_run
18533    /// # use google_cloud_deploy_v1::model::Automation;
18534    /// use wkt::Timestamp;
18535    /// let x = Automation::new().set_create_time(Timestamp::default()/* use setters */);
18536    /// ```
18537    pub fn set_create_time<T>(mut self, v: T) -> Self
18538    where
18539        T: std::convert::Into<wkt::Timestamp>,
18540    {
18541        self.create_time = std::option::Option::Some(v.into());
18542        self
18543    }
18544
18545    /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
18546    ///
18547    /// # Example
18548    /// ```ignore,no_run
18549    /// # use google_cloud_deploy_v1::model::Automation;
18550    /// use wkt::Timestamp;
18551    /// let x = Automation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18552    /// let x = Automation::new().set_or_clear_create_time(None::<Timestamp>);
18553    /// ```
18554    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18555    where
18556        T: std::convert::Into<wkt::Timestamp>,
18557    {
18558        self.create_time = v.map(|x| x.into());
18559        self
18560    }
18561
18562    /// Sets the value of [update_time][crate::model::Automation::update_time].
18563    ///
18564    /// # Example
18565    /// ```ignore,no_run
18566    /// # use google_cloud_deploy_v1::model::Automation;
18567    /// use wkt::Timestamp;
18568    /// let x = Automation::new().set_update_time(Timestamp::default()/* use setters */);
18569    /// ```
18570    pub fn set_update_time<T>(mut self, v: T) -> Self
18571    where
18572        T: std::convert::Into<wkt::Timestamp>,
18573    {
18574        self.update_time = std::option::Option::Some(v.into());
18575        self
18576    }
18577
18578    /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
18579    ///
18580    /// # Example
18581    /// ```ignore,no_run
18582    /// # use google_cloud_deploy_v1::model::Automation;
18583    /// use wkt::Timestamp;
18584    /// let x = Automation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18585    /// let x = Automation::new().set_or_clear_update_time(None::<Timestamp>);
18586    /// ```
18587    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18588    where
18589        T: std::convert::Into<wkt::Timestamp>,
18590    {
18591        self.update_time = v.map(|x| x.into());
18592        self
18593    }
18594
18595    /// Sets the value of [annotations][crate::model::Automation::annotations].
18596    ///
18597    /// # Example
18598    /// ```ignore,no_run
18599    /// # use google_cloud_deploy_v1::model::Automation;
18600    /// let x = Automation::new().set_annotations([
18601    ///     ("key0", "abc"),
18602    ///     ("key1", "xyz"),
18603    /// ]);
18604    /// ```
18605    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18606    where
18607        T: std::iter::IntoIterator<Item = (K, V)>,
18608        K: std::convert::Into<std::string::String>,
18609        V: std::convert::Into<std::string::String>,
18610    {
18611        use std::iter::Iterator;
18612        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18613        self
18614    }
18615
18616    /// Sets the value of [labels][crate::model::Automation::labels].
18617    ///
18618    /// # Example
18619    /// ```ignore,no_run
18620    /// # use google_cloud_deploy_v1::model::Automation;
18621    /// let x = Automation::new().set_labels([
18622    ///     ("key0", "abc"),
18623    ///     ("key1", "xyz"),
18624    /// ]);
18625    /// ```
18626    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18627    where
18628        T: std::iter::IntoIterator<Item = (K, V)>,
18629        K: std::convert::Into<std::string::String>,
18630        V: std::convert::Into<std::string::String>,
18631    {
18632        use std::iter::Iterator;
18633        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18634        self
18635    }
18636
18637    /// Sets the value of [etag][crate::model::Automation::etag].
18638    ///
18639    /// # Example
18640    /// ```ignore,no_run
18641    /// # use google_cloud_deploy_v1::model::Automation;
18642    /// let x = Automation::new().set_etag("example");
18643    /// ```
18644    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18645        self.etag = v.into();
18646        self
18647    }
18648
18649    /// Sets the value of [suspended][crate::model::Automation::suspended].
18650    ///
18651    /// # Example
18652    /// ```ignore,no_run
18653    /// # use google_cloud_deploy_v1::model::Automation;
18654    /// let x = Automation::new().set_suspended(true);
18655    /// ```
18656    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18657        self.suspended = v.into();
18658        self
18659    }
18660
18661    /// Sets the value of [service_account][crate::model::Automation::service_account].
18662    ///
18663    /// # Example
18664    /// ```ignore,no_run
18665    /// # use google_cloud_deploy_v1::model::Automation;
18666    /// let x = Automation::new().set_service_account("example");
18667    /// ```
18668    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18669        self.service_account = v.into();
18670        self
18671    }
18672
18673    /// Sets the value of [selector][crate::model::Automation::selector].
18674    ///
18675    /// # Example
18676    /// ```ignore,no_run
18677    /// # use google_cloud_deploy_v1::model::Automation;
18678    /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18679    /// let x = Automation::new().set_selector(AutomationResourceSelector::default()/* use setters */);
18680    /// ```
18681    pub fn set_selector<T>(mut self, v: T) -> Self
18682    where
18683        T: std::convert::Into<crate::model::AutomationResourceSelector>,
18684    {
18685        self.selector = std::option::Option::Some(v.into());
18686        self
18687    }
18688
18689    /// Sets or clears the value of [selector][crate::model::Automation::selector].
18690    ///
18691    /// # Example
18692    /// ```ignore,no_run
18693    /// # use google_cloud_deploy_v1::model::Automation;
18694    /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18695    /// let x = Automation::new().set_or_clear_selector(Some(AutomationResourceSelector::default()/* use setters */));
18696    /// let x = Automation::new().set_or_clear_selector(None::<AutomationResourceSelector>);
18697    /// ```
18698    pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
18699    where
18700        T: std::convert::Into<crate::model::AutomationResourceSelector>,
18701    {
18702        self.selector = v.map(|x| x.into());
18703        self
18704    }
18705
18706    /// Sets the value of [rules][crate::model::Automation::rules].
18707    ///
18708    /// # Example
18709    /// ```ignore,no_run
18710    /// # use google_cloud_deploy_v1::model::Automation;
18711    /// use google_cloud_deploy_v1::model::AutomationRule;
18712    /// let x = Automation::new()
18713    ///     .set_rules([
18714    ///         AutomationRule::default()/* use setters */,
18715    ///         AutomationRule::default()/* use (different) setters */,
18716    ///     ]);
18717    /// ```
18718    pub fn set_rules<T, V>(mut self, v: T) -> Self
18719    where
18720        T: std::iter::IntoIterator<Item = V>,
18721        V: std::convert::Into<crate::model::AutomationRule>,
18722    {
18723        use std::iter::Iterator;
18724        self.rules = v.into_iter().map(|i| i.into()).collect();
18725        self
18726    }
18727}
18728
18729impl wkt::message::Message for Automation {
18730    fn typename() -> &'static str {
18731        "type.googleapis.com/google.cloud.deploy.v1.Automation"
18732    }
18733}
18734
18735/// AutomationResourceSelector contains the information to select the resources
18736/// to which an Automation is going to be applied.
18737#[derive(Clone, Default, PartialEq)]
18738#[non_exhaustive]
18739pub struct AutomationResourceSelector {
18740    /// Optional. Contains attributes about a target.
18741    pub targets: std::vec::Vec<crate::model::TargetAttribute>,
18742
18743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18744}
18745
18746impl AutomationResourceSelector {
18747    /// Creates a new default instance.
18748    pub fn new() -> Self {
18749        std::default::Default::default()
18750    }
18751
18752    /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
18753    ///
18754    /// # Example
18755    /// ```ignore,no_run
18756    /// # use google_cloud_deploy_v1::model::AutomationResourceSelector;
18757    /// use google_cloud_deploy_v1::model::TargetAttribute;
18758    /// let x = AutomationResourceSelector::new()
18759    ///     .set_targets([
18760    ///         TargetAttribute::default()/* use setters */,
18761    ///         TargetAttribute::default()/* use (different) setters */,
18762    ///     ]);
18763    /// ```
18764    pub fn set_targets<T, V>(mut self, v: T) -> Self
18765    where
18766        T: std::iter::IntoIterator<Item = V>,
18767        V: std::convert::Into<crate::model::TargetAttribute>,
18768    {
18769        use std::iter::Iterator;
18770        self.targets = v.into_iter().map(|i| i.into()).collect();
18771        self
18772    }
18773}
18774
18775impl wkt::message::Message for AutomationResourceSelector {
18776    fn typename() -> &'static str {
18777        "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
18778    }
18779}
18780
18781/// `AutomationRule` defines the automation activities.
18782#[derive(Clone, Default, PartialEq)]
18783#[non_exhaustive]
18784pub struct AutomationRule {
18785    /// The configuration of the Automation rule.
18786    pub rule: std::option::Option<crate::model::automation_rule::Rule>,
18787
18788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18789}
18790
18791impl AutomationRule {
18792    /// Creates a new default instance.
18793    pub fn new() -> Self {
18794        std::default::Default::default()
18795    }
18796
18797    /// Sets the value of [rule][crate::model::AutomationRule::rule].
18798    ///
18799    /// Note that all the setters affecting `rule` are mutually
18800    /// exclusive.
18801    ///
18802    /// # Example
18803    /// ```ignore,no_run
18804    /// # use google_cloud_deploy_v1::model::AutomationRule;
18805    /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18806    /// let x = AutomationRule::new().set_rule(Some(
18807    ///     google_cloud_deploy_v1::model::automation_rule::Rule::PromoteReleaseRule(PromoteReleaseRule::default().into())));
18808    /// ```
18809    pub fn set_rule<
18810        T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
18811    >(
18812        mut self,
18813        v: T,
18814    ) -> Self {
18815        self.rule = v.into();
18816        self
18817    }
18818
18819    /// The value of [rule][crate::model::AutomationRule::rule]
18820    /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
18821    /// holds a different branch.
18822    pub fn promote_release_rule(
18823        &self,
18824    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
18825        #[allow(unreachable_patterns)]
18826        self.rule.as_ref().and_then(|v| match v {
18827            crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
18828                std::option::Option::Some(v)
18829            }
18830            _ => std::option::Option::None,
18831        })
18832    }
18833
18834    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18835    /// to hold a `PromoteReleaseRule`.
18836    ///
18837    /// Note that all the setters affecting `rule` are
18838    /// mutually exclusive.
18839    ///
18840    /// # Example
18841    /// ```ignore,no_run
18842    /// # use google_cloud_deploy_v1::model::AutomationRule;
18843    /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18844    /// let x = AutomationRule::new().set_promote_release_rule(PromoteReleaseRule::default()/* use setters */);
18845    /// assert!(x.promote_release_rule().is_some());
18846    /// assert!(x.advance_rollout_rule().is_none());
18847    /// assert!(x.repair_rollout_rule().is_none());
18848    /// assert!(x.timed_promote_release_rule().is_none());
18849    /// ```
18850    pub fn set_promote_release_rule<
18851        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
18852    >(
18853        mut self,
18854        v: T,
18855    ) -> Self {
18856        self.rule = std::option::Option::Some(
18857            crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
18858        );
18859        self
18860    }
18861
18862    /// The value of [rule][crate::model::AutomationRule::rule]
18863    /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
18864    /// holds a different branch.
18865    pub fn advance_rollout_rule(
18866        &self,
18867    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
18868        #[allow(unreachable_patterns)]
18869        self.rule.as_ref().and_then(|v| match v {
18870            crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
18871                std::option::Option::Some(v)
18872            }
18873            _ => std::option::Option::None,
18874        })
18875    }
18876
18877    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18878    /// to hold a `AdvanceRolloutRule`.
18879    ///
18880    /// Note that all the setters affecting `rule` are
18881    /// mutually exclusive.
18882    ///
18883    /// # Example
18884    /// ```ignore,no_run
18885    /// # use google_cloud_deploy_v1::model::AutomationRule;
18886    /// use google_cloud_deploy_v1::model::AdvanceRolloutRule;
18887    /// let x = AutomationRule::new().set_advance_rollout_rule(AdvanceRolloutRule::default()/* use setters */);
18888    /// assert!(x.advance_rollout_rule().is_some());
18889    /// assert!(x.promote_release_rule().is_none());
18890    /// assert!(x.repair_rollout_rule().is_none());
18891    /// assert!(x.timed_promote_release_rule().is_none());
18892    /// ```
18893    pub fn set_advance_rollout_rule<
18894        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
18895    >(
18896        mut self,
18897        v: T,
18898    ) -> Self {
18899        self.rule = std::option::Option::Some(
18900            crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
18901        );
18902        self
18903    }
18904
18905    /// The value of [rule][crate::model::AutomationRule::rule]
18906    /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
18907    /// holds a different branch.
18908    pub fn repair_rollout_rule(
18909        &self,
18910    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
18911        #[allow(unreachable_patterns)]
18912        self.rule.as_ref().and_then(|v| match v {
18913            crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
18914                std::option::Option::Some(v)
18915            }
18916            _ => std::option::Option::None,
18917        })
18918    }
18919
18920    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18921    /// to hold a `RepairRolloutRule`.
18922    ///
18923    /// Note that all the setters affecting `rule` are
18924    /// mutually exclusive.
18925    ///
18926    /// # Example
18927    /// ```ignore,no_run
18928    /// # use google_cloud_deploy_v1::model::AutomationRule;
18929    /// use google_cloud_deploy_v1::model::RepairRolloutRule;
18930    /// let x = AutomationRule::new().set_repair_rollout_rule(RepairRolloutRule::default()/* use setters */);
18931    /// assert!(x.repair_rollout_rule().is_some());
18932    /// assert!(x.promote_release_rule().is_none());
18933    /// assert!(x.advance_rollout_rule().is_none());
18934    /// assert!(x.timed_promote_release_rule().is_none());
18935    /// ```
18936    pub fn set_repair_rollout_rule<
18937        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
18938    >(
18939        mut self,
18940        v: T,
18941    ) -> Self {
18942        self.rule = std::option::Option::Some(
18943            crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
18944        );
18945        self
18946    }
18947
18948    /// The value of [rule][crate::model::AutomationRule::rule]
18949    /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
18950    /// holds a different branch.
18951    pub fn timed_promote_release_rule(
18952        &self,
18953    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
18954        #[allow(unreachable_patterns)]
18955        self.rule.as_ref().and_then(|v| match v {
18956            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
18957                std::option::Option::Some(v)
18958            }
18959            _ => std::option::Option::None,
18960        })
18961    }
18962
18963    /// Sets the value of [rule][crate::model::AutomationRule::rule]
18964    /// to hold a `TimedPromoteReleaseRule`.
18965    ///
18966    /// Note that all the setters affecting `rule` are
18967    /// mutually exclusive.
18968    ///
18969    /// # Example
18970    /// ```ignore,no_run
18971    /// # use google_cloud_deploy_v1::model::AutomationRule;
18972    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18973    /// let x = AutomationRule::new().set_timed_promote_release_rule(TimedPromoteReleaseRule::default()/* use setters */);
18974    /// assert!(x.timed_promote_release_rule().is_some());
18975    /// assert!(x.promote_release_rule().is_none());
18976    /// assert!(x.advance_rollout_rule().is_none());
18977    /// assert!(x.repair_rollout_rule().is_none());
18978    /// ```
18979    pub fn set_timed_promote_release_rule<
18980        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
18981    >(
18982        mut self,
18983        v: T,
18984    ) -> Self {
18985        self.rule = std::option::Option::Some(
18986            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
18987        );
18988        self
18989    }
18990}
18991
18992impl wkt::message::Message for AutomationRule {
18993    fn typename() -> &'static str {
18994        "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
18995    }
18996}
18997
18998/// Defines additional types related to [AutomationRule].
18999pub mod automation_rule {
19000    #[allow(unused_imports)]
19001    use super::*;
19002
19003    /// The configuration of the Automation rule.
19004    #[derive(Clone, Debug, PartialEq)]
19005    #[non_exhaustive]
19006    pub enum Rule {
19007        /// Optional. `PromoteReleaseRule` will automatically promote a release from
19008        /// the current target to a specified target.
19009        PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
19010        /// Optional. The `AdvanceRolloutRule` will automatically advance a
19011        /// successful Rollout.
19012        AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
19013        /// Optional. The `RepairRolloutRule` will automatically repair a failed
19014        /// rollout.
19015        RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
19016        /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
19017        /// release from the current target(s) to the specified target(s) on a
19018        /// configured schedule.
19019        TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
19020    }
19021}
19022
19023/// The `TimedPromoteReleaseRule` will automatically promote a release from the
19024/// current target(s) to the specified target(s) on a configured schedule.
19025#[derive(Clone, Default, PartialEq)]
19026#[non_exhaustive]
19027pub struct TimedPromoteReleaseRule {
19028    /// Required. ID of the rule. This ID must be unique in the `Automation`
19029    /// resource to which this rule belongs. The format is
19030    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19031    pub id: std::string::String,
19032
19033    /// Optional. The ID of the stage in the pipeline to which this `Release` is
19034    /// deploying. If unspecified, default it to the next stage in the promotion
19035    /// flow. The value of this field could be one of the following:
19036    ///
19037    /// * The last segment of a target name
19038    /// * "@next", the next target in the promotion sequence
19039    pub destination_target_id: std::string::String,
19040
19041    /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
19042    /// 9am.
19043    pub schedule: std::string::String,
19044
19045    /// Required. The time zone in IANA format [IANA Time Zone
19046    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
19047    pub time_zone: std::string::String,
19048
19049    /// Output only. Information around the state of the Automation rule.
19050    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19051
19052    /// Optional. The starting phase of the rollout created by this rule. Default
19053    /// to the first phase.
19054    pub destination_phase: std::string::String,
19055
19056    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19057}
19058
19059impl TimedPromoteReleaseRule {
19060    /// Creates a new default instance.
19061    pub fn new() -> Self {
19062        std::default::Default::default()
19063    }
19064
19065    /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
19066    ///
19067    /// # Example
19068    /// ```ignore,no_run
19069    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19070    /// let x = TimedPromoteReleaseRule::new().set_id("example");
19071    /// ```
19072    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19073        self.id = v.into();
19074        self
19075    }
19076
19077    /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
19078    ///
19079    /// # Example
19080    /// ```ignore,no_run
19081    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19082    /// let x = TimedPromoteReleaseRule::new().set_destination_target_id("example");
19083    /// ```
19084    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19085        mut self,
19086        v: T,
19087    ) -> Self {
19088        self.destination_target_id = v.into();
19089        self
19090    }
19091
19092    /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
19093    ///
19094    /// # Example
19095    /// ```ignore,no_run
19096    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19097    /// let x = TimedPromoteReleaseRule::new().set_schedule("example");
19098    /// ```
19099    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19100        self.schedule = v.into();
19101        self
19102    }
19103
19104    /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
19105    ///
19106    /// # Example
19107    /// ```ignore,no_run
19108    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19109    /// let x = TimedPromoteReleaseRule::new().set_time_zone("example");
19110    /// ```
19111    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19112        self.time_zone = v.into();
19113        self
19114    }
19115
19116    /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
19117    ///
19118    /// # Example
19119    /// ```ignore,no_run
19120    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19121    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19122    /// let x = TimedPromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19123    /// ```
19124    pub fn set_condition<T>(mut self, v: T) -> Self
19125    where
19126        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19127    {
19128        self.condition = std::option::Option::Some(v.into());
19129        self
19130    }
19131
19132    /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
19133    ///
19134    /// # Example
19135    /// ```ignore,no_run
19136    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19137    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19138    /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19139    /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19140    /// ```
19141    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19142    where
19143        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19144    {
19145        self.condition = v.map(|x| x.into());
19146        self
19147    }
19148
19149    /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
19150    ///
19151    /// # Example
19152    /// ```ignore,no_run
19153    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19154    /// let x = TimedPromoteReleaseRule::new().set_destination_phase("example");
19155    /// ```
19156    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19157        mut self,
19158        v: T,
19159    ) -> Self {
19160        self.destination_phase = v.into();
19161        self
19162    }
19163}
19164
19165impl wkt::message::Message for TimedPromoteReleaseRule {
19166    fn typename() -> &'static str {
19167        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
19168    }
19169}
19170
19171/// The `PromoteRelease` rule will automatically promote a release from the
19172/// current target to a specified target.
19173#[derive(Clone, Default, PartialEq)]
19174#[non_exhaustive]
19175pub struct PromoteReleaseRule {
19176    /// Required. ID of the rule. This id must be unique in the `Automation`
19177    /// resource to which this rule belongs. The format is
19178    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19179    pub id: std::string::String,
19180
19181    /// Optional. How long the release need to be paused until being promoted to
19182    /// the next target.
19183    pub wait: std::option::Option<wkt::Duration>,
19184
19185    /// Optional. The ID of the stage in the pipeline to which this `Release` is
19186    /// deploying. If unspecified, default it to the next stage in the promotion
19187    /// flow. The value of this field could be one of the following:
19188    ///
19189    /// * The last segment of a target name
19190    /// * "@next", the next target in the promotion sequence
19191    pub destination_target_id: std::string::String,
19192
19193    /// Output only. Information around the state of the Automation rule.
19194    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19195
19196    /// Optional. The starting phase of the rollout created by this operation.
19197    /// Default to the first phase.
19198    pub destination_phase: std::string::String,
19199
19200    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19201}
19202
19203impl PromoteReleaseRule {
19204    /// Creates a new default instance.
19205    pub fn new() -> Self {
19206        std::default::Default::default()
19207    }
19208
19209    /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
19210    ///
19211    /// # Example
19212    /// ```ignore,no_run
19213    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19214    /// let x = PromoteReleaseRule::new().set_id("example");
19215    /// ```
19216    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19217        self.id = v.into();
19218        self
19219    }
19220
19221    /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
19222    ///
19223    /// # Example
19224    /// ```ignore,no_run
19225    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19226    /// use wkt::Duration;
19227    /// let x = PromoteReleaseRule::new().set_wait(Duration::default()/* use setters */);
19228    /// ```
19229    pub fn set_wait<T>(mut self, v: T) -> Self
19230    where
19231        T: std::convert::Into<wkt::Duration>,
19232    {
19233        self.wait = std::option::Option::Some(v.into());
19234        self
19235    }
19236
19237    /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
19238    ///
19239    /// # Example
19240    /// ```ignore,no_run
19241    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19242    /// use wkt::Duration;
19243    /// let x = PromoteReleaseRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19244    /// let x = PromoteReleaseRule::new().set_or_clear_wait(None::<Duration>);
19245    /// ```
19246    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19247    where
19248        T: std::convert::Into<wkt::Duration>,
19249    {
19250        self.wait = v.map(|x| x.into());
19251        self
19252    }
19253
19254    /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
19255    ///
19256    /// # Example
19257    /// ```ignore,no_run
19258    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19259    /// let x = PromoteReleaseRule::new().set_destination_target_id("example");
19260    /// ```
19261    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19262        mut self,
19263        v: T,
19264    ) -> Self {
19265        self.destination_target_id = v.into();
19266        self
19267    }
19268
19269    /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
19270    ///
19271    /// # Example
19272    /// ```ignore,no_run
19273    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19274    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19275    /// let x = PromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19276    /// ```
19277    pub fn set_condition<T>(mut self, v: T) -> Self
19278    where
19279        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19280    {
19281        self.condition = std::option::Option::Some(v.into());
19282        self
19283    }
19284
19285    /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
19286    ///
19287    /// # Example
19288    /// ```ignore,no_run
19289    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19290    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19291    /// let x = PromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19292    /// let x = PromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19293    /// ```
19294    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19295    where
19296        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19297    {
19298        self.condition = v.map(|x| x.into());
19299        self
19300    }
19301
19302    /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
19303    ///
19304    /// # Example
19305    /// ```ignore,no_run
19306    /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19307    /// let x = PromoteReleaseRule::new().set_destination_phase("example");
19308    /// ```
19309    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19310        mut self,
19311        v: T,
19312    ) -> Self {
19313        self.destination_phase = v.into();
19314        self
19315    }
19316}
19317
19318impl wkt::message::Message for PromoteReleaseRule {
19319    fn typename() -> &'static str {
19320        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
19321    }
19322}
19323
19324/// The `AdvanceRollout` automation rule will automatically advance a successful
19325/// Rollout to the next phase.
19326#[derive(Clone, Default, PartialEq)]
19327#[non_exhaustive]
19328pub struct AdvanceRolloutRule {
19329    /// Required. ID of the rule. This id must be unique in the `Automation`
19330    /// resource to which this rule belongs. The format is
19331    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19332    pub id: std::string::String,
19333
19334    /// Optional. Proceeds only after phase name matched any one in the list.
19335    /// This value must consist of lower-case letters, numbers, and hyphens,
19336    /// start with a letter and end with a letter or a number, and have a max
19337    /// length of 63 characters. In other words, it must match the following
19338    /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19339    pub source_phases: std::vec::Vec<std::string::String>,
19340
19341    /// Optional. How long to wait after a rollout is finished.
19342    pub wait: std::option::Option<wkt::Duration>,
19343
19344    /// Output only. Information around the state of the Automation rule.
19345    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19346
19347    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19348}
19349
19350impl AdvanceRolloutRule {
19351    /// Creates a new default instance.
19352    pub fn new() -> Self {
19353        std::default::Default::default()
19354    }
19355
19356    /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
19357    ///
19358    /// # Example
19359    /// ```ignore,no_run
19360    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19361    /// let x = AdvanceRolloutRule::new().set_id("example");
19362    /// ```
19363    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19364        self.id = v.into();
19365        self
19366    }
19367
19368    /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
19369    ///
19370    /// # Example
19371    /// ```ignore,no_run
19372    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19373    /// let x = AdvanceRolloutRule::new().set_source_phases(["a", "b", "c"]);
19374    /// ```
19375    pub fn set_source_phases<T, V>(mut self, v: T) -> Self
19376    where
19377        T: std::iter::IntoIterator<Item = V>,
19378        V: std::convert::Into<std::string::String>,
19379    {
19380        use std::iter::Iterator;
19381        self.source_phases = v.into_iter().map(|i| i.into()).collect();
19382        self
19383    }
19384
19385    /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
19386    ///
19387    /// # Example
19388    /// ```ignore,no_run
19389    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19390    /// use wkt::Duration;
19391    /// let x = AdvanceRolloutRule::new().set_wait(Duration::default()/* use setters */);
19392    /// ```
19393    pub fn set_wait<T>(mut self, v: T) -> Self
19394    where
19395        T: std::convert::Into<wkt::Duration>,
19396    {
19397        self.wait = std::option::Option::Some(v.into());
19398        self
19399    }
19400
19401    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
19402    ///
19403    /// # Example
19404    /// ```ignore,no_run
19405    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19406    /// use wkt::Duration;
19407    /// let x = AdvanceRolloutRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19408    /// let x = AdvanceRolloutRule::new().set_or_clear_wait(None::<Duration>);
19409    /// ```
19410    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19411    where
19412        T: std::convert::Into<wkt::Duration>,
19413    {
19414        self.wait = v.map(|x| x.into());
19415        self
19416    }
19417
19418    /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
19419    ///
19420    /// # Example
19421    /// ```ignore,no_run
19422    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19423    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19424    /// let x = AdvanceRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19425    /// ```
19426    pub fn set_condition<T>(mut self, v: T) -> Self
19427    where
19428        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19429    {
19430        self.condition = std::option::Option::Some(v.into());
19431        self
19432    }
19433
19434    /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
19435    ///
19436    /// # Example
19437    /// ```ignore,no_run
19438    /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19439    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19440    /// let x = AdvanceRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19441    /// let x = AdvanceRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19442    /// ```
19443    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19444    where
19445        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19446    {
19447        self.condition = v.map(|x| x.into());
19448        self
19449    }
19450}
19451
19452impl wkt::message::Message for AdvanceRolloutRule {
19453    fn typename() -> &'static str {
19454        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
19455    }
19456}
19457
19458/// The `RepairRolloutRule` automation rule will automatically repair a failed
19459/// `Rollout`.
19460#[derive(Clone, Default, PartialEq)]
19461#[non_exhaustive]
19462pub struct RepairRolloutRule {
19463    /// Required. ID of the rule. This id must be unique in the `Automation`
19464    /// resource to which this rule belongs. The format is
19465    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19466    pub id: std::string::String,
19467
19468    /// Optional. Phases within which jobs are subject to automatic repair actions
19469    /// on failure. Proceeds only after phase name matched any one in the list, or
19470    /// for all phases if unspecified. This value must consist of lower-case
19471    /// letters, numbers, and hyphens, start with a letter and end with a letter or
19472    /// a number, and have a max length of 63 characters. In other words, it must
19473    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19474    pub phases: std::vec::Vec<std::string::String>,
19475
19476    /// Optional. Jobs to repair. Proceeds only after job name matched any one in
19477    /// the list, or for all jobs if unspecified or empty. The phase that includes
19478    /// the job must match the phase ID specified in `source_phase`. This value
19479    /// must consist of lower-case letters, numbers, and hyphens, start with a
19480    /// letter and end with a letter or a number, and have a max length of 63
19481    /// characters. In other words, it must match the following regex:
19482    /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19483    pub jobs: std::vec::Vec<std::string::String>,
19484
19485    /// Output only. Information around the state of the 'Automation' rule.
19486    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19487
19488    /// Required. Defines the types of automatic repair phases for failed jobs.
19489    pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
19490
19491    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19492}
19493
19494impl RepairRolloutRule {
19495    /// Creates a new default instance.
19496    pub fn new() -> Self {
19497        std::default::Default::default()
19498    }
19499
19500    /// Sets the value of [id][crate::model::RepairRolloutRule::id].
19501    ///
19502    /// # Example
19503    /// ```ignore,no_run
19504    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19505    /// let x = RepairRolloutRule::new().set_id("example");
19506    /// ```
19507    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19508        self.id = v.into();
19509        self
19510    }
19511
19512    /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
19513    ///
19514    /// # Example
19515    /// ```ignore,no_run
19516    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19517    /// let x = RepairRolloutRule::new().set_phases(["a", "b", "c"]);
19518    /// ```
19519    pub fn set_phases<T, V>(mut self, v: T) -> Self
19520    where
19521        T: std::iter::IntoIterator<Item = V>,
19522        V: std::convert::Into<std::string::String>,
19523    {
19524        use std::iter::Iterator;
19525        self.phases = v.into_iter().map(|i| i.into()).collect();
19526        self
19527    }
19528
19529    /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
19530    ///
19531    /// # Example
19532    /// ```ignore,no_run
19533    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19534    /// let x = RepairRolloutRule::new().set_jobs(["a", "b", "c"]);
19535    /// ```
19536    pub fn set_jobs<T, V>(mut self, v: T) -> Self
19537    where
19538        T: std::iter::IntoIterator<Item = V>,
19539        V: std::convert::Into<std::string::String>,
19540    {
19541        use std::iter::Iterator;
19542        self.jobs = v.into_iter().map(|i| i.into()).collect();
19543        self
19544    }
19545
19546    /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
19547    ///
19548    /// # Example
19549    /// ```ignore,no_run
19550    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19551    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19552    /// let x = RepairRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19553    /// ```
19554    pub fn set_condition<T>(mut self, v: T) -> Self
19555    where
19556        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19557    {
19558        self.condition = std::option::Option::Some(v.into());
19559        self
19560    }
19561
19562    /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
19563    ///
19564    /// # Example
19565    /// ```ignore,no_run
19566    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19567    /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19568    /// let x = RepairRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19569    /// let x = RepairRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19570    /// ```
19571    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19572    where
19573        T: std::convert::Into<crate::model::AutomationRuleCondition>,
19574    {
19575        self.condition = v.map(|x| x.into());
19576        self
19577    }
19578
19579    /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
19580    ///
19581    /// # Example
19582    /// ```ignore,no_run
19583    /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19584    /// use google_cloud_deploy_v1::model::RepairPhaseConfig;
19585    /// let x = RepairRolloutRule::new()
19586    ///     .set_repair_phases([
19587    ///         RepairPhaseConfig::default()/* use setters */,
19588    ///         RepairPhaseConfig::default()/* use (different) setters */,
19589    ///     ]);
19590    /// ```
19591    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
19592    where
19593        T: std::iter::IntoIterator<Item = V>,
19594        V: std::convert::Into<crate::model::RepairPhaseConfig>,
19595    {
19596        use std::iter::Iterator;
19597        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
19598        self
19599    }
19600}
19601
19602impl wkt::message::Message for RepairRolloutRule {
19603    fn typename() -> &'static str {
19604        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
19605    }
19606}
19607
19608/// Configuration of the repair phase.
19609#[derive(Clone, Default, PartialEq)]
19610#[non_exhaustive]
19611pub struct RepairPhaseConfig {
19612    /// The repair phase to perform.
19613    pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
19614
19615    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19616}
19617
19618impl RepairPhaseConfig {
19619    /// Creates a new default instance.
19620    pub fn new() -> Self {
19621        std::default::Default::default()
19622    }
19623
19624    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
19625    ///
19626    /// Note that all the setters affecting `repair_phase` are mutually
19627    /// exclusive.
19628    ///
19629    /// # Example
19630    /// ```ignore,no_run
19631    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19632    /// use google_cloud_deploy_v1::model::Retry;
19633    /// let x = RepairPhaseConfig::new().set_repair_phase(Some(
19634    ///     google_cloud_deploy_v1::model::repair_phase_config::RepairPhase::Retry(Retry::default().into())));
19635    /// ```
19636    pub fn set_repair_phase<
19637        T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
19638    >(
19639        mut self,
19640        v: T,
19641    ) -> Self {
19642        self.repair_phase = v.into();
19643        self
19644    }
19645
19646    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19647    /// if it holds a `Retry`, `None` if the field is not set or
19648    /// holds a different branch.
19649    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
19650        #[allow(unreachable_patterns)]
19651        self.repair_phase.as_ref().and_then(|v| match v {
19652            crate::model::repair_phase_config::RepairPhase::Retry(v) => {
19653                std::option::Option::Some(v)
19654            }
19655            _ => std::option::Option::None,
19656        })
19657    }
19658
19659    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19660    /// to hold a `Retry`.
19661    ///
19662    /// Note that all the setters affecting `repair_phase` are
19663    /// mutually exclusive.
19664    ///
19665    /// # Example
19666    /// ```ignore,no_run
19667    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19668    /// use google_cloud_deploy_v1::model::Retry;
19669    /// let x = RepairPhaseConfig::new().set_retry(Retry::default()/* use setters */);
19670    /// assert!(x.retry().is_some());
19671    /// assert!(x.rollback().is_none());
19672    /// ```
19673    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
19674        mut self,
19675        v: T,
19676    ) -> Self {
19677        self.repair_phase = std::option::Option::Some(
19678            crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
19679        );
19680        self
19681    }
19682
19683    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19684    /// if it holds a `Rollback`, `None` if the field is not set or
19685    /// holds a different branch.
19686    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
19687        #[allow(unreachable_patterns)]
19688        self.repair_phase.as_ref().and_then(|v| match v {
19689            crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
19690                std::option::Option::Some(v)
19691            }
19692            _ => std::option::Option::None,
19693        })
19694    }
19695
19696    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19697    /// to hold a `Rollback`.
19698    ///
19699    /// Note that all the setters affecting `repair_phase` are
19700    /// mutually exclusive.
19701    ///
19702    /// # Example
19703    /// ```ignore,no_run
19704    /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19705    /// use google_cloud_deploy_v1::model::Rollback;
19706    /// let x = RepairPhaseConfig::new().set_rollback(Rollback::default()/* use setters */);
19707    /// assert!(x.rollback().is_some());
19708    /// assert!(x.retry().is_none());
19709    /// ```
19710    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
19711        mut self,
19712        v: T,
19713    ) -> Self {
19714        self.repair_phase = std::option::Option::Some(
19715            crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
19716        );
19717        self
19718    }
19719}
19720
19721impl wkt::message::Message for RepairPhaseConfig {
19722    fn typename() -> &'static str {
19723        "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
19724    }
19725}
19726
19727/// Defines additional types related to [RepairPhaseConfig].
19728pub mod repair_phase_config {
19729    #[allow(unused_imports)]
19730    use super::*;
19731
19732    /// The repair phase to perform.
19733    #[derive(Clone, Debug, PartialEq)]
19734    #[non_exhaustive]
19735    pub enum RepairPhase {
19736        /// Optional. Retries a failed job.
19737        Retry(std::boxed::Box<crate::model::Retry>),
19738        /// Optional. Rolls back a `Rollout`.
19739        Rollback(std::boxed::Box<crate::model::Rollback>),
19740    }
19741}
19742
19743/// Retries the failed job.
19744#[derive(Clone, Default, PartialEq)]
19745#[non_exhaustive]
19746pub struct Retry {
19747    /// Required. Total number of retries. Retry is skipped if set to 0; The
19748    /// minimum value is 1, and the maximum value is 10.
19749    pub attempts: i64,
19750
19751    /// Optional. How long to wait for the first retry. Default is 0, and the
19752    /// maximum value is 14d.
19753    pub wait: std::option::Option<wkt::Duration>,
19754
19755    /// Optional. The pattern of how wait time will be increased. Default is
19756    /// linear. Backoff mode will be ignored if `wait` is 0.
19757    pub backoff_mode: crate::model::BackoffMode,
19758
19759    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19760}
19761
19762impl Retry {
19763    /// Creates a new default instance.
19764    pub fn new() -> Self {
19765        std::default::Default::default()
19766    }
19767
19768    /// Sets the value of [attempts][crate::model::Retry::attempts].
19769    ///
19770    /// # Example
19771    /// ```ignore,no_run
19772    /// # use google_cloud_deploy_v1::model::Retry;
19773    /// let x = Retry::new().set_attempts(42);
19774    /// ```
19775    pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19776        self.attempts = v.into();
19777        self
19778    }
19779
19780    /// Sets the value of [wait][crate::model::Retry::wait].
19781    ///
19782    /// # Example
19783    /// ```ignore,no_run
19784    /// # use google_cloud_deploy_v1::model::Retry;
19785    /// use wkt::Duration;
19786    /// let x = Retry::new().set_wait(Duration::default()/* use setters */);
19787    /// ```
19788    pub fn set_wait<T>(mut self, v: T) -> Self
19789    where
19790        T: std::convert::Into<wkt::Duration>,
19791    {
19792        self.wait = std::option::Option::Some(v.into());
19793        self
19794    }
19795
19796    /// Sets or clears the value of [wait][crate::model::Retry::wait].
19797    ///
19798    /// # Example
19799    /// ```ignore,no_run
19800    /// # use google_cloud_deploy_v1::model::Retry;
19801    /// use wkt::Duration;
19802    /// let x = Retry::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19803    /// let x = Retry::new().set_or_clear_wait(None::<Duration>);
19804    /// ```
19805    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19806    where
19807        T: std::convert::Into<wkt::Duration>,
19808    {
19809        self.wait = v.map(|x| x.into());
19810        self
19811    }
19812
19813    /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
19814    ///
19815    /// # Example
19816    /// ```ignore,no_run
19817    /// # use google_cloud_deploy_v1::model::Retry;
19818    /// use google_cloud_deploy_v1::model::BackoffMode;
19819    /// let x0 = Retry::new().set_backoff_mode(BackoffMode::Linear);
19820    /// let x1 = Retry::new().set_backoff_mode(BackoffMode::Exponential);
19821    /// ```
19822    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
19823        mut self,
19824        v: T,
19825    ) -> Self {
19826        self.backoff_mode = v.into();
19827        self
19828    }
19829}
19830
19831impl wkt::message::Message for Retry {
19832    fn typename() -> &'static str {
19833        "type.googleapis.com/google.cloud.deploy.v1.Retry"
19834    }
19835}
19836
19837/// Rolls back a `Rollout`.
19838#[derive(Clone, Default, PartialEq)]
19839#[non_exhaustive]
19840pub struct Rollback {
19841    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
19842    /// `Rollout` will start in the stable phase.
19843    pub destination_phase: std::string::String,
19844
19845    /// Optional. If pending rollout exists on the target, the rollback operation
19846    /// will be aborted.
19847    pub disable_rollback_if_rollout_pending: bool,
19848
19849    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19850}
19851
19852impl Rollback {
19853    /// Creates a new default instance.
19854    pub fn new() -> Self {
19855        std::default::Default::default()
19856    }
19857
19858    /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
19859    ///
19860    /// # Example
19861    /// ```ignore,no_run
19862    /// # use google_cloud_deploy_v1::model::Rollback;
19863    /// let x = Rollback::new().set_destination_phase("example");
19864    /// ```
19865    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19866        mut self,
19867        v: T,
19868    ) -> Self {
19869        self.destination_phase = v.into();
19870        self
19871    }
19872
19873    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
19874    ///
19875    /// # Example
19876    /// ```ignore,no_run
19877    /// # use google_cloud_deploy_v1::model::Rollback;
19878    /// let x = Rollback::new().set_disable_rollback_if_rollout_pending(true);
19879    /// ```
19880    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
19881        mut self,
19882        v: T,
19883    ) -> Self {
19884        self.disable_rollback_if_rollout_pending = v.into();
19885        self
19886    }
19887}
19888
19889impl wkt::message::Message for Rollback {
19890    fn typename() -> &'static str {
19891        "type.googleapis.com/google.cloud.deploy.v1.Rollback"
19892    }
19893}
19894
19895/// `AutomationRuleCondition` contains conditions relevant to an
19896/// `Automation` rule.
19897#[derive(Clone, Default, PartialEq)]
19898#[non_exhaustive]
19899pub struct AutomationRuleCondition {
19900    /// Optional. Details around targets enumerated in the rule.
19901    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
19902
19903    /// Details specific to the automation rule type.
19904    pub rule_type_condition:
19905        std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19906
19907    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19908}
19909
19910impl AutomationRuleCondition {
19911    /// Creates a new default instance.
19912    pub fn new() -> Self {
19913        std::default::Default::default()
19914    }
19915
19916    /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19917    ///
19918    /// # Example
19919    /// ```ignore,no_run
19920    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19921    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19922    /// let x = AutomationRuleCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
19923    /// ```
19924    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
19925    where
19926        T: std::convert::Into<crate::model::TargetsPresentCondition>,
19927    {
19928        self.targets_present_condition = std::option::Option::Some(v.into());
19929        self
19930    }
19931
19932    /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19933    ///
19934    /// # Example
19935    /// ```ignore,no_run
19936    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19937    /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19938    /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
19939    /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
19940    /// ```
19941    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
19942    where
19943        T: std::convert::Into<crate::model::TargetsPresentCondition>,
19944    {
19945        self.targets_present_condition = v.map(|x| x.into());
19946        self
19947    }
19948
19949    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
19950    ///
19951    /// Note that all the setters affecting `rule_type_condition` are mutually
19952    /// exclusive.
19953    ///
19954    /// # Example
19955    /// ```ignore,no_run
19956    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19957    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19958    /// let x = AutomationRuleCondition::new().set_rule_type_condition(Some(
19959    ///     google_cloud_deploy_v1::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(TimedPromoteReleaseCondition::default().into())));
19960    /// ```
19961    pub fn set_rule_type_condition<
19962        T: std::convert::Into<
19963                std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19964            >,
19965    >(
19966        mut self,
19967        v: T,
19968    ) -> Self {
19969        self.rule_type_condition = v.into();
19970        self
19971    }
19972
19973    /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19974    /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
19975    /// holds a different branch.
19976    pub fn timed_promote_release_condition(
19977        &self,
19978    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
19979        #[allow(unreachable_patterns)]
19980        self.rule_type_condition.as_ref().and_then(|v| match v {
19981            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
19982            _ => std::option::Option::None,
19983        })
19984    }
19985
19986    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19987    /// to hold a `TimedPromoteReleaseCondition`.
19988    ///
19989    /// Note that all the setters affecting `rule_type_condition` are
19990    /// mutually exclusive.
19991    ///
19992    /// # Example
19993    /// ```ignore,no_run
19994    /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19995    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19996    /// let x = AutomationRuleCondition::new().set_timed_promote_release_condition(TimedPromoteReleaseCondition::default()/* use setters */);
19997    /// assert!(x.timed_promote_release_condition().is_some());
19998    /// ```
19999    pub fn set_timed_promote_release_condition<
20000        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
20001    >(
20002        mut self,
20003        v: T,
20004    ) -> Self {
20005        self.rule_type_condition = std::option::Option::Some(
20006            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
20007                v.into()
20008            )
20009        );
20010        self
20011    }
20012}
20013
20014impl wkt::message::Message for AutomationRuleCondition {
20015    fn typename() -> &'static str {
20016        "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
20017    }
20018}
20019
20020/// Defines additional types related to [AutomationRuleCondition].
20021pub mod automation_rule_condition {
20022    #[allow(unused_imports)]
20023    use super::*;
20024
20025    /// Details specific to the automation rule type.
20026    #[derive(Clone, Debug, PartialEq)]
20027    #[non_exhaustive]
20028    pub enum RuleTypeCondition {
20029        /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
20030        /// to a an Automation with a timed promote release rule defined.
20031        TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
20032    }
20033}
20034
20035/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
20036/// with a Timed Promote Release rule defined.
20037#[derive(Clone, Default, PartialEq)]
20038#[non_exhaustive]
20039pub struct TimedPromoteReleaseCondition {
20040    /// Output only. When the next scheduled promotion(s) will occur.
20041    pub next_promotion_time: std::option::Option<wkt::Timestamp>,
20042
20043    /// Output only. A list of targets involved in the upcoming timed promotion(s).
20044    pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
20045
20046    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20047}
20048
20049impl TimedPromoteReleaseCondition {
20050    /// Creates a new default instance.
20051    pub fn new() -> Self {
20052        std::default::Default::default()
20053    }
20054
20055    /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
20056    ///
20057    /// # Example
20058    /// ```ignore,no_run
20059    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
20060    /// use wkt::Timestamp;
20061    /// let x = TimedPromoteReleaseCondition::new().set_next_promotion_time(Timestamp::default()/* use setters */);
20062    /// ```
20063    pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
20064    where
20065        T: std::convert::Into<wkt::Timestamp>,
20066    {
20067        self.next_promotion_time = std::option::Option::Some(v.into());
20068        self
20069    }
20070
20071    /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
20072    ///
20073    /// # Example
20074    /// ```ignore,no_run
20075    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
20076    /// use wkt::Timestamp;
20077    /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(Some(Timestamp::default()/* use setters */));
20078    /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(None::<Timestamp>);
20079    /// ```
20080    pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
20081    where
20082        T: std::convert::Into<wkt::Timestamp>,
20083    {
20084        self.next_promotion_time = v.map(|x| x.into());
20085        self
20086    }
20087
20088    /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
20089    ///
20090    /// # Example
20091    /// ```ignore,no_run
20092    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
20093    /// use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20094    /// let x = TimedPromoteReleaseCondition::new()
20095    ///     .set_targets_list([
20096    ///         Targets::default()/* use setters */,
20097    ///         Targets::default()/* use (different) setters */,
20098    ///     ]);
20099    /// ```
20100    pub fn set_targets_list<T, V>(mut self, v: T) -> Self
20101    where
20102        T: std::iter::IntoIterator<Item = V>,
20103        V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
20104    {
20105        use std::iter::Iterator;
20106        self.targets_list = v.into_iter().map(|i| i.into()).collect();
20107        self
20108    }
20109}
20110
20111impl wkt::message::Message for TimedPromoteReleaseCondition {
20112    fn typename() -> &'static str {
20113        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
20114    }
20115}
20116
20117/// Defines additional types related to [TimedPromoteReleaseCondition].
20118pub mod timed_promote_release_condition {
20119    #[allow(unused_imports)]
20120    use super::*;
20121
20122    /// The targets involved in a single timed promotion.
20123    #[derive(Clone, Default, PartialEq)]
20124    #[non_exhaustive]
20125    pub struct Targets {
20126        /// Optional. The source target ID.
20127        pub source_target_id: std::string::String,
20128
20129        /// Optional. The destination target ID.
20130        pub destination_target_id: std::string::String,
20131
20132        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20133    }
20134
20135    impl Targets {
20136        /// Creates a new default instance.
20137        pub fn new() -> Self {
20138            std::default::Default::default()
20139        }
20140
20141        /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
20142        ///
20143        /// # Example
20144        /// ```ignore,no_run
20145        /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20146        /// let x = Targets::new().set_source_target_id("example");
20147        /// ```
20148        pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
20149            mut self,
20150            v: T,
20151        ) -> Self {
20152            self.source_target_id = v.into();
20153            self
20154        }
20155
20156        /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
20157        ///
20158        /// # Example
20159        /// ```ignore,no_run
20160        /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20161        /// let x = Targets::new().set_destination_target_id("example");
20162        /// ```
20163        pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
20164            mut self,
20165            v: T,
20166        ) -> Self {
20167            self.destination_target_id = v.into();
20168            self
20169        }
20170    }
20171
20172    impl wkt::message::Message for Targets {
20173        fn typename() -> &'static str {
20174            "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
20175        }
20176    }
20177}
20178
20179/// The request object for `CreateAutomation`.
20180#[derive(Clone, Default, PartialEq)]
20181#[non_exhaustive]
20182pub struct CreateAutomationRequest {
20183    /// Required. The parent collection in which the `Automation` must be created.
20184    /// The format is
20185    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20186    pub parent: std::string::String,
20187
20188    /// Required. ID of the `Automation`.
20189    pub automation_id: std::string::String,
20190
20191    /// Required. The `Automation` to create.
20192    pub automation: std::option::Option<crate::model::Automation>,
20193
20194    /// Optional. A request ID to identify requests. Specify a unique request ID
20195    /// so that if you must retry your request, the server knows to ignore the
20196    /// request if it has already been completed. The server guarantees that for
20197    /// at least 60 minutes after the first request.
20198    ///
20199    /// For example, consider a situation where you make an initial request and the
20200    /// request times out. If you make the request again with the same request ID,
20201    /// the server can check if original operation with the same request ID was
20202    /// received, and if so, will ignore the second request. This prevents clients
20203    /// from accidentally creating duplicate commitments.
20204    ///
20205    /// The request ID must be a valid UUID with the exception that zero UUID is
20206    /// not supported (00000000-0000-0000-0000-000000000000).
20207    pub request_id: std::string::String,
20208
20209    /// Optional. If set to true, the request is validated and the user is provided
20210    /// with an expected result, but no actual change is made.
20211    pub validate_only: bool,
20212
20213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20214}
20215
20216impl CreateAutomationRequest {
20217    /// Creates a new default instance.
20218    pub fn new() -> Self {
20219        std::default::Default::default()
20220    }
20221
20222    /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
20223    ///
20224    /// # Example
20225    /// ```ignore,no_run
20226    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20227    /// # let project_id = "project_id";
20228    /// # let location_id = "location_id";
20229    /// # let delivery_pipeline_id = "delivery_pipeline_id";
20230    /// let x = CreateAutomationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
20231    /// ```
20232    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20233        self.parent = v.into();
20234        self
20235    }
20236
20237    /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
20238    ///
20239    /// # Example
20240    /// ```ignore,no_run
20241    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20242    /// let x = CreateAutomationRequest::new().set_automation_id("example");
20243    /// ```
20244    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20245        self.automation_id = v.into();
20246        self
20247    }
20248
20249    /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
20250    ///
20251    /// # Example
20252    /// ```ignore,no_run
20253    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20254    /// use google_cloud_deploy_v1::model::Automation;
20255    /// let x = CreateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20256    /// ```
20257    pub fn set_automation<T>(mut self, v: T) -> Self
20258    where
20259        T: std::convert::Into<crate::model::Automation>,
20260    {
20261        self.automation = std::option::Option::Some(v.into());
20262        self
20263    }
20264
20265    /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
20266    ///
20267    /// # Example
20268    /// ```ignore,no_run
20269    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20270    /// use google_cloud_deploy_v1::model::Automation;
20271    /// let x = CreateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20272    /// let x = CreateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20273    /// ```
20274    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20275    where
20276        T: std::convert::Into<crate::model::Automation>,
20277    {
20278        self.automation = v.map(|x| x.into());
20279        self
20280    }
20281
20282    /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
20283    ///
20284    /// # Example
20285    /// ```ignore,no_run
20286    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20287    /// let x = CreateAutomationRequest::new().set_request_id("example");
20288    /// ```
20289    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20290        self.request_id = v.into();
20291        self
20292    }
20293
20294    /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
20295    ///
20296    /// # Example
20297    /// ```ignore,no_run
20298    /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20299    /// let x = CreateAutomationRequest::new().set_validate_only(true);
20300    /// ```
20301    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20302        self.validate_only = v.into();
20303        self
20304    }
20305}
20306
20307impl wkt::message::Message for CreateAutomationRequest {
20308    fn typename() -> &'static str {
20309        "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
20310    }
20311}
20312
20313/// The request object for `UpdateAutomation`.
20314#[derive(Clone, Default, PartialEq)]
20315#[non_exhaustive]
20316pub struct UpdateAutomationRequest {
20317    /// Required. Field mask is used to specify the fields to be overwritten by the
20318    /// update in the `Automation` resource. The fields specified in the
20319    /// update_mask are relative to the resource, not the full request. A field
20320    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
20321    /// then all fields are overwritten.
20322    pub update_mask: std::option::Option<wkt::FieldMask>,
20323
20324    /// Required. The `Automation` to update.
20325    pub automation: std::option::Option<crate::model::Automation>,
20326
20327    /// Optional. A request ID to identify requests. Specify a unique request ID
20328    /// so that if you must retry your request, the server knows to ignore the
20329    /// request if it has already been completed. The server guarantees that for
20330    /// at least 60 minutes after the first request.
20331    ///
20332    /// For example, consider a situation where you make an initial request and the
20333    /// request times out. If you make the request again with the same request ID,
20334    /// the server can check if original operation with the same request ID was
20335    /// received, and if so, will ignore the second request. This prevents clients
20336    /// from accidentally creating duplicate commitments.
20337    ///
20338    /// The request ID must be a valid UUID with the exception that zero UUID is
20339    /// not supported (00000000-0000-0000-0000-000000000000).
20340    pub request_id: std::string::String,
20341
20342    /// Optional. If set to true, updating a `Automation` that does not exist will
20343    /// result in the creation of a new `Automation`.
20344    pub allow_missing: bool,
20345
20346    /// Optional. If set to true, the request is validated and the user is provided
20347    /// with an expected result, but no actual change is made.
20348    pub validate_only: bool,
20349
20350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20351}
20352
20353impl UpdateAutomationRequest {
20354    /// Creates a new default instance.
20355    pub fn new() -> Self {
20356        std::default::Default::default()
20357    }
20358
20359    /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20360    ///
20361    /// # Example
20362    /// ```ignore,no_run
20363    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20364    /// use wkt::FieldMask;
20365    /// let x = UpdateAutomationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20366    /// ```
20367    pub fn set_update_mask<T>(mut self, v: T) -> Self
20368    where
20369        T: std::convert::Into<wkt::FieldMask>,
20370    {
20371        self.update_mask = std::option::Option::Some(v.into());
20372        self
20373    }
20374
20375    /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20376    ///
20377    /// # Example
20378    /// ```ignore,no_run
20379    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20380    /// use wkt::FieldMask;
20381    /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20382    /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20383    /// ```
20384    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20385    where
20386        T: std::convert::Into<wkt::FieldMask>,
20387    {
20388        self.update_mask = v.map(|x| x.into());
20389        self
20390    }
20391
20392    /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
20393    ///
20394    /// # Example
20395    /// ```ignore,no_run
20396    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20397    /// use google_cloud_deploy_v1::model::Automation;
20398    /// let x = UpdateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20399    /// ```
20400    pub fn set_automation<T>(mut self, v: T) -> Self
20401    where
20402        T: std::convert::Into<crate::model::Automation>,
20403    {
20404        self.automation = std::option::Option::Some(v.into());
20405        self
20406    }
20407
20408    /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
20409    ///
20410    /// # Example
20411    /// ```ignore,no_run
20412    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20413    /// use google_cloud_deploy_v1::model::Automation;
20414    /// let x = UpdateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20415    /// let x = UpdateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20416    /// ```
20417    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20418    where
20419        T: std::convert::Into<crate::model::Automation>,
20420    {
20421        self.automation = v.map(|x| x.into());
20422        self
20423    }
20424
20425    /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
20426    ///
20427    /// # Example
20428    /// ```ignore,no_run
20429    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20430    /// let x = UpdateAutomationRequest::new().set_request_id("example");
20431    /// ```
20432    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20433        self.request_id = v.into();
20434        self
20435    }
20436
20437    /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
20438    ///
20439    /// # Example
20440    /// ```ignore,no_run
20441    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20442    /// let x = UpdateAutomationRequest::new().set_allow_missing(true);
20443    /// ```
20444    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20445        self.allow_missing = v.into();
20446        self
20447    }
20448
20449    /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
20450    ///
20451    /// # Example
20452    /// ```ignore,no_run
20453    /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20454    /// let x = UpdateAutomationRequest::new().set_validate_only(true);
20455    /// ```
20456    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20457        self.validate_only = v.into();
20458        self
20459    }
20460}
20461
20462impl wkt::message::Message for UpdateAutomationRequest {
20463    fn typename() -> &'static str {
20464        "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
20465    }
20466}
20467
20468/// The request object for `DeleteAutomation`.
20469#[derive(Clone, Default, PartialEq)]
20470#[non_exhaustive]
20471pub struct DeleteAutomationRequest {
20472    /// Required. The name of the `Automation` to delete. The format is
20473    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20474    pub name: std::string::String,
20475
20476    /// Optional. A request ID to identify requests. Specify a unique request ID
20477    /// so that if you must retry your request, the server knows to ignore the
20478    /// request if it has already been completed. The server guarantees that for
20479    /// at least 60 minutes after the first request.
20480    ///
20481    /// For example, consider a situation where you make an initial request and the
20482    /// request times out. If you make the request again with the same request ID,
20483    /// the server can check if original operation with the same request ID was
20484    /// received, and if so, will ignore the second request. This prevents clients
20485    /// from accidentally creating duplicate commitments.
20486    ///
20487    /// The request ID must be a valid UUID with the exception that zero UUID is
20488    /// not supported (00000000-0000-0000-0000-000000000000).
20489    pub request_id: std::string::String,
20490
20491    /// Optional. If set to true, then deleting an already deleted or non-existing
20492    /// `Automation` will succeed.
20493    pub allow_missing: bool,
20494
20495    /// Optional. If set, validate the request and verify whether the resource
20496    /// exists, but do not actually post it.
20497    pub validate_only: bool,
20498
20499    /// Optional. The weak etag of the request.
20500    /// This checksum is computed by the server based on the value of other
20501    /// fields, and may be sent on update and delete requests to ensure the
20502    /// client has an up-to-date value before proceeding.
20503    pub etag: std::string::String,
20504
20505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20506}
20507
20508impl DeleteAutomationRequest {
20509    /// Creates a new default instance.
20510    pub fn new() -> Self {
20511        std::default::Default::default()
20512    }
20513
20514    /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
20515    ///
20516    /// # Example
20517    /// ```ignore,no_run
20518    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20519    /// # let project_id = "project_id";
20520    /// # let location_id = "location_id";
20521    /// # let delivery_pipeline_id = "delivery_pipeline_id";
20522    /// # let automation_id = "automation_id";
20523    /// let x = DeleteAutomationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automations/{automation_id}"));
20524    /// ```
20525    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20526        self.name = v.into();
20527        self
20528    }
20529
20530    /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
20531    ///
20532    /// # Example
20533    /// ```ignore,no_run
20534    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20535    /// let x = DeleteAutomationRequest::new().set_request_id("example");
20536    /// ```
20537    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20538        self.request_id = v.into();
20539        self
20540    }
20541
20542    /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
20543    ///
20544    /// # Example
20545    /// ```ignore,no_run
20546    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20547    /// let x = DeleteAutomationRequest::new().set_allow_missing(true);
20548    /// ```
20549    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20550        self.allow_missing = v.into();
20551        self
20552    }
20553
20554    /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
20555    ///
20556    /// # Example
20557    /// ```ignore,no_run
20558    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20559    /// let x = DeleteAutomationRequest::new().set_validate_only(true);
20560    /// ```
20561    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20562        self.validate_only = v.into();
20563        self
20564    }
20565
20566    /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
20567    ///
20568    /// # Example
20569    /// ```ignore,no_run
20570    /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20571    /// let x = DeleteAutomationRequest::new().set_etag("example");
20572    /// ```
20573    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20574        self.etag = v.into();
20575        self
20576    }
20577}
20578
20579impl wkt::message::Message for DeleteAutomationRequest {
20580    fn typename() -> &'static str {
20581        "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
20582    }
20583}
20584
20585/// The request object for `ListAutomations`.
20586#[derive(Clone, Default, PartialEq)]
20587#[non_exhaustive]
20588pub struct ListAutomationsRequest {
20589    /// Required. The parent `Delivery Pipeline`, which owns this collection of
20590    /// automations. Format must be
20591    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20592    pub parent: std::string::String,
20593
20594    /// The maximum number of automations to return. The service may return
20595    /// fewer than this value. If unspecified, at most 50 automations will
20596    /// be returned. The maximum value is 1000; values above 1000 will be set
20597    /// to 1000.
20598    pub page_size: i32,
20599
20600    /// A page token, received from a previous `ListAutomations` call.
20601    /// Provide this to retrieve the subsequent page.
20602    ///
20603    /// When paginating, all other provided parameters match
20604    /// the call that provided the page token.
20605    pub page_token: std::string::String,
20606
20607    /// Filter automations to be returned. All fields can be used in the
20608    /// filter.
20609    pub filter: std::string::String,
20610
20611    /// Field to sort by.
20612    pub order_by: std::string::String,
20613
20614    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20615}
20616
20617impl ListAutomationsRequest {
20618    /// Creates a new default instance.
20619    pub fn new() -> Self {
20620        std::default::Default::default()
20621    }
20622
20623    /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
20624    ///
20625    /// # Example
20626    /// ```ignore,no_run
20627    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20628    /// # let project_id = "project_id";
20629    /// # let location_id = "location_id";
20630    /// # let delivery_pipeline_id = "delivery_pipeline_id";
20631    /// let x = ListAutomationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
20632    /// ```
20633    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20634        self.parent = v.into();
20635        self
20636    }
20637
20638    /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
20639    ///
20640    /// # Example
20641    /// ```ignore,no_run
20642    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20643    /// let x = ListAutomationsRequest::new().set_page_size(42);
20644    /// ```
20645    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20646        self.page_size = v.into();
20647        self
20648    }
20649
20650    /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
20651    ///
20652    /// # Example
20653    /// ```ignore,no_run
20654    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20655    /// let x = ListAutomationsRequest::new().set_page_token("example");
20656    /// ```
20657    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20658        self.page_token = v.into();
20659        self
20660    }
20661
20662    /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
20663    ///
20664    /// # Example
20665    /// ```ignore,no_run
20666    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20667    /// let x = ListAutomationsRequest::new().set_filter("example");
20668    /// ```
20669    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20670        self.filter = v.into();
20671        self
20672    }
20673
20674    /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
20675    ///
20676    /// # Example
20677    /// ```ignore,no_run
20678    /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20679    /// let x = ListAutomationsRequest::new().set_order_by("example");
20680    /// ```
20681    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20682        self.order_by = v.into();
20683        self
20684    }
20685}
20686
20687impl wkt::message::Message for ListAutomationsRequest {
20688    fn typename() -> &'static str {
20689        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
20690    }
20691}
20692
20693/// The response object from `ListAutomations`.
20694#[derive(Clone, Default, PartialEq)]
20695#[non_exhaustive]
20696pub struct ListAutomationsResponse {
20697    /// The `Automation` objects.
20698    pub automations: std::vec::Vec<crate::model::Automation>,
20699
20700    /// A token, which can be sent as `page_token` to retrieve the next page.
20701    /// If this field is omitted, there are no subsequent pages.
20702    pub next_page_token: std::string::String,
20703
20704    /// Locations that could not be reached.
20705    pub unreachable: std::vec::Vec<std::string::String>,
20706
20707    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20708}
20709
20710impl ListAutomationsResponse {
20711    /// Creates a new default instance.
20712    pub fn new() -> Self {
20713        std::default::Default::default()
20714    }
20715
20716    /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
20717    ///
20718    /// # Example
20719    /// ```ignore,no_run
20720    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20721    /// use google_cloud_deploy_v1::model::Automation;
20722    /// let x = ListAutomationsResponse::new()
20723    ///     .set_automations([
20724    ///         Automation::default()/* use setters */,
20725    ///         Automation::default()/* use (different) setters */,
20726    ///     ]);
20727    /// ```
20728    pub fn set_automations<T, V>(mut self, v: T) -> Self
20729    where
20730        T: std::iter::IntoIterator<Item = V>,
20731        V: std::convert::Into<crate::model::Automation>,
20732    {
20733        use std::iter::Iterator;
20734        self.automations = v.into_iter().map(|i| i.into()).collect();
20735        self
20736    }
20737
20738    /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
20739    ///
20740    /// # Example
20741    /// ```ignore,no_run
20742    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20743    /// let x = ListAutomationsResponse::new().set_next_page_token("example");
20744    /// ```
20745    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20746        self.next_page_token = v.into();
20747        self
20748    }
20749
20750    /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
20751    ///
20752    /// # Example
20753    /// ```ignore,no_run
20754    /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20755    /// let x = ListAutomationsResponse::new().set_unreachable(["a", "b", "c"]);
20756    /// ```
20757    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20758    where
20759        T: std::iter::IntoIterator<Item = V>,
20760        V: std::convert::Into<std::string::String>,
20761    {
20762        use std::iter::Iterator;
20763        self.unreachable = v.into_iter().map(|i| i.into()).collect();
20764        self
20765    }
20766}
20767
20768impl wkt::message::Message for ListAutomationsResponse {
20769    fn typename() -> &'static str {
20770        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
20771    }
20772}
20773
20774#[doc(hidden)]
20775impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationsResponse {
20776    type PageItem = crate::model::Automation;
20777
20778    fn items(self) -> std::vec::Vec<Self::PageItem> {
20779        self.automations
20780    }
20781
20782    fn next_page_token(&self) -> std::string::String {
20783        use std::clone::Clone;
20784        self.next_page_token.clone()
20785    }
20786}
20787
20788/// The request object for `GetAutomation`
20789#[derive(Clone, Default, PartialEq)]
20790#[non_exhaustive]
20791pub struct GetAutomationRequest {
20792    /// Required. Name of the `Automation`. Format must be
20793    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20794    pub name: std::string::String,
20795
20796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20797}
20798
20799impl GetAutomationRequest {
20800    /// Creates a new default instance.
20801    pub fn new() -> Self {
20802        std::default::Default::default()
20803    }
20804
20805    /// Sets the value of [name][crate::model::GetAutomationRequest::name].
20806    ///
20807    /// # Example
20808    /// ```ignore,no_run
20809    /// # use google_cloud_deploy_v1::model::GetAutomationRequest;
20810    /// # let project_id = "project_id";
20811    /// # let location_id = "location_id";
20812    /// # let delivery_pipeline_id = "delivery_pipeline_id";
20813    /// # let automation_id = "automation_id";
20814    /// let x = GetAutomationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automations/{automation_id}"));
20815    /// ```
20816    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20817        self.name = v.into();
20818        self
20819    }
20820}
20821
20822impl wkt::message::Message for GetAutomationRequest {
20823    fn typename() -> &'static str {
20824        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
20825    }
20826}
20827
20828/// An `AutomationRun` resource in the Cloud Deploy API.
20829///
20830/// An `AutomationRun` represents an execution instance of an
20831/// automation rule.
20832#[derive(Clone, Default, PartialEq)]
20833#[non_exhaustive]
20834pub struct AutomationRun {
20835    /// Output only. Name of the `AutomationRun`. Format is
20836    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
20837    pub name: std::string::String,
20838
20839    /// Output only. Time at which the `AutomationRun` was created.
20840    pub create_time: std::option::Option<wkt::Timestamp>,
20841
20842    /// Output only. Time at which the automationRun was updated.
20843    pub update_time: std::option::Option<wkt::Timestamp>,
20844
20845    /// Output only. The weak etag of the `AutomationRun` resource.
20846    /// This checksum is computed by the server based on the value of other
20847    /// fields, and may be sent on update and delete requests to ensure the
20848    /// client has an up-to-date value before proceeding.
20849    pub etag: std::string::String,
20850
20851    /// Output only. Email address of the user-managed IAM service account that
20852    /// performs the operations against Cloud Deploy resources.
20853    pub service_account: std::string::String,
20854
20855    /// Output only. Snapshot of the Automation taken at AutomationRun creation
20856    /// time.
20857    pub automation_snapshot: std::option::Option<crate::model::Automation>,
20858
20859    /// Output only. The ID of the source target that initiates the
20860    /// `AutomationRun`. The value of this field is the last segment of a target
20861    /// name.
20862    pub target_id: std::string::String,
20863
20864    /// Output only. Current state of the `AutomationRun`.
20865    pub state: crate::model::automation_run::State,
20866
20867    /// Output only. Explains the current state of the `AutomationRun`. Present
20868    /// only when an explanation is needed.
20869    pub state_description: std::string::String,
20870
20871    /// Output only. Contains information about what policies prevented the
20872    /// `AutomationRun` from proceeding.
20873    pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
20874
20875    /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
20876    /// after 14 days from its creation date.
20877    pub expire_time: std::option::Option<wkt::Timestamp>,
20878
20879    /// Output only. The ID of the automation rule that initiated the operation.
20880    pub rule_id: std::string::String,
20881
20882    /// Output only. The ID of the automation that initiated the operation.
20883    pub automation_id: std::string::String,
20884
20885    /// Output only. Earliest time the `AutomationRun` will attempt to resume.
20886    /// Wait-time is configured by `wait` in automation rule.
20887    pub wait_until_time: std::option::Option<wkt::Timestamp>,
20888
20889    /// The operation that the `AutomationRun` will perform.
20890    pub operation: std::option::Option<crate::model::automation_run::Operation>,
20891
20892    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20893}
20894
20895impl AutomationRun {
20896    /// Creates a new default instance.
20897    pub fn new() -> Self {
20898        std::default::Default::default()
20899    }
20900
20901    /// Sets the value of [name][crate::model::AutomationRun::name].
20902    ///
20903    /// # Example
20904    /// ```ignore,no_run
20905    /// # use google_cloud_deploy_v1::model::AutomationRun;
20906    /// # let project_id = "project_id";
20907    /// # let location_id = "location_id";
20908    /// # let delivery_pipeline_id = "delivery_pipeline_id";
20909    /// # let automation_run_id = "automation_run_id";
20910    /// let x = AutomationRun::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automationRuns/{automation_run_id}"));
20911    /// ```
20912    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20913        self.name = v.into();
20914        self
20915    }
20916
20917    /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
20918    ///
20919    /// # Example
20920    /// ```ignore,no_run
20921    /// # use google_cloud_deploy_v1::model::AutomationRun;
20922    /// use wkt::Timestamp;
20923    /// let x = AutomationRun::new().set_create_time(Timestamp::default()/* use setters */);
20924    /// ```
20925    pub fn set_create_time<T>(mut self, v: T) -> Self
20926    where
20927        T: std::convert::Into<wkt::Timestamp>,
20928    {
20929        self.create_time = std::option::Option::Some(v.into());
20930        self
20931    }
20932
20933    /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
20934    ///
20935    /// # Example
20936    /// ```ignore,no_run
20937    /// # use google_cloud_deploy_v1::model::AutomationRun;
20938    /// use wkt::Timestamp;
20939    /// let x = AutomationRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20940    /// let x = AutomationRun::new().set_or_clear_create_time(None::<Timestamp>);
20941    /// ```
20942    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20943    where
20944        T: std::convert::Into<wkt::Timestamp>,
20945    {
20946        self.create_time = v.map(|x| x.into());
20947        self
20948    }
20949
20950    /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
20951    ///
20952    /// # Example
20953    /// ```ignore,no_run
20954    /// # use google_cloud_deploy_v1::model::AutomationRun;
20955    /// use wkt::Timestamp;
20956    /// let x = AutomationRun::new().set_update_time(Timestamp::default()/* use setters */);
20957    /// ```
20958    pub fn set_update_time<T>(mut self, v: T) -> Self
20959    where
20960        T: std::convert::Into<wkt::Timestamp>,
20961    {
20962        self.update_time = std::option::Option::Some(v.into());
20963        self
20964    }
20965
20966    /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
20967    ///
20968    /// # Example
20969    /// ```ignore,no_run
20970    /// # use google_cloud_deploy_v1::model::AutomationRun;
20971    /// use wkt::Timestamp;
20972    /// let x = AutomationRun::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20973    /// let x = AutomationRun::new().set_or_clear_update_time(None::<Timestamp>);
20974    /// ```
20975    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20976    where
20977        T: std::convert::Into<wkt::Timestamp>,
20978    {
20979        self.update_time = v.map(|x| x.into());
20980        self
20981    }
20982
20983    /// Sets the value of [etag][crate::model::AutomationRun::etag].
20984    ///
20985    /// # Example
20986    /// ```ignore,no_run
20987    /// # use google_cloud_deploy_v1::model::AutomationRun;
20988    /// let x = AutomationRun::new().set_etag("example");
20989    /// ```
20990    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20991        self.etag = v.into();
20992        self
20993    }
20994
20995    /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
20996    ///
20997    /// # Example
20998    /// ```ignore,no_run
20999    /// # use google_cloud_deploy_v1::model::AutomationRun;
21000    /// let x = AutomationRun::new().set_service_account("example");
21001    /// ```
21002    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21003        self.service_account = v.into();
21004        self
21005    }
21006
21007    /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
21008    ///
21009    /// # Example
21010    /// ```ignore,no_run
21011    /// # use google_cloud_deploy_v1::model::AutomationRun;
21012    /// use google_cloud_deploy_v1::model::Automation;
21013    /// let x = AutomationRun::new().set_automation_snapshot(Automation::default()/* use setters */);
21014    /// ```
21015    pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
21016    where
21017        T: std::convert::Into<crate::model::Automation>,
21018    {
21019        self.automation_snapshot = std::option::Option::Some(v.into());
21020        self
21021    }
21022
21023    /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
21024    ///
21025    /// # Example
21026    /// ```ignore,no_run
21027    /// # use google_cloud_deploy_v1::model::AutomationRun;
21028    /// use google_cloud_deploy_v1::model::Automation;
21029    /// let x = AutomationRun::new().set_or_clear_automation_snapshot(Some(Automation::default()/* use setters */));
21030    /// let x = AutomationRun::new().set_or_clear_automation_snapshot(None::<Automation>);
21031    /// ```
21032    pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
21033    where
21034        T: std::convert::Into<crate::model::Automation>,
21035    {
21036        self.automation_snapshot = v.map(|x| x.into());
21037        self
21038    }
21039
21040    /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
21041    ///
21042    /// # Example
21043    /// ```ignore,no_run
21044    /// # use google_cloud_deploy_v1::model::AutomationRun;
21045    /// let x = AutomationRun::new().set_target_id("example");
21046    /// ```
21047    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21048        self.target_id = v.into();
21049        self
21050    }
21051
21052    /// Sets the value of [state][crate::model::AutomationRun::state].
21053    ///
21054    /// # Example
21055    /// ```ignore,no_run
21056    /// # use google_cloud_deploy_v1::model::AutomationRun;
21057    /// use google_cloud_deploy_v1::model::automation_run::State;
21058    /// let x0 = AutomationRun::new().set_state(State::Succeeded);
21059    /// let x1 = AutomationRun::new().set_state(State::Cancelled);
21060    /// let x2 = AutomationRun::new().set_state(State::Failed);
21061    /// ```
21062    pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
21063        mut self,
21064        v: T,
21065    ) -> Self {
21066        self.state = v.into();
21067        self
21068    }
21069
21070    /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
21071    ///
21072    /// # Example
21073    /// ```ignore,no_run
21074    /// # use google_cloud_deploy_v1::model::AutomationRun;
21075    /// let x = AutomationRun::new().set_state_description("example");
21076    /// ```
21077    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
21078        mut self,
21079        v: T,
21080    ) -> Self {
21081        self.state_description = v.into();
21082        self
21083    }
21084
21085    /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
21086    ///
21087    /// # Example
21088    /// ```ignore,no_run
21089    /// # use google_cloud_deploy_v1::model::AutomationRun;
21090    /// use google_cloud_deploy_v1::model::PolicyViolation;
21091    /// let x = AutomationRun::new().set_policy_violation(PolicyViolation::default()/* use setters */);
21092    /// ```
21093    pub fn set_policy_violation<T>(mut self, v: T) -> Self
21094    where
21095        T: std::convert::Into<crate::model::PolicyViolation>,
21096    {
21097        self.policy_violation = std::option::Option::Some(v.into());
21098        self
21099    }
21100
21101    /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
21102    ///
21103    /// # Example
21104    /// ```ignore,no_run
21105    /// # use google_cloud_deploy_v1::model::AutomationRun;
21106    /// use google_cloud_deploy_v1::model::PolicyViolation;
21107    /// let x = AutomationRun::new().set_or_clear_policy_violation(Some(PolicyViolation::default()/* use setters */));
21108    /// let x = AutomationRun::new().set_or_clear_policy_violation(None::<PolicyViolation>);
21109    /// ```
21110    pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
21111    where
21112        T: std::convert::Into<crate::model::PolicyViolation>,
21113    {
21114        self.policy_violation = v.map(|x| x.into());
21115        self
21116    }
21117
21118    /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
21119    ///
21120    /// # Example
21121    /// ```ignore,no_run
21122    /// # use google_cloud_deploy_v1::model::AutomationRun;
21123    /// use wkt::Timestamp;
21124    /// let x = AutomationRun::new().set_expire_time(Timestamp::default()/* use setters */);
21125    /// ```
21126    pub fn set_expire_time<T>(mut self, v: T) -> Self
21127    where
21128        T: std::convert::Into<wkt::Timestamp>,
21129    {
21130        self.expire_time = std::option::Option::Some(v.into());
21131        self
21132    }
21133
21134    /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
21135    ///
21136    /// # Example
21137    /// ```ignore,no_run
21138    /// # use google_cloud_deploy_v1::model::AutomationRun;
21139    /// use wkt::Timestamp;
21140    /// let x = AutomationRun::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
21141    /// let x = AutomationRun::new().set_or_clear_expire_time(None::<Timestamp>);
21142    /// ```
21143    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
21144    where
21145        T: std::convert::Into<wkt::Timestamp>,
21146    {
21147        self.expire_time = v.map(|x| x.into());
21148        self
21149    }
21150
21151    /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
21152    ///
21153    /// # Example
21154    /// ```ignore,no_run
21155    /// # use google_cloud_deploy_v1::model::AutomationRun;
21156    /// let x = AutomationRun::new().set_rule_id("example");
21157    /// ```
21158    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21159        self.rule_id = v.into();
21160        self
21161    }
21162
21163    /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
21164    ///
21165    /// # Example
21166    /// ```ignore,no_run
21167    /// # use google_cloud_deploy_v1::model::AutomationRun;
21168    /// let x = AutomationRun::new().set_automation_id("example");
21169    /// ```
21170    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21171        self.automation_id = v.into();
21172        self
21173    }
21174
21175    /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
21176    ///
21177    /// # Example
21178    /// ```ignore,no_run
21179    /// # use google_cloud_deploy_v1::model::AutomationRun;
21180    /// use wkt::Timestamp;
21181    /// let x = AutomationRun::new().set_wait_until_time(Timestamp::default()/* use setters */);
21182    /// ```
21183    pub fn set_wait_until_time<T>(mut self, v: T) -> Self
21184    where
21185        T: std::convert::Into<wkt::Timestamp>,
21186    {
21187        self.wait_until_time = std::option::Option::Some(v.into());
21188        self
21189    }
21190
21191    /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
21192    ///
21193    /// # Example
21194    /// ```ignore,no_run
21195    /// # use google_cloud_deploy_v1::model::AutomationRun;
21196    /// use wkt::Timestamp;
21197    /// let x = AutomationRun::new().set_or_clear_wait_until_time(Some(Timestamp::default()/* use setters */));
21198    /// let x = AutomationRun::new().set_or_clear_wait_until_time(None::<Timestamp>);
21199    /// ```
21200    pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
21201    where
21202        T: std::convert::Into<wkt::Timestamp>,
21203    {
21204        self.wait_until_time = v.map(|x| x.into());
21205        self
21206    }
21207
21208    /// Sets the value of [operation][crate::model::AutomationRun::operation].
21209    ///
21210    /// Note that all the setters affecting `operation` are mutually
21211    /// exclusive.
21212    ///
21213    /// # Example
21214    /// ```ignore,no_run
21215    /// # use google_cloud_deploy_v1::model::AutomationRun;
21216    /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21217    /// let x = AutomationRun::new().set_operation(Some(
21218    ///     google_cloud_deploy_v1::model::automation_run::Operation::PromoteReleaseOperation(PromoteReleaseOperation::default().into())));
21219    /// ```
21220    pub fn set_operation<
21221        T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
21222    >(
21223        mut self,
21224        v: T,
21225    ) -> Self {
21226        self.operation = v.into();
21227        self
21228    }
21229
21230    /// The value of [operation][crate::model::AutomationRun::operation]
21231    /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
21232    /// holds a different branch.
21233    pub fn promote_release_operation(
21234        &self,
21235    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
21236        #[allow(unreachable_patterns)]
21237        self.operation.as_ref().and_then(|v| match v {
21238            crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
21239                std::option::Option::Some(v)
21240            }
21241            _ => std::option::Option::None,
21242        })
21243    }
21244
21245    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21246    /// to hold a `PromoteReleaseOperation`.
21247    ///
21248    /// Note that all the setters affecting `operation` are
21249    /// mutually exclusive.
21250    ///
21251    /// # Example
21252    /// ```ignore,no_run
21253    /// # use google_cloud_deploy_v1::model::AutomationRun;
21254    /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21255    /// let x = AutomationRun::new().set_promote_release_operation(PromoteReleaseOperation::default()/* use setters */);
21256    /// assert!(x.promote_release_operation().is_some());
21257    /// assert!(x.advance_rollout_operation().is_none());
21258    /// assert!(x.repair_rollout_operation().is_none());
21259    /// assert!(x.timed_promote_release_operation().is_none());
21260    /// ```
21261    pub fn set_promote_release_operation<
21262        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
21263    >(
21264        mut self,
21265        v: T,
21266    ) -> Self {
21267        self.operation = std::option::Option::Some(
21268            crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
21269        );
21270        self
21271    }
21272
21273    /// The value of [operation][crate::model::AutomationRun::operation]
21274    /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
21275    /// holds a different branch.
21276    pub fn advance_rollout_operation(
21277        &self,
21278    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
21279        #[allow(unreachable_patterns)]
21280        self.operation.as_ref().and_then(|v| match v {
21281            crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
21282                std::option::Option::Some(v)
21283            }
21284            _ => std::option::Option::None,
21285        })
21286    }
21287
21288    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21289    /// to hold a `AdvanceRolloutOperation`.
21290    ///
21291    /// Note that all the setters affecting `operation` are
21292    /// mutually exclusive.
21293    ///
21294    /// # Example
21295    /// ```ignore,no_run
21296    /// # use google_cloud_deploy_v1::model::AutomationRun;
21297    /// use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21298    /// let x = AutomationRun::new().set_advance_rollout_operation(AdvanceRolloutOperation::default()/* use setters */);
21299    /// assert!(x.advance_rollout_operation().is_some());
21300    /// assert!(x.promote_release_operation().is_none());
21301    /// assert!(x.repair_rollout_operation().is_none());
21302    /// assert!(x.timed_promote_release_operation().is_none());
21303    /// ```
21304    pub fn set_advance_rollout_operation<
21305        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
21306    >(
21307        mut self,
21308        v: T,
21309    ) -> Self {
21310        self.operation = std::option::Option::Some(
21311            crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
21312        );
21313        self
21314    }
21315
21316    /// The value of [operation][crate::model::AutomationRun::operation]
21317    /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
21318    /// holds a different branch.
21319    pub fn repair_rollout_operation(
21320        &self,
21321    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
21322        #[allow(unreachable_patterns)]
21323        self.operation.as_ref().and_then(|v| match v {
21324            crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
21325                std::option::Option::Some(v)
21326            }
21327            _ => std::option::Option::None,
21328        })
21329    }
21330
21331    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21332    /// to hold a `RepairRolloutOperation`.
21333    ///
21334    /// Note that all the setters affecting `operation` are
21335    /// mutually exclusive.
21336    ///
21337    /// # Example
21338    /// ```ignore,no_run
21339    /// # use google_cloud_deploy_v1::model::AutomationRun;
21340    /// use google_cloud_deploy_v1::model::RepairRolloutOperation;
21341    /// let x = AutomationRun::new().set_repair_rollout_operation(RepairRolloutOperation::default()/* use setters */);
21342    /// assert!(x.repair_rollout_operation().is_some());
21343    /// assert!(x.promote_release_operation().is_none());
21344    /// assert!(x.advance_rollout_operation().is_none());
21345    /// assert!(x.timed_promote_release_operation().is_none());
21346    /// ```
21347    pub fn set_repair_rollout_operation<
21348        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
21349    >(
21350        mut self,
21351        v: T,
21352    ) -> Self {
21353        self.operation = std::option::Option::Some(
21354            crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
21355        );
21356        self
21357    }
21358
21359    /// The value of [operation][crate::model::AutomationRun::operation]
21360    /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
21361    /// holds a different branch.
21362    pub fn timed_promote_release_operation(
21363        &self,
21364    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
21365        #[allow(unreachable_patterns)]
21366        self.operation.as_ref().and_then(|v| match v {
21367            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
21368                std::option::Option::Some(v)
21369            }
21370            _ => std::option::Option::None,
21371        })
21372    }
21373
21374    /// Sets the value of [operation][crate::model::AutomationRun::operation]
21375    /// to hold a `TimedPromoteReleaseOperation`.
21376    ///
21377    /// Note that all the setters affecting `operation` are
21378    /// mutually exclusive.
21379    ///
21380    /// # Example
21381    /// ```ignore,no_run
21382    /// # use google_cloud_deploy_v1::model::AutomationRun;
21383    /// use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21384    /// let x = AutomationRun::new().set_timed_promote_release_operation(TimedPromoteReleaseOperation::default()/* use setters */);
21385    /// assert!(x.timed_promote_release_operation().is_some());
21386    /// assert!(x.promote_release_operation().is_none());
21387    /// assert!(x.advance_rollout_operation().is_none());
21388    /// assert!(x.repair_rollout_operation().is_none());
21389    /// ```
21390    pub fn set_timed_promote_release_operation<
21391        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
21392    >(
21393        mut self,
21394        v: T,
21395    ) -> Self {
21396        self.operation = std::option::Option::Some(
21397            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
21398        );
21399        self
21400    }
21401}
21402
21403impl wkt::message::Message for AutomationRun {
21404    fn typename() -> &'static str {
21405        "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
21406    }
21407}
21408
21409/// Defines additional types related to [AutomationRun].
21410pub mod automation_run {
21411    #[allow(unused_imports)]
21412    use super::*;
21413
21414    /// Valid state of an `AutomationRun`.
21415    ///
21416    /// # Working with unknown values
21417    ///
21418    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21419    /// additional enum variants at any time. Adding new variants is not considered
21420    /// a breaking change. Applications should write their code in anticipation of:
21421    ///
21422    /// - New values appearing in future releases of the client library, **and**
21423    /// - New values received dynamically, without application changes.
21424    ///
21425    /// Please consult the [Working with enums] section in the user guide for some
21426    /// guidelines.
21427    ///
21428    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21429    #[derive(Clone, Debug, PartialEq)]
21430    #[non_exhaustive]
21431    pub enum State {
21432        /// The `AutomationRun` has an unspecified state.
21433        Unspecified,
21434        /// The `AutomationRun` has succeeded.
21435        Succeeded,
21436        /// The `AutomationRun` was cancelled.
21437        Cancelled,
21438        /// The `AutomationRun` has failed.
21439        Failed,
21440        /// The `AutomationRun` is in progress.
21441        InProgress,
21442        /// The `AutomationRun` is pending.
21443        Pending,
21444        /// The `AutomationRun` was aborted.
21445        Aborted,
21446        /// If set, the enum was initialized with an unknown value.
21447        ///
21448        /// Applications can examine the value using [State::value] or
21449        /// [State::name].
21450        UnknownValue(state::UnknownValue),
21451    }
21452
21453    #[doc(hidden)]
21454    pub mod state {
21455        #[allow(unused_imports)]
21456        use super::*;
21457        #[derive(Clone, Debug, PartialEq)]
21458        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21459    }
21460
21461    impl State {
21462        /// Gets the enum value.
21463        ///
21464        /// Returns `None` if the enum contains an unknown value deserialized from
21465        /// the string representation of enums.
21466        pub fn value(&self) -> std::option::Option<i32> {
21467            match self {
21468                Self::Unspecified => std::option::Option::Some(0),
21469                Self::Succeeded => std::option::Option::Some(1),
21470                Self::Cancelled => std::option::Option::Some(2),
21471                Self::Failed => std::option::Option::Some(3),
21472                Self::InProgress => std::option::Option::Some(4),
21473                Self::Pending => std::option::Option::Some(5),
21474                Self::Aborted => std::option::Option::Some(6),
21475                Self::UnknownValue(u) => u.0.value(),
21476            }
21477        }
21478
21479        /// Gets the enum value as a string.
21480        ///
21481        /// Returns `None` if the enum contains an unknown value deserialized from
21482        /// the integer representation of enums.
21483        pub fn name(&self) -> std::option::Option<&str> {
21484            match self {
21485                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21486                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
21487                Self::Cancelled => std::option::Option::Some("CANCELLED"),
21488                Self::Failed => std::option::Option::Some("FAILED"),
21489                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
21490                Self::Pending => std::option::Option::Some("PENDING"),
21491                Self::Aborted => std::option::Option::Some("ABORTED"),
21492                Self::UnknownValue(u) => u.0.name(),
21493            }
21494        }
21495    }
21496
21497    impl std::default::Default for State {
21498        fn default() -> Self {
21499            use std::convert::From;
21500            Self::from(0)
21501        }
21502    }
21503
21504    impl std::fmt::Display for State {
21505        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21506            wkt::internal::display_enum(f, self.name(), self.value())
21507        }
21508    }
21509
21510    impl std::convert::From<i32> for State {
21511        fn from(value: i32) -> Self {
21512            match value {
21513                0 => Self::Unspecified,
21514                1 => Self::Succeeded,
21515                2 => Self::Cancelled,
21516                3 => Self::Failed,
21517                4 => Self::InProgress,
21518                5 => Self::Pending,
21519                6 => Self::Aborted,
21520                _ => Self::UnknownValue(state::UnknownValue(
21521                    wkt::internal::UnknownEnumValue::Integer(value),
21522                )),
21523            }
21524        }
21525    }
21526
21527    impl std::convert::From<&str> for State {
21528        fn from(value: &str) -> Self {
21529            use std::string::ToString;
21530            match value {
21531                "STATE_UNSPECIFIED" => Self::Unspecified,
21532                "SUCCEEDED" => Self::Succeeded,
21533                "CANCELLED" => Self::Cancelled,
21534                "FAILED" => Self::Failed,
21535                "IN_PROGRESS" => Self::InProgress,
21536                "PENDING" => Self::Pending,
21537                "ABORTED" => Self::Aborted,
21538                _ => Self::UnknownValue(state::UnknownValue(
21539                    wkt::internal::UnknownEnumValue::String(value.to_string()),
21540                )),
21541            }
21542        }
21543    }
21544
21545    impl serde::ser::Serialize for State {
21546        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21547        where
21548            S: serde::Serializer,
21549        {
21550            match self {
21551                Self::Unspecified => serializer.serialize_i32(0),
21552                Self::Succeeded => serializer.serialize_i32(1),
21553                Self::Cancelled => serializer.serialize_i32(2),
21554                Self::Failed => serializer.serialize_i32(3),
21555                Self::InProgress => serializer.serialize_i32(4),
21556                Self::Pending => serializer.serialize_i32(5),
21557                Self::Aborted => serializer.serialize_i32(6),
21558                Self::UnknownValue(u) => u.0.serialize(serializer),
21559            }
21560        }
21561    }
21562
21563    impl<'de> serde::de::Deserialize<'de> for State {
21564        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21565        where
21566            D: serde::Deserializer<'de>,
21567        {
21568            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21569                ".google.cloud.deploy.v1.AutomationRun.State",
21570            ))
21571        }
21572    }
21573
21574    /// The operation that the `AutomationRun` will perform.
21575    #[derive(Clone, Debug, PartialEq)]
21576    #[non_exhaustive]
21577    pub enum Operation {
21578        /// Output only. Promotes a release to a specified 'Target'.
21579        PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
21580        /// Output only. Advances a rollout to the next phase.
21581        AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
21582        /// Output only. Repairs a failed 'Rollout'.
21583        RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
21584        /// Output only. Promotes a release to a specified 'Target' as defined in a
21585        /// Timed Promote Release rule.
21586        TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
21587    }
21588}
21589
21590/// Contains the information of an automated promote-release operation.
21591#[derive(Clone, Default, PartialEq)]
21592#[non_exhaustive]
21593pub struct PromoteReleaseOperation {
21594    /// Output only. The ID of the target that represents the promotion stage to
21595    /// which the release will be promoted. The value of this field is the last
21596    /// segment of a target name.
21597    pub target_id: std::string::String,
21598
21599    /// Output only. How long the operation will be paused.
21600    pub wait: std::option::Option<wkt::Duration>,
21601
21602    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21603    pub rollout: std::string::String,
21604
21605    /// Output only. The starting phase of the rollout created by this operation.
21606    pub phase: std::string::String,
21607
21608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21609}
21610
21611impl PromoteReleaseOperation {
21612    /// Creates a new default instance.
21613    pub fn new() -> Self {
21614        std::default::Default::default()
21615    }
21616
21617    /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
21618    ///
21619    /// # Example
21620    /// ```ignore,no_run
21621    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21622    /// let x = PromoteReleaseOperation::new().set_target_id("example");
21623    /// ```
21624    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21625        self.target_id = v.into();
21626        self
21627    }
21628
21629    /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
21630    ///
21631    /// # Example
21632    /// ```ignore,no_run
21633    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21634    /// use wkt::Duration;
21635    /// let x = PromoteReleaseOperation::new().set_wait(Duration::default()/* use setters */);
21636    /// ```
21637    pub fn set_wait<T>(mut self, v: T) -> Self
21638    where
21639        T: std::convert::Into<wkt::Duration>,
21640    {
21641        self.wait = std::option::Option::Some(v.into());
21642        self
21643    }
21644
21645    /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
21646    ///
21647    /// # Example
21648    /// ```ignore,no_run
21649    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21650    /// use wkt::Duration;
21651    /// let x = PromoteReleaseOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21652    /// let x = PromoteReleaseOperation::new().set_or_clear_wait(None::<Duration>);
21653    /// ```
21654    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21655    where
21656        T: std::convert::Into<wkt::Duration>,
21657    {
21658        self.wait = v.map(|x| x.into());
21659        self
21660    }
21661
21662    /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
21663    ///
21664    /// # Example
21665    /// ```ignore,no_run
21666    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21667    /// let x = PromoteReleaseOperation::new().set_rollout("example");
21668    /// ```
21669    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21670        self.rollout = v.into();
21671        self
21672    }
21673
21674    /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
21675    ///
21676    /// # Example
21677    /// ```ignore,no_run
21678    /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21679    /// let x = PromoteReleaseOperation::new().set_phase("example");
21680    /// ```
21681    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21682        self.phase = v.into();
21683        self
21684    }
21685}
21686
21687impl wkt::message::Message for PromoteReleaseOperation {
21688    fn typename() -> &'static str {
21689        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
21690    }
21691}
21692
21693/// Contains the information of an automated advance-rollout operation.
21694#[derive(Clone, Default, PartialEq)]
21695#[non_exhaustive]
21696pub struct AdvanceRolloutOperation {
21697    /// Output only. The phase of a deployment that initiated the operation.
21698    pub source_phase: std::string::String,
21699
21700    /// Output only. How long the operation will be paused.
21701    pub wait: std::option::Option<wkt::Duration>,
21702
21703    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21704    pub rollout: std::string::String,
21705
21706    /// Output only. The phase the rollout will be advanced to.
21707    pub destination_phase: std::string::String,
21708
21709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21710}
21711
21712impl AdvanceRolloutOperation {
21713    /// Creates a new default instance.
21714    pub fn new() -> Self {
21715        std::default::Default::default()
21716    }
21717
21718    /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
21719    ///
21720    /// # Example
21721    /// ```ignore,no_run
21722    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21723    /// let x = AdvanceRolloutOperation::new().set_source_phase("example");
21724    /// ```
21725    pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21726        self.source_phase = v.into();
21727        self
21728    }
21729
21730    /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21731    ///
21732    /// # Example
21733    /// ```ignore,no_run
21734    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21735    /// use wkt::Duration;
21736    /// let x = AdvanceRolloutOperation::new().set_wait(Duration::default()/* use setters */);
21737    /// ```
21738    pub fn set_wait<T>(mut self, v: T) -> Self
21739    where
21740        T: std::convert::Into<wkt::Duration>,
21741    {
21742        self.wait = std::option::Option::Some(v.into());
21743        self
21744    }
21745
21746    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21747    ///
21748    /// # Example
21749    /// ```ignore,no_run
21750    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21751    /// use wkt::Duration;
21752    /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21753    /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(None::<Duration>);
21754    /// ```
21755    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21756    where
21757        T: std::convert::Into<wkt::Duration>,
21758    {
21759        self.wait = v.map(|x| x.into());
21760        self
21761    }
21762
21763    /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
21764    ///
21765    /// # Example
21766    /// ```ignore,no_run
21767    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21768    /// let x = AdvanceRolloutOperation::new().set_rollout("example");
21769    /// ```
21770    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21771        self.rollout = v.into();
21772        self
21773    }
21774
21775    /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
21776    ///
21777    /// # Example
21778    /// ```ignore,no_run
21779    /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21780    /// let x = AdvanceRolloutOperation::new().set_destination_phase("example");
21781    /// ```
21782    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21783        mut self,
21784        v: T,
21785    ) -> Self {
21786        self.destination_phase = v.into();
21787        self
21788    }
21789}
21790
21791impl wkt::message::Message for AdvanceRolloutOperation {
21792    fn typename() -> &'static str {
21793        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
21794    }
21795}
21796
21797/// Contains the information for an automated `repair rollout` operation.
21798#[derive(Clone, Default, PartialEq)]
21799#[non_exhaustive]
21800pub struct RepairRolloutOperation {
21801    /// Output only. The name of the rollout that initiates the `AutomationRun`.
21802    pub rollout: std::string::String,
21803
21804    /// Output only. The index of the current repair action in the repair sequence.
21805    pub current_repair_phase_index: i64,
21806
21807    /// Output only. Records of the repair attempts. Each repair phase may have
21808    /// multiple retry attempts or single rollback attempt.
21809    pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
21810
21811    /// Output only. The phase ID of the phase that includes the job being
21812    /// repaired.
21813    pub phase_id: std::string::String,
21814
21815    /// Output only. The job ID for the Job to repair.
21816    pub job_id: std::string::String,
21817
21818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21819}
21820
21821impl RepairRolloutOperation {
21822    /// Creates a new default instance.
21823    pub fn new() -> Self {
21824        std::default::Default::default()
21825    }
21826
21827    /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
21828    ///
21829    /// # Example
21830    /// ```ignore,no_run
21831    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21832    /// let x = RepairRolloutOperation::new().set_rollout("example");
21833    /// ```
21834    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21835        self.rollout = v.into();
21836        self
21837    }
21838
21839    /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
21840    ///
21841    /// # Example
21842    /// ```ignore,no_run
21843    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21844    /// let x = RepairRolloutOperation::new().set_current_repair_phase_index(42);
21845    /// ```
21846    pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21847        self.current_repair_phase_index = v.into();
21848        self
21849    }
21850
21851    /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
21852    ///
21853    /// # Example
21854    /// ```ignore,no_run
21855    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21856    /// use google_cloud_deploy_v1::model::RepairPhase;
21857    /// let x = RepairRolloutOperation::new()
21858    ///     .set_repair_phases([
21859    ///         RepairPhase::default()/* use setters */,
21860    ///         RepairPhase::default()/* use (different) setters */,
21861    ///     ]);
21862    /// ```
21863    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
21864    where
21865        T: std::iter::IntoIterator<Item = V>,
21866        V: std::convert::Into<crate::model::RepairPhase>,
21867    {
21868        use std::iter::Iterator;
21869        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
21870        self
21871    }
21872
21873    /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
21874    ///
21875    /// # Example
21876    /// ```ignore,no_run
21877    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21878    /// let x = RepairRolloutOperation::new().set_phase_id("example");
21879    /// ```
21880    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21881        self.phase_id = v.into();
21882        self
21883    }
21884
21885    /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
21886    ///
21887    /// # Example
21888    /// ```ignore,no_run
21889    /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21890    /// let x = RepairRolloutOperation::new().set_job_id("example");
21891    /// ```
21892    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21893        self.job_id = v.into();
21894        self
21895    }
21896}
21897
21898impl wkt::message::Message for RepairRolloutOperation {
21899    fn typename() -> &'static str {
21900        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
21901    }
21902}
21903
21904/// Contains the information of an automated timed promote-release operation.
21905#[derive(Clone, Default, PartialEq)]
21906#[non_exhaustive]
21907pub struct TimedPromoteReleaseOperation {
21908    /// Output only. The ID of the target that represents the promotion stage to
21909    /// which the release will be promoted. The value of this field is the last
21910    /// segment of a target name.
21911    pub target_id: std::string::String,
21912
21913    /// Output only. The name of the release to be promoted.
21914    pub release: std::string::String,
21915
21916    /// Output only. The starting phase of the rollout created by this operation.
21917    pub phase: std::string::String,
21918
21919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21920}
21921
21922impl TimedPromoteReleaseOperation {
21923    /// Creates a new default instance.
21924    pub fn new() -> Self {
21925        std::default::Default::default()
21926    }
21927
21928    /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
21929    ///
21930    /// # Example
21931    /// ```ignore,no_run
21932    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21933    /// let x = TimedPromoteReleaseOperation::new().set_target_id("example");
21934    /// ```
21935    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21936        self.target_id = v.into();
21937        self
21938    }
21939
21940    /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
21941    ///
21942    /// # Example
21943    /// ```ignore,no_run
21944    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21945    /// let x = TimedPromoteReleaseOperation::new().set_release("example");
21946    /// ```
21947    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21948        self.release = v.into();
21949        self
21950    }
21951
21952    /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
21953    ///
21954    /// # Example
21955    /// ```ignore,no_run
21956    /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21957    /// let x = TimedPromoteReleaseOperation::new().set_phase("example");
21958    /// ```
21959    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21960        self.phase = v.into();
21961        self
21962    }
21963}
21964
21965impl wkt::message::Message for TimedPromoteReleaseOperation {
21966    fn typename() -> &'static str {
21967        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
21968    }
21969}
21970
21971/// RepairPhase tracks the repair attempts that have been made for
21972/// each `RepairPhaseConfig` specified in the `Automation` resource.
21973#[derive(Clone, Default, PartialEq)]
21974#[non_exhaustive]
21975pub struct RepairPhase {
21976    /// The `RepairPhase` type and the information for that type.
21977    pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
21978
21979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21980}
21981
21982impl RepairPhase {
21983    /// Creates a new default instance.
21984    pub fn new() -> Self {
21985        std::default::Default::default()
21986    }
21987
21988    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
21989    ///
21990    /// Note that all the setters affecting `repair_phase` are mutually
21991    /// exclusive.
21992    ///
21993    /// # Example
21994    /// ```ignore,no_run
21995    /// # use google_cloud_deploy_v1::model::RepairPhase;
21996    /// use google_cloud_deploy_v1::model::RetryPhase;
21997    /// let x = RepairPhase::new().set_repair_phase(Some(
21998    ///     google_cloud_deploy_v1::model::repair_phase::RepairPhase::Retry(RetryPhase::default().into())));
21999    /// ```
22000    pub fn set_repair_phase<
22001        T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
22002    >(
22003        mut self,
22004        v: T,
22005    ) -> Self {
22006        self.repair_phase = v.into();
22007        self
22008    }
22009
22010    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
22011    /// if it holds a `Retry`, `None` if the field is not set or
22012    /// holds a different branch.
22013    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
22014        #[allow(unreachable_patterns)]
22015        self.repair_phase.as_ref().and_then(|v| match v {
22016            crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
22017            _ => std::option::Option::None,
22018        })
22019    }
22020
22021    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
22022    /// to hold a `Retry`.
22023    ///
22024    /// Note that all the setters affecting `repair_phase` are
22025    /// mutually exclusive.
22026    ///
22027    /// # Example
22028    /// ```ignore,no_run
22029    /// # use google_cloud_deploy_v1::model::RepairPhase;
22030    /// use google_cloud_deploy_v1::model::RetryPhase;
22031    /// let x = RepairPhase::new().set_retry(RetryPhase::default()/* use setters */);
22032    /// assert!(x.retry().is_some());
22033    /// assert!(x.rollback().is_none());
22034    /// ```
22035    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
22036        mut self,
22037        v: T,
22038    ) -> Self {
22039        self.repair_phase =
22040            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
22041        self
22042    }
22043
22044    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
22045    /// if it holds a `Rollback`, `None` if the field is not set or
22046    /// holds a different branch.
22047    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
22048        #[allow(unreachable_patterns)]
22049        self.repair_phase.as_ref().and_then(|v| match v {
22050            crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
22051            _ => std::option::Option::None,
22052        })
22053    }
22054
22055    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
22056    /// to hold a `Rollback`.
22057    ///
22058    /// Note that all the setters affecting `repair_phase` are
22059    /// mutually exclusive.
22060    ///
22061    /// # Example
22062    /// ```ignore,no_run
22063    /// # use google_cloud_deploy_v1::model::RepairPhase;
22064    /// use google_cloud_deploy_v1::model::RollbackAttempt;
22065    /// let x = RepairPhase::new().set_rollback(RollbackAttempt::default()/* use setters */);
22066    /// assert!(x.rollback().is_some());
22067    /// assert!(x.retry().is_none());
22068    /// ```
22069    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
22070        mut self,
22071        v: T,
22072    ) -> Self {
22073        self.repair_phase =
22074            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
22075        self
22076    }
22077}
22078
22079impl wkt::message::Message for RepairPhase {
22080    fn typename() -> &'static str {
22081        "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
22082    }
22083}
22084
22085/// Defines additional types related to [RepairPhase].
22086pub mod repair_phase {
22087    #[allow(unused_imports)]
22088    use super::*;
22089
22090    /// The `RepairPhase` type and the information for that type.
22091    #[derive(Clone, Debug, PartialEq)]
22092    #[non_exhaustive]
22093    pub enum RepairPhase {
22094        /// Output only. Records of the retry attempts for retry repair mode.
22095        Retry(std::boxed::Box<crate::model::RetryPhase>),
22096        /// Output only. Rollback attempt for rollback repair mode .
22097        Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
22098    }
22099}
22100
22101/// RetryPhase contains the retry attempts and the metadata for initiating a
22102/// new attempt.
22103#[derive(Clone, Default, PartialEq)]
22104#[non_exhaustive]
22105pub struct RetryPhase {
22106    /// Output only. The number of attempts that have been made.
22107    pub total_attempts: i64,
22108
22109    /// Output only. The pattern of how the wait time of the retry attempt is
22110    /// calculated.
22111    pub backoff_mode: crate::model::BackoffMode,
22112
22113    /// Output only. Detail of a retry action.
22114    pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
22115
22116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22117}
22118
22119impl RetryPhase {
22120    /// Creates a new default instance.
22121    pub fn new() -> Self {
22122        std::default::Default::default()
22123    }
22124
22125    /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
22126    ///
22127    /// # Example
22128    /// ```ignore,no_run
22129    /// # use google_cloud_deploy_v1::model::RetryPhase;
22130    /// let x = RetryPhase::new().set_total_attempts(42);
22131    /// ```
22132    pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22133        self.total_attempts = v.into();
22134        self
22135    }
22136
22137    /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
22138    ///
22139    /// # Example
22140    /// ```ignore,no_run
22141    /// # use google_cloud_deploy_v1::model::RetryPhase;
22142    /// use google_cloud_deploy_v1::model::BackoffMode;
22143    /// let x0 = RetryPhase::new().set_backoff_mode(BackoffMode::Linear);
22144    /// let x1 = RetryPhase::new().set_backoff_mode(BackoffMode::Exponential);
22145    /// ```
22146    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
22147        mut self,
22148        v: T,
22149    ) -> Self {
22150        self.backoff_mode = v.into();
22151        self
22152    }
22153
22154    /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
22155    ///
22156    /// # Example
22157    /// ```ignore,no_run
22158    /// # use google_cloud_deploy_v1::model::RetryPhase;
22159    /// use google_cloud_deploy_v1::model::RetryAttempt;
22160    /// let x = RetryPhase::new()
22161    ///     .set_attempts([
22162    ///         RetryAttempt::default()/* use setters */,
22163    ///         RetryAttempt::default()/* use (different) setters */,
22164    ///     ]);
22165    /// ```
22166    pub fn set_attempts<T, V>(mut self, v: T) -> Self
22167    where
22168        T: std::iter::IntoIterator<Item = V>,
22169        V: std::convert::Into<crate::model::RetryAttempt>,
22170    {
22171        use std::iter::Iterator;
22172        self.attempts = v.into_iter().map(|i| i.into()).collect();
22173        self
22174    }
22175}
22176
22177impl wkt::message::Message for RetryPhase {
22178    fn typename() -> &'static str {
22179        "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
22180    }
22181}
22182
22183/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
22184#[derive(Clone, Default, PartialEq)]
22185#[non_exhaustive]
22186pub struct RetryAttempt {
22187    /// Output only. The index of this retry attempt.
22188    pub attempt: i64,
22189
22190    /// Output only. How long the operation will be paused.
22191    pub wait: std::option::Option<wkt::Duration>,
22192
22193    /// Output only. Valid state of this retry action.
22194    pub state: crate::model::RepairState,
22195
22196    /// Output only. Description of the state of the Retry.
22197    pub state_desc: std::string::String,
22198
22199    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22200}
22201
22202impl RetryAttempt {
22203    /// Creates a new default instance.
22204    pub fn new() -> Self {
22205        std::default::Default::default()
22206    }
22207
22208    /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
22209    ///
22210    /// # Example
22211    /// ```ignore,no_run
22212    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22213    /// let x = RetryAttempt::new().set_attempt(42);
22214    /// ```
22215    pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22216        self.attempt = v.into();
22217        self
22218    }
22219
22220    /// Sets the value of [wait][crate::model::RetryAttempt::wait].
22221    ///
22222    /// # Example
22223    /// ```ignore,no_run
22224    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22225    /// use wkt::Duration;
22226    /// let x = RetryAttempt::new().set_wait(Duration::default()/* use setters */);
22227    /// ```
22228    pub fn set_wait<T>(mut self, v: T) -> Self
22229    where
22230        T: std::convert::Into<wkt::Duration>,
22231    {
22232        self.wait = std::option::Option::Some(v.into());
22233        self
22234    }
22235
22236    /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
22237    ///
22238    /// # Example
22239    /// ```ignore,no_run
22240    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22241    /// use wkt::Duration;
22242    /// let x = RetryAttempt::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
22243    /// let x = RetryAttempt::new().set_or_clear_wait(None::<Duration>);
22244    /// ```
22245    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
22246    where
22247        T: std::convert::Into<wkt::Duration>,
22248    {
22249        self.wait = v.map(|x| x.into());
22250        self
22251    }
22252
22253    /// Sets the value of [state][crate::model::RetryAttempt::state].
22254    ///
22255    /// # Example
22256    /// ```ignore,no_run
22257    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22258    /// use google_cloud_deploy_v1::model::RepairState;
22259    /// let x0 = RetryAttempt::new().set_state(RepairState::Succeeded);
22260    /// let x1 = RetryAttempt::new().set_state(RepairState::Cancelled);
22261    /// let x2 = RetryAttempt::new().set_state(RepairState::Failed);
22262    /// ```
22263    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22264        self.state = v.into();
22265        self
22266    }
22267
22268    /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
22269    ///
22270    /// # Example
22271    /// ```ignore,no_run
22272    /// # use google_cloud_deploy_v1::model::RetryAttempt;
22273    /// let x = RetryAttempt::new().set_state_desc("example");
22274    /// ```
22275    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22276        self.state_desc = v.into();
22277        self
22278    }
22279}
22280
22281impl wkt::message::Message for RetryAttempt {
22282    fn typename() -> &'static str {
22283        "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
22284    }
22285}
22286
22287/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
22288#[derive(Clone, Default, PartialEq)]
22289#[non_exhaustive]
22290pub struct RollbackAttempt {
22291    /// Output only. The phase to which the rollout will be rolled back to.
22292    pub destination_phase: std::string::String,
22293
22294    /// Output only. ID of the rollback `Rollout` to create.
22295    pub rollout_id: std::string::String,
22296
22297    /// Output only. Valid state of this rollback action.
22298    pub state: crate::model::RepairState,
22299
22300    /// Output only. Description of the state of the Rollback.
22301    pub state_desc: std::string::String,
22302
22303    /// Output only. If active rollout exists on the target, abort this rollback.
22304    pub disable_rollback_if_rollout_pending: bool,
22305
22306    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22307}
22308
22309impl RollbackAttempt {
22310    /// Creates a new default instance.
22311    pub fn new() -> Self {
22312        std::default::Default::default()
22313    }
22314
22315    /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
22316    ///
22317    /// # Example
22318    /// ```ignore,no_run
22319    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22320    /// let x = RollbackAttempt::new().set_destination_phase("example");
22321    /// ```
22322    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
22323        mut self,
22324        v: T,
22325    ) -> Self {
22326        self.destination_phase = v.into();
22327        self
22328    }
22329
22330    /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
22331    ///
22332    /// # Example
22333    /// ```ignore,no_run
22334    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22335    /// let x = RollbackAttempt::new().set_rollout_id("example");
22336    /// ```
22337    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22338        self.rollout_id = v.into();
22339        self
22340    }
22341
22342    /// Sets the value of [state][crate::model::RollbackAttempt::state].
22343    ///
22344    /// # Example
22345    /// ```ignore,no_run
22346    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22347    /// use google_cloud_deploy_v1::model::RepairState;
22348    /// let x0 = RollbackAttempt::new().set_state(RepairState::Succeeded);
22349    /// let x1 = RollbackAttempt::new().set_state(RepairState::Cancelled);
22350    /// let x2 = RollbackAttempt::new().set_state(RepairState::Failed);
22351    /// ```
22352    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22353        self.state = v.into();
22354        self
22355    }
22356
22357    /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
22358    ///
22359    /// # Example
22360    /// ```ignore,no_run
22361    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22362    /// let x = RollbackAttempt::new().set_state_desc("example");
22363    /// ```
22364    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22365        self.state_desc = v.into();
22366        self
22367    }
22368
22369    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
22370    ///
22371    /// # Example
22372    /// ```ignore,no_run
22373    /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22374    /// let x = RollbackAttempt::new().set_disable_rollback_if_rollout_pending(true);
22375    /// ```
22376    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
22377        mut self,
22378        v: T,
22379    ) -> Self {
22380        self.disable_rollback_if_rollout_pending = v.into();
22381        self
22382    }
22383}
22384
22385impl wkt::message::Message for RollbackAttempt {
22386    fn typename() -> &'static str {
22387        "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
22388    }
22389}
22390
22391/// The request object for `ListAutomationRuns`.
22392#[derive(Clone, Default, PartialEq)]
22393#[non_exhaustive]
22394pub struct ListAutomationRunsRequest {
22395    /// Required. The parent `Delivery Pipeline`, which owns this collection of
22396    /// automationRuns. Format must be
22397    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
22398    pub parent: std::string::String,
22399
22400    /// The maximum number of automationRuns to return. The service may return
22401    /// fewer than this value. If unspecified, at most 50 automationRuns will
22402    /// be returned. The maximum value is 1000; values above 1000 will be set
22403    /// to 1000.
22404    pub page_size: i32,
22405
22406    /// A page token, received from a previous `ListAutomationRuns` call.
22407    /// Provide this to retrieve the subsequent page.
22408    ///
22409    /// When paginating, all other provided parameters match
22410    /// the call that provided the page token.
22411    pub page_token: std::string::String,
22412
22413    /// Filter automationRuns to be returned. All fields can be used in the
22414    /// filter.
22415    pub filter: std::string::String,
22416
22417    /// Field to sort by.
22418    pub order_by: std::string::String,
22419
22420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22421}
22422
22423impl ListAutomationRunsRequest {
22424    /// Creates a new default instance.
22425    pub fn new() -> Self {
22426        std::default::Default::default()
22427    }
22428
22429    /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
22430    ///
22431    /// # Example
22432    /// ```ignore,no_run
22433    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22434    /// # let project_id = "project_id";
22435    /// # let location_id = "location_id";
22436    /// # let delivery_pipeline_id = "delivery_pipeline_id";
22437    /// let x = ListAutomationRunsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
22438    /// ```
22439    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22440        self.parent = v.into();
22441        self
22442    }
22443
22444    /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
22445    ///
22446    /// # Example
22447    /// ```ignore,no_run
22448    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22449    /// let x = ListAutomationRunsRequest::new().set_page_size(42);
22450    /// ```
22451    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22452        self.page_size = v.into();
22453        self
22454    }
22455
22456    /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
22457    ///
22458    /// # Example
22459    /// ```ignore,no_run
22460    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22461    /// let x = ListAutomationRunsRequest::new().set_page_token("example");
22462    /// ```
22463    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22464        self.page_token = v.into();
22465        self
22466    }
22467
22468    /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
22469    ///
22470    /// # Example
22471    /// ```ignore,no_run
22472    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22473    /// let x = ListAutomationRunsRequest::new().set_filter("example");
22474    /// ```
22475    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22476        self.filter = v.into();
22477        self
22478    }
22479
22480    /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
22481    ///
22482    /// # Example
22483    /// ```ignore,no_run
22484    /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22485    /// let x = ListAutomationRunsRequest::new().set_order_by("example");
22486    /// ```
22487    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22488        self.order_by = v.into();
22489        self
22490    }
22491}
22492
22493impl wkt::message::Message for ListAutomationRunsRequest {
22494    fn typename() -> &'static str {
22495        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
22496    }
22497}
22498
22499/// The response object from `ListAutomationRuns`.
22500#[derive(Clone, Default, PartialEq)]
22501#[non_exhaustive]
22502pub struct ListAutomationRunsResponse {
22503    /// The `AutomationRuns` objects.
22504    pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
22505
22506    /// A token, which can be sent as `page_token` to retrieve the next page.
22507    /// If this field is omitted, there are no subsequent pages.
22508    pub next_page_token: std::string::String,
22509
22510    /// Locations that could not be reached.
22511    pub unreachable: std::vec::Vec<std::string::String>,
22512
22513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22514}
22515
22516impl ListAutomationRunsResponse {
22517    /// Creates a new default instance.
22518    pub fn new() -> Self {
22519        std::default::Default::default()
22520    }
22521
22522    /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
22523    ///
22524    /// # Example
22525    /// ```ignore,no_run
22526    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22527    /// use google_cloud_deploy_v1::model::AutomationRun;
22528    /// let x = ListAutomationRunsResponse::new()
22529    ///     .set_automation_runs([
22530    ///         AutomationRun::default()/* use setters */,
22531    ///         AutomationRun::default()/* use (different) setters */,
22532    ///     ]);
22533    /// ```
22534    pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
22535    where
22536        T: std::iter::IntoIterator<Item = V>,
22537        V: std::convert::Into<crate::model::AutomationRun>,
22538    {
22539        use std::iter::Iterator;
22540        self.automation_runs = v.into_iter().map(|i| i.into()).collect();
22541        self
22542    }
22543
22544    /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
22545    ///
22546    /// # Example
22547    /// ```ignore,no_run
22548    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22549    /// let x = ListAutomationRunsResponse::new().set_next_page_token("example");
22550    /// ```
22551    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22552        self.next_page_token = v.into();
22553        self
22554    }
22555
22556    /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
22557    ///
22558    /// # Example
22559    /// ```ignore,no_run
22560    /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22561    /// let x = ListAutomationRunsResponse::new().set_unreachable(["a", "b", "c"]);
22562    /// ```
22563    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
22564    where
22565        T: std::iter::IntoIterator<Item = V>,
22566        V: std::convert::Into<std::string::String>,
22567    {
22568        use std::iter::Iterator;
22569        self.unreachable = v.into_iter().map(|i| i.into()).collect();
22570        self
22571    }
22572}
22573
22574impl wkt::message::Message for ListAutomationRunsResponse {
22575    fn typename() -> &'static str {
22576        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
22577    }
22578}
22579
22580#[doc(hidden)]
22581impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
22582    type PageItem = crate::model::AutomationRun;
22583
22584    fn items(self) -> std::vec::Vec<Self::PageItem> {
22585        self.automation_runs
22586    }
22587
22588    fn next_page_token(&self) -> std::string::String {
22589        use std::clone::Clone;
22590        self.next_page_token.clone()
22591    }
22592}
22593
22594/// The request object for `GetAutomationRun`
22595#[derive(Clone, Default, PartialEq)]
22596#[non_exhaustive]
22597pub struct GetAutomationRunRequest {
22598    /// Required. Name of the `AutomationRun`. Format must be
22599    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22600    pub name: std::string::String,
22601
22602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22603}
22604
22605impl GetAutomationRunRequest {
22606    /// Creates a new default instance.
22607    pub fn new() -> Self {
22608        std::default::Default::default()
22609    }
22610
22611    /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
22612    ///
22613    /// # Example
22614    /// ```ignore,no_run
22615    /// # use google_cloud_deploy_v1::model::GetAutomationRunRequest;
22616    /// # let project_id = "project_id";
22617    /// # let location_id = "location_id";
22618    /// # let delivery_pipeline_id = "delivery_pipeline_id";
22619    /// # let automation_run_id = "automation_run_id";
22620    /// let x = GetAutomationRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automationRuns/{automation_run_id}"));
22621    /// ```
22622    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22623        self.name = v.into();
22624        self
22625    }
22626}
22627
22628impl wkt::message::Message for GetAutomationRunRequest {
22629    fn typename() -> &'static str {
22630        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
22631    }
22632}
22633
22634/// The request object used by `CancelAutomationRun`.
22635#[derive(Clone, Default, PartialEq)]
22636#[non_exhaustive]
22637pub struct CancelAutomationRunRequest {
22638    /// Required. Name of the `AutomationRun`. Format is
22639    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22640    pub name: std::string::String,
22641
22642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22643}
22644
22645impl CancelAutomationRunRequest {
22646    /// Creates a new default instance.
22647    pub fn new() -> Self {
22648        std::default::Default::default()
22649    }
22650
22651    /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
22652    ///
22653    /// # Example
22654    /// ```ignore,no_run
22655    /// # use google_cloud_deploy_v1::model::CancelAutomationRunRequest;
22656    /// # let project_id = "project_id";
22657    /// # let location_id = "location_id";
22658    /// # let delivery_pipeline_id = "delivery_pipeline_id";
22659    /// # let automation_run_id = "automation_run_id";
22660    /// let x = CancelAutomationRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automationRuns/{automation_run_id}"));
22661    /// ```
22662    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22663        self.name = v.into();
22664        self
22665    }
22666}
22667
22668impl wkt::message::Message for CancelAutomationRunRequest {
22669    fn typename() -> &'static str {
22670        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
22671    }
22672}
22673
22674/// The response object from `CancelAutomationRun`.
22675#[derive(Clone, Default, PartialEq)]
22676#[non_exhaustive]
22677pub struct CancelAutomationRunResponse {
22678    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22679}
22680
22681impl CancelAutomationRunResponse {
22682    /// Creates a new default instance.
22683    pub fn new() -> Self {
22684        std::default::Default::default()
22685    }
22686}
22687
22688impl wkt::message::Message for CancelAutomationRunResponse {
22689    fn typename() -> &'static str {
22690        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
22691    }
22692}
22693
22694/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
22695/// Platform Log event that describes the failure to send a custom target type
22696/// status change Pub/Sub notification.
22697#[derive(Clone, Default, PartialEq)]
22698#[non_exhaustive]
22699pub struct CustomTargetTypeNotificationEvent {
22700    /// Debug message for when a notification fails to send.
22701    pub message: std::string::String,
22702
22703    /// Unique identifier of the `CustomTargetType`.
22704    pub custom_target_type_uid: std::string::String,
22705
22706    /// The name of the `CustomTargetType`.
22707    pub custom_target_type: std::string::String,
22708
22709    /// Type of this notification, e.g. for a Pub/Sub failure.
22710    pub r#type: crate::model::Type,
22711
22712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22713}
22714
22715impl CustomTargetTypeNotificationEvent {
22716    /// Creates a new default instance.
22717    pub fn new() -> Self {
22718        std::default::Default::default()
22719    }
22720
22721    /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
22722    ///
22723    /// # Example
22724    /// ```ignore,no_run
22725    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22726    /// let x = CustomTargetTypeNotificationEvent::new().set_message("example");
22727    /// ```
22728    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22729        self.message = v.into();
22730        self
22731    }
22732
22733    /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
22734    ///
22735    /// # Example
22736    /// ```ignore,no_run
22737    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22738    /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type_uid("example");
22739    /// ```
22740    pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
22741        mut self,
22742        v: T,
22743    ) -> Self {
22744        self.custom_target_type_uid = v.into();
22745        self
22746    }
22747
22748    /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
22749    ///
22750    /// # Example
22751    /// ```ignore,no_run
22752    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22753    /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type("example");
22754    /// ```
22755    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
22756        mut self,
22757        v: T,
22758    ) -> Self {
22759        self.custom_target_type = v.into();
22760        self
22761    }
22762
22763    /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
22764    ///
22765    /// # Example
22766    /// ```ignore,no_run
22767    /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22768    /// use google_cloud_deploy_v1::model::Type;
22769    /// let x0 = CustomTargetTypeNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22770    /// let x1 = CustomTargetTypeNotificationEvent::new().set_type(Type::ResourceStateChange);
22771    /// let x2 = CustomTargetTypeNotificationEvent::new().set_type(Type::ProcessAborted);
22772    /// ```
22773    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22774        self.r#type = v.into();
22775        self
22776    }
22777}
22778
22779impl wkt::message::Message for CustomTargetTypeNotificationEvent {
22780    fn typename() -> &'static str {
22781        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
22782    }
22783}
22784
22785/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
22786/// Platform Log event that describes the failure to send delivery pipeline
22787/// status change Pub/Sub notification.
22788#[derive(Clone, Default, PartialEq)]
22789#[non_exhaustive]
22790pub struct DeliveryPipelineNotificationEvent {
22791    /// Debug message for when a notification fails to send.
22792    pub message: std::string::String,
22793
22794    /// Unique identifier of the `DeliveryPipeline`.
22795    pub pipeline_uid: std::string::String,
22796
22797    /// The name of the `Delivery Pipeline`.
22798    pub delivery_pipeline: std::string::String,
22799
22800    /// Type of this notification, e.g. for a Pub/Sub failure.
22801    pub r#type: crate::model::Type,
22802
22803    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22804}
22805
22806impl DeliveryPipelineNotificationEvent {
22807    /// Creates a new default instance.
22808    pub fn new() -> Self {
22809        std::default::Default::default()
22810    }
22811
22812    /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
22813    ///
22814    /// # Example
22815    /// ```ignore,no_run
22816    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22817    /// let x = DeliveryPipelineNotificationEvent::new().set_message("example");
22818    /// ```
22819    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22820        self.message = v.into();
22821        self
22822    }
22823
22824    /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
22825    ///
22826    /// # Example
22827    /// ```ignore,no_run
22828    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22829    /// let x = DeliveryPipelineNotificationEvent::new().set_pipeline_uid("example");
22830    /// ```
22831    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22832        self.pipeline_uid = v.into();
22833        self
22834    }
22835
22836    /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
22837    ///
22838    /// # Example
22839    /// ```ignore,no_run
22840    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22841    /// let x = DeliveryPipelineNotificationEvent::new().set_delivery_pipeline("example");
22842    /// ```
22843    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22844        mut self,
22845        v: T,
22846    ) -> Self {
22847        self.delivery_pipeline = v.into();
22848        self
22849    }
22850
22851    /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
22852    ///
22853    /// # Example
22854    /// ```ignore,no_run
22855    /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22856    /// use google_cloud_deploy_v1::model::Type;
22857    /// let x0 = DeliveryPipelineNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22858    /// let x1 = DeliveryPipelineNotificationEvent::new().set_type(Type::ResourceStateChange);
22859    /// let x2 = DeliveryPipelineNotificationEvent::new().set_type(Type::ProcessAborted);
22860    /// ```
22861    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22862        self.r#type = v.into();
22863        self
22864    }
22865}
22866
22867impl wkt::message::Message for DeliveryPipelineNotificationEvent {
22868    fn typename() -> &'static str {
22869        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
22870    }
22871}
22872
22873/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
22874/// Platform Log event that describes the deploy policy evaluation event.
22875#[derive(Clone, Default, PartialEq)]
22876#[non_exhaustive]
22877pub struct DeployPolicyEvaluationEvent {
22878    /// Debug message for when a deploy policy event occurs.
22879    pub message: std::string::String,
22880
22881    /// Rule type (e.g. Restrict Rollouts).
22882    pub rule_type: std::string::String,
22883
22884    /// Rule id.
22885    pub rule: std::string::String,
22886
22887    /// Unique identifier of the `Delivery Pipeline`.
22888    pub pipeline_uid: std::string::String,
22889
22890    /// The name of the `Delivery Pipeline`.
22891    pub delivery_pipeline: std::string::String,
22892
22893    /// Unique identifier of the `Target`. This is an optional field, as a `Target`
22894    /// may not always be applicable to a policy.
22895    pub target_uid: std::string::String,
22896
22897    /// The name of the `Target`. This is an optional field, as a `Target` may not
22898    /// always be applicable to a policy.
22899    pub target: std::string::String,
22900
22901    /// What invoked the action (e.g. a user or automation).
22902    pub invoker: crate::model::deploy_policy::Invoker,
22903
22904    /// The name of the `DeployPolicy`.
22905    pub deploy_policy: std::string::String,
22906
22907    /// Unique identifier of the `DeployPolicy`.
22908    pub deploy_policy_uid: std::string::String,
22909
22910    /// Whether the request is allowed. Allowed is set as true if:
22911    /// (1) the request complies with the policy; or
22912    /// (2) the request doesn't comply with the policy but the policy was
22913    /// overridden; or
22914    /// (3) the request doesn't comply with the policy but the policy was suspended
22915    pub allowed: bool,
22916
22917    /// The policy verdict of the request.
22918    pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
22919
22920    /// Things that could have overridden the policy verdict. Overrides together
22921    /// with verdict decide whether the request is allowed.
22922    pub overrides:
22923        std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22924
22925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22926}
22927
22928impl DeployPolicyEvaluationEvent {
22929    /// Creates a new default instance.
22930    pub fn new() -> Self {
22931        std::default::Default::default()
22932    }
22933
22934    /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
22935    ///
22936    /// # Example
22937    /// ```ignore,no_run
22938    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22939    /// let x = DeployPolicyEvaluationEvent::new().set_message("example");
22940    /// ```
22941    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22942        self.message = v.into();
22943        self
22944    }
22945
22946    /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
22947    ///
22948    /// # Example
22949    /// ```ignore,no_run
22950    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22951    /// let x = DeployPolicyEvaluationEvent::new().set_rule_type("example");
22952    /// ```
22953    pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22954        self.rule_type = v.into();
22955        self
22956    }
22957
22958    /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
22959    ///
22960    /// # Example
22961    /// ```ignore,no_run
22962    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22963    /// let x = DeployPolicyEvaluationEvent::new().set_rule("example");
22964    /// ```
22965    pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22966        self.rule = v.into();
22967        self
22968    }
22969
22970    /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
22971    ///
22972    /// # Example
22973    /// ```ignore,no_run
22974    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22975    /// let x = DeployPolicyEvaluationEvent::new().set_pipeline_uid("example");
22976    /// ```
22977    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22978        self.pipeline_uid = v.into();
22979        self
22980    }
22981
22982    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
22983    ///
22984    /// # Example
22985    /// ```ignore,no_run
22986    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22987    /// let x = DeployPolicyEvaluationEvent::new().set_delivery_pipeline("example");
22988    /// ```
22989    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22990        mut self,
22991        v: T,
22992    ) -> Self {
22993        self.delivery_pipeline = v.into();
22994        self
22995    }
22996
22997    /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
22998    ///
22999    /// # Example
23000    /// ```ignore,no_run
23001    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23002    /// let x = DeployPolicyEvaluationEvent::new().set_target_uid("example");
23003    /// ```
23004    pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23005        self.target_uid = v.into();
23006        self
23007    }
23008
23009    /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
23010    ///
23011    /// # Example
23012    /// ```ignore,no_run
23013    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23014    /// let x = DeployPolicyEvaluationEvent::new().set_target("example");
23015    /// ```
23016    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23017        self.target = v.into();
23018        self
23019    }
23020
23021    /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
23022    ///
23023    /// # Example
23024    /// ```ignore,no_run
23025    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23026    /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
23027    /// let x0 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::User);
23028    /// let x1 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::DeployAutomation);
23029    /// ```
23030    pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
23031        mut self,
23032        v: T,
23033    ) -> Self {
23034        self.invoker = v.into();
23035        self
23036    }
23037
23038    /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
23039    ///
23040    /// # Example
23041    /// ```ignore,no_run
23042    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23043    /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy("example");
23044    /// ```
23045    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23046        self.deploy_policy = v.into();
23047        self
23048    }
23049
23050    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
23051    ///
23052    /// # Example
23053    /// ```ignore,no_run
23054    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23055    /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy_uid("example");
23056    /// ```
23057    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23058        mut self,
23059        v: T,
23060    ) -> Self {
23061        self.deploy_policy_uid = v.into();
23062        self
23063    }
23064
23065    /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
23066    ///
23067    /// # Example
23068    /// ```ignore,no_run
23069    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23070    /// let x = DeployPolicyEvaluationEvent::new().set_allowed(true);
23071    /// ```
23072    pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23073        self.allowed = v.into();
23074        self
23075    }
23076
23077    /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
23078    ///
23079    /// # Example
23080    /// ```ignore,no_run
23081    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23082    /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdict;
23083    /// let x0 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::AllowedByPolicy);
23084    /// let x1 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::DeniedByPolicy);
23085    /// ```
23086    pub fn set_verdict<
23087        T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
23088    >(
23089        mut self,
23090        v: T,
23091    ) -> Self {
23092        self.verdict = v.into();
23093        self
23094    }
23095
23096    /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
23097    ///
23098    /// # Example
23099    /// ```ignore,no_run
23100    /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23101    /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdictOverride;
23102    /// let x = DeployPolicyEvaluationEvent::new().set_overrides([
23103    ///     PolicyVerdictOverride::PolicyOverridden,
23104    ///     PolicyVerdictOverride::PolicySuspended,
23105    /// ]);
23106    /// ```
23107    pub fn set_overrides<T, V>(mut self, v: T) -> Self
23108    where
23109        T: std::iter::IntoIterator<Item = V>,
23110        V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
23111    {
23112        use std::iter::Iterator;
23113        self.overrides = v.into_iter().map(|i| i.into()).collect();
23114        self
23115    }
23116}
23117
23118impl wkt::message::Message for DeployPolicyEvaluationEvent {
23119    fn typename() -> &'static str {
23120        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
23121    }
23122}
23123
23124/// Defines additional types related to [DeployPolicyEvaluationEvent].
23125pub mod deploy_policy_evaluation_event {
23126    #[allow(unused_imports)]
23127    use super::*;
23128
23129    /// The policy verdict of the request.
23130    ///
23131    /// # Working with unknown values
23132    ///
23133    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23134    /// additional enum variants at any time. Adding new variants is not considered
23135    /// a breaking change. Applications should write their code in anticipation of:
23136    ///
23137    /// - New values appearing in future releases of the client library, **and**
23138    /// - New values received dynamically, without application changes.
23139    ///
23140    /// Please consult the [Working with enums] section in the user guide for some
23141    /// guidelines.
23142    ///
23143    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23144    #[derive(Clone, Debug, PartialEq)]
23145    #[non_exhaustive]
23146    pub enum PolicyVerdict {
23147        /// This should never happen.
23148        Unspecified,
23149        /// Allowed by policy. This enum value is not currently used but may be used
23150        /// in the future. Currently logs are only generated when a request is denied
23151        /// by policy.
23152        AllowedByPolicy,
23153        /// Denied by policy.
23154        DeniedByPolicy,
23155        /// If set, the enum was initialized with an unknown value.
23156        ///
23157        /// Applications can examine the value using [PolicyVerdict::value] or
23158        /// [PolicyVerdict::name].
23159        UnknownValue(policy_verdict::UnknownValue),
23160    }
23161
23162    #[doc(hidden)]
23163    pub mod policy_verdict {
23164        #[allow(unused_imports)]
23165        use super::*;
23166        #[derive(Clone, Debug, PartialEq)]
23167        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23168    }
23169
23170    impl PolicyVerdict {
23171        /// Gets the enum value.
23172        ///
23173        /// Returns `None` if the enum contains an unknown value deserialized from
23174        /// the string representation of enums.
23175        pub fn value(&self) -> std::option::Option<i32> {
23176            match self {
23177                Self::Unspecified => std::option::Option::Some(0),
23178                Self::AllowedByPolicy => std::option::Option::Some(1),
23179                Self::DeniedByPolicy => std::option::Option::Some(2),
23180                Self::UnknownValue(u) => u.0.value(),
23181            }
23182        }
23183
23184        /// Gets the enum value as a string.
23185        ///
23186        /// Returns `None` if the enum contains an unknown value deserialized from
23187        /// the integer representation of enums.
23188        pub fn name(&self) -> std::option::Option<&str> {
23189            match self {
23190                Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
23191                Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
23192                Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
23193                Self::UnknownValue(u) => u.0.name(),
23194            }
23195        }
23196    }
23197
23198    impl std::default::Default for PolicyVerdict {
23199        fn default() -> Self {
23200            use std::convert::From;
23201            Self::from(0)
23202        }
23203    }
23204
23205    impl std::fmt::Display for PolicyVerdict {
23206        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23207            wkt::internal::display_enum(f, self.name(), self.value())
23208        }
23209    }
23210
23211    impl std::convert::From<i32> for PolicyVerdict {
23212        fn from(value: i32) -> Self {
23213            match value {
23214                0 => Self::Unspecified,
23215                1 => Self::AllowedByPolicy,
23216                2 => Self::DeniedByPolicy,
23217                _ => Self::UnknownValue(policy_verdict::UnknownValue(
23218                    wkt::internal::UnknownEnumValue::Integer(value),
23219                )),
23220            }
23221        }
23222    }
23223
23224    impl std::convert::From<&str> for PolicyVerdict {
23225        fn from(value: &str) -> Self {
23226            use std::string::ToString;
23227            match value {
23228                "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
23229                "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
23230                "DENIED_BY_POLICY" => Self::DeniedByPolicy,
23231                _ => Self::UnknownValue(policy_verdict::UnknownValue(
23232                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23233                )),
23234            }
23235        }
23236    }
23237
23238    impl serde::ser::Serialize for PolicyVerdict {
23239        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23240        where
23241            S: serde::Serializer,
23242        {
23243            match self {
23244                Self::Unspecified => serializer.serialize_i32(0),
23245                Self::AllowedByPolicy => serializer.serialize_i32(1),
23246                Self::DeniedByPolicy => serializer.serialize_i32(2),
23247                Self::UnknownValue(u) => u.0.serialize(serializer),
23248            }
23249        }
23250    }
23251
23252    impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
23253        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23254        where
23255            D: serde::Deserializer<'de>,
23256        {
23257            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
23258                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
23259            ))
23260        }
23261    }
23262
23263    /// Things that could have overridden the policy verdict. When overrides are
23264    /// used, the request will be allowed even if it is DENIED_BY_POLICY.
23265    ///
23266    /// # Working with unknown values
23267    ///
23268    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23269    /// additional enum variants at any time. Adding new variants is not considered
23270    /// a breaking change. Applications should write their code in anticipation of:
23271    ///
23272    /// - New values appearing in future releases of the client library, **and**
23273    /// - New values received dynamically, without application changes.
23274    ///
23275    /// Please consult the [Working with enums] section in the user guide for some
23276    /// guidelines.
23277    ///
23278    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23279    #[derive(Clone, Debug, PartialEq)]
23280    #[non_exhaustive]
23281    pub enum PolicyVerdictOverride {
23282        /// This should never happen.
23283        Unspecified,
23284        /// The policy was overridden.
23285        PolicyOverridden,
23286        /// The policy was suspended.
23287        PolicySuspended,
23288        /// If set, the enum was initialized with an unknown value.
23289        ///
23290        /// Applications can examine the value using [PolicyVerdictOverride::value] or
23291        /// [PolicyVerdictOverride::name].
23292        UnknownValue(policy_verdict_override::UnknownValue),
23293    }
23294
23295    #[doc(hidden)]
23296    pub mod policy_verdict_override {
23297        #[allow(unused_imports)]
23298        use super::*;
23299        #[derive(Clone, Debug, PartialEq)]
23300        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23301    }
23302
23303    impl PolicyVerdictOverride {
23304        /// Gets the enum value.
23305        ///
23306        /// Returns `None` if the enum contains an unknown value deserialized from
23307        /// the string representation of enums.
23308        pub fn value(&self) -> std::option::Option<i32> {
23309            match self {
23310                Self::Unspecified => std::option::Option::Some(0),
23311                Self::PolicyOverridden => std::option::Option::Some(1),
23312                Self::PolicySuspended => std::option::Option::Some(2),
23313                Self::UnknownValue(u) => u.0.value(),
23314            }
23315        }
23316
23317        /// Gets the enum value as a string.
23318        ///
23319        /// Returns `None` if the enum contains an unknown value deserialized from
23320        /// the integer representation of enums.
23321        pub fn name(&self) -> std::option::Option<&str> {
23322            match self {
23323                Self::Unspecified => {
23324                    std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
23325                }
23326                Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
23327                Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
23328                Self::UnknownValue(u) => u.0.name(),
23329            }
23330        }
23331    }
23332
23333    impl std::default::Default for PolicyVerdictOverride {
23334        fn default() -> Self {
23335            use std::convert::From;
23336            Self::from(0)
23337        }
23338    }
23339
23340    impl std::fmt::Display for PolicyVerdictOverride {
23341        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23342            wkt::internal::display_enum(f, self.name(), self.value())
23343        }
23344    }
23345
23346    impl std::convert::From<i32> for PolicyVerdictOverride {
23347        fn from(value: i32) -> Self {
23348            match value {
23349                0 => Self::Unspecified,
23350                1 => Self::PolicyOverridden,
23351                2 => Self::PolicySuspended,
23352                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23353                    wkt::internal::UnknownEnumValue::Integer(value),
23354                )),
23355            }
23356        }
23357    }
23358
23359    impl std::convert::From<&str> for PolicyVerdictOverride {
23360        fn from(value: &str) -> Self {
23361            use std::string::ToString;
23362            match value {
23363                "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
23364                "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
23365                "POLICY_SUSPENDED" => Self::PolicySuspended,
23366                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23367                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23368                )),
23369            }
23370        }
23371    }
23372
23373    impl serde::ser::Serialize for PolicyVerdictOverride {
23374        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23375        where
23376            S: serde::Serializer,
23377        {
23378            match self {
23379                Self::Unspecified => serializer.serialize_i32(0),
23380                Self::PolicyOverridden => serializer.serialize_i32(1),
23381                Self::PolicySuspended => serializer.serialize_i32(2),
23382                Self::UnknownValue(u) => u.0.serialize(serializer),
23383            }
23384        }
23385    }
23386
23387    impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
23388        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23389        where
23390            D: serde::Deserializer<'de>,
23391        {
23392            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
23393                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
23394            ))
23395        }
23396    }
23397}
23398
23399/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
23400/// Platform Log event that describes the failure to send a pub/sub notification
23401/// when there is a DeployPolicy status change.
23402#[derive(Clone, Default, PartialEq)]
23403#[non_exhaustive]
23404pub struct DeployPolicyNotificationEvent {
23405    /// Debug message for when a deploy policy fails to send a pub/sub
23406    /// notification.
23407    pub message: std::string::String,
23408
23409    /// The name of the `DeployPolicy`.
23410    pub deploy_policy: std::string::String,
23411
23412    /// Unique identifier of the deploy policy.
23413    pub deploy_policy_uid: std::string::String,
23414
23415    /// Type of this notification, e.g. for a Pub/Sub failure.
23416    pub r#type: crate::model::Type,
23417
23418    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23419}
23420
23421impl DeployPolicyNotificationEvent {
23422    /// Creates a new default instance.
23423    pub fn new() -> Self {
23424        std::default::Default::default()
23425    }
23426
23427    /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
23428    ///
23429    /// # Example
23430    /// ```ignore,no_run
23431    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23432    /// let x = DeployPolicyNotificationEvent::new().set_message("example");
23433    /// ```
23434    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23435        self.message = v.into();
23436        self
23437    }
23438
23439    /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
23440    ///
23441    /// # Example
23442    /// ```ignore,no_run
23443    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23444    /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy("example");
23445    /// ```
23446    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23447        self.deploy_policy = v.into();
23448        self
23449    }
23450
23451    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
23452    ///
23453    /// # Example
23454    /// ```ignore,no_run
23455    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23456    /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy_uid("example");
23457    /// ```
23458    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23459        mut self,
23460        v: T,
23461    ) -> Self {
23462        self.deploy_policy_uid = v.into();
23463        self
23464    }
23465
23466    /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
23467    ///
23468    /// # Example
23469    /// ```ignore,no_run
23470    /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23471    /// use google_cloud_deploy_v1::model::Type;
23472    /// let x0 = DeployPolicyNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23473    /// let x1 = DeployPolicyNotificationEvent::new().set_type(Type::ResourceStateChange);
23474    /// let x2 = DeployPolicyNotificationEvent::new().set_type(Type::ProcessAborted);
23475    /// ```
23476    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23477        self.r#type = v.into();
23478        self
23479    }
23480}
23481
23482impl wkt::message::Message for DeployPolicyNotificationEvent {
23483    fn typename() -> &'static str {
23484        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
23485    }
23486}
23487
23488/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
23489/// Platform Log event that describes the failure to send JobRun resource update
23490/// Pub/Sub notification.
23491#[derive(Clone, Default, PartialEq)]
23492#[non_exhaustive]
23493pub struct JobRunNotificationEvent {
23494    /// Debug message for when a notification fails to send.
23495    pub message: std::string::String,
23496
23497    /// The name of the `JobRun`.
23498    pub job_run: std::string::String,
23499
23500    /// Unique identifier of the `DeliveryPipeline`.
23501    pub pipeline_uid: std::string::String,
23502
23503    /// Unique identifier of the `Release`.
23504    pub release_uid: std::string::String,
23505
23506    /// The name of the `Release`.
23507    pub release: std::string::String,
23508
23509    /// Unique identifier of the `Rollout`.
23510    pub rollout_uid: std::string::String,
23511
23512    /// The name of the `Rollout`.
23513    pub rollout: std::string::String,
23514
23515    /// ID of the `Target`.
23516    pub target_id: std::string::String,
23517
23518    /// Type of this notification, e.g. for a Pub/Sub failure.
23519    pub r#type: crate::model::Type,
23520
23521    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23522}
23523
23524impl JobRunNotificationEvent {
23525    /// Creates a new default instance.
23526    pub fn new() -> Self {
23527        std::default::Default::default()
23528    }
23529
23530    /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
23531    ///
23532    /// # Example
23533    /// ```ignore,no_run
23534    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23535    /// let x = JobRunNotificationEvent::new().set_message("example");
23536    /// ```
23537    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23538        self.message = v.into();
23539        self
23540    }
23541
23542    /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
23543    ///
23544    /// # Example
23545    /// ```ignore,no_run
23546    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23547    /// let x = JobRunNotificationEvent::new().set_job_run("example");
23548    /// ```
23549    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23550        self.job_run = v.into();
23551        self
23552    }
23553
23554    /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
23555    ///
23556    /// # Example
23557    /// ```ignore,no_run
23558    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23559    /// let x = JobRunNotificationEvent::new().set_pipeline_uid("example");
23560    /// ```
23561    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23562        self.pipeline_uid = v.into();
23563        self
23564    }
23565
23566    /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
23567    ///
23568    /// # Example
23569    /// ```ignore,no_run
23570    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23571    /// let x = JobRunNotificationEvent::new().set_release_uid("example");
23572    /// ```
23573    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23574        self.release_uid = v.into();
23575        self
23576    }
23577
23578    /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
23579    ///
23580    /// # Example
23581    /// ```ignore,no_run
23582    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23583    /// let x = JobRunNotificationEvent::new().set_release("example");
23584    /// ```
23585    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23586        self.release = v.into();
23587        self
23588    }
23589
23590    /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
23591    ///
23592    /// # Example
23593    /// ```ignore,no_run
23594    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23595    /// let x = JobRunNotificationEvent::new().set_rollout_uid("example");
23596    /// ```
23597    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23598        self.rollout_uid = v.into();
23599        self
23600    }
23601
23602    /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
23603    ///
23604    /// # Example
23605    /// ```ignore,no_run
23606    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23607    /// let x = JobRunNotificationEvent::new().set_rollout("example");
23608    /// ```
23609    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23610        self.rollout = v.into();
23611        self
23612    }
23613
23614    /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
23615    ///
23616    /// # Example
23617    /// ```ignore,no_run
23618    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23619    /// let x = JobRunNotificationEvent::new().set_target_id("example");
23620    /// ```
23621    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23622        self.target_id = v.into();
23623        self
23624    }
23625
23626    /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
23627    ///
23628    /// # Example
23629    /// ```ignore,no_run
23630    /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23631    /// use google_cloud_deploy_v1::model::Type;
23632    /// let x0 = JobRunNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23633    /// let x1 = JobRunNotificationEvent::new().set_type(Type::ResourceStateChange);
23634    /// let x2 = JobRunNotificationEvent::new().set_type(Type::ProcessAborted);
23635    /// ```
23636    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23637        self.r#type = v.into();
23638        self
23639    }
23640}
23641
23642impl wkt::message::Message for JobRunNotificationEvent {
23643    fn typename() -> &'static str {
23644        "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
23645    }
23646}
23647
23648/// Payload proto for "clouddeploy.googleapis.com/release_notification"
23649/// Platform Log event that describes the failure to send release status change
23650/// Pub/Sub notification.
23651#[derive(Clone, Default, PartialEq)]
23652#[non_exhaustive]
23653pub struct ReleaseNotificationEvent {
23654    /// Debug message for when a notification fails to send.
23655    pub message: std::string::String,
23656
23657    /// Unique identifier of the `DeliveryPipeline`.
23658    pub pipeline_uid: std::string::String,
23659
23660    /// Unique identifier of the `Release`.
23661    pub release_uid: std::string::String,
23662
23663    /// The name of the `Release`.
23664    pub release: std::string::String,
23665
23666    /// Type of this notification, e.g. for a Pub/Sub failure.
23667    pub r#type: crate::model::Type,
23668
23669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23670}
23671
23672impl ReleaseNotificationEvent {
23673    /// Creates a new default instance.
23674    pub fn new() -> Self {
23675        std::default::Default::default()
23676    }
23677
23678    /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
23679    ///
23680    /// # Example
23681    /// ```ignore,no_run
23682    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23683    /// let x = ReleaseNotificationEvent::new().set_message("example");
23684    /// ```
23685    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23686        self.message = v.into();
23687        self
23688    }
23689
23690    /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
23691    ///
23692    /// # Example
23693    /// ```ignore,no_run
23694    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23695    /// let x = ReleaseNotificationEvent::new().set_pipeline_uid("example");
23696    /// ```
23697    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23698        self.pipeline_uid = v.into();
23699        self
23700    }
23701
23702    /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
23703    ///
23704    /// # Example
23705    /// ```ignore,no_run
23706    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23707    /// let x = ReleaseNotificationEvent::new().set_release_uid("example");
23708    /// ```
23709    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23710        self.release_uid = v.into();
23711        self
23712    }
23713
23714    /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
23715    ///
23716    /// # Example
23717    /// ```ignore,no_run
23718    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23719    /// let x = ReleaseNotificationEvent::new().set_release("example");
23720    /// ```
23721    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23722        self.release = v.into();
23723        self
23724    }
23725
23726    /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
23727    ///
23728    /// # Example
23729    /// ```ignore,no_run
23730    /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23731    /// use google_cloud_deploy_v1::model::Type;
23732    /// let x0 = ReleaseNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23733    /// let x1 = ReleaseNotificationEvent::new().set_type(Type::ResourceStateChange);
23734    /// let x2 = ReleaseNotificationEvent::new().set_type(Type::ProcessAborted);
23735    /// ```
23736    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23737        self.r#type = v.into();
23738        self
23739    }
23740}
23741
23742impl wkt::message::Message for ReleaseNotificationEvent {
23743    fn typename() -> &'static str {
23744        "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
23745    }
23746}
23747
23748/// Payload proto for "clouddeploy.googleapis.com/release_render"
23749/// Platform Log event that describes the render status change.
23750#[derive(Clone, Default, PartialEq)]
23751#[non_exhaustive]
23752pub struct ReleaseRenderEvent {
23753    /// Debug message for when a render transition occurs. Provides further
23754    /// details as rendering progresses through render states.
23755    pub message: std::string::String,
23756
23757    /// Unique identifier of the `DeliveryPipeline`.
23758    pub pipeline_uid: std::string::String,
23759
23760    /// The name of the release.
23761    /// release_uid is not in this log message because we write some of these log
23762    /// messages at release creation time, before we've generated the uid.
23763    pub release: std::string::String,
23764
23765    /// Type of this notification, e.g. for a release render state change event.
23766    pub r#type: crate::model::Type,
23767
23768    /// The state of the release render.
23769    pub release_render_state: crate::model::release::RenderState,
23770
23771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23772}
23773
23774impl ReleaseRenderEvent {
23775    /// Creates a new default instance.
23776    pub fn new() -> Self {
23777        std::default::Default::default()
23778    }
23779
23780    /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
23781    ///
23782    /// # Example
23783    /// ```ignore,no_run
23784    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23785    /// let x = ReleaseRenderEvent::new().set_message("example");
23786    /// ```
23787    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23788        self.message = v.into();
23789        self
23790    }
23791
23792    /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
23793    ///
23794    /// # Example
23795    /// ```ignore,no_run
23796    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23797    /// let x = ReleaseRenderEvent::new().set_pipeline_uid("example");
23798    /// ```
23799    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23800        self.pipeline_uid = v.into();
23801        self
23802    }
23803
23804    /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
23805    ///
23806    /// # Example
23807    /// ```ignore,no_run
23808    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23809    /// let x = ReleaseRenderEvent::new().set_release("example");
23810    /// ```
23811    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23812        self.release = v.into();
23813        self
23814    }
23815
23816    /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
23817    ///
23818    /// # Example
23819    /// ```ignore,no_run
23820    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23821    /// use google_cloud_deploy_v1::model::Type;
23822    /// let x0 = ReleaseRenderEvent::new().set_type(Type::PubsubNotificationFailure);
23823    /// let x1 = ReleaseRenderEvent::new().set_type(Type::ResourceStateChange);
23824    /// let x2 = ReleaseRenderEvent::new().set_type(Type::ProcessAborted);
23825    /// ```
23826    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23827        self.r#type = v.into();
23828        self
23829    }
23830
23831    /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
23832    ///
23833    /// # Example
23834    /// ```ignore,no_run
23835    /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23836    /// use google_cloud_deploy_v1::model::release::RenderState;
23837    /// let x0 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Succeeded);
23838    /// let x1 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Failed);
23839    /// let x2 = ReleaseRenderEvent::new().set_release_render_state(RenderState::InProgress);
23840    /// ```
23841    pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
23842        mut self,
23843        v: T,
23844    ) -> Self {
23845        self.release_render_state = v.into();
23846        self
23847    }
23848}
23849
23850impl wkt::message::Message for ReleaseRenderEvent {
23851    fn typename() -> &'static str {
23852        "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
23853    }
23854}
23855
23856/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
23857/// Platform Log event that describes the failure to send rollout status change
23858/// Pub/Sub notification.
23859#[derive(Clone, Default, PartialEq)]
23860#[non_exhaustive]
23861pub struct RolloutNotificationEvent {
23862    /// Debug message for when a notification fails to send.
23863    pub message: std::string::String,
23864
23865    /// Unique identifier of the `DeliveryPipeline`.
23866    pub pipeline_uid: std::string::String,
23867
23868    /// Unique identifier of the `Release`.
23869    pub release_uid: std::string::String,
23870
23871    /// The name of the `Release`.
23872    pub release: std::string::String,
23873
23874    /// Unique identifier of the `Rollout`.
23875    pub rollout_uid: std::string::String,
23876
23877    /// The name of the `Rollout`.
23878    pub rollout: std::string::String,
23879
23880    /// ID of the `Target` that the rollout is deployed to.
23881    pub target_id: std::string::String,
23882
23883    /// Type of this notification, e.g. for a Pub/Sub failure.
23884    pub r#type: crate::model::Type,
23885
23886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23887}
23888
23889impl RolloutNotificationEvent {
23890    /// Creates a new default instance.
23891    pub fn new() -> Self {
23892        std::default::Default::default()
23893    }
23894
23895    /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
23896    ///
23897    /// # Example
23898    /// ```ignore,no_run
23899    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23900    /// let x = RolloutNotificationEvent::new().set_message("example");
23901    /// ```
23902    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23903        self.message = v.into();
23904        self
23905    }
23906
23907    /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
23908    ///
23909    /// # Example
23910    /// ```ignore,no_run
23911    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23912    /// let x = RolloutNotificationEvent::new().set_pipeline_uid("example");
23913    /// ```
23914    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23915        self.pipeline_uid = v.into();
23916        self
23917    }
23918
23919    /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
23920    ///
23921    /// # Example
23922    /// ```ignore,no_run
23923    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23924    /// let x = RolloutNotificationEvent::new().set_release_uid("example");
23925    /// ```
23926    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23927        self.release_uid = v.into();
23928        self
23929    }
23930
23931    /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
23932    ///
23933    /// # Example
23934    /// ```ignore,no_run
23935    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23936    /// let x = RolloutNotificationEvent::new().set_release("example");
23937    /// ```
23938    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23939        self.release = v.into();
23940        self
23941    }
23942
23943    /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
23944    ///
23945    /// # Example
23946    /// ```ignore,no_run
23947    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23948    /// let x = RolloutNotificationEvent::new().set_rollout_uid("example");
23949    /// ```
23950    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23951        self.rollout_uid = v.into();
23952        self
23953    }
23954
23955    /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
23956    ///
23957    /// # Example
23958    /// ```ignore,no_run
23959    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23960    /// let x = RolloutNotificationEvent::new().set_rollout("example");
23961    /// ```
23962    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23963        self.rollout = v.into();
23964        self
23965    }
23966
23967    /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
23968    ///
23969    /// # Example
23970    /// ```ignore,no_run
23971    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23972    /// let x = RolloutNotificationEvent::new().set_target_id("example");
23973    /// ```
23974    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23975        self.target_id = v.into();
23976        self
23977    }
23978
23979    /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
23980    ///
23981    /// # Example
23982    /// ```ignore,no_run
23983    /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23984    /// use google_cloud_deploy_v1::model::Type;
23985    /// let x0 = RolloutNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23986    /// let x1 = RolloutNotificationEvent::new().set_type(Type::ResourceStateChange);
23987    /// let x2 = RolloutNotificationEvent::new().set_type(Type::ProcessAborted);
23988    /// ```
23989    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23990        self.r#type = v.into();
23991        self
23992    }
23993}
23994
23995impl wkt::message::Message for RolloutNotificationEvent {
23996    fn typename() -> &'static str {
23997        "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
23998    }
23999}
24000
24001/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
24002/// Platform Log event that describes the rollout update event.
24003#[derive(Clone, Default, PartialEq)]
24004#[non_exhaustive]
24005pub struct RolloutUpdateEvent {
24006    /// Debug message for when a rollout update event occurs.
24007    pub message: std::string::String,
24008
24009    /// Unique identifier of the pipeline.
24010    pub pipeline_uid: std::string::String,
24011
24012    /// Unique identifier of the release.
24013    pub release_uid: std::string::String,
24014
24015    /// The name of the `Release`.
24016    pub release: std::string::String,
24017
24018    /// The name of the rollout.
24019    /// rollout_uid is not in this log message because we write some of these log
24020    /// messages at rollout creation time, before we've generated the uid.
24021    pub rollout: std::string::String,
24022
24023    /// ID of the target.
24024    pub target_id: std::string::String,
24025
24026    /// Type of this notification, e.g. for a rollout update event.
24027    pub r#type: crate::model::Type,
24028
24029    /// The type of the rollout update.
24030    pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
24031
24032    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24033}
24034
24035impl RolloutUpdateEvent {
24036    /// Creates a new default instance.
24037    pub fn new() -> Self {
24038        std::default::Default::default()
24039    }
24040
24041    /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
24042    ///
24043    /// # Example
24044    /// ```ignore,no_run
24045    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24046    /// let x = RolloutUpdateEvent::new().set_message("example");
24047    /// ```
24048    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24049        self.message = v.into();
24050        self
24051    }
24052
24053    /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
24054    ///
24055    /// # Example
24056    /// ```ignore,no_run
24057    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24058    /// let x = RolloutUpdateEvent::new().set_pipeline_uid("example");
24059    /// ```
24060    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24061        self.pipeline_uid = v.into();
24062        self
24063    }
24064
24065    /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
24066    ///
24067    /// # Example
24068    /// ```ignore,no_run
24069    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24070    /// let x = RolloutUpdateEvent::new().set_release_uid("example");
24071    /// ```
24072    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24073        self.release_uid = v.into();
24074        self
24075    }
24076
24077    /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
24078    ///
24079    /// # Example
24080    /// ```ignore,no_run
24081    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24082    /// let x = RolloutUpdateEvent::new().set_release("example");
24083    /// ```
24084    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24085        self.release = v.into();
24086        self
24087    }
24088
24089    /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
24090    ///
24091    /// # Example
24092    /// ```ignore,no_run
24093    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24094    /// let x = RolloutUpdateEvent::new().set_rollout("example");
24095    /// ```
24096    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24097        self.rollout = v.into();
24098        self
24099    }
24100
24101    /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
24102    ///
24103    /// # Example
24104    /// ```ignore,no_run
24105    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24106    /// let x = RolloutUpdateEvent::new().set_target_id("example");
24107    /// ```
24108    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24109        self.target_id = v.into();
24110        self
24111    }
24112
24113    /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
24114    ///
24115    /// # Example
24116    /// ```ignore,no_run
24117    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24118    /// use google_cloud_deploy_v1::model::Type;
24119    /// let x0 = RolloutUpdateEvent::new().set_type(Type::PubsubNotificationFailure);
24120    /// let x1 = RolloutUpdateEvent::new().set_type(Type::ResourceStateChange);
24121    /// let x2 = RolloutUpdateEvent::new().set_type(Type::ProcessAborted);
24122    /// ```
24123    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24124        self.r#type = v.into();
24125        self
24126    }
24127
24128    /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
24129    ///
24130    /// # Example
24131    /// ```ignore,no_run
24132    /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24133    /// use google_cloud_deploy_v1::model::rollout_update_event::RolloutUpdateType;
24134    /// let x0 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::Pending);
24135    /// let x1 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::PendingRelease);
24136    /// let x2 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::InProgress);
24137    /// ```
24138    pub fn set_rollout_update_type<
24139        T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
24140    >(
24141        mut self,
24142        v: T,
24143    ) -> Self {
24144        self.rollout_update_type = v.into();
24145        self
24146    }
24147}
24148
24149impl wkt::message::Message for RolloutUpdateEvent {
24150    fn typename() -> &'static str {
24151        "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
24152    }
24153}
24154
24155/// Defines additional types related to [RolloutUpdateEvent].
24156pub mod rollout_update_event {
24157    #[allow(unused_imports)]
24158    use super::*;
24159
24160    /// RolloutUpdateType indicates the type of the rollout update.
24161    ///
24162    /// # Working with unknown values
24163    ///
24164    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24165    /// additional enum variants at any time. Adding new variants is not considered
24166    /// a breaking change. Applications should write their code in anticipation of:
24167    ///
24168    /// - New values appearing in future releases of the client library, **and**
24169    /// - New values received dynamically, without application changes.
24170    ///
24171    /// Please consult the [Working with enums] section in the user guide for some
24172    /// guidelines.
24173    ///
24174    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24175    #[derive(Clone, Debug, PartialEq)]
24176    #[non_exhaustive]
24177    pub enum RolloutUpdateType {
24178        /// Rollout update type unspecified.
24179        Unspecified,
24180        /// rollout state updated to pending.
24181        Pending,
24182        /// Rollout state updated to pending release.
24183        PendingRelease,
24184        /// Rollout state updated to in progress.
24185        InProgress,
24186        /// Rollout state updated to cancelling.
24187        Cancelling,
24188        /// Rollout state updated to cancelled.
24189        Cancelled,
24190        /// Rollout state updated to halted.
24191        Halted,
24192        /// Rollout state updated to succeeded.
24193        Succeeded,
24194        /// Rollout state updated to failed.
24195        Failed,
24196        /// Rollout requires approval.
24197        ApprovalRequired,
24198        /// Rollout has been approved.
24199        Approved,
24200        /// Rollout has been rejected.
24201        Rejected,
24202        /// Rollout requires advance to the next phase.
24203        AdvanceRequired,
24204        /// Rollout has been advanced.
24205        Advanced,
24206        /// If set, the enum was initialized with an unknown value.
24207        ///
24208        /// Applications can examine the value using [RolloutUpdateType::value] or
24209        /// [RolloutUpdateType::name].
24210        UnknownValue(rollout_update_type::UnknownValue),
24211    }
24212
24213    #[doc(hidden)]
24214    pub mod rollout_update_type {
24215        #[allow(unused_imports)]
24216        use super::*;
24217        #[derive(Clone, Debug, PartialEq)]
24218        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24219    }
24220
24221    impl RolloutUpdateType {
24222        /// Gets the enum value.
24223        ///
24224        /// Returns `None` if the enum contains an unknown value deserialized from
24225        /// the string representation of enums.
24226        pub fn value(&self) -> std::option::Option<i32> {
24227            match self {
24228                Self::Unspecified => std::option::Option::Some(0),
24229                Self::Pending => std::option::Option::Some(1),
24230                Self::PendingRelease => std::option::Option::Some(2),
24231                Self::InProgress => std::option::Option::Some(3),
24232                Self::Cancelling => std::option::Option::Some(4),
24233                Self::Cancelled => std::option::Option::Some(5),
24234                Self::Halted => std::option::Option::Some(6),
24235                Self::Succeeded => std::option::Option::Some(7),
24236                Self::Failed => std::option::Option::Some(8),
24237                Self::ApprovalRequired => std::option::Option::Some(9),
24238                Self::Approved => std::option::Option::Some(10),
24239                Self::Rejected => std::option::Option::Some(11),
24240                Self::AdvanceRequired => std::option::Option::Some(12),
24241                Self::Advanced => std::option::Option::Some(13),
24242                Self::UnknownValue(u) => u.0.value(),
24243            }
24244        }
24245
24246        /// Gets the enum value as a string.
24247        ///
24248        /// Returns `None` if the enum contains an unknown value deserialized from
24249        /// the integer representation of enums.
24250        pub fn name(&self) -> std::option::Option<&str> {
24251            match self {
24252                Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
24253                Self::Pending => std::option::Option::Some("PENDING"),
24254                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
24255                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
24256                Self::Cancelling => std::option::Option::Some("CANCELLING"),
24257                Self::Cancelled => std::option::Option::Some("CANCELLED"),
24258                Self::Halted => std::option::Option::Some("HALTED"),
24259                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24260                Self::Failed => std::option::Option::Some("FAILED"),
24261                Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
24262                Self::Approved => std::option::Option::Some("APPROVED"),
24263                Self::Rejected => std::option::Option::Some("REJECTED"),
24264                Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
24265                Self::Advanced => std::option::Option::Some("ADVANCED"),
24266                Self::UnknownValue(u) => u.0.name(),
24267            }
24268        }
24269    }
24270
24271    impl std::default::Default for RolloutUpdateType {
24272        fn default() -> Self {
24273            use std::convert::From;
24274            Self::from(0)
24275        }
24276    }
24277
24278    impl std::fmt::Display for RolloutUpdateType {
24279        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24280            wkt::internal::display_enum(f, self.name(), self.value())
24281        }
24282    }
24283
24284    impl std::convert::From<i32> for RolloutUpdateType {
24285        fn from(value: i32) -> Self {
24286            match value {
24287                0 => Self::Unspecified,
24288                1 => Self::Pending,
24289                2 => Self::PendingRelease,
24290                3 => Self::InProgress,
24291                4 => Self::Cancelling,
24292                5 => Self::Cancelled,
24293                6 => Self::Halted,
24294                7 => Self::Succeeded,
24295                8 => Self::Failed,
24296                9 => Self::ApprovalRequired,
24297                10 => Self::Approved,
24298                11 => Self::Rejected,
24299                12 => Self::AdvanceRequired,
24300                13 => Self::Advanced,
24301                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
24302                    wkt::internal::UnknownEnumValue::Integer(value),
24303                )),
24304            }
24305        }
24306    }
24307
24308    impl std::convert::From<&str> for RolloutUpdateType {
24309        fn from(value: &str) -> Self {
24310            use std::string::ToString;
24311            match value {
24312                "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
24313                "PENDING" => Self::Pending,
24314                "PENDING_RELEASE" => Self::PendingRelease,
24315                "IN_PROGRESS" => Self::InProgress,
24316                "CANCELLING" => Self::Cancelling,
24317                "CANCELLED" => Self::Cancelled,
24318                "HALTED" => Self::Halted,
24319                "SUCCEEDED" => Self::Succeeded,
24320                "FAILED" => Self::Failed,
24321                "APPROVAL_REQUIRED" => Self::ApprovalRequired,
24322                "APPROVED" => Self::Approved,
24323                "REJECTED" => Self::Rejected,
24324                "ADVANCE_REQUIRED" => Self::AdvanceRequired,
24325                "ADVANCED" => Self::Advanced,
24326                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
24327                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24328                )),
24329            }
24330        }
24331    }
24332
24333    impl serde::ser::Serialize for RolloutUpdateType {
24334        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24335        where
24336            S: serde::Serializer,
24337        {
24338            match self {
24339                Self::Unspecified => serializer.serialize_i32(0),
24340                Self::Pending => serializer.serialize_i32(1),
24341                Self::PendingRelease => serializer.serialize_i32(2),
24342                Self::InProgress => serializer.serialize_i32(3),
24343                Self::Cancelling => serializer.serialize_i32(4),
24344                Self::Cancelled => serializer.serialize_i32(5),
24345                Self::Halted => serializer.serialize_i32(6),
24346                Self::Succeeded => serializer.serialize_i32(7),
24347                Self::Failed => serializer.serialize_i32(8),
24348                Self::ApprovalRequired => serializer.serialize_i32(9),
24349                Self::Approved => serializer.serialize_i32(10),
24350                Self::Rejected => serializer.serialize_i32(11),
24351                Self::AdvanceRequired => serializer.serialize_i32(12),
24352                Self::Advanced => serializer.serialize_i32(13),
24353                Self::UnknownValue(u) => u.0.serialize(serializer),
24354            }
24355        }
24356    }
24357
24358    impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
24359        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24360        where
24361            D: serde::Deserializer<'de>,
24362        {
24363            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
24364                ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
24365            ))
24366        }
24367    }
24368}
24369
24370/// Payload proto for "clouddeploy.googleapis.com/target_notification"
24371/// Platform Log event that describes the failure to send target status change
24372/// Pub/Sub notification.
24373#[derive(Clone, Default, PartialEq)]
24374#[non_exhaustive]
24375pub struct TargetNotificationEvent {
24376    /// Debug message for when a notification fails to send.
24377    pub message: std::string::String,
24378
24379    /// The name of the `Target`.
24380    pub target: std::string::String,
24381
24382    /// Type of this notification, e.g. for a Pub/Sub failure.
24383    pub r#type: crate::model::Type,
24384
24385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24386}
24387
24388impl TargetNotificationEvent {
24389    /// Creates a new default instance.
24390    pub fn new() -> Self {
24391        std::default::Default::default()
24392    }
24393
24394    /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
24395    ///
24396    /// # Example
24397    /// ```ignore,no_run
24398    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24399    /// let x = TargetNotificationEvent::new().set_message("example");
24400    /// ```
24401    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24402        self.message = v.into();
24403        self
24404    }
24405
24406    /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
24407    ///
24408    /// # Example
24409    /// ```ignore,no_run
24410    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24411    /// let x = TargetNotificationEvent::new().set_target("example");
24412    /// ```
24413    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24414        self.target = v.into();
24415        self
24416    }
24417
24418    /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
24419    ///
24420    /// # Example
24421    /// ```ignore,no_run
24422    /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24423    /// use google_cloud_deploy_v1::model::Type;
24424    /// let x0 = TargetNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
24425    /// let x1 = TargetNotificationEvent::new().set_type(Type::ResourceStateChange);
24426    /// let x2 = TargetNotificationEvent::new().set_type(Type::ProcessAborted);
24427    /// ```
24428    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24429        self.r#type = v.into();
24430        self
24431    }
24432}
24433
24434impl wkt::message::Message for TargetNotificationEvent {
24435    fn typename() -> &'static str {
24436        "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
24437    }
24438}
24439
24440/// The support state of a specific Skaffold version.
24441///
24442/// # Working with unknown values
24443///
24444/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24445/// additional enum variants at any time. Adding new variants is not considered
24446/// a breaking change. Applications should write their code in anticipation of:
24447///
24448/// - New values appearing in future releases of the client library, **and**
24449/// - New values received dynamically, without application changes.
24450///
24451/// Please consult the [Working with enums] section in the user guide for some
24452/// guidelines.
24453///
24454/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24455#[derive(Clone, Debug, PartialEq)]
24456#[non_exhaustive]
24457pub enum SkaffoldSupportState {
24458    /// Default value. This value is unused.
24459    Unspecified,
24460    /// This Skaffold version is currently supported.
24461    Supported,
24462    /// This Skaffold version is in maintenance mode.
24463    MaintenanceMode,
24464    /// This Skaffold version is no longer supported.
24465    Unsupported,
24466    /// If set, the enum was initialized with an unknown value.
24467    ///
24468    /// Applications can examine the value using [SkaffoldSupportState::value] or
24469    /// [SkaffoldSupportState::name].
24470    UnknownValue(skaffold_support_state::UnknownValue),
24471}
24472
24473#[doc(hidden)]
24474pub mod skaffold_support_state {
24475    #[allow(unused_imports)]
24476    use super::*;
24477    #[derive(Clone, Debug, PartialEq)]
24478    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24479}
24480
24481impl SkaffoldSupportState {
24482    /// Gets the enum value.
24483    ///
24484    /// Returns `None` if the enum contains an unknown value deserialized from
24485    /// the string representation of enums.
24486    pub fn value(&self) -> std::option::Option<i32> {
24487        match self {
24488            Self::Unspecified => std::option::Option::Some(0),
24489            Self::Supported => std::option::Option::Some(1),
24490            Self::MaintenanceMode => std::option::Option::Some(2),
24491            Self::Unsupported => std::option::Option::Some(3),
24492            Self::UnknownValue(u) => u.0.value(),
24493        }
24494    }
24495
24496    /// Gets the enum value as a string.
24497    ///
24498    /// Returns `None` if the enum contains an unknown value deserialized from
24499    /// the integer representation of enums.
24500    pub fn name(&self) -> std::option::Option<&str> {
24501        match self {
24502            Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
24503            Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
24504            Self::MaintenanceMode => {
24505                std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
24506            }
24507            Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
24508            Self::UnknownValue(u) => u.0.name(),
24509        }
24510    }
24511}
24512
24513impl std::default::Default for SkaffoldSupportState {
24514    fn default() -> Self {
24515        use std::convert::From;
24516        Self::from(0)
24517    }
24518}
24519
24520impl std::fmt::Display for SkaffoldSupportState {
24521    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24522        wkt::internal::display_enum(f, self.name(), self.value())
24523    }
24524}
24525
24526impl std::convert::From<i32> for SkaffoldSupportState {
24527    fn from(value: i32) -> Self {
24528        match value {
24529            0 => Self::Unspecified,
24530            1 => Self::Supported,
24531            2 => Self::MaintenanceMode,
24532            3 => Self::Unsupported,
24533            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24534                wkt::internal::UnknownEnumValue::Integer(value),
24535            )),
24536        }
24537    }
24538}
24539
24540impl std::convert::From<&str> for SkaffoldSupportState {
24541    fn from(value: &str) -> Self {
24542        use std::string::ToString;
24543        match value {
24544            "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
24545            "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
24546            "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
24547            "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
24548            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24549                wkt::internal::UnknownEnumValue::String(value.to_string()),
24550            )),
24551        }
24552    }
24553}
24554
24555impl serde::ser::Serialize for SkaffoldSupportState {
24556    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24557    where
24558        S: serde::Serializer,
24559    {
24560        match self {
24561            Self::Unspecified => serializer.serialize_i32(0),
24562            Self::Supported => serializer.serialize_i32(1),
24563            Self::MaintenanceMode => serializer.serialize_i32(2),
24564            Self::Unsupported => serializer.serialize_i32(3),
24565            Self::UnknownValue(u) => u.0.serialize(serializer),
24566        }
24567    }
24568}
24569
24570impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
24571    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24572    where
24573        D: serde::Deserializer<'de>,
24574    {
24575        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
24576            ".google.cloud.deploy.v1.SkaffoldSupportState",
24577        ))
24578    }
24579}
24580
24581/// The pattern of how wait time is increased.
24582///
24583/// # Working with unknown values
24584///
24585/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24586/// additional enum variants at any time. Adding new variants is not considered
24587/// a breaking change. Applications should write their code in anticipation of:
24588///
24589/// - New values appearing in future releases of the client library, **and**
24590/// - New values received dynamically, without application changes.
24591///
24592/// Please consult the [Working with enums] section in the user guide for some
24593/// guidelines.
24594///
24595/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24596#[derive(Clone, Debug, PartialEq)]
24597#[non_exhaustive]
24598pub enum BackoffMode {
24599    /// No WaitMode is specified.
24600    Unspecified,
24601    /// Increases the wait time linearly.
24602    Linear,
24603    /// Increases the wait time exponentially.
24604    Exponential,
24605    /// If set, the enum was initialized with an unknown value.
24606    ///
24607    /// Applications can examine the value using [BackoffMode::value] or
24608    /// [BackoffMode::name].
24609    UnknownValue(backoff_mode::UnknownValue),
24610}
24611
24612#[doc(hidden)]
24613pub mod backoff_mode {
24614    #[allow(unused_imports)]
24615    use super::*;
24616    #[derive(Clone, Debug, PartialEq)]
24617    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24618}
24619
24620impl BackoffMode {
24621    /// Gets the enum value.
24622    ///
24623    /// Returns `None` if the enum contains an unknown value deserialized from
24624    /// the string representation of enums.
24625    pub fn value(&self) -> std::option::Option<i32> {
24626        match self {
24627            Self::Unspecified => std::option::Option::Some(0),
24628            Self::Linear => std::option::Option::Some(1),
24629            Self::Exponential => std::option::Option::Some(2),
24630            Self::UnknownValue(u) => u.0.value(),
24631        }
24632    }
24633
24634    /// Gets the enum value as a string.
24635    ///
24636    /// Returns `None` if the enum contains an unknown value deserialized from
24637    /// the integer representation of enums.
24638    pub fn name(&self) -> std::option::Option<&str> {
24639        match self {
24640            Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
24641            Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
24642            Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
24643            Self::UnknownValue(u) => u.0.name(),
24644        }
24645    }
24646}
24647
24648impl std::default::Default for BackoffMode {
24649    fn default() -> Self {
24650        use std::convert::From;
24651        Self::from(0)
24652    }
24653}
24654
24655impl std::fmt::Display for BackoffMode {
24656    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24657        wkt::internal::display_enum(f, self.name(), self.value())
24658    }
24659}
24660
24661impl std::convert::From<i32> for BackoffMode {
24662    fn from(value: i32) -> Self {
24663        match value {
24664            0 => Self::Unspecified,
24665            1 => Self::Linear,
24666            2 => Self::Exponential,
24667            _ => Self::UnknownValue(backoff_mode::UnknownValue(
24668                wkt::internal::UnknownEnumValue::Integer(value),
24669            )),
24670        }
24671    }
24672}
24673
24674impl std::convert::From<&str> for BackoffMode {
24675    fn from(value: &str) -> Self {
24676        use std::string::ToString;
24677        match value {
24678            "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
24679            "BACKOFF_MODE_LINEAR" => Self::Linear,
24680            "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
24681            _ => Self::UnknownValue(backoff_mode::UnknownValue(
24682                wkt::internal::UnknownEnumValue::String(value.to_string()),
24683            )),
24684        }
24685    }
24686}
24687
24688impl serde::ser::Serialize for BackoffMode {
24689    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24690    where
24691        S: serde::Serializer,
24692    {
24693        match self {
24694            Self::Unspecified => serializer.serialize_i32(0),
24695            Self::Linear => serializer.serialize_i32(1),
24696            Self::Exponential => serializer.serialize_i32(2),
24697            Self::UnknownValue(u) => u.0.serialize(serializer),
24698        }
24699    }
24700}
24701
24702impl<'de> serde::de::Deserialize<'de> for BackoffMode {
24703    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24704    where
24705        D: serde::Deserializer<'de>,
24706    {
24707        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
24708            ".google.cloud.deploy.v1.BackoffMode",
24709        ))
24710    }
24711}
24712
24713/// Valid state of a repair attempt.
24714///
24715/// # Working with unknown values
24716///
24717/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24718/// additional enum variants at any time. Adding new variants is not considered
24719/// a breaking change. Applications should write their code in anticipation of:
24720///
24721/// - New values appearing in future releases of the client library, **and**
24722/// - New values received dynamically, without application changes.
24723///
24724/// Please consult the [Working with enums] section in the user guide for some
24725/// guidelines.
24726///
24727/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24728#[derive(Clone, Debug, PartialEq)]
24729#[non_exhaustive]
24730pub enum RepairState {
24731    /// The `repair` has an unspecified state.
24732    Unspecified,
24733    /// The `repair` action has succeeded.
24734    Succeeded,
24735    /// The `repair` action was cancelled.
24736    Cancelled,
24737    /// The `repair` action has failed.
24738    Failed,
24739    /// The `repair` action is in progress.
24740    InProgress,
24741    /// The `repair` action is pending.
24742    Pending,
24743    /// The `repair` action was aborted.
24744    Aborted,
24745    /// If set, the enum was initialized with an unknown value.
24746    ///
24747    /// Applications can examine the value using [RepairState::value] or
24748    /// [RepairState::name].
24749    UnknownValue(repair_state::UnknownValue),
24750}
24751
24752#[doc(hidden)]
24753pub mod repair_state {
24754    #[allow(unused_imports)]
24755    use super::*;
24756    #[derive(Clone, Debug, PartialEq)]
24757    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24758}
24759
24760impl RepairState {
24761    /// Gets the enum value.
24762    ///
24763    /// Returns `None` if the enum contains an unknown value deserialized from
24764    /// the string representation of enums.
24765    pub fn value(&self) -> std::option::Option<i32> {
24766        match self {
24767            Self::Unspecified => std::option::Option::Some(0),
24768            Self::Succeeded => std::option::Option::Some(1),
24769            Self::Cancelled => std::option::Option::Some(2),
24770            Self::Failed => std::option::Option::Some(3),
24771            Self::InProgress => std::option::Option::Some(4),
24772            Self::Pending => std::option::Option::Some(5),
24773            Self::Aborted => std::option::Option::Some(7),
24774            Self::UnknownValue(u) => u.0.value(),
24775        }
24776    }
24777
24778    /// Gets the enum value as a string.
24779    ///
24780    /// Returns `None` if the enum contains an unknown value deserialized from
24781    /// the integer representation of enums.
24782    pub fn name(&self) -> std::option::Option<&str> {
24783        match self {
24784            Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
24785            Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
24786            Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
24787            Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
24788            Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
24789            Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
24790            Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
24791            Self::UnknownValue(u) => u.0.name(),
24792        }
24793    }
24794}
24795
24796impl std::default::Default for RepairState {
24797    fn default() -> Self {
24798        use std::convert::From;
24799        Self::from(0)
24800    }
24801}
24802
24803impl std::fmt::Display for RepairState {
24804    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24805        wkt::internal::display_enum(f, self.name(), self.value())
24806    }
24807}
24808
24809impl std::convert::From<i32> for RepairState {
24810    fn from(value: i32) -> Self {
24811        match value {
24812            0 => Self::Unspecified,
24813            1 => Self::Succeeded,
24814            2 => Self::Cancelled,
24815            3 => Self::Failed,
24816            4 => Self::InProgress,
24817            5 => Self::Pending,
24818            7 => Self::Aborted,
24819            _ => Self::UnknownValue(repair_state::UnknownValue(
24820                wkt::internal::UnknownEnumValue::Integer(value),
24821            )),
24822        }
24823    }
24824}
24825
24826impl std::convert::From<&str> for RepairState {
24827    fn from(value: &str) -> Self {
24828        use std::string::ToString;
24829        match value {
24830            "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
24831            "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
24832            "REPAIR_STATE_CANCELLED" => Self::Cancelled,
24833            "REPAIR_STATE_FAILED" => Self::Failed,
24834            "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
24835            "REPAIR_STATE_PENDING" => Self::Pending,
24836            "REPAIR_STATE_ABORTED" => Self::Aborted,
24837            _ => Self::UnknownValue(repair_state::UnknownValue(
24838                wkt::internal::UnknownEnumValue::String(value.to_string()),
24839            )),
24840        }
24841    }
24842}
24843
24844impl serde::ser::Serialize for RepairState {
24845    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24846    where
24847        S: serde::Serializer,
24848    {
24849        match self {
24850            Self::Unspecified => serializer.serialize_i32(0),
24851            Self::Succeeded => serializer.serialize_i32(1),
24852            Self::Cancelled => serializer.serialize_i32(2),
24853            Self::Failed => serializer.serialize_i32(3),
24854            Self::InProgress => serializer.serialize_i32(4),
24855            Self::Pending => serializer.serialize_i32(5),
24856            Self::Aborted => serializer.serialize_i32(7),
24857            Self::UnknownValue(u) => u.0.serialize(serializer),
24858        }
24859    }
24860}
24861
24862impl<'de> serde::de::Deserialize<'de> for RepairState {
24863    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24864    where
24865        D: serde::Deserializer<'de>,
24866    {
24867        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
24868            ".google.cloud.deploy.v1.RepairState",
24869        ))
24870    }
24871}
24872
24873/// Type indicates the type of the log entry and can be used as a filter.
24874///
24875/// # Working with unknown values
24876///
24877/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24878/// additional enum variants at any time. Adding new variants is not considered
24879/// a breaking change. Applications should write their code in anticipation of:
24880///
24881/// - New values appearing in future releases of the client library, **and**
24882/// - New values received dynamically, without application changes.
24883///
24884/// Please consult the [Working with enums] section in the user guide for some
24885/// guidelines.
24886///
24887/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24888#[derive(Clone, Debug, PartialEq)]
24889#[non_exhaustive]
24890pub enum Type {
24891    /// Type is unspecified.
24892    Unspecified,
24893    /// A Pub/Sub notification failed to be sent.
24894    PubsubNotificationFailure,
24895    /// Resource state changed.
24896    ResourceStateChange,
24897    /// A process aborted.
24898    ProcessAborted,
24899    /// Restriction check failed.
24900    RestrictionViolated,
24901    /// Resource deleted.
24902    ResourceDeleted,
24903    /// Rollout updated.
24904    RolloutUpdate,
24905    /// Deploy Policy evaluation.
24906    DeployPolicyEvaluation,
24907    /// Deprecated: This field is never used. Use release_render log type instead.
24908    #[deprecated]
24909    RenderStatuesChange,
24910    /// If set, the enum was initialized with an unknown value.
24911    ///
24912    /// Applications can examine the value using [Type::value] or
24913    /// [Type::name].
24914    UnknownValue(r#type::UnknownValue),
24915}
24916
24917#[doc(hidden)]
24918pub mod r#type {
24919    #[allow(unused_imports)]
24920    use super::*;
24921    #[derive(Clone, Debug, PartialEq)]
24922    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24923}
24924
24925impl Type {
24926    /// Gets the enum value.
24927    ///
24928    /// Returns `None` if the enum contains an unknown value deserialized from
24929    /// the string representation of enums.
24930    pub fn value(&self) -> std::option::Option<i32> {
24931        match self {
24932            Self::Unspecified => std::option::Option::Some(0),
24933            Self::PubsubNotificationFailure => std::option::Option::Some(1),
24934            Self::ResourceStateChange => std::option::Option::Some(3),
24935            Self::ProcessAborted => std::option::Option::Some(4),
24936            Self::RestrictionViolated => std::option::Option::Some(5),
24937            Self::ResourceDeleted => std::option::Option::Some(6),
24938            Self::RolloutUpdate => std::option::Option::Some(7),
24939            Self::DeployPolicyEvaluation => std::option::Option::Some(8),
24940            Self::RenderStatuesChange => std::option::Option::Some(2),
24941            Self::UnknownValue(u) => u.0.value(),
24942        }
24943    }
24944
24945    /// Gets the enum value as a string.
24946    ///
24947    /// Returns `None` if the enum contains an unknown value deserialized from
24948    /// the integer representation of enums.
24949    pub fn name(&self) -> std::option::Option<&str> {
24950        match self {
24951            Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
24952            Self::PubsubNotificationFailure => {
24953                std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
24954            }
24955            Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
24956            Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
24957            Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
24958            Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
24959            Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
24960            Self::DeployPolicyEvaluation => {
24961                std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
24962            }
24963            Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
24964            Self::UnknownValue(u) => u.0.name(),
24965        }
24966    }
24967}
24968
24969impl std::default::Default for Type {
24970    fn default() -> Self {
24971        use std::convert::From;
24972        Self::from(0)
24973    }
24974}
24975
24976impl std::fmt::Display for Type {
24977    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24978        wkt::internal::display_enum(f, self.name(), self.value())
24979    }
24980}
24981
24982impl std::convert::From<i32> for Type {
24983    fn from(value: i32) -> Self {
24984        match value {
24985            0 => Self::Unspecified,
24986            1 => Self::PubsubNotificationFailure,
24987            2 => Self::RenderStatuesChange,
24988            3 => Self::ResourceStateChange,
24989            4 => Self::ProcessAborted,
24990            5 => Self::RestrictionViolated,
24991            6 => Self::ResourceDeleted,
24992            7 => Self::RolloutUpdate,
24993            8 => Self::DeployPolicyEvaluation,
24994            _ => Self::UnknownValue(r#type::UnknownValue(
24995                wkt::internal::UnknownEnumValue::Integer(value),
24996            )),
24997        }
24998    }
24999}
25000
25001impl std::convert::From<&str> for Type {
25002    fn from(value: &str) -> Self {
25003        use std::string::ToString;
25004        match value {
25005            "TYPE_UNSPECIFIED" => Self::Unspecified,
25006            "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
25007            "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
25008            "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
25009            "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
25010            "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
25011            "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
25012            "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
25013            "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
25014            _ => Self::UnknownValue(r#type::UnknownValue(
25015                wkt::internal::UnknownEnumValue::String(value.to_string()),
25016            )),
25017        }
25018    }
25019}
25020
25021impl serde::ser::Serialize for Type {
25022    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25023    where
25024        S: serde::Serializer,
25025    {
25026        match self {
25027            Self::Unspecified => serializer.serialize_i32(0),
25028            Self::PubsubNotificationFailure => serializer.serialize_i32(1),
25029            Self::ResourceStateChange => serializer.serialize_i32(3),
25030            Self::ProcessAborted => serializer.serialize_i32(4),
25031            Self::RestrictionViolated => serializer.serialize_i32(5),
25032            Self::ResourceDeleted => serializer.serialize_i32(6),
25033            Self::RolloutUpdate => serializer.serialize_i32(7),
25034            Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
25035            Self::RenderStatuesChange => serializer.serialize_i32(2),
25036            Self::UnknownValue(u) => u.0.serialize(serializer),
25037        }
25038    }
25039}
25040
25041impl<'de> serde::de::Deserialize<'de> for Type {
25042    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25043    where
25044        D: serde::Deserializer<'de>,
25045    {
25046        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
25047            ".google.cloud.deploy.v1.Type",
25048        ))
25049    }
25050}