google_cloud_deploy_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate location;
28extern crate longrunning;
29extern crate lro;
30extern crate reqwest;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Payload proto for "clouddeploy.googleapis.com/automation"
43/// Platform Log event that describes the Automation related events.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct AutomationEvent {
47    /// Debug message for when there is an update on the AutomationRun.
48    /// Provides further details about the resource creation or state change.
49    pub message: std::string::String,
50
51    /// The name of the `AutomationRun`.
52    pub automation: std::string::String,
53
54    /// Unique identifier of the `DeliveryPipeline`.
55    pub pipeline_uid: std::string::String,
56
57    /// Type of this notification, e.g. for a Pub/Sub failure.
58    pub r#type: crate::model::Type,
59
60    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl AutomationEvent {
64    pub fn new() -> Self {
65        std::default::Default::default()
66    }
67
68    /// Sets the value of [message][crate::model::AutomationEvent::message].
69    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
70        self.message = v.into();
71        self
72    }
73
74    /// Sets the value of [automation][crate::model::AutomationEvent::automation].
75    pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.automation = v.into();
77        self
78    }
79
80    /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
81    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
82        self.pipeline_uid = v.into();
83        self
84    }
85
86    /// Sets the value of [r#type][crate::model::AutomationEvent::type].
87    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
88        self.r#type = v.into();
89        self
90    }
91}
92
93impl wkt::message::Message for AutomationEvent {
94    fn typename() -> &'static str {
95        "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
96    }
97}
98
99/// Payload proto for "clouddeploy.googleapis.com/automation_run"
100/// Platform Log event that describes the AutomationRun related events.
101#[derive(Clone, Default, PartialEq)]
102#[non_exhaustive]
103pub struct AutomationRunEvent {
104    /// Debug message for when there is an update on the AutomationRun.
105    /// Provides further details about the resource creation or state change.
106    pub message: std::string::String,
107
108    /// The name of the `AutomationRun`.
109    pub automation_run: std::string::String,
110
111    /// Unique identifier of the `DeliveryPipeline`.
112    pub pipeline_uid: std::string::String,
113
114    /// Identifier of the `Automation`.
115    pub automation_id: std::string::String,
116
117    /// Identifier of the `Automation` rule.
118    pub rule_id: std::string::String,
119
120    /// ID of the `Target` to which the `AutomationRun` is created.
121    pub destination_target_id: std::string::String,
122
123    /// Type of this notification, e.g. for a Pub/Sub failure.
124    pub r#type: crate::model::Type,
125
126    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
127}
128
129impl AutomationRunEvent {
130    pub fn new() -> Self {
131        std::default::Default::default()
132    }
133
134    /// Sets the value of [message][crate::model::AutomationRunEvent::message].
135    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
136        self.message = v.into();
137        self
138    }
139
140    /// Sets the value of [automation_run][crate::model::AutomationRunEvent::automation_run].
141    pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142        self.automation_run = v.into();
143        self
144    }
145
146    /// Sets the value of [pipeline_uid][crate::model::AutomationRunEvent::pipeline_uid].
147    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
148        self.pipeline_uid = v.into();
149        self
150    }
151
152    /// Sets the value of [automation_id][crate::model::AutomationRunEvent::automation_id].
153    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
154        self.automation_id = v.into();
155        self
156    }
157
158    /// Sets the value of [rule_id][crate::model::AutomationRunEvent::rule_id].
159    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
160        self.rule_id = v.into();
161        self
162    }
163
164    /// Sets the value of [destination_target_id][crate::model::AutomationRunEvent::destination_target_id].
165    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
166        mut self,
167        v: T,
168    ) -> Self {
169        self.destination_target_id = v.into();
170        self
171    }
172
173    /// Sets the value of [r#type][crate::model::AutomationRunEvent::type].
174    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
175        self.r#type = v.into();
176        self
177    }
178}
179
180impl wkt::message::Message for AutomationRunEvent {
181    fn typename() -> &'static str {
182        "type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
183    }
184}
185
186/// A `DeliveryPipeline` resource in the Cloud Deploy API.
187///
188/// A `DeliveryPipeline` defines a pipeline through which a Skaffold
189/// configuration can progress.
190#[derive(Clone, Default, PartialEq)]
191#[non_exhaustive]
192pub struct DeliveryPipeline {
193    /// Identifier. Name of the `DeliveryPipeline`. Format is
194    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`.
195    /// The `deliveryPipeline` component must match
196    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
197    pub name: std::string::String,
198
199    /// Output only. Unique identifier of the `DeliveryPipeline`.
200    pub uid: std::string::String,
201
202    /// Optional. Description of the `DeliveryPipeline`. Max length is 255
203    /// characters.
204    pub description: std::string::String,
205
206    /// Optional. User annotations. These attributes can only be set and used by
207    /// the user, and not by Cloud Deploy.
208    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
209
210    /// Labels are attributes that can be set and used by both the
211    /// user and by Cloud Deploy. Labels must meet the following constraints:
212    ///
213    /// * Keys and values can contain only lowercase letters, numeric characters,
214    ///   underscores, and dashes.
215    /// * All characters must use UTF-8 encoding, and international characters are
216    ///   allowed.
217    /// * Keys must start with a lowercase letter or international character.
218    /// * Each resource is limited to a maximum of 64 labels.
219    ///
220    /// Both keys and values are additionally constrained to be <= 128 bytes.
221    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
222
223    /// Output only. Time at which the pipeline was created.
224    pub create_time: std::option::Option<wkt::Timestamp>,
225
226    /// Output only. Most recent time at which the pipeline was updated.
227    pub update_time: std::option::Option<wkt::Timestamp>,
228
229    /// Output only. Information around the state of the Delivery Pipeline.
230    pub condition: std::option::Option<crate::model::PipelineCondition>,
231
232    /// This checksum is computed by the server based on the value of other
233    /// fields, and may be sent on update and delete requests to ensure the
234    /// client has an up-to-date value before proceeding.
235    pub etag: std::string::String,
236
237    /// Optional. When suspended, no new releases or rollouts can be created,
238    /// but in-progress ones will complete.
239    pub suspended: bool,
240
241    /// The ordering configuration of the `DeliveryPipeline`.
242    pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
243
244    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
245}
246
247impl DeliveryPipeline {
248    pub fn new() -> Self {
249        std::default::Default::default()
250    }
251
252    /// Sets the value of [name][crate::model::DeliveryPipeline::name].
253    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
254        self.name = v.into();
255        self
256    }
257
258    /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
259    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
260        self.uid = v.into();
261        self
262    }
263
264    /// Sets the value of [description][crate::model::DeliveryPipeline::description].
265    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
266        self.description = v.into();
267        self
268    }
269
270    /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
271    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
272    where
273        T: std::iter::IntoIterator<Item = (K, V)>,
274        K: std::convert::Into<std::string::String>,
275        V: std::convert::Into<std::string::String>,
276    {
277        use std::iter::Iterator;
278        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
279        self
280    }
281
282    /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
283    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
284    where
285        T: std::iter::IntoIterator<Item = (K, V)>,
286        K: std::convert::Into<std::string::String>,
287        V: std::convert::Into<std::string::String>,
288    {
289        use std::iter::Iterator;
290        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
291        self
292    }
293
294    /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
295    pub fn set_create_time<T>(mut self, v: T) -> Self
296    where
297        T: std::convert::Into<wkt::Timestamp>,
298    {
299        self.create_time = std::option::Option::Some(v.into());
300        self
301    }
302
303    /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
304    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
305    where
306        T: std::convert::Into<wkt::Timestamp>,
307    {
308        self.create_time = v.map(|x| x.into());
309        self
310    }
311
312    /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
313    pub fn set_update_time<T>(mut self, v: T) -> Self
314    where
315        T: std::convert::Into<wkt::Timestamp>,
316    {
317        self.update_time = std::option::Option::Some(v.into());
318        self
319    }
320
321    /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
322    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
323    where
324        T: std::convert::Into<wkt::Timestamp>,
325    {
326        self.update_time = v.map(|x| x.into());
327        self
328    }
329
330    /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
331    pub fn set_condition<T>(mut self, v: T) -> Self
332    where
333        T: std::convert::Into<crate::model::PipelineCondition>,
334    {
335        self.condition = std::option::Option::Some(v.into());
336        self
337    }
338
339    /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
340    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
341    where
342        T: std::convert::Into<crate::model::PipelineCondition>,
343    {
344        self.condition = v.map(|x| x.into());
345        self
346    }
347
348    /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
349    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
350        self.etag = v.into();
351        self
352    }
353
354    /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
355    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
356        self.suspended = v.into();
357        self
358    }
359
360    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
361    ///
362    /// Note that all the setters affecting `pipeline` are mutually
363    /// exclusive.
364    pub fn set_pipeline<
365        T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
366    >(
367        mut self,
368        v: T,
369    ) -> Self {
370        self.pipeline = v.into();
371        self
372    }
373
374    /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
375    /// if it holds a `SerialPipeline`, `None` if the field is not set or
376    /// holds a different branch.
377    pub fn serial_pipeline(
378        &self,
379    ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
380        #[allow(unreachable_patterns)]
381        self.pipeline.as_ref().and_then(|v| match v {
382            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
383                std::option::Option::Some(v)
384            }
385            _ => std::option::Option::None,
386        })
387    }
388
389    /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
390    /// to hold a `SerialPipeline`.
391    ///
392    /// Note that all the setters affecting `pipeline` are
393    /// mutually exclusive.
394    pub fn set_serial_pipeline<
395        T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
396    >(
397        mut self,
398        v: T,
399    ) -> Self {
400        self.pipeline = std::option::Option::Some(
401            crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
402        );
403        self
404    }
405}
406
407impl wkt::message::Message for DeliveryPipeline {
408    fn typename() -> &'static str {
409        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
410    }
411}
412
413/// Defines additional types related to [DeliveryPipeline].
414pub mod delivery_pipeline {
415    #[allow(unused_imports)]
416    use super::*;
417
418    /// The ordering configuration of the `DeliveryPipeline`.
419    #[derive(Clone, Debug, PartialEq)]
420    #[non_exhaustive]
421    pub enum Pipeline {
422        /// Optional. SerialPipeline defines a sequential set of stages for a
423        /// `DeliveryPipeline`.
424        SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
425    }
426}
427
428/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
429#[derive(Clone, Default, PartialEq)]
430#[non_exhaustive]
431pub struct SerialPipeline {
432    /// Optional. Each stage specifies configuration for a `Target`. The ordering
433    /// of this list defines the promotion flow.
434    pub stages: std::vec::Vec<crate::model::Stage>,
435
436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
437}
438
439impl SerialPipeline {
440    pub fn new() -> Self {
441        std::default::Default::default()
442    }
443
444    /// Sets the value of [stages][crate::model::SerialPipeline::stages].
445    pub fn set_stages<T, V>(mut self, v: T) -> Self
446    where
447        T: std::iter::IntoIterator<Item = V>,
448        V: std::convert::Into<crate::model::Stage>,
449    {
450        use std::iter::Iterator;
451        self.stages = v.into_iter().map(|i| i.into()).collect();
452        self
453    }
454}
455
456impl wkt::message::Message for SerialPipeline {
457    fn typename() -> &'static str {
458        "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
459    }
460}
461
462/// Stage specifies a location to which to deploy.
463#[derive(Clone, Default, PartialEq)]
464#[non_exhaustive]
465pub struct Stage {
466    /// Optional. The target_id to which this stage points. This field refers
467    /// exclusively to the last segment of a target name. For example, this field
468    /// would just be `my-target` (rather than
469    /// `projects/project/locations/location/targets/my-target`). The location of
470    /// the `Target` is inferred to be the same as the location of the
471    /// `DeliveryPipeline` that contains this `Stage`.
472    pub target_id: std::string::String,
473
474    /// Optional. Skaffold profiles to use when rendering the manifest for this
475    /// stage's `Target`.
476    pub profiles: std::vec::Vec<std::string::String>,
477
478    /// Optional. The strategy to use for a `Rollout` to this stage.
479    pub strategy: std::option::Option<crate::model::Strategy>,
480
481    /// Optional. The deploy parameters to use for the target in this stage.
482    pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
483
484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
485}
486
487impl Stage {
488    pub fn new() -> Self {
489        std::default::Default::default()
490    }
491
492    /// Sets the value of [target_id][crate::model::Stage::target_id].
493    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
494        self.target_id = v.into();
495        self
496    }
497
498    /// Sets the value of [profiles][crate::model::Stage::profiles].
499    pub fn set_profiles<T, V>(mut self, v: T) -> Self
500    where
501        T: std::iter::IntoIterator<Item = V>,
502        V: std::convert::Into<std::string::String>,
503    {
504        use std::iter::Iterator;
505        self.profiles = v.into_iter().map(|i| i.into()).collect();
506        self
507    }
508
509    /// Sets the value of [strategy][crate::model::Stage::strategy].
510    pub fn set_strategy<T>(mut self, v: T) -> Self
511    where
512        T: std::convert::Into<crate::model::Strategy>,
513    {
514        self.strategy = std::option::Option::Some(v.into());
515        self
516    }
517
518    /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
519    pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
520    where
521        T: std::convert::Into<crate::model::Strategy>,
522    {
523        self.strategy = v.map(|x| x.into());
524        self
525    }
526
527    /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
528    pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
529    where
530        T: std::iter::IntoIterator<Item = V>,
531        V: std::convert::Into<crate::model::DeployParameters>,
532    {
533        use std::iter::Iterator;
534        self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
535        self
536    }
537}
538
539impl wkt::message::Message for Stage {
540    fn typename() -> &'static str {
541        "type.googleapis.com/google.cloud.deploy.v1.Stage"
542    }
543}
544
545/// DeployParameters contains deploy parameters information.
546#[derive(Clone, Default, PartialEq)]
547#[non_exhaustive]
548pub struct DeployParameters {
549    /// Required. Values are deploy parameters in key-value pairs.
550    pub values: std::collections::HashMap<std::string::String, std::string::String>,
551
552    /// Optional. Deploy parameters are applied to targets with match labels.
553    /// If unspecified, deploy parameters are applied to all targets (including
554    /// child targets of a multi-target).
555    pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
556
557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
558}
559
560impl DeployParameters {
561    pub fn new() -> Self {
562        std::default::Default::default()
563    }
564
565    /// Sets the value of [values][crate::model::DeployParameters::values].
566    pub fn set_values<T, K, V>(mut self, v: T) -> Self
567    where
568        T: std::iter::IntoIterator<Item = (K, V)>,
569        K: std::convert::Into<std::string::String>,
570        V: std::convert::Into<std::string::String>,
571    {
572        use std::iter::Iterator;
573        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
574        self
575    }
576
577    /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
578    pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
579    where
580        T: std::iter::IntoIterator<Item = (K, V)>,
581        K: std::convert::Into<std::string::String>,
582        V: std::convert::Into<std::string::String>,
583    {
584        use std::iter::Iterator;
585        self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
586        self
587    }
588}
589
590impl wkt::message::Message for DeployParameters {
591    fn typename() -> &'static str {
592        "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
593    }
594}
595
596/// Strategy contains deployment strategy information.
597#[derive(Clone, Default, PartialEq)]
598#[non_exhaustive]
599pub struct Strategy {
600    /// Deployment strategy details.
601    pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
602
603    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
604}
605
606impl Strategy {
607    pub fn new() -> Self {
608        std::default::Default::default()
609    }
610
611    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
612    ///
613    /// Note that all the setters affecting `deployment_strategy` are mutually
614    /// exclusive.
615    pub fn set_deployment_strategy<
616        T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
617    >(
618        mut self,
619        v: T,
620    ) -> Self {
621        self.deployment_strategy = v.into();
622        self
623    }
624
625    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
626    /// if it holds a `Standard`, `None` if the field is not set or
627    /// holds a different branch.
628    pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
629        #[allow(unreachable_patterns)]
630        self.deployment_strategy.as_ref().and_then(|v| match v {
631            crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
632            _ => std::option::Option::None,
633        })
634    }
635
636    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
637    /// to hold a `Standard`.
638    ///
639    /// Note that all the setters affecting `deployment_strategy` are
640    /// mutually exclusive.
641    pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
642        mut self,
643        v: T,
644    ) -> Self {
645        self.deployment_strategy = std::option::Option::Some(
646            crate::model::strategy::DeploymentStrategy::Standard(v.into()),
647        );
648        self
649    }
650
651    /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
652    /// if it holds a `Canary`, `None` if the field is not set or
653    /// holds a different branch.
654    pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
655        #[allow(unreachable_patterns)]
656        self.deployment_strategy.as_ref().and_then(|v| match v {
657            crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
658            _ => std::option::Option::None,
659        })
660    }
661
662    /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
663    /// to hold a `Canary`.
664    ///
665    /// Note that all the setters affecting `deployment_strategy` are
666    /// mutually exclusive.
667    pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
668        mut self,
669        v: T,
670    ) -> Self {
671        self.deployment_strategy =
672            std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
673        self
674    }
675}
676
677impl wkt::message::Message for Strategy {
678    fn typename() -> &'static str {
679        "type.googleapis.com/google.cloud.deploy.v1.Strategy"
680    }
681}
682
683/// Defines additional types related to [Strategy].
684pub mod strategy {
685    #[allow(unused_imports)]
686    use super::*;
687
688    /// Deployment strategy details.
689    #[derive(Clone, Debug, PartialEq)]
690    #[non_exhaustive]
691    pub enum DeploymentStrategy {
692        /// Optional. Standard deployment strategy executes a single deploy and
693        /// allows verifying the deployment.
694        Standard(std::boxed::Box<crate::model::Standard>),
695        /// Optional. Canary deployment strategy provides progressive percentage
696        /// based deployments to a Target.
697        Canary(std::boxed::Box<crate::model::Canary>),
698    }
699}
700
701/// Predeploy contains the predeploy job configuration information.
702#[derive(Clone, Default, PartialEq)]
703#[non_exhaustive]
704pub struct Predeploy {
705    /// Optional. A sequence of Skaffold custom actions to invoke during execution
706    /// of the predeploy job.
707    pub actions: std::vec::Vec<std::string::String>,
708
709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
710}
711
712impl Predeploy {
713    pub fn new() -> Self {
714        std::default::Default::default()
715    }
716
717    /// Sets the value of [actions][crate::model::Predeploy::actions].
718    pub fn set_actions<T, V>(mut self, v: T) -> Self
719    where
720        T: std::iter::IntoIterator<Item = V>,
721        V: std::convert::Into<std::string::String>,
722    {
723        use std::iter::Iterator;
724        self.actions = v.into_iter().map(|i| i.into()).collect();
725        self
726    }
727}
728
729impl wkt::message::Message for Predeploy {
730    fn typename() -> &'static str {
731        "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
732    }
733}
734
735/// Postdeploy contains the postdeploy job configuration information.
736#[derive(Clone, Default, PartialEq)]
737#[non_exhaustive]
738pub struct Postdeploy {
739    /// Optional. A sequence of Skaffold custom actions to invoke during execution
740    /// of the postdeploy job.
741    pub actions: std::vec::Vec<std::string::String>,
742
743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
744}
745
746impl Postdeploy {
747    pub fn new() -> Self {
748        std::default::Default::default()
749    }
750
751    /// Sets the value of [actions][crate::model::Postdeploy::actions].
752    pub fn set_actions<T, V>(mut self, v: T) -> Self
753    where
754        T: std::iter::IntoIterator<Item = V>,
755        V: std::convert::Into<std::string::String>,
756    {
757        use std::iter::Iterator;
758        self.actions = v.into_iter().map(|i| i.into()).collect();
759        self
760    }
761}
762
763impl wkt::message::Message for Postdeploy {
764    fn typename() -> &'static str {
765        "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
766    }
767}
768
769/// Standard represents the standard deployment strategy.
770#[derive(Clone, Default, PartialEq)]
771#[non_exhaustive]
772pub struct Standard {
773    /// Optional. Whether to verify a deployment via `skaffold verify`.
774    pub verify: bool,
775
776    /// Optional. Configuration for the predeploy job. If this is not configured,
777    /// the predeploy job will not be present.
778    pub predeploy: std::option::Option<crate::model::Predeploy>,
779
780    /// Optional. Configuration for the postdeploy job. If this is not configured,
781    /// the postdeploy job will not be present.
782    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
783
784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
785}
786
787impl Standard {
788    pub fn new() -> Self {
789        std::default::Default::default()
790    }
791
792    /// Sets the value of [verify][crate::model::Standard::verify].
793    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
794        self.verify = v.into();
795        self
796    }
797
798    /// Sets the value of [predeploy][crate::model::Standard::predeploy].
799    pub fn set_predeploy<T>(mut self, v: T) -> Self
800    where
801        T: std::convert::Into<crate::model::Predeploy>,
802    {
803        self.predeploy = std::option::Option::Some(v.into());
804        self
805    }
806
807    /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
808    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
809    where
810        T: std::convert::Into<crate::model::Predeploy>,
811    {
812        self.predeploy = v.map(|x| x.into());
813        self
814    }
815
816    /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
817    pub fn set_postdeploy<T>(mut self, v: T) -> Self
818    where
819        T: std::convert::Into<crate::model::Postdeploy>,
820    {
821        self.postdeploy = std::option::Option::Some(v.into());
822        self
823    }
824
825    /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
826    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
827    where
828        T: std::convert::Into<crate::model::Postdeploy>,
829    {
830        self.postdeploy = v.map(|x| x.into());
831        self
832    }
833}
834
835impl wkt::message::Message for Standard {
836    fn typename() -> &'static str {
837        "type.googleapis.com/google.cloud.deploy.v1.Standard"
838    }
839}
840
841/// Canary represents the canary deployment strategy.
842#[derive(Clone, Default, PartialEq)]
843#[non_exhaustive]
844pub struct Canary {
845    /// Optional. Runtime specific configurations for the deployment strategy. The
846    /// runtime configuration is used to determine how Cloud Deploy will split
847    /// traffic to enable a progressive deployment.
848    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
849
850    /// The mode to use for the canary deployment strategy.
851    pub mode: std::option::Option<crate::model::canary::Mode>,
852
853    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
854}
855
856impl Canary {
857    pub fn new() -> Self {
858        std::default::Default::default()
859    }
860
861    /// Sets the value of [runtime_config][crate::model::Canary::runtime_config].
862    pub fn set_runtime_config<T>(mut self, v: T) -> Self
863    where
864        T: std::convert::Into<crate::model::RuntimeConfig>,
865    {
866        self.runtime_config = std::option::Option::Some(v.into());
867        self
868    }
869
870    /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
871    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
872    where
873        T: std::convert::Into<crate::model::RuntimeConfig>,
874    {
875        self.runtime_config = v.map(|x| x.into());
876        self
877    }
878
879    /// Sets the value of [mode][crate::model::Canary::mode].
880    ///
881    /// Note that all the setters affecting `mode` are mutually
882    /// exclusive.
883    pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
884        mut self,
885        v: T,
886    ) -> Self {
887        self.mode = v.into();
888        self
889    }
890
891    /// The value of [mode][crate::model::Canary::mode]
892    /// if it holds a `CanaryDeployment`, `None` if the field is not set or
893    /// holds a different branch.
894    pub fn canary_deployment(
895        &self,
896    ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
897        #[allow(unreachable_patterns)]
898        self.mode.as_ref().and_then(|v| match v {
899            crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
900            _ => std::option::Option::None,
901        })
902    }
903
904    /// Sets the value of [mode][crate::model::Canary::mode]
905    /// to hold a `CanaryDeployment`.
906    ///
907    /// Note that all the setters affecting `mode` are
908    /// mutually exclusive.
909    pub fn set_canary_deployment<
910        T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
911    >(
912        mut self,
913        v: T,
914    ) -> Self {
915        self.mode =
916            std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
917        self
918    }
919
920    /// The value of [mode][crate::model::Canary::mode]
921    /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
922    /// holds a different branch.
923    pub fn custom_canary_deployment(
924        &self,
925    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
926        #[allow(unreachable_patterns)]
927        self.mode.as_ref().and_then(|v| match v {
928            crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
929            _ => std::option::Option::None,
930        })
931    }
932
933    /// Sets the value of [mode][crate::model::Canary::mode]
934    /// to hold a `CustomCanaryDeployment`.
935    ///
936    /// Note that all the setters affecting `mode` are
937    /// mutually exclusive.
938    pub fn set_custom_canary_deployment<
939        T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
940    >(
941        mut self,
942        v: T,
943    ) -> Self {
944        self.mode =
945            std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
946        self
947    }
948}
949
950impl wkt::message::Message for Canary {
951    fn typename() -> &'static str {
952        "type.googleapis.com/google.cloud.deploy.v1.Canary"
953    }
954}
955
956/// Defines additional types related to [Canary].
957pub mod canary {
958    #[allow(unused_imports)]
959    use super::*;
960
961    /// The mode to use for the canary deployment strategy.
962    #[derive(Clone, Debug, PartialEq)]
963    #[non_exhaustive]
964    pub enum Mode {
965        /// Optional. Configures the progressive based deployment for a Target.
966        CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
967        /// Optional. Configures the progressive based deployment for a Target, but
968        /// allows customizing at the phase level where a phase represents each of
969        /// the percentage deployments.
970        CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
971    }
972}
973
974/// CanaryDeployment represents the canary deployment configuration
975#[derive(Clone, Default, PartialEq)]
976#[non_exhaustive]
977pub struct CanaryDeployment {
978    /// Required. The percentage based deployments that will occur as a part of a
979    /// `Rollout`. List is expected in ascending order and each integer n is
980    /// 0 <= n < 100.
981    /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
982    /// n is 0 <= n <= 100.
983    pub percentages: std::vec::Vec<i32>,
984
985    /// Optional. Whether to run verify tests after each percentage deployment via
986    /// `skaffold verify`.
987    pub verify: bool,
988
989    /// Optional. Configuration for the predeploy job of the first phase. If this
990    /// is not configured, there will be no predeploy job for this phase.
991    pub predeploy: std::option::Option<crate::model::Predeploy>,
992
993    /// Optional. Configuration for the postdeploy job of the last phase. If this
994    /// is not configured, there will be no postdeploy job for this phase.
995    pub postdeploy: std::option::Option<crate::model::Postdeploy>,
996
997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
998}
999
1000impl CanaryDeployment {
1001    pub fn new() -> Self {
1002        std::default::Default::default()
1003    }
1004
1005    /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1006    pub fn set_percentages<T, V>(mut self, v: T) -> Self
1007    where
1008        T: std::iter::IntoIterator<Item = V>,
1009        V: std::convert::Into<i32>,
1010    {
1011        use std::iter::Iterator;
1012        self.percentages = v.into_iter().map(|i| i.into()).collect();
1013        self
1014    }
1015
1016    /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1017    pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1018        self.verify = v.into();
1019        self
1020    }
1021
1022    /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1023    pub fn set_predeploy<T>(mut self, v: T) -> Self
1024    where
1025        T: std::convert::Into<crate::model::Predeploy>,
1026    {
1027        self.predeploy = std::option::Option::Some(v.into());
1028        self
1029    }
1030
1031    /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1032    pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1033    where
1034        T: std::convert::Into<crate::model::Predeploy>,
1035    {
1036        self.predeploy = v.map(|x| x.into());
1037        self
1038    }
1039
1040    /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1041    pub fn set_postdeploy<T>(mut self, v: T) -> Self
1042    where
1043        T: std::convert::Into<crate::model::Postdeploy>,
1044    {
1045        self.postdeploy = std::option::Option::Some(v.into());
1046        self
1047    }
1048
1049    /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1050    pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1051    where
1052        T: std::convert::Into<crate::model::Postdeploy>,
1053    {
1054        self.postdeploy = v.map(|x| x.into());
1055        self
1056    }
1057}
1058
1059impl wkt::message::Message for CanaryDeployment {
1060    fn typename() -> &'static str {
1061        "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1062    }
1063}
1064
1065/// CustomCanaryDeployment represents the custom canary deployment
1066/// configuration.
1067#[derive(Clone, Default, PartialEq)]
1068#[non_exhaustive]
1069pub struct CustomCanaryDeployment {
1070    /// Required. Configuration for each phase in the canary deployment in the
1071    /// order executed.
1072    pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1073
1074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1075}
1076
1077impl CustomCanaryDeployment {
1078    pub fn new() -> Self {
1079        std::default::Default::default()
1080    }
1081
1082    /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1083    pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1084    where
1085        T: std::iter::IntoIterator<Item = V>,
1086        V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1087    {
1088        use std::iter::Iterator;
1089        self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1090        self
1091    }
1092}
1093
1094impl wkt::message::Message for CustomCanaryDeployment {
1095    fn typename() -> &'static str {
1096        "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1097    }
1098}
1099
1100/// Defines additional types related to [CustomCanaryDeployment].
1101pub mod custom_canary_deployment {
1102    #[allow(unused_imports)]
1103    use super::*;
1104
1105    /// PhaseConfig represents the configuration for a phase in the custom
1106    /// canary deployment.
1107    #[derive(Clone, Default, PartialEq)]
1108    #[non_exhaustive]
1109    pub struct PhaseConfig {
1110        /// Required. The ID to assign to the `Rollout` phase.
1111        /// This value must consist of lower-case letters, numbers, and hyphens,
1112        /// start with a letter and end with a letter or a number, and have a max
1113        /// length of 63 characters. In other words, it must match the following
1114        /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1115        pub phase_id: std::string::String,
1116
1117        /// Required. Percentage deployment for the phase.
1118        pub percentage: i32,
1119
1120        /// Optional. Skaffold profiles to use when rendering the manifest for this
1121        /// phase. These are in addition to the profiles list specified in the
1122        /// `DeliveryPipeline` stage.
1123        pub profiles: std::vec::Vec<std::string::String>,
1124
1125        /// Optional. Whether to run verify tests after the deployment via `skaffold
1126        /// verify`.
1127        pub verify: bool,
1128
1129        /// Optional. Configuration for the predeploy job of this phase. If this is
1130        /// not configured, there will be no predeploy job for this phase.
1131        pub predeploy: std::option::Option<crate::model::Predeploy>,
1132
1133        /// Optional. Configuration for the postdeploy job of this phase. If this is
1134        /// not configured, there will be no postdeploy job for this phase.
1135        pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1136
1137        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1138    }
1139
1140    impl PhaseConfig {
1141        pub fn new() -> Self {
1142            std::default::Default::default()
1143        }
1144
1145        /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1146        pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1147            self.phase_id = v.into();
1148            self
1149        }
1150
1151        /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1152        pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1153            self.percentage = v.into();
1154            self
1155        }
1156
1157        /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1158        pub fn set_profiles<T, V>(mut self, v: T) -> Self
1159        where
1160            T: std::iter::IntoIterator<Item = V>,
1161            V: std::convert::Into<std::string::String>,
1162        {
1163            use std::iter::Iterator;
1164            self.profiles = v.into_iter().map(|i| i.into()).collect();
1165            self
1166        }
1167
1168        /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1169        pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1170            self.verify = v.into();
1171            self
1172        }
1173
1174        /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1175        pub fn set_predeploy<T>(mut self, v: T) -> Self
1176        where
1177            T: std::convert::Into<crate::model::Predeploy>,
1178        {
1179            self.predeploy = std::option::Option::Some(v.into());
1180            self
1181        }
1182
1183        /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1184        pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1185        where
1186            T: std::convert::Into<crate::model::Predeploy>,
1187        {
1188            self.predeploy = v.map(|x| x.into());
1189            self
1190        }
1191
1192        /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1193        pub fn set_postdeploy<T>(mut self, v: T) -> Self
1194        where
1195            T: std::convert::Into<crate::model::Postdeploy>,
1196        {
1197            self.postdeploy = std::option::Option::Some(v.into());
1198            self
1199        }
1200
1201        /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1202        pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1203        where
1204            T: std::convert::Into<crate::model::Postdeploy>,
1205        {
1206            self.postdeploy = v.map(|x| x.into());
1207            self
1208        }
1209    }
1210
1211    impl wkt::message::Message for PhaseConfig {
1212        fn typename() -> &'static str {
1213            "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1214        }
1215    }
1216}
1217
1218/// KubernetesConfig contains the Kubernetes runtime configuration.
1219#[derive(Clone, Default, PartialEq)]
1220#[non_exhaustive]
1221pub struct KubernetesConfig {
1222    /// The service definition configuration.
1223    pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1224
1225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1226}
1227
1228impl KubernetesConfig {
1229    pub fn new() -> Self {
1230        std::default::Default::default()
1231    }
1232
1233    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1234    ///
1235    /// Note that all the setters affecting `service_definition` are mutually
1236    /// exclusive.
1237    pub fn set_service_definition<
1238        T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1239    >(
1240        mut self,
1241        v: T,
1242    ) -> Self {
1243        self.service_definition = v.into();
1244        self
1245    }
1246
1247    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1248    /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1249    /// holds a different branch.
1250    pub fn gateway_service_mesh(
1251        &self,
1252    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1253    {
1254        #[allow(unreachable_patterns)]
1255        self.service_definition.as_ref().and_then(|v| match v {
1256            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1257                std::option::Option::Some(v)
1258            }
1259            _ => std::option::Option::None,
1260        })
1261    }
1262
1263    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1264    /// to hold a `GatewayServiceMesh`.
1265    ///
1266    /// Note that all the setters affecting `service_definition` are
1267    /// mutually exclusive.
1268    pub fn set_gateway_service_mesh<
1269        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1270    >(
1271        mut self,
1272        v: T,
1273    ) -> Self {
1274        self.service_definition = std::option::Option::Some(
1275            crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1276        );
1277        self
1278    }
1279
1280    /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1281    /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1282    /// holds a different branch.
1283    pub fn service_networking(
1284        &self,
1285    ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1286    {
1287        #[allow(unreachable_patterns)]
1288        self.service_definition.as_ref().and_then(|v| match v {
1289            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1290                std::option::Option::Some(v)
1291            }
1292            _ => std::option::Option::None,
1293        })
1294    }
1295
1296    /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1297    /// to hold a `ServiceNetworking`.
1298    ///
1299    /// Note that all the setters affecting `service_definition` are
1300    /// mutually exclusive.
1301    pub fn set_service_networking<
1302        T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1303    >(
1304        mut self,
1305        v: T,
1306    ) -> Self {
1307        self.service_definition = std::option::Option::Some(
1308            crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1309        );
1310        self
1311    }
1312}
1313
1314impl wkt::message::Message for KubernetesConfig {
1315    fn typename() -> &'static str {
1316        "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1317    }
1318}
1319
1320/// Defines additional types related to [KubernetesConfig].
1321pub mod kubernetes_config {
1322    #[allow(unused_imports)]
1323    use super::*;
1324
1325    /// Information about the Kubernetes Gateway API service mesh configuration.
1326    #[derive(Clone, Default, PartialEq)]
1327    #[non_exhaustive]
1328    pub struct GatewayServiceMesh {
1329        /// Required. Name of the Gateway API HTTPRoute.
1330        pub http_route: std::string::String,
1331
1332        /// Required. Name of the Kubernetes Service.
1333        pub service: std::string::String,
1334
1335        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1336        /// the specified HTTPRoute and Service.
1337        pub deployment: std::string::String,
1338
1339        /// Optional. The time to wait for route updates to propagate. The maximum
1340        /// configurable time is 3 hours, in seconds format. If unspecified, there is
1341        /// no wait time.
1342        pub route_update_wait_time: std::option::Option<wkt::Duration>,
1343
1344        /// Optional. The amount of time to migrate traffic back from the canary
1345        /// Service to the original Service during the stable phase deployment. If
1346        /// specified, must be between 15s and 3600s. If unspecified, there is no
1347        /// cutback time.
1348        pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1349
1350        /// Optional. The label to use when selecting Pods for the Deployment and
1351        /// Service resources. This label must already be present in both resources.
1352        pub pod_selector_label: std::string::String,
1353
1354        /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1355        /// to be deployed to additional clusters. This option is available for
1356        /// multi-cluster service mesh set ups that require the route to exist in the
1357        /// clusters that call the service. If unspecified, the HTTPRoute will only
1358        /// be deployed to the Target cluster.
1359        pub route_destinations: std::option::Option<
1360            crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1361        >,
1362
1363        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1364    }
1365
1366    impl GatewayServiceMesh {
1367        pub fn new() -> Self {
1368            std::default::Default::default()
1369        }
1370
1371        /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1372        pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1373            self.http_route = v.into();
1374            self
1375        }
1376
1377        /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1378        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1379            self.service = v.into();
1380            self
1381        }
1382
1383        /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1384        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1385            self.deployment = v.into();
1386            self
1387        }
1388
1389        /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1390        pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1391        where
1392            T: std::convert::Into<wkt::Duration>,
1393        {
1394            self.route_update_wait_time = std::option::Option::Some(v.into());
1395            self
1396        }
1397
1398        /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1399        pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1400        where
1401            T: std::convert::Into<wkt::Duration>,
1402        {
1403            self.route_update_wait_time = v.map(|x| x.into());
1404            self
1405        }
1406
1407        /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1408        pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1409        where
1410            T: std::convert::Into<wkt::Duration>,
1411        {
1412            self.stable_cutback_duration = std::option::Option::Some(v.into());
1413            self
1414        }
1415
1416        /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1417        pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1418        where
1419            T: std::convert::Into<wkt::Duration>,
1420        {
1421            self.stable_cutback_duration = v.map(|x| x.into());
1422            self
1423        }
1424
1425        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1426        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1427            mut self,
1428            v: T,
1429        ) -> Self {
1430            self.pod_selector_label = v.into();
1431            self
1432        }
1433
1434        /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
1435        pub fn set_route_destinations<T>(mut self, v: T) -> Self
1436        where
1437            T: std::convert::Into<
1438                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1439                >,
1440        {
1441            self.route_destinations = std::option::Option::Some(v.into());
1442            self
1443        }
1444
1445        /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
1446        pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
1447        where
1448            T: std::convert::Into<
1449                    crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1450                >,
1451        {
1452            self.route_destinations = v.map(|x| x.into());
1453            self
1454        }
1455    }
1456
1457    impl wkt::message::Message for GatewayServiceMesh {
1458        fn typename() -> &'static str {
1459            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
1460        }
1461    }
1462
1463    /// Defines additional types related to [GatewayServiceMesh].
1464    pub mod gateway_service_mesh {
1465        #[allow(unused_imports)]
1466        use super::*;
1467
1468        /// Information about route destinations for the Gateway API service mesh.
1469        #[derive(Clone, Default, PartialEq)]
1470        #[non_exhaustive]
1471        pub struct RouteDestinations {
1472            /// Required. The clusters where the Gateway API HTTPRoute resource will be
1473            /// deployed to. Valid entries include the associated entities IDs
1474            /// configured in the Target resource and "@self" to include the Target
1475            /// cluster.
1476            pub destination_ids: std::vec::Vec<std::string::String>,
1477
1478            /// Optional. Whether to propagate the Kubernetes Service to the route
1479            /// destination clusters. The Service will always be deployed to the Target
1480            /// cluster even if the HTTPRoute is not. This option may be used to
1481            /// facilitate successful DNS lookup in the route destination clusters. Can
1482            /// only be set to true if destinations are specified.
1483            pub propagate_service: bool,
1484
1485            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1486        }
1487
1488        impl RouteDestinations {
1489            pub fn new() -> Self {
1490                std::default::Default::default()
1491            }
1492
1493            /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
1494            pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
1495            where
1496                T: std::iter::IntoIterator<Item = V>,
1497                V: std::convert::Into<std::string::String>,
1498            {
1499                use std::iter::Iterator;
1500                self.destination_ids = v.into_iter().map(|i| i.into()).collect();
1501                self
1502            }
1503
1504            /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
1505            pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1506                self.propagate_service = v.into();
1507                self
1508            }
1509        }
1510
1511        impl wkt::message::Message for RouteDestinations {
1512            fn typename() -> &'static str {
1513                "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
1514            }
1515        }
1516    }
1517
1518    /// Information about the Kubernetes Service networking configuration.
1519    #[derive(Clone, Default, PartialEq)]
1520    #[non_exhaustive]
1521    pub struct ServiceNetworking {
1522        /// Required. Name of the Kubernetes Service.
1523        pub service: std::string::String,
1524
1525        /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1526        /// the specified Service.
1527        pub deployment: std::string::String,
1528
1529        /// Optional. Whether to disable Pod overprovisioning. If Pod
1530        /// overprovisioning is disabled then Cloud Deploy will limit the number of
1531        /// total Pods used for the deployment strategy to the number of Pods the
1532        /// Deployment has on the cluster.
1533        pub disable_pod_overprovisioning: bool,
1534
1535        /// Optional. The label to use when selecting Pods for the Deployment
1536        /// resource. This label must already be present in the Deployment.
1537        pub pod_selector_label: std::string::String,
1538
1539        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1540    }
1541
1542    impl ServiceNetworking {
1543        pub fn new() -> Self {
1544            std::default::Default::default()
1545        }
1546
1547        /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
1548        pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1549            self.service = v.into();
1550            self
1551        }
1552
1553        /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
1554        pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1555            self.deployment = v.into();
1556            self
1557        }
1558
1559        /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
1560        pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
1561            mut self,
1562            v: T,
1563        ) -> Self {
1564            self.disable_pod_overprovisioning = v.into();
1565            self
1566        }
1567
1568        /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
1569        pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1570            mut self,
1571            v: T,
1572        ) -> Self {
1573            self.pod_selector_label = v.into();
1574            self
1575        }
1576    }
1577
1578    impl wkt::message::Message for ServiceNetworking {
1579        fn typename() -> &'static str {
1580            "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
1581        }
1582    }
1583
1584    /// The service definition configuration.
1585    #[derive(Clone, Debug, PartialEq)]
1586    #[non_exhaustive]
1587    pub enum ServiceDefinition {
1588        /// Optional. Kubernetes Gateway API service mesh configuration.
1589        GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
1590        /// Optional. Kubernetes Service networking configuration.
1591        ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
1592    }
1593}
1594
1595/// CloudRunConfig contains the Cloud Run runtime configuration.
1596#[derive(Clone, Default, PartialEq)]
1597#[non_exhaustive]
1598pub struct CloudRunConfig {
1599    /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
1600    /// Run Service on the user's behalf to facilitate traffic splitting. This is
1601    /// required to be true for CanaryDeployments, but optional for
1602    /// CustomCanaryDeployments.
1603    pub automatic_traffic_control: bool,
1604
1605    /// Optional. A list of tags that are added to the canary revision while the
1606    /// canary phase is in progress.
1607    pub canary_revision_tags: std::vec::Vec<std::string::String>,
1608
1609    /// Optional. A list of tags that are added to the prior revision while the
1610    /// canary phase is in progress.
1611    pub prior_revision_tags: std::vec::Vec<std::string::String>,
1612
1613    /// Optional. A list of tags that are added to the final stable revision when
1614    /// the stable phase is applied.
1615    pub stable_revision_tags: std::vec::Vec<std::string::String>,
1616
1617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1618}
1619
1620impl CloudRunConfig {
1621    pub fn new() -> Self {
1622        std::default::Default::default()
1623    }
1624
1625    /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
1626    pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1627        self.automatic_traffic_control = v.into();
1628        self
1629    }
1630
1631    /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
1632    pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
1633    where
1634        T: std::iter::IntoIterator<Item = V>,
1635        V: std::convert::Into<std::string::String>,
1636    {
1637        use std::iter::Iterator;
1638        self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
1639        self
1640    }
1641
1642    /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
1643    pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
1644    where
1645        T: std::iter::IntoIterator<Item = V>,
1646        V: std::convert::Into<std::string::String>,
1647    {
1648        use std::iter::Iterator;
1649        self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
1650        self
1651    }
1652
1653    /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
1654    pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
1655    where
1656        T: std::iter::IntoIterator<Item = V>,
1657        V: std::convert::Into<std::string::String>,
1658    {
1659        use std::iter::Iterator;
1660        self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
1661        self
1662    }
1663}
1664
1665impl wkt::message::Message for CloudRunConfig {
1666    fn typename() -> &'static str {
1667        "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
1668    }
1669}
1670
1671/// RuntimeConfig contains the runtime specific configurations for a deployment
1672/// strategy.
1673#[derive(Clone, Default, PartialEq)]
1674#[non_exhaustive]
1675pub struct RuntimeConfig {
1676    /// The runtime configuration details.
1677    pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
1678
1679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1680}
1681
1682impl RuntimeConfig {
1683    pub fn new() -> Self {
1684        std::default::Default::default()
1685    }
1686
1687    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
1688    ///
1689    /// Note that all the setters affecting `runtime_config` are mutually
1690    /// exclusive.
1691    pub fn set_runtime_config<
1692        T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
1693    >(
1694        mut self,
1695        v: T,
1696    ) -> Self {
1697        self.runtime_config = v.into();
1698        self
1699    }
1700
1701    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
1702    /// if it holds a `Kubernetes`, `None` if the field is not set or
1703    /// holds a different branch.
1704    pub fn kubernetes(
1705        &self,
1706    ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
1707        #[allow(unreachable_patterns)]
1708        self.runtime_config.as_ref().and_then(|v| match v {
1709            crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
1710                std::option::Option::Some(v)
1711            }
1712            _ => std::option::Option::None,
1713        })
1714    }
1715
1716    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
1717    /// to hold a `Kubernetes`.
1718    ///
1719    /// Note that all the setters affecting `runtime_config` are
1720    /// mutually exclusive.
1721    pub fn set_kubernetes<
1722        T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
1723    >(
1724        mut self,
1725        v: T,
1726    ) -> Self {
1727        self.runtime_config = std::option::Option::Some(
1728            crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
1729        );
1730        self
1731    }
1732
1733    /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
1734    /// if it holds a `CloudRun`, `None` if the field is not set or
1735    /// holds a different branch.
1736    pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
1737        #[allow(unreachable_patterns)]
1738        self.runtime_config.as_ref().and_then(|v| match v {
1739            crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
1740                std::option::Option::Some(v)
1741            }
1742            _ => std::option::Option::None,
1743        })
1744    }
1745
1746    /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
1747    /// to hold a `CloudRun`.
1748    ///
1749    /// Note that all the setters affecting `runtime_config` are
1750    /// mutually exclusive.
1751    pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
1752        mut self,
1753        v: T,
1754    ) -> Self {
1755        self.runtime_config = std::option::Option::Some(
1756            crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
1757        );
1758        self
1759    }
1760}
1761
1762impl wkt::message::Message for RuntimeConfig {
1763    fn typename() -> &'static str {
1764        "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
1765    }
1766}
1767
1768/// Defines additional types related to [RuntimeConfig].
1769pub mod runtime_config {
1770    #[allow(unused_imports)]
1771    use super::*;
1772
1773    /// The runtime configuration details.
1774    #[derive(Clone, Debug, PartialEq)]
1775    #[non_exhaustive]
1776    pub enum RuntimeConfig {
1777        /// Optional. Kubernetes runtime configuration.
1778        Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
1779        /// Optional. Cloud Run runtime configuration.
1780        CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
1781    }
1782}
1783
1784/// PipelineReadyCondition contains information around the status of the
1785/// Pipeline.
1786#[derive(Clone, Default, PartialEq)]
1787#[non_exhaustive]
1788pub struct PipelineReadyCondition {
1789    /// True if the Pipeline is in a valid state. Otherwise at least one condition
1790    /// in `PipelineCondition` is in an invalid state. Iterate over those
1791    /// conditions and see which condition(s) has status = false to find out what
1792    /// is wrong with the Pipeline.
1793    pub status: bool,
1794
1795    /// Last time the condition was updated.
1796    pub update_time: std::option::Option<wkt::Timestamp>,
1797
1798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1799}
1800
1801impl PipelineReadyCondition {
1802    pub fn new() -> Self {
1803        std::default::Default::default()
1804    }
1805
1806    /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
1807    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1808        self.status = v.into();
1809        self
1810    }
1811
1812    /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
1813    pub fn set_update_time<T>(mut self, v: T) -> Self
1814    where
1815        T: std::convert::Into<wkt::Timestamp>,
1816    {
1817        self.update_time = std::option::Option::Some(v.into());
1818        self
1819    }
1820
1821    /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
1822    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1823    where
1824        T: std::convert::Into<wkt::Timestamp>,
1825    {
1826        self.update_time = v.map(|x| x.into());
1827        self
1828    }
1829}
1830
1831impl wkt::message::Message for PipelineReadyCondition {
1832    fn typename() -> &'static str {
1833        "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
1834    }
1835}
1836
1837/// `TargetsPresentCondition` contains information on any Targets referenced in
1838/// the Delivery Pipeline that do not actually exist.
1839#[derive(Clone, Default, PartialEq)]
1840#[non_exhaustive]
1841pub struct TargetsPresentCondition {
1842    /// True if there aren't any missing Targets.
1843    pub status: bool,
1844
1845    /// The list of Target names that do not exist. For example,
1846    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
1847    pub missing_targets: std::vec::Vec<std::string::String>,
1848
1849    /// Last time the condition was updated.
1850    pub update_time: std::option::Option<wkt::Timestamp>,
1851
1852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1853}
1854
1855impl TargetsPresentCondition {
1856    pub fn new() -> Self {
1857        std::default::Default::default()
1858    }
1859
1860    /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
1861    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1862        self.status = v.into();
1863        self
1864    }
1865
1866    /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
1867    pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
1868    where
1869        T: std::iter::IntoIterator<Item = V>,
1870        V: std::convert::Into<std::string::String>,
1871    {
1872        use std::iter::Iterator;
1873        self.missing_targets = v.into_iter().map(|i| i.into()).collect();
1874        self
1875    }
1876
1877    /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
1878    pub fn set_update_time<T>(mut self, v: T) -> Self
1879    where
1880        T: std::convert::Into<wkt::Timestamp>,
1881    {
1882        self.update_time = std::option::Option::Some(v.into());
1883        self
1884    }
1885
1886    /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
1887    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1888    where
1889        T: std::convert::Into<wkt::Timestamp>,
1890    {
1891        self.update_time = v.map(|x| x.into());
1892        self
1893    }
1894}
1895
1896impl wkt::message::Message for TargetsPresentCondition {
1897    fn typename() -> &'static str {
1898        "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
1899    }
1900}
1901
1902/// TargetsTypeCondition contains information on whether the Targets defined in
1903/// the Delivery Pipeline are of the same type.
1904#[derive(Clone, Default, PartialEq)]
1905#[non_exhaustive]
1906pub struct TargetsTypeCondition {
1907    /// True if the targets are all a comparable type. For example this is true if
1908    /// all targets are GKE clusters. This is false if some targets are Cloud Run
1909    /// targets and others are GKE clusters.
1910    pub status: bool,
1911
1912    /// Human readable error message.
1913    pub error_details: std::string::String,
1914
1915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1916}
1917
1918impl TargetsTypeCondition {
1919    pub fn new() -> Self {
1920        std::default::Default::default()
1921    }
1922
1923    /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
1924    pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1925        self.status = v.into();
1926        self
1927    }
1928
1929    /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
1930    pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1931        self.error_details = v.into();
1932        self
1933    }
1934}
1935
1936impl wkt::message::Message for TargetsTypeCondition {
1937    fn typename() -> &'static str {
1938        "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
1939    }
1940}
1941
1942/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
1943#[derive(Clone, Default, PartialEq)]
1944#[non_exhaustive]
1945pub struct PipelineCondition {
1946    /// Details around the Pipeline's overall status.
1947    pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
1948
1949    /// Details around targets enumerated in the pipeline.
1950    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
1951
1952    /// Details on the whether the targets enumerated in the pipeline are of the
1953    /// same type.
1954    pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
1955
1956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1957}
1958
1959impl PipelineCondition {
1960    pub fn new() -> Self {
1961        std::default::Default::default()
1962    }
1963
1964    /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
1965    pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
1966    where
1967        T: std::convert::Into<crate::model::PipelineReadyCondition>,
1968    {
1969        self.pipeline_ready_condition = std::option::Option::Some(v.into());
1970        self
1971    }
1972
1973    /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
1974    pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
1975    where
1976        T: std::convert::Into<crate::model::PipelineReadyCondition>,
1977    {
1978        self.pipeline_ready_condition = v.map(|x| x.into());
1979        self
1980    }
1981
1982    /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
1983    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
1984    where
1985        T: std::convert::Into<crate::model::TargetsPresentCondition>,
1986    {
1987        self.targets_present_condition = std::option::Option::Some(v.into());
1988        self
1989    }
1990
1991    /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
1992    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
1993    where
1994        T: std::convert::Into<crate::model::TargetsPresentCondition>,
1995    {
1996        self.targets_present_condition = v.map(|x| x.into());
1997        self
1998    }
1999
2000    /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2001    pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2002    where
2003        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2004    {
2005        self.targets_type_condition = std::option::Option::Some(v.into());
2006        self
2007    }
2008
2009    /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2010    pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2011    where
2012        T: std::convert::Into<crate::model::TargetsTypeCondition>,
2013    {
2014        self.targets_type_condition = v.map(|x| x.into());
2015        self
2016    }
2017}
2018
2019impl wkt::message::Message for PipelineCondition {
2020    fn typename() -> &'static str {
2021        "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2022    }
2023}
2024
2025/// The request object for `ListDeliveryPipelines`.
2026#[derive(Clone, Default, PartialEq)]
2027#[non_exhaustive]
2028pub struct ListDeliveryPipelinesRequest {
2029    /// Required. The parent, which owns this collection of pipelines. Format must
2030    /// be `projects/{project_id}/locations/{location_name}`.
2031    pub parent: std::string::String,
2032
2033    /// The maximum number of pipelines to return. The service may return
2034    /// fewer than this value. If unspecified, at most 50 pipelines will
2035    /// be returned. The maximum value is 1000; values above 1000 will be set
2036    /// to 1000.
2037    pub page_size: i32,
2038
2039    /// A page token, received from a previous `ListDeliveryPipelines` call.
2040    /// Provide this to retrieve the subsequent page.
2041    ///
2042    /// When paginating, all other provided parameters match
2043    /// the call that provided the page token.
2044    pub page_token: std::string::String,
2045
2046    /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2047    /// details.
2048    pub filter: std::string::String,
2049
2050    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2051    pub order_by: std::string::String,
2052
2053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2054}
2055
2056impl ListDeliveryPipelinesRequest {
2057    pub fn new() -> Self {
2058        std::default::Default::default()
2059    }
2060
2061    /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2062    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2063        self.parent = v.into();
2064        self
2065    }
2066
2067    /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2068    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2069        self.page_size = v.into();
2070        self
2071    }
2072
2073    /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2074    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2075        self.page_token = v.into();
2076        self
2077    }
2078
2079    /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2080    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2081        self.filter = v.into();
2082        self
2083    }
2084
2085    /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2086    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2087        self.order_by = v.into();
2088        self
2089    }
2090}
2091
2092impl wkt::message::Message for ListDeliveryPipelinesRequest {
2093    fn typename() -> &'static str {
2094        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2095    }
2096}
2097
2098/// The response object from `ListDeliveryPipelines`.
2099#[derive(Clone, Default, PartialEq)]
2100#[non_exhaustive]
2101pub struct ListDeliveryPipelinesResponse {
2102    /// The `DeliveryPipeline` objects.
2103    pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2104
2105    /// A token, which can be sent as `page_token` to retrieve the next page.
2106    /// If this field is omitted, there are no subsequent pages.
2107    pub next_page_token: std::string::String,
2108
2109    /// Locations that could not be reached.
2110    pub unreachable: std::vec::Vec<std::string::String>,
2111
2112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2113}
2114
2115impl ListDeliveryPipelinesResponse {
2116    pub fn new() -> Self {
2117        std::default::Default::default()
2118    }
2119
2120    /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2121    pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2122    where
2123        T: std::iter::IntoIterator<Item = V>,
2124        V: std::convert::Into<crate::model::DeliveryPipeline>,
2125    {
2126        use std::iter::Iterator;
2127        self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2128        self
2129    }
2130
2131    /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2132    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2133        self.next_page_token = v.into();
2134        self
2135    }
2136
2137    /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2138    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2139    where
2140        T: std::iter::IntoIterator<Item = V>,
2141        V: std::convert::Into<std::string::String>,
2142    {
2143        use std::iter::Iterator;
2144        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2145        self
2146    }
2147}
2148
2149impl wkt::message::Message for ListDeliveryPipelinesResponse {
2150    fn typename() -> &'static str {
2151        "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2152    }
2153}
2154
2155#[doc(hidden)]
2156impl gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2157    type PageItem = crate::model::DeliveryPipeline;
2158
2159    fn items(self) -> std::vec::Vec<Self::PageItem> {
2160        self.delivery_pipelines
2161    }
2162
2163    fn next_page_token(&self) -> std::string::String {
2164        use std::clone::Clone;
2165        self.next_page_token.clone()
2166    }
2167}
2168
2169/// The request object for `GetDeliveryPipeline`
2170#[derive(Clone, Default, PartialEq)]
2171#[non_exhaustive]
2172pub struct GetDeliveryPipelineRequest {
2173    /// Required. Name of the `DeliveryPipeline`. Format must be
2174    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
2175    pub name: std::string::String,
2176
2177    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2178}
2179
2180impl GetDeliveryPipelineRequest {
2181    pub fn new() -> Self {
2182        std::default::Default::default()
2183    }
2184
2185    /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
2186    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2187        self.name = v.into();
2188        self
2189    }
2190}
2191
2192impl wkt::message::Message for GetDeliveryPipelineRequest {
2193    fn typename() -> &'static str {
2194        "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
2195    }
2196}
2197
2198/// The request object for `CreateDeliveryPipeline`.
2199#[derive(Clone, Default, PartialEq)]
2200#[non_exhaustive]
2201pub struct CreateDeliveryPipelineRequest {
2202    /// Required. The parent collection in which the `DeliveryPipeline` must be
2203    /// created. The format is `projects/{project_id}/locations/{location_name}`.
2204    pub parent: std::string::String,
2205
2206    /// Required. ID of the `DeliveryPipeline`.
2207    pub delivery_pipeline_id: std::string::String,
2208
2209    /// Required. The `DeliveryPipeline` to create.
2210    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
2211
2212    /// Optional. A request ID to identify requests. Specify a unique request ID
2213    /// so that if you must retry your request, the server knows to ignore the
2214    /// request if it has already been completed. The server guarantees that for
2215    /// at least 60 minutes after the first request.
2216    ///
2217    /// For example, consider a situation where you make an initial request and the
2218    /// request times out. If you make the request again with the same request ID,
2219    /// the server can check if original operation with the same request ID was
2220    /// received, and if so, will ignore the second request. This prevents clients
2221    /// from accidentally creating duplicate commitments.
2222    ///
2223    /// The request ID must be a valid UUID with the exception that zero UUID is
2224    /// not supported (00000000-0000-0000-0000-000000000000).
2225    pub request_id: std::string::String,
2226
2227    /// Optional. If set to true, the request is validated and the user is provided
2228    /// with an expected result, but no actual change is made.
2229    pub validate_only: bool,
2230
2231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2232}
2233
2234impl CreateDeliveryPipelineRequest {
2235    pub fn new() -> Self {
2236        std::default::Default::default()
2237    }
2238
2239    /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
2240    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2241        self.parent = v.into();
2242        self
2243    }
2244
2245    /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
2246    pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
2247        mut self,
2248        v: T,
2249    ) -> Self {
2250        self.delivery_pipeline_id = v.into();
2251        self
2252    }
2253
2254    /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
2255    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
2256    where
2257        T: std::convert::Into<crate::model::DeliveryPipeline>,
2258    {
2259        self.delivery_pipeline = std::option::Option::Some(v.into());
2260        self
2261    }
2262
2263    /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
2264    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
2265    where
2266        T: std::convert::Into<crate::model::DeliveryPipeline>,
2267    {
2268        self.delivery_pipeline = v.map(|x| x.into());
2269        self
2270    }
2271
2272    /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
2273    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2274        self.request_id = v.into();
2275        self
2276    }
2277
2278    /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
2279    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2280        self.validate_only = v.into();
2281        self
2282    }
2283}
2284
2285impl wkt::message::Message for CreateDeliveryPipelineRequest {
2286    fn typename() -> &'static str {
2287        "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
2288    }
2289}
2290
2291/// The request object for `UpdateDeliveryPipeline`.
2292#[derive(Clone, Default, PartialEq)]
2293#[non_exhaustive]
2294pub struct UpdateDeliveryPipelineRequest {
2295    /// Required. Field mask is used to specify the fields to be overwritten by the
2296    /// update in the `DeliveryPipeline` resource. The fields specified in the
2297    /// update_mask are relative to the resource, not the full request. A field
2298    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
2299    /// then all fields are overwritten.
2300    pub update_mask: std::option::Option<wkt::FieldMask>,
2301
2302    /// Required. The `DeliveryPipeline` to update.
2303    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
2304
2305    /// Optional. A request ID to identify requests. Specify a unique request ID
2306    /// so that if you must retry your request, the server knows to ignore the
2307    /// request if it has already been completed. The server guarantees that for
2308    /// at least 60 minutes after the first request.
2309    ///
2310    /// For example, consider a situation where you make an initial request and the
2311    /// request times out. If you make the request again with the same request ID,
2312    /// the server can check if original operation with the same request ID was
2313    /// received, and if so, will ignore the second request. This prevents clients
2314    /// from accidentally creating duplicate commitments.
2315    ///
2316    /// The request ID must be a valid UUID with the exception that zero UUID is
2317    /// not supported (00000000-0000-0000-0000-000000000000).
2318    pub request_id: std::string::String,
2319
2320    /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
2321    /// will result in the creation of a new `DeliveryPipeline`.
2322    pub allow_missing: bool,
2323
2324    /// Optional. If set to true, the request is validated and the user is provided
2325    /// with an expected result, but no actual change is made.
2326    pub validate_only: bool,
2327
2328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2329}
2330
2331impl UpdateDeliveryPipelineRequest {
2332    pub fn new() -> Self {
2333        std::default::Default::default()
2334    }
2335
2336    /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
2337    pub fn set_update_mask<T>(mut self, v: T) -> Self
2338    where
2339        T: std::convert::Into<wkt::FieldMask>,
2340    {
2341        self.update_mask = std::option::Option::Some(v.into());
2342        self
2343    }
2344
2345    /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
2346    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2347    where
2348        T: std::convert::Into<wkt::FieldMask>,
2349    {
2350        self.update_mask = v.map(|x| x.into());
2351        self
2352    }
2353
2354    /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
2355    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
2356    where
2357        T: std::convert::Into<crate::model::DeliveryPipeline>,
2358    {
2359        self.delivery_pipeline = std::option::Option::Some(v.into());
2360        self
2361    }
2362
2363    /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
2364    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
2365    where
2366        T: std::convert::Into<crate::model::DeliveryPipeline>,
2367    {
2368        self.delivery_pipeline = v.map(|x| x.into());
2369        self
2370    }
2371
2372    /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
2373    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2374        self.request_id = v.into();
2375        self
2376    }
2377
2378    /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
2379    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2380        self.allow_missing = v.into();
2381        self
2382    }
2383
2384    /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
2385    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2386        self.validate_only = v.into();
2387        self
2388    }
2389}
2390
2391impl wkt::message::Message for UpdateDeliveryPipelineRequest {
2392    fn typename() -> &'static str {
2393        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
2394    }
2395}
2396
2397/// The request object for `DeleteDeliveryPipeline`.
2398#[derive(Clone, Default, PartialEq)]
2399#[non_exhaustive]
2400pub struct DeleteDeliveryPipelineRequest {
2401    /// Required. The name of the `DeliveryPipeline` to delete. The format is
2402    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
2403    pub name: std::string::String,
2404
2405    /// Optional. A request ID to identify requests. Specify a unique request ID
2406    /// so that if you must retry your request, the server knows to ignore the
2407    /// request if it has already been completed. The server guarantees that for
2408    /// at least 60 minutes after the first request.
2409    ///
2410    /// For example, consider a situation where you make an initial request and the
2411    /// request times out. If you make the request again with the same request ID,
2412    /// the server can check if original operation with the same request ID was
2413    /// received, and if so, will ignore the second request. This prevents clients
2414    /// from accidentally creating duplicate commitments.
2415    ///
2416    /// The request ID must be a valid UUID with the exception that zero UUID is
2417    /// not supported (00000000-0000-0000-0000-000000000000).
2418    pub request_id: std::string::String,
2419
2420    /// Optional. If set to true, then deleting an already deleted or non-existing
2421    /// `DeliveryPipeline` will succeed.
2422    pub allow_missing: bool,
2423
2424    /// Optional. If set, validate the request and preview the review, but do not
2425    /// actually post it.
2426    pub validate_only: bool,
2427
2428    /// Optional. If set to true, all child resources under this pipeline will also
2429    /// be deleted. Otherwise, the request will only work if the pipeline has no
2430    /// child resources.
2431    pub force: bool,
2432
2433    /// Optional. This checksum is computed by the server based on the value of
2434    /// other fields, and may be sent on update and delete requests to ensure the
2435    /// client has an up-to-date value before proceeding.
2436    pub etag: std::string::String,
2437
2438    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2439}
2440
2441impl DeleteDeliveryPipelineRequest {
2442    pub fn new() -> Self {
2443        std::default::Default::default()
2444    }
2445
2446    /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
2447    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2448        self.name = v.into();
2449        self
2450    }
2451
2452    /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
2453    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2454        self.request_id = v.into();
2455        self
2456    }
2457
2458    /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
2459    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2460        self.allow_missing = v.into();
2461        self
2462    }
2463
2464    /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
2465    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2466        self.validate_only = v.into();
2467        self
2468    }
2469
2470    /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
2471    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2472        self.force = v.into();
2473        self
2474    }
2475
2476    /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
2477    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2478        self.etag = v.into();
2479        self
2480    }
2481}
2482
2483impl wkt::message::Message for DeleteDeliveryPipelineRequest {
2484    fn typename() -> &'static str {
2485        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
2486    }
2487}
2488
2489/// Configs for the Rollback rollout.
2490#[derive(Clone, Default, PartialEq)]
2491#[non_exhaustive]
2492pub struct RollbackTargetConfig {
2493    /// Optional. The rollback `Rollout` to create.
2494    pub rollout: std::option::Option<crate::model::Rollout>,
2495
2496    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
2497    /// `Rollout` will start in the stable phase.
2498    pub starting_phase_id: std::string::String,
2499
2500    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2501}
2502
2503impl RollbackTargetConfig {
2504    pub fn new() -> Self {
2505        std::default::Default::default()
2506    }
2507
2508    /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
2509    pub fn set_rollout<T>(mut self, v: T) -> Self
2510    where
2511        T: std::convert::Into<crate::model::Rollout>,
2512    {
2513        self.rollout = std::option::Option::Some(v.into());
2514        self
2515    }
2516
2517    /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
2518    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
2519    where
2520        T: std::convert::Into<crate::model::Rollout>,
2521    {
2522        self.rollout = v.map(|x| x.into());
2523        self
2524    }
2525
2526    /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
2527    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
2528        mut self,
2529        v: T,
2530    ) -> Self {
2531        self.starting_phase_id = v.into();
2532        self
2533    }
2534}
2535
2536impl wkt::message::Message for RollbackTargetConfig {
2537    fn typename() -> &'static str {
2538        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
2539    }
2540}
2541
2542/// The request object for `RollbackTarget`.
2543#[derive(Clone, Default, PartialEq)]
2544#[non_exhaustive]
2545pub struct RollbackTargetRequest {
2546    /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
2547    /// created. The format is
2548    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
2549    pub name: std::string::String,
2550
2551    /// Required. ID of the `Target` that is being rolled back.
2552    pub target_id: std::string::String,
2553
2554    /// Required. ID of the rollback `Rollout` to create.
2555    pub rollout_id: std::string::String,
2556
2557    /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
2558    /// previous successful `Rollout` to the specified target will be used to
2559    /// determine the `Release`.
2560    pub release_id: std::string::String,
2561
2562    /// Optional. If provided, this must be the latest `Rollout` that is on the
2563    /// `Target`.
2564    pub rollout_to_roll_back: std::string::String,
2565
2566    /// Optional. Configs for the rollback `Rollout`.
2567    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
2568
2569    /// Optional. If set to true, the request is validated and the user is provided
2570    /// with a `RollbackTargetResponse`.
2571    pub validate_only: bool,
2572
2573    /// Optional. Deploy policies to override. Format is
2574    /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
2575    pub override_deploy_policy: std::vec::Vec<std::string::String>,
2576
2577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2578}
2579
2580impl RollbackTargetRequest {
2581    pub fn new() -> Self {
2582        std::default::Default::default()
2583    }
2584
2585    /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
2586    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2587        self.name = v.into();
2588        self
2589    }
2590
2591    /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
2592    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2593        self.target_id = v.into();
2594        self
2595    }
2596
2597    /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
2598    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2599        self.rollout_id = v.into();
2600        self
2601    }
2602
2603    /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
2604    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2605        self.release_id = v.into();
2606        self
2607    }
2608
2609    /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
2610    pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
2611        mut self,
2612        v: T,
2613    ) -> Self {
2614        self.rollout_to_roll_back = v.into();
2615        self
2616    }
2617
2618    /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
2619    pub fn set_rollback_config<T>(mut self, v: T) -> Self
2620    where
2621        T: std::convert::Into<crate::model::RollbackTargetConfig>,
2622    {
2623        self.rollback_config = std::option::Option::Some(v.into());
2624        self
2625    }
2626
2627    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
2628    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
2629    where
2630        T: std::convert::Into<crate::model::RollbackTargetConfig>,
2631    {
2632        self.rollback_config = v.map(|x| x.into());
2633        self
2634    }
2635
2636    /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
2637    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2638        self.validate_only = v.into();
2639        self
2640    }
2641
2642    /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
2643    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
2644    where
2645        T: std::iter::IntoIterator<Item = V>,
2646        V: std::convert::Into<std::string::String>,
2647    {
2648        use std::iter::Iterator;
2649        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
2650        self
2651    }
2652}
2653
2654impl wkt::message::Message for RollbackTargetRequest {
2655    fn typename() -> &'static str {
2656        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
2657    }
2658}
2659
2660/// The response object from `RollbackTarget`.
2661#[derive(Clone, Default, PartialEq)]
2662#[non_exhaustive]
2663pub struct RollbackTargetResponse {
2664    /// The config of the rollback `Rollout` created or will be created.
2665    pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
2666
2667    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2668}
2669
2670impl RollbackTargetResponse {
2671    pub fn new() -> Self {
2672        std::default::Default::default()
2673    }
2674
2675    /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
2676    pub fn set_rollback_config<T>(mut self, v: T) -> Self
2677    where
2678        T: std::convert::Into<crate::model::RollbackTargetConfig>,
2679    {
2680        self.rollback_config = std::option::Option::Some(v.into());
2681        self
2682    }
2683
2684    /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
2685    pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
2686    where
2687        T: std::convert::Into<crate::model::RollbackTargetConfig>,
2688    {
2689        self.rollback_config = v.map(|x| x.into());
2690        self
2691    }
2692}
2693
2694impl wkt::message::Message for RollbackTargetResponse {
2695    fn typename() -> &'static str {
2696        "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
2697    }
2698}
2699
2700/// A `Target` resource in the Cloud Deploy API.
2701///
2702/// A `Target` defines a location to which a Skaffold configuration
2703/// can be deployed.
2704#[derive(Clone, Default, PartialEq)]
2705#[non_exhaustive]
2706pub struct Target {
2707    /// Identifier. Name of the `Target`. Format is
2708    /// `projects/{project}/locations/{location}/targets/{target}`.
2709    /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
2710    pub name: std::string::String,
2711
2712    /// Output only. Resource id of the `Target`.
2713    pub target_id: std::string::String,
2714
2715    /// Output only. Unique identifier of the `Target`.
2716    pub uid: std::string::String,
2717
2718    /// Optional. Description of the `Target`. Max length is 255 characters.
2719    pub description: std::string::String,
2720
2721    /// Optional. User annotations. These attributes can only be set and used by
2722    /// the user, and not by Cloud Deploy. See
2723    /// <https://google.aip.dev/128#annotations> for more details such as format and
2724    /// size limitations.
2725    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2726
2727    /// Optional. Labels are attributes that can be set and used by both the
2728    /// user and by Cloud Deploy. Labels must meet the following constraints:
2729    ///
2730    /// * Keys and values can contain only lowercase letters, numeric characters,
2731    ///   underscores, and dashes.
2732    /// * All characters must use UTF-8 encoding, and international characters are
2733    ///   allowed.
2734    /// * Keys must start with a lowercase letter or international character.
2735    /// * Each resource is limited to a maximum of 64 labels.
2736    ///
2737    /// Both keys and values are additionally constrained to be <= 128 bytes.
2738    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2739
2740    /// Optional. Whether or not the `Target` requires approval.
2741    pub require_approval: bool,
2742
2743    /// Output only. Time at which the `Target` was created.
2744    pub create_time: std::option::Option<wkt::Timestamp>,
2745
2746    /// Output only. Most recent time at which the `Target` was updated.
2747    pub update_time: std::option::Option<wkt::Timestamp>,
2748
2749    /// Optional. Map of entity IDs to their associated entities. Associated
2750    /// entities allows specifying places other than the deployment target for
2751    /// specific features. For example, the Gateway API canary can be configured to
2752    /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
2753    /// using associated entities. An entity ID must consist of lower-case letters,
2754    /// numbers, and hyphens, start with a letter and end with a letter or a
2755    /// number, and have a max length of 63 characters. In other words, it must
2756    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
2757    pub associated_entities:
2758        std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
2759
2760    /// Optional. This checksum is computed by the server based on the value of
2761    /// other fields, and may be sent on update and delete requests to ensure the
2762    /// client has an up-to-date value before proceeding.
2763    pub etag: std::string::String,
2764
2765    /// Optional. Configurations for all execution that relates to this `Target`.
2766    /// Each `ExecutionEnvironmentUsage` value may only be used in a single
2767    /// configuration; using the same value multiple times is an error.
2768    /// When one or more configurations are specified, they must include the
2769    /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
2770    /// When no configurations are specified, execution will use the default
2771    /// specified in `DefaultPool`.
2772    pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
2773
2774    /// Optional. The deploy parameters to use for this target.
2775    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
2776
2777    /// Destination to which the Skaffold configuration is applied during a
2778    /// rollout.
2779    pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
2780
2781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2782}
2783
2784impl Target {
2785    pub fn new() -> Self {
2786        std::default::Default::default()
2787    }
2788
2789    /// Sets the value of [name][crate::model::Target::name].
2790    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2791        self.name = v.into();
2792        self
2793    }
2794
2795    /// Sets the value of [target_id][crate::model::Target::target_id].
2796    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2797        self.target_id = v.into();
2798        self
2799    }
2800
2801    /// Sets the value of [uid][crate::model::Target::uid].
2802    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2803        self.uid = v.into();
2804        self
2805    }
2806
2807    /// Sets the value of [description][crate::model::Target::description].
2808    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2809        self.description = v.into();
2810        self
2811    }
2812
2813    /// Sets the value of [annotations][crate::model::Target::annotations].
2814    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2815    where
2816        T: std::iter::IntoIterator<Item = (K, V)>,
2817        K: std::convert::Into<std::string::String>,
2818        V: std::convert::Into<std::string::String>,
2819    {
2820        use std::iter::Iterator;
2821        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2822        self
2823    }
2824
2825    /// Sets the value of [labels][crate::model::Target::labels].
2826    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2827    where
2828        T: std::iter::IntoIterator<Item = (K, V)>,
2829        K: std::convert::Into<std::string::String>,
2830        V: std::convert::Into<std::string::String>,
2831    {
2832        use std::iter::Iterator;
2833        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2834        self
2835    }
2836
2837    /// Sets the value of [require_approval][crate::model::Target::require_approval].
2838    pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2839        self.require_approval = v.into();
2840        self
2841    }
2842
2843    /// Sets the value of [create_time][crate::model::Target::create_time].
2844    pub fn set_create_time<T>(mut self, v: T) -> Self
2845    where
2846        T: std::convert::Into<wkt::Timestamp>,
2847    {
2848        self.create_time = std::option::Option::Some(v.into());
2849        self
2850    }
2851
2852    /// Sets or clears the value of [create_time][crate::model::Target::create_time].
2853    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2854    where
2855        T: std::convert::Into<wkt::Timestamp>,
2856    {
2857        self.create_time = v.map(|x| x.into());
2858        self
2859    }
2860
2861    /// Sets the value of [update_time][crate::model::Target::update_time].
2862    pub fn set_update_time<T>(mut self, v: T) -> Self
2863    where
2864        T: std::convert::Into<wkt::Timestamp>,
2865    {
2866        self.update_time = std::option::Option::Some(v.into());
2867        self
2868    }
2869
2870    /// Sets or clears the value of [update_time][crate::model::Target::update_time].
2871    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2872    where
2873        T: std::convert::Into<wkt::Timestamp>,
2874    {
2875        self.update_time = v.map(|x| x.into());
2876        self
2877    }
2878
2879    /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
2880    pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
2881    where
2882        T: std::iter::IntoIterator<Item = (K, V)>,
2883        K: std::convert::Into<std::string::String>,
2884        V: std::convert::Into<crate::model::AssociatedEntities>,
2885    {
2886        use std::iter::Iterator;
2887        self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2888        self
2889    }
2890
2891    /// Sets the value of [etag][crate::model::Target::etag].
2892    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2893        self.etag = v.into();
2894        self
2895    }
2896
2897    /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
2898    pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
2899    where
2900        T: std::iter::IntoIterator<Item = V>,
2901        V: std::convert::Into<crate::model::ExecutionConfig>,
2902    {
2903        use std::iter::Iterator;
2904        self.execution_configs = v.into_iter().map(|i| i.into()).collect();
2905        self
2906    }
2907
2908    /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
2909    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
2910    where
2911        T: std::iter::IntoIterator<Item = (K, V)>,
2912        K: std::convert::Into<std::string::String>,
2913        V: std::convert::Into<std::string::String>,
2914    {
2915        use std::iter::Iterator;
2916        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2917        self
2918    }
2919
2920    /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
2921    ///
2922    /// Note that all the setters affecting `deployment_target` are mutually
2923    /// exclusive.
2924    pub fn set_deployment_target<
2925        T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
2926    >(
2927        mut self,
2928        v: T,
2929    ) -> Self {
2930        self.deployment_target = v.into();
2931        self
2932    }
2933
2934    /// The value of [deployment_target][crate::model::Target::deployment_target]
2935    /// if it holds a `Gke`, `None` if the field is not set or
2936    /// holds a different branch.
2937    pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
2938        #[allow(unreachable_patterns)]
2939        self.deployment_target.as_ref().and_then(|v| match v {
2940            crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
2941            _ => std::option::Option::None,
2942        })
2943    }
2944
2945    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
2946    /// to hold a `Gke`.
2947    ///
2948    /// Note that all the setters affecting `deployment_target` are
2949    /// mutually exclusive.
2950    pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
2951        mut self,
2952        v: T,
2953    ) -> Self {
2954        self.deployment_target =
2955            std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
2956        self
2957    }
2958
2959    /// The value of [deployment_target][crate::model::Target::deployment_target]
2960    /// if it holds a `AnthosCluster`, `None` if the field is not set or
2961    /// holds a different branch.
2962    pub fn anthos_cluster(
2963        &self,
2964    ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
2965        #[allow(unreachable_patterns)]
2966        self.deployment_target.as_ref().and_then(|v| match v {
2967            crate::model::target::DeploymentTarget::AnthosCluster(v) => {
2968                std::option::Option::Some(v)
2969            }
2970            _ => std::option::Option::None,
2971        })
2972    }
2973
2974    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
2975    /// to hold a `AnthosCluster`.
2976    ///
2977    /// Note that all the setters affecting `deployment_target` are
2978    /// mutually exclusive.
2979    pub fn set_anthos_cluster<
2980        T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
2981    >(
2982        mut self,
2983        v: T,
2984    ) -> Self {
2985        self.deployment_target = std::option::Option::Some(
2986            crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
2987        );
2988        self
2989    }
2990
2991    /// The value of [deployment_target][crate::model::Target::deployment_target]
2992    /// if it holds a `Run`, `None` if the field is not set or
2993    /// holds a different branch.
2994    pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
2995        #[allow(unreachable_patterns)]
2996        self.deployment_target.as_ref().and_then(|v| match v {
2997            crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
2998            _ => std::option::Option::None,
2999        })
3000    }
3001
3002    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
3003    /// to hold a `Run`.
3004    ///
3005    /// Note that all the setters affecting `deployment_target` are
3006    /// mutually exclusive.
3007    pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
3008        mut self,
3009        v: T,
3010    ) -> Self {
3011        self.deployment_target =
3012            std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
3013        self
3014    }
3015
3016    /// The value of [deployment_target][crate::model::Target::deployment_target]
3017    /// if it holds a `MultiTarget`, `None` if the field is not set or
3018    /// holds a different branch.
3019    pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
3020        #[allow(unreachable_patterns)]
3021        self.deployment_target.as_ref().and_then(|v| match v {
3022            crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
3023            _ => std::option::Option::None,
3024        })
3025    }
3026
3027    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
3028    /// to hold a `MultiTarget`.
3029    ///
3030    /// Note that all the setters affecting `deployment_target` are
3031    /// mutually exclusive.
3032    pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
3033        mut self,
3034        v: T,
3035    ) -> Self {
3036        self.deployment_target = std::option::Option::Some(
3037            crate::model::target::DeploymentTarget::MultiTarget(v.into()),
3038        );
3039        self
3040    }
3041
3042    /// The value of [deployment_target][crate::model::Target::deployment_target]
3043    /// if it holds a `CustomTarget`, `None` if the field is not set or
3044    /// holds a different branch.
3045    pub fn custom_target(
3046        &self,
3047    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
3048        #[allow(unreachable_patterns)]
3049        self.deployment_target.as_ref().and_then(|v| match v {
3050            crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
3051            _ => std::option::Option::None,
3052        })
3053    }
3054
3055    /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
3056    /// to hold a `CustomTarget`.
3057    ///
3058    /// Note that all the setters affecting `deployment_target` are
3059    /// mutually exclusive.
3060    pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
3061        mut self,
3062        v: T,
3063    ) -> Self {
3064        self.deployment_target = std::option::Option::Some(
3065            crate::model::target::DeploymentTarget::CustomTarget(v.into()),
3066        );
3067        self
3068    }
3069}
3070
3071impl wkt::message::Message for Target {
3072    fn typename() -> &'static str {
3073        "type.googleapis.com/google.cloud.deploy.v1.Target"
3074    }
3075}
3076
3077/// Defines additional types related to [Target].
3078pub mod target {
3079    #[allow(unused_imports)]
3080    use super::*;
3081
3082    /// Destination to which the Skaffold configuration is applied during a
3083    /// rollout.
3084    #[derive(Clone, Debug, PartialEq)]
3085    #[non_exhaustive]
3086    pub enum DeploymentTarget {
3087        /// Optional. Information specifying a GKE Cluster.
3088        Gke(std::boxed::Box<crate::model::GkeCluster>),
3089        /// Optional. Information specifying an Anthos Cluster.
3090        AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
3091        /// Optional. Information specifying a Cloud Run deployment target.
3092        Run(std::boxed::Box<crate::model::CloudRunLocation>),
3093        /// Optional. Information specifying a multiTarget.
3094        MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
3095        /// Optional. Information specifying a Custom Target.
3096        CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
3097    }
3098}
3099
3100/// Configuration of the environment to use when calling Skaffold.
3101#[derive(Clone, Default, PartialEq)]
3102#[non_exhaustive]
3103pub struct ExecutionConfig {
3104    /// Required. Usages when this configuration should be applied.
3105    pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
3106
3107    /// Optional. The resource name of the `WorkerPool`, with the format
3108    /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
3109    /// If this optional field is unspecified, the default Cloud Build pool will be
3110    /// used.
3111    pub worker_pool: std::string::String,
3112
3113    /// Optional. Google service account to use for execution. If unspecified,
3114    /// the project execution service account
3115    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
3116    pub service_account: std::string::String,
3117
3118    /// Optional. Cloud Storage location in which to store execution outputs. This
3119    /// can either be a bucket ("gs://my-bucket") or a path within a bucket
3120    /// ("gs://my-bucket/my-dir").
3121    /// If unspecified, a default bucket located in the same region will be used.
3122    pub artifact_storage: std::string::String,
3123
3124    /// Optional. Execution timeout for a Cloud Build Execution. This must be
3125    /// between 10m and 24h in seconds format. If unspecified, a default timeout of
3126    /// 1h is used.
3127    pub execution_timeout: std::option::Option<wkt::Duration>,
3128
3129    /// Optional. If true, additional logging will be enabled when running builds
3130    /// in this execution environment.
3131    pub verbose: bool,
3132
3133    /// Details of the environment.
3134    pub execution_environment:
3135        std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
3136
3137    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3138}
3139
3140impl ExecutionConfig {
3141    pub fn new() -> Self {
3142        std::default::Default::default()
3143    }
3144
3145    /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
3146    pub fn set_usages<T, V>(mut self, v: T) -> Self
3147    where
3148        T: std::iter::IntoIterator<Item = V>,
3149        V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
3150    {
3151        use std::iter::Iterator;
3152        self.usages = v.into_iter().map(|i| i.into()).collect();
3153        self
3154    }
3155
3156    /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
3157    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3158        self.worker_pool = v.into();
3159        self
3160    }
3161
3162    /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
3163    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3164        self.service_account = v.into();
3165        self
3166    }
3167
3168    /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
3169    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
3170        mut self,
3171        v: T,
3172    ) -> Self {
3173        self.artifact_storage = v.into();
3174        self
3175    }
3176
3177    /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
3178    pub fn set_execution_timeout<T>(mut self, v: T) -> Self
3179    where
3180        T: std::convert::Into<wkt::Duration>,
3181    {
3182        self.execution_timeout = std::option::Option::Some(v.into());
3183        self
3184    }
3185
3186    /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
3187    pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3188    where
3189        T: std::convert::Into<wkt::Duration>,
3190    {
3191        self.execution_timeout = v.map(|x| x.into());
3192        self
3193    }
3194
3195    /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
3196    pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3197        self.verbose = v.into();
3198        self
3199    }
3200
3201    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
3202    ///
3203    /// Note that all the setters affecting `execution_environment` are mutually
3204    /// exclusive.
3205    pub fn set_execution_environment<
3206        T: std::convert::Into<
3207                std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
3208            >,
3209    >(
3210        mut self,
3211        v: T,
3212    ) -> Self {
3213        self.execution_environment = v.into();
3214        self
3215    }
3216
3217    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
3218    /// if it holds a `DefaultPool`, `None` if the field is not set or
3219    /// holds a different branch.
3220    pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
3221        #[allow(unreachable_patterns)]
3222        self.execution_environment.as_ref().and_then(|v| match v {
3223            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
3224                std::option::Option::Some(v)
3225            }
3226            _ => std::option::Option::None,
3227        })
3228    }
3229
3230    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
3231    /// to hold a `DefaultPool`.
3232    ///
3233    /// Note that all the setters affecting `execution_environment` are
3234    /// mutually exclusive.
3235    pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
3236        mut self,
3237        v: T,
3238    ) -> Self {
3239        self.execution_environment = std::option::Option::Some(
3240            crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
3241        );
3242        self
3243    }
3244
3245    /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
3246    /// if it holds a `PrivatePool`, `None` if the field is not set or
3247    /// holds a different branch.
3248    pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
3249        #[allow(unreachable_patterns)]
3250        self.execution_environment.as_ref().and_then(|v| match v {
3251            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
3252                std::option::Option::Some(v)
3253            }
3254            _ => std::option::Option::None,
3255        })
3256    }
3257
3258    /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
3259    /// to hold a `PrivatePool`.
3260    ///
3261    /// Note that all the setters affecting `execution_environment` are
3262    /// mutually exclusive.
3263    pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
3264        mut self,
3265        v: T,
3266    ) -> Self {
3267        self.execution_environment = std::option::Option::Some(
3268            crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
3269        );
3270        self
3271    }
3272}
3273
3274impl wkt::message::Message for ExecutionConfig {
3275    fn typename() -> &'static str {
3276        "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
3277    }
3278}
3279
3280/// Defines additional types related to [ExecutionConfig].
3281pub mod execution_config {
3282    #[allow(unused_imports)]
3283    use super::*;
3284
3285    /// Possible usages of this configuration.
3286    ///
3287    /// # Working with unknown values
3288    ///
3289    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3290    /// additional enum variants at any time. Adding new variants is not considered
3291    /// a breaking change. Applications should write their code in anticipation of:
3292    ///
3293    /// - New values appearing in future releases of the client library, **and**
3294    /// - New values received dynamically, without application changes.
3295    ///
3296    /// Please consult the [Working with enums] section in the user guide for some
3297    /// guidelines.
3298    ///
3299    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3300    #[derive(Clone, Debug, PartialEq)]
3301    #[non_exhaustive]
3302    pub enum ExecutionEnvironmentUsage {
3303        /// Default value. This value is unused.
3304        Unspecified,
3305        /// Use for rendering.
3306        Render,
3307        /// Use for deploying and deployment hooks.
3308        Deploy,
3309        /// Use for deployment verification.
3310        Verify,
3311        /// Use for predeploy job execution.
3312        Predeploy,
3313        /// Use for postdeploy job execution.
3314        Postdeploy,
3315        /// If set, the enum was initialized with an unknown value.
3316        ///
3317        /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
3318        /// [ExecutionEnvironmentUsage::name].
3319        UnknownValue(execution_environment_usage::UnknownValue),
3320    }
3321
3322    #[doc(hidden)]
3323    pub mod execution_environment_usage {
3324        #[allow(unused_imports)]
3325        use super::*;
3326        #[derive(Clone, Debug, PartialEq)]
3327        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3328    }
3329
3330    impl ExecutionEnvironmentUsage {
3331        /// Gets the enum value.
3332        ///
3333        /// Returns `None` if the enum contains an unknown value deserialized from
3334        /// the string representation of enums.
3335        pub fn value(&self) -> std::option::Option<i32> {
3336            match self {
3337                Self::Unspecified => std::option::Option::Some(0),
3338                Self::Render => std::option::Option::Some(1),
3339                Self::Deploy => std::option::Option::Some(2),
3340                Self::Verify => std::option::Option::Some(3),
3341                Self::Predeploy => std::option::Option::Some(4),
3342                Self::Postdeploy => std::option::Option::Some(5),
3343                Self::UnknownValue(u) => u.0.value(),
3344            }
3345        }
3346
3347        /// Gets the enum value as a string.
3348        ///
3349        /// Returns `None` if the enum contains an unknown value deserialized from
3350        /// the integer representation of enums.
3351        pub fn name(&self) -> std::option::Option<&str> {
3352            match self {
3353                Self::Unspecified => {
3354                    std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
3355                }
3356                Self::Render => std::option::Option::Some("RENDER"),
3357                Self::Deploy => std::option::Option::Some("DEPLOY"),
3358                Self::Verify => std::option::Option::Some("VERIFY"),
3359                Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
3360                Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
3361                Self::UnknownValue(u) => u.0.name(),
3362            }
3363        }
3364    }
3365
3366    impl std::default::Default for ExecutionEnvironmentUsage {
3367        fn default() -> Self {
3368            use std::convert::From;
3369            Self::from(0)
3370        }
3371    }
3372
3373    impl std::fmt::Display for ExecutionEnvironmentUsage {
3374        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3375            wkt::internal::display_enum(f, self.name(), self.value())
3376        }
3377    }
3378
3379    impl std::convert::From<i32> for ExecutionEnvironmentUsage {
3380        fn from(value: i32) -> Self {
3381            match value {
3382                0 => Self::Unspecified,
3383                1 => Self::Render,
3384                2 => Self::Deploy,
3385                3 => Self::Verify,
3386                4 => Self::Predeploy,
3387                5 => Self::Postdeploy,
3388                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
3389                    wkt::internal::UnknownEnumValue::Integer(value),
3390                )),
3391            }
3392        }
3393    }
3394
3395    impl std::convert::From<&str> for ExecutionEnvironmentUsage {
3396        fn from(value: &str) -> Self {
3397            use std::string::ToString;
3398            match value {
3399                "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
3400                "RENDER" => Self::Render,
3401                "DEPLOY" => Self::Deploy,
3402                "VERIFY" => Self::Verify,
3403                "PREDEPLOY" => Self::Predeploy,
3404                "POSTDEPLOY" => Self::Postdeploy,
3405                _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
3406                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3407                )),
3408            }
3409        }
3410    }
3411
3412    impl serde::ser::Serialize for ExecutionEnvironmentUsage {
3413        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3414        where
3415            S: serde::Serializer,
3416        {
3417            match self {
3418                Self::Unspecified => serializer.serialize_i32(0),
3419                Self::Render => serializer.serialize_i32(1),
3420                Self::Deploy => serializer.serialize_i32(2),
3421                Self::Verify => serializer.serialize_i32(3),
3422                Self::Predeploy => serializer.serialize_i32(4),
3423                Self::Postdeploy => serializer.serialize_i32(5),
3424                Self::UnknownValue(u) => u.0.serialize(serializer),
3425            }
3426        }
3427    }
3428
3429    impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
3430        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3431        where
3432            D: serde::Deserializer<'de>,
3433        {
3434            deserializer.deserialize_any(
3435                wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
3436                    ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
3437                ),
3438            )
3439        }
3440    }
3441
3442    /// Details of the environment.
3443    #[derive(Clone, Debug, PartialEq)]
3444    #[non_exhaustive]
3445    pub enum ExecutionEnvironment {
3446        /// Optional. Use default Cloud Build pool.
3447        DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
3448        /// Optional. Use private Cloud Build pool.
3449        PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
3450    }
3451}
3452
3453/// Execution using the default Cloud Build pool.
3454#[derive(Clone, Default, PartialEq)]
3455#[non_exhaustive]
3456pub struct DefaultPool {
3457    /// Optional. Google service account to use for execution. If unspecified,
3458    /// the project execution service account
3459    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
3460    pub service_account: std::string::String,
3461
3462    /// Optional. Cloud Storage location where execution outputs should be stored.
3463    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
3464    /// ("gs://my-bucket/my-dir").
3465    /// If unspecified, a default bucket located in the same region will be used.
3466    pub artifact_storage: std::string::String,
3467
3468    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3469}
3470
3471impl DefaultPool {
3472    pub fn new() -> Self {
3473        std::default::Default::default()
3474    }
3475
3476    /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
3477    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3478        self.service_account = v.into();
3479        self
3480    }
3481
3482    /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
3483    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
3484        mut self,
3485        v: T,
3486    ) -> Self {
3487        self.artifact_storage = v.into();
3488        self
3489    }
3490}
3491
3492impl wkt::message::Message for DefaultPool {
3493    fn typename() -> &'static str {
3494        "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
3495    }
3496}
3497
3498/// Execution using a private Cloud Build pool.
3499#[derive(Clone, Default, PartialEq)]
3500#[non_exhaustive]
3501pub struct PrivatePool {
3502    /// Required. Resource name of the Cloud Build worker pool to use. The format
3503    /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
3504    pub worker_pool: std::string::String,
3505
3506    /// Optional. Google service account to use for execution. If unspecified,
3507    /// the project execution service account
3508    /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
3509    pub service_account: std::string::String,
3510
3511    /// Optional. Cloud Storage location where execution outputs should be stored.
3512    /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
3513    /// ("gs://my-bucket/my-dir").
3514    /// If unspecified, a default bucket located in the same region will be used.
3515    pub artifact_storage: std::string::String,
3516
3517    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3518}
3519
3520impl PrivatePool {
3521    pub fn new() -> Self {
3522        std::default::Default::default()
3523    }
3524
3525    /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
3526    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3527        self.worker_pool = v.into();
3528        self
3529    }
3530
3531    /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
3532    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3533        self.service_account = v.into();
3534        self
3535    }
3536
3537    /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
3538    pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
3539        mut self,
3540        v: T,
3541    ) -> Self {
3542        self.artifact_storage = v.into();
3543        self
3544    }
3545}
3546
3547impl wkt::message::Message for PrivatePool {
3548    fn typename() -> &'static str {
3549        "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
3550    }
3551}
3552
3553/// Information specifying a GKE Cluster.
3554#[derive(Clone, Default, PartialEq)]
3555#[non_exhaustive]
3556pub struct GkeCluster {
3557    /// Optional. Information specifying a GKE Cluster. Format is
3558    /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
3559    pub cluster: std::string::String,
3560
3561    /// Optional. If true, `cluster` is accessed using the private IP address of
3562    /// the control plane endpoint. Otherwise, the default IP address of the
3563    /// control plane endpoint is used. The default IP address is the private IP
3564    /// address for clusters with private control-plane endpoints and the public IP
3565    /// address otherwise.
3566    ///
3567    /// Only specify this option when `cluster` is a [private GKE
3568    /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
3569    /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
3570    pub internal_ip: bool,
3571
3572    /// Optional. If set, used to configure a
3573    /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
3574    /// to the Kubernetes server.
3575    pub proxy_url: std::string::String,
3576
3577    /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
3578    /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
3579    pub dns_endpoint: bool,
3580
3581    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3582}
3583
3584impl GkeCluster {
3585    pub fn new() -> Self {
3586        std::default::Default::default()
3587    }
3588
3589    /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
3590    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3591        self.cluster = v.into();
3592        self
3593    }
3594
3595    /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
3596    pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3597        self.internal_ip = v.into();
3598        self
3599    }
3600
3601    /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
3602    pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3603        self.proxy_url = v.into();
3604        self
3605    }
3606
3607    /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
3608    pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3609        self.dns_endpoint = v.into();
3610        self
3611    }
3612}
3613
3614impl wkt::message::Message for GkeCluster {
3615    fn typename() -> &'static str {
3616        "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
3617    }
3618}
3619
3620/// Information specifying an Anthos Cluster.
3621#[derive(Clone, Default, PartialEq)]
3622#[non_exhaustive]
3623pub struct AnthosCluster {
3624    /// Optional. Membership of the GKE Hub-registered cluster to which to apply
3625    /// the Skaffold configuration. Format is
3626    /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
3627    pub membership: std::string::String,
3628
3629    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3630}
3631
3632impl AnthosCluster {
3633    pub fn new() -> Self {
3634        std::default::Default::default()
3635    }
3636
3637    /// Sets the value of [membership][crate::model::AnthosCluster::membership].
3638    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3639        self.membership = v.into();
3640        self
3641    }
3642}
3643
3644impl wkt::message::Message for AnthosCluster {
3645    fn typename() -> &'static str {
3646        "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
3647    }
3648}
3649
3650/// Information specifying where to deploy a Cloud Run Service.
3651#[derive(Clone, Default, PartialEq)]
3652#[non_exhaustive]
3653pub struct CloudRunLocation {
3654    /// Required. The location for the Cloud Run Service. Format must be
3655    /// `projects/{project}/locations/{location}`.
3656    pub location: std::string::String,
3657
3658    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3659}
3660
3661impl CloudRunLocation {
3662    pub fn new() -> Self {
3663        std::default::Default::default()
3664    }
3665
3666    /// Sets the value of [location][crate::model::CloudRunLocation::location].
3667    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3668        self.location = v.into();
3669        self
3670    }
3671}
3672
3673impl wkt::message::Message for CloudRunLocation {
3674    fn typename() -> &'static str {
3675        "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
3676    }
3677}
3678
3679/// Information specifying a multiTarget.
3680#[derive(Clone, Default, PartialEq)]
3681#[non_exhaustive]
3682pub struct MultiTarget {
3683    /// Required. The target_ids of this multiTarget.
3684    pub target_ids: std::vec::Vec<std::string::String>,
3685
3686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3687}
3688
3689impl MultiTarget {
3690    pub fn new() -> Self {
3691        std::default::Default::default()
3692    }
3693
3694    /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
3695    pub fn set_target_ids<T, V>(mut self, v: T) -> Self
3696    where
3697        T: std::iter::IntoIterator<Item = V>,
3698        V: std::convert::Into<std::string::String>,
3699    {
3700        use std::iter::Iterator;
3701        self.target_ids = v.into_iter().map(|i| i.into()).collect();
3702        self
3703    }
3704}
3705
3706impl wkt::message::Message for MultiTarget {
3707    fn typename() -> &'static str {
3708        "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
3709    }
3710}
3711
3712/// Information specifying a Custom Target.
3713#[derive(Clone, Default, PartialEq)]
3714#[non_exhaustive]
3715pub struct CustomTarget {
3716    /// Required. The name of the CustomTargetType. Format must be
3717    /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
3718    pub custom_target_type: std::string::String,
3719
3720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3721}
3722
3723impl CustomTarget {
3724    pub fn new() -> Self {
3725        std::default::Default::default()
3726    }
3727
3728    /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
3729    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
3730        mut self,
3731        v: T,
3732    ) -> Self {
3733        self.custom_target_type = v.into();
3734        self
3735    }
3736}
3737
3738impl wkt::message::Message for CustomTarget {
3739    fn typename() -> &'static str {
3740        "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
3741    }
3742}
3743
3744/// Information about entities associated with a `Target`.
3745#[derive(Clone, Default, PartialEq)]
3746#[non_exhaustive]
3747pub struct AssociatedEntities {
3748    /// Optional. Information specifying GKE clusters as associated entities.
3749    pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
3750
3751    /// Optional. Information specifying Anthos clusters as associated entities.
3752    pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
3753
3754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3755}
3756
3757impl AssociatedEntities {
3758    pub fn new() -> Self {
3759        std::default::Default::default()
3760    }
3761
3762    /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
3763    pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
3764    where
3765        T: std::iter::IntoIterator<Item = V>,
3766        V: std::convert::Into<crate::model::GkeCluster>,
3767    {
3768        use std::iter::Iterator;
3769        self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
3770        self
3771    }
3772
3773    /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
3774    pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
3775    where
3776        T: std::iter::IntoIterator<Item = V>,
3777        V: std::convert::Into<crate::model::AnthosCluster>,
3778    {
3779        use std::iter::Iterator;
3780        self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
3781        self
3782    }
3783}
3784
3785impl wkt::message::Message for AssociatedEntities {
3786    fn typename() -> &'static str {
3787        "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
3788    }
3789}
3790
3791/// The request object for `ListTargets`.
3792#[derive(Clone, Default, PartialEq)]
3793#[non_exhaustive]
3794pub struct ListTargetsRequest {
3795    /// Required. The parent, which owns this collection of targets. Format must be
3796    /// `projects/{project_id}/locations/{location_name}`.
3797    pub parent: std::string::String,
3798
3799    /// Optional. The maximum number of `Target` objects to return. The service may
3800    /// return fewer than this value. If unspecified, at most 50 `Target` objects
3801    /// will be returned. The maximum value is 1000; values above 1000 will be set
3802    /// to 1000.
3803    pub page_size: i32,
3804
3805    /// Optional. A page token, received from a previous `ListTargets` call.
3806    /// Provide this to retrieve the subsequent page.
3807    ///
3808    /// When paginating, all other provided parameters match
3809    /// the call that provided the page token.
3810    pub page_token: std::string::String,
3811
3812    /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
3813    /// more details.
3814    pub filter: std::string::String,
3815
3816    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
3817    /// more details.
3818    pub order_by: std::string::String,
3819
3820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3821}
3822
3823impl ListTargetsRequest {
3824    pub fn new() -> Self {
3825        std::default::Default::default()
3826    }
3827
3828    /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
3829    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3830        self.parent = v.into();
3831        self
3832    }
3833
3834    /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
3835    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3836        self.page_size = v.into();
3837        self
3838    }
3839
3840    /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
3841    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3842        self.page_token = v.into();
3843        self
3844    }
3845
3846    /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
3847    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3848        self.filter = v.into();
3849        self
3850    }
3851
3852    /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
3853    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3854        self.order_by = v.into();
3855        self
3856    }
3857}
3858
3859impl wkt::message::Message for ListTargetsRequest {
3860    fn typename() -> &'static str {
3861        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
3862    }
3863}
3864
3865/// The response object from `ListTargets`.
3866#[derive(Clone, Default, PartialEq)]
3867#[non_exhaustive]
3868pub struct ListTargetsResponse {
3869    /// The `Target` objects.
3870    pub targets: std::vec::Vec<crate::model::Target>,
3871
3872    /// A token, which can be sent as `page_token` to retrieve the next page.
3873    /// If this field is omitted, there are no subsequent pages.
3874    pub next_page_token: std::string::String,
3875
3876    /// Locations that could not be reached.
3877    pub unreachable: std::vec::Vec<std::string::String>,
3878
3879    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3880}
3881
3882impl ListTargetsResponse {
3883    pub fn new() -> Self {
3884        std::default::Default::default()
3885    }
3886
3887    /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
3888    pub fn set_targets<T, V>(mut self, v: T) -> Self
3889    where
3890        T: std::iter::IntoIterator<Item = V>,
3891        V: std::convert::Into<crate::model::Target>,
3892    {
3893        use std::iter::Iterator;
3894        self.targets = v.into_iter().map(|i| i.into()).collect();
3895        self
3896    }
3897
3898    /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
3899    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3900        self.next_page_token = v.into();
3901        self
3902    }
3903
3904    /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
3905    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3906    where
3907        T: std::iter::IntoIterator<Item = V>,
3908        V: std::convert::Into<std::string::String>,
3909    {
3910        use std::iter::Iterator;
3911        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3912        self
3913    }
3914}
3915
3916impl wkt::message::Message for ListTargetsResponse {
3917    fn typename() -> &'static str {
3918        "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
3919    }
3920}
3921
3922#[doc(hidden)]
3923impl gax::paginator::internal::PageableResponse for ListTargetsResponse {
3924    type PageItem = crate::model::Target;
3925
3926    fn items(self) -> std::vec::Vec<Self::PageItem> {
3927        self.targets
3928    }
3929
3930    fn next_page_token(&self) -> std::string::String {
3931        use std::clone::Clone;
3932        self.next_page_token.clone()
3933    }
3934}
3935
3936/// The request object for `GetTarget`.
3937#[derive(Clone, Default, PartialEq)]
3938#[non_exhaustive]
3939pub struct GetTargetRequest {
3940    /// Required. Name of the `Target`. Format must be
3941    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
3942    pub name: std::string::String,
3943
3944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3945}
3946
3947impl GetTargetRequest {
3948    pub fn new() -> Self {
3949        std::default::Default::default()
3950    }
3951
3952    /// Sets the value of [name][crate::model::GetTargetRequest::name].
3953    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3954        self.name = v.into();
3955        self
3956    }
3957}
3958
3959impl wkt::message::Message for GetTargetRequest {
3960    fn typename() -> &'static str {
3961        "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
3962    }
3963}
3964
3965/// The request object for `CreateTarget`.
3966#[derive(Clone, Default, PartialEq)]
3967#[non_exhaustive]
3968pub struct CreateTargetRequest {
3969    /// Required. The parent collection in which the `Target` must be created.
3970    /// The format is
3971    /// `projects/{project_id}/locations/{location_name}`.
3972    pub parent: std::string::String,
3973
3974    /// Required. ID of the `Target`.
3975    pub target_id: std::string::String,
3976
3977    /// Required. The `Target` to create.
3978    pub target: std::option::Option<crate::model::Target>,
3979
3980    /// Optional. A request ID to identify requests. Specify a unique request ID
3981    /// so that if you must retry your request, the server knows to ignore the
3982    /// request if it has already been completed. The server guarantees that for
3983    /// at least 60 minutes after the first request.
3984    ///
3985    /// For example, consider a situation where you make an initial request and the
3986    /// request times out. If you make the request again with the same request ID,
3987    /// the server can check if original operation with the same request ID was
3988    /// received, and if so, will ignore the second request. This prevents clients
3989    /// from accidentally creating duplicate commitments.
3990    ///
3991    /// The request ID must be a valid UUID with the exception that zero UUID is
3992    /// not supported (00000000-0000-0000-0000-000000000000).
3993    pub request_id: std::string::String,
3994
3995    /// Optional. If set to true, the request is validated and the user is provided
3996    /// with an expected result, but no actual change is made.
3997    pub validate_only: bool,
3998
3999    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4000}
4001
4002impl CreateTargetRequest {
4003    pub fn new() -> Self {
4004        std::default::Default::default()
4005    }
4006
4007    /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
4008    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4009        self.parent = v.into();
4010        self
4011    }
4012
4013    /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
4014    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4015        self.target_id = v.into();
4016        self
4017    }
4018
4019    /// Sets the value of [target][crate::model::CreateTargetRequest::target].
4020    pub fn set_target<T>(mut self, v: T) -> Self
4021    where
4022        T: std::convert::Into<crate::model::Target>,
4023    {
4024        self.target = std::option::Option::Some(v.into());
4025        self
4026    }
4027
4028    /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
4029    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
4030    where
4031        T: std::convert::Into<crate::model::Target>,
4032    {
4033        self.target = v.map(|x| x.into());
4034        self
4035    }
4036
4037    /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
4038    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4039        self.request_id = v.into();
4040        self
4041    }
4042
4043    /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
4044    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4045        self.validate_only = v.into();
4046        self
4047    }
4048}
4049
4050impl wkt::message::Message for CreateTargetRequest {
4051    fn typename() -> &'static str {
4052        "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
4053    }
4054}
4055
4056/// The request object for `UpdateTarget`.
4057#[derive(Clone, Default, PartialEq)]
4058#[non_exhaustive]
4059pub struct UpdateTargetRequest {
4060    /// Required. Field mask is used to specify the fields to be overwritten by the
4061    /// update in the `Target` resource. The fields specified in the update_mask
4062    /// are relative to the resource, not the full request. A field will be
4063    /// overwritten if it's in the mask. If the user doesn't provide a mask then
4064    /// all fields are overwritten.
4065    pub update_mask: std::option::Option<wkt::FieldMask>,
4066
4067    /// Required. The `Target` to update.
4068    pub target: std::option::Option<crate::model::Target>,
4069
4070    /// Optional. A request ID to identify requests. Specify a unique request ID
4071    /// so that if you must retry your request, the server knows to ignore the
4072    /// request if it has already been completed. The server guarantees that for
4073    /// at least 60 minutes after the first request.
4074    ///
4075    /// For example, consider a situation where you make an initial request and the
4076    /// request times out. If you make the request again with the same request ID,
4077    /// the server can check if original operation with the same request ID was
4078    /// received, and if so, will ignore the second request. This prevents clients
4079    /// from accidentally creating duplicate commitments.
4080    ///
4081    /// The request ID must be a valid UUID with the exception that zero UUID is
4082    /// not supported (00000000-0000-0000-0000-000000000000).
4083    pub request_id: std::string::String,
4084
4085    /// Optional. If set to true, updating a `Target` that does not exist will
4086    /// result in the creation of a new `Target`.
4087    pub allow_missing: bool,
4088
4089    /// Optional. If set to true, the request is validated and the user is provided
4090    /// with an expected result, but no actual change is made.
4091    pub validate_only: bool,
4092
4093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4094}
4095
4096impl UpdateTargetRequest {
4097    pub fn new() -> Self {
4098        std::default::Default::default()
4099    }
4100
4101    /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
4102    pub fn set_update_mask<T>(mut self, v: T) -> Self
4103    where
4104        T: std::convert::Into<wkt::FieldMask>,
4105    {
4106        self.update_mask = std::option::Option::Some(v.into());
4107        self
4108    }
4109
4110    /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
4111    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4112    where
4113        T: std::convert::Into<wkt::FieldMask>,
4114    {
4115        self.update_mask = v.map(|x| x.into());
4116        self
4117    }
4118
4119    /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
4120    pub fn set_target<T>(mut self, v: T) -> Self
4121    where
4122        T: std::convert::Into<crate::model::Target>,
4123    {
4124        self.target = std::option::Option::Some(v.into());
4125        self
4126    }
4127
4128    /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
4129    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
4130    where
4131        T: std::convert::Into<crate::model::Target>,
4132    {
4133        self.target = v.map(|x| x.into());
4134        self
4135    }
4136
4137    /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
4138    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4139        self.request_id = v.into();
4140        self
4141    }
4142
4143    /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
4144    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4145        self.allow_missing = v.into();
4146        self
4147    }
4148
4149    /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
4150    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4151        self.validate_only = v.into();
4152        self
4153    }
4154}
4155
4156impl wkt::message::Message for UpdateTargetRequest {
4157    fn typename() -> &'static str {
4158        "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
4159    }
4160}
4161
4162/// The request object for `DeleteTarget`.
4163#[derive(Clone, Default, PartialEq)]
4164#[non_exhaustive]
4165pub struct DeleteTargetRequest {
4166    /// Required. The name of the `Target` to delete. The format is
4167    /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
4168    pub name: std::string::String,
4169
4170    /// Optional. A request ID to identify requests. Specify a unique request ID
4171    /// so that if you must retry your request, the server knows to ignore the
4172    /// request if it has already been completed. The server guarantees that for
4173    /// at least 60 minutes after the first request.
4174    ///
4175    /// For example, consider a situation where you make an initial request and the
4176    /// request times out. If you make the request again with the same request ID,
4177    /// the server can check if original operation with the same request ID was
4178    /// received, and if so, will ignore the second request. This prevents clients
4179    /// from accidentally creating duplicate commitments.
4180    ///
4181    /// The request ID must be a valid UUID with the exception that zero UUID is
4182    /// not supported (00000000-0000-0000-0000-000000000000).
4183    pub request_id: std::string::String,
4184
4185    /// Optional. If set to true, then deleting an already deleted or non-existing
4186    /// `Target` will succeed.
4187    pub allow_missing: bool,
4188
4189    /// Optional. If set, validate the request and preview the review, but do not
4190    /// actually post it.
4191    pub validate_only: bool,
4192
4193    /// Optional. This checksum is computed by the server based on the value of
4194    /// other fields, and may be sent on update and delete requests to ensure the
4195    /// client has an up-to-date value before proceeding.
4196    pub etag: std::string::String,
4197
4198    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4199}
4200
4201impl DeleteTargetRequest {
4202    pub fn new() -> Self {
4203        std::default::Default::default()
4204    }
4205
4206    /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
4207    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4208        self.name = v.into();
4209        self
4210    }
4211
4212    /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
4213    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4214        self.request_id = v.into();
4215        self
4216    }
4217
4218    /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
4219    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4220        self.allow_missing = v.into();
4221        self
4222    }
4223
4224    /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
4225    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4226        self.validate_only = v.into();
4227        self
4228    }
4229
4230    /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
4231    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4232        self.etag = v.into();
4233        self
4234    }
4235}
4236
4237impl wkt::message::Message for DeleteTargetRequest {
4238    fn typename() -> &'static str {
4239        "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
4240    }
4241}
4242
4243/// A `CustomTargetType` resource in the Cloud Deploy API.
4244///
4245/// A `CustomTargetType` defines a type of custom target that can be referenced
4246/// in a `Target` in order to facilitate deploying to other systems besides the
4247/// supported runtimes.
4248#[derive(Clone, Default, PartialEq)]
4249#[non_exhaustive]
4250pub struct CustomTargetType {
4251    /// Identifier. Name of the `CustomTargetType`. Format is
4252    /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
4253    /// The `customTargetType` component must match
4254    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
4255    pub name: std::string::String,
4256
4257    /// Output only. Resource id of the `CustomTargetType`.
4258    pub custom_target_type_id: std::string::String,
4259
4260    /// Output only. Unique identifier of the `CustomTargetType`.
4261    pub uid: std::string::String,
4262
4263    /// Optional. Description of the `CustomTargetType`. Max length is 255
4264    /// characters.
4265    pub description: std::string::String,
4266
4267    /// Optional. User annotations. These attributes can only be set and used by
4268    /// the user, and not by Cloud Deploy. See
4269    /// <https://google.aip.dev/128#annotations> for more details such as format and
4270    /// size limitations.
4271    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4272
4273    /// Optional. Labels are attributes that can be set and used by both the
4274    /// user and by Cloud Deploy. Labels must meet the following constraints:
4275    ///
4276    /// * Keys and values can contain only lowercase letters, numeric characters,
4277    ///   underscores, and dashes.
4278    /// * All characters must use UTF-8 encoding, and international characters are
4279    ///   allowed.
4280    /// * Keys must start with a lowercase letter or international character.
4281    /// * Each resource is limited to a maximum of 64 labels.
4282    ///
4283    /// Both keys and values are additionally constrained to be <= 128 bytes.
4284    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4285
4286    /// Output only. Time at which the `CustomTargetType` was created.
4287    pub create_time: std::option::Option<wkt::Timestamp>,
4288
4289    /// Output only. Most recent time at which the `CustomTargetType` was updated.
4290    pub update_time: std::option::Option<wkt::Timestamp>,
4291
4292    /// Optional. This checksum is computed by the server based on the value of
4293    /// other fields, and may be sent on update and delete requests to ensure the
4294    /// client has an up-to-date value before proceeding.
4295    pub etag: std::string::String,
4296
4297    /// Defines the `CustomTargetType` renderer and deployer.
4298    pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
4299
4300    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4301}
4302
4303impl CustomTargetType {
4304    pub fn new() -> Self {
4305        std::default::Default::default()
4306    }
4307
4308    /// Sets the value of [name][crate::model::CustomTargetType::name].
4309    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4310        self.name = v.into();
4311        self
4312    }
4313
4314    /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
4315    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
4316        mut self,
4317        v: T,
4318    ) -> Self {
4319        self.custom_target_type_id = v.into();
4320        self
4321    }
4322
4323    /// Sets the value of [uid][crate::model::CustomTargetType::uid].
4324    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4325        self.uid = v.into();
4326        self
4327    }
4328
4329    /// Sets the value of [description][crate::model::CustomTargetType::description].
4330    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4331        self.description = v.into();
4332        self
4333    }
4334
4335    /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
4336    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
4337    where
4338        T: std::iter::IntoIterator<Item = (K, V)>,
4339        K: std::convert::Into<std::string::String>,
4340        V: std::convert::Into<std::string::String>,
4341    {
4342        use std::iter::Iterator;
4343        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4344        self
4345    }
4346
4347    /// Sets the value of [labels][crate::model::CustomTargetType::labels].
4348    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4349    where
4350        T: std::iter::IntoIterator<Item = (K, V)>,
4351        K: std::convert::Into<std::string::String>,
4352        V: std::convert::Into<std::string::String>,
4353    {
4354        use std::iter::Iterator;
4355        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4356        self
4357    }
4358
4359    /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
4360    pub fn set_create_time<T>(mut self, v: T) -> Self
4361    where
4362        T: std::convert::Into<wkt::Timestamp>,
4363    {
4364        self.create_time = std::option::Option::Some(v.into());
4365        self
4366    }
4367
4368    /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
4369    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4370    where
4371        T: std::convert::Into<wkt::Timestamp>,
4372    {
4373        self.create_time = v.map(|x| x.into());
4374        self
4375    }
4376
4377    /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
4378    pub fn set_update_time<T>(mut self, v: T) -> Self
4379    where
4380        T: std::convert::Into<wkt::Timestamp>,
4381    {
4382        self.update_time = std::option::Option::Some(v.into());
4383        self
4384    }
4385
4386    /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
4387    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4388    where
4389        T: std::convert::Into<wkt::Timestamp>,
4390    {
4391        self.update_time = v.map(|x| x.into());
4392        self
4393    }
4394
4395    /// Sets the value of [etag][crate::model::CustomTargetType::etag].
4396    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4397        self.etag = v.into();
4398        self
4399    }
4400
4401    /// Sets the value of [definition][crate::model::CustomTargetType::definition].
4402    ///
4403    /// Note that all the setters affecting `definition` are mutually
4404    /// exclusive.
4405    pub fn set_definition<
4406        T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
4407    >(
4408        mut self,
4409        v: T,
4410    ) -> Self {
4411        self.definition = v.into();
4412        self
4413    }
4414
4415    /// The value of [definition][crate::model::CustomTargetType::definition]
4416    /// if it holds a `CustomActions`, `None` if the field is not set or
4417    /// holds a different branch.
4418    pub fn custom_actions(
4419        &self,
4420    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
4421        #[allow(unreachable_patterns)]
4422        self.definition.as_ref().and_then(|v| match v {
4423            crate::model::custom_target_type::Definition::CustomActions(v) => {
4424                std::option::Option::Some(v)
4425            }
4426            _ => std::option::Option::None,
4427        })
4428    }
4429
4430    /// Sets the value of [definition][crate::model::CustomTargetType::definition]
4431    /// to hold a `CustomActions`.
4432    ///
4433    /// Note that all the setters affecting `definition` are
4434    /// mutually exclusive.
4435    pub fn set_custom_actions<
4436        T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
4437    >(
4438        mut self,
4439        v: T,
4440    ) -> Self {
4441        self.definition = std::option::Option::Some(
4442            crate::model::custom_target_type::Definition::CustomActions(v.into()),
4443        );
4444        self
4445    }
4446}
4447
4448impl wkt::message::Message for CustomTargetType {
4449    fn typename() -> &'static str {
4450        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
4451    }
4452}
4453
4454/// Defines additional types related to [CustomTargetType].
4455pub mod custom_target_type {
4456    #[allow(unused_imports)]
4457    use super::*;
4458
4459    /// Defines the `CustomTargetType` renderer and deployer.
4460    #[derive(Clone, Debug, PartialEq)]
4461    #[non_exhaustive]
4462    pub enum Definition {
4463        /// Optional. Configures render and deploy for the `CustomTargetType` using
4464        /// Skaffold custom actions.
4465        CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
4466    }
4467}
4468
4469/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
4470/// using Skaffold custom actions.
4471#[derive(Clone, Default, PartialEq)]
4472#[non_exhaustive]
4473pub struct CustomTargetSkaffoldActions {
4474    /// Optional. The Skaffold custom action responsible for render operations. If
4475    /// not provided then Cloud Deploy will perform the render operations via
4476    /// `skaffold render`.
4477    pub render_action: std::string::String,
4478
4479    /// Required. The Skaffold custom action responsible for deploy operations.
4480    pub deploy_action: std::string::String,
4481
4482    /// Optional. List of Skaffold modules Cloud Deploy will include in the
4483    /// Skaffold Config as required before performing diagnose.
4484    pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
4485
4486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4487}
4488
4489impl CustomTargetSkaffoldActions {
4490    pub fn new() -> Self {
4491        std::default::Default::default()
4492    }
4493
4494    /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
4495    pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4496        self.render_action = v.into();
4497        self
4498    }
4499
4500    /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
4501    pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4502        self.deploy_action = v.into();
4503        self
4504    }
4505
4506    /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
4507    pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
4508    where
4509        T: std::iter::IntoIterator<Item = V>,
4510        V: std::convert::Into<crate::model::SkaffoldModules>,
4511    {
4512        use std::iter::Iterator;
4513        self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
4514        self
4515    }
4516}
4517
4518impl wkt::message::Message for CustomTargetSkaffoldActions {
4519    fn typename() -> &'static str {
4520        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
4521    }
4522}
4523
4524/// Skaffold Config modules and their remote source.
4525#[derive(Clone, Default, PartialEq)]
4526#[non_exhaustive]
4527pub struct SkaffoldModules {
4528    /// Optional. The Skaffold Config modules to use from the specified source.
4529    pub configs: std::vec::Vec<std::string::String>,
4530
4531    /// The source that contains the Skaffold Config modules.
4532    pub source: std::option::Option<crate::model::skaffold_modules::Source>,
4533
4534    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4535}
4536
4537impl SkaffoldModules {
4538    pub fn new() -> Self {
4539        std::default::Default::default()
4540    }
4541
4542    /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
4543    pub fn set_configs<T, V>(mut self, v: T) -> Self
4544    where
4545        T: std::iter::IntoIterator<Item = V>,
4546        V: std::convert::Into<std::string::String>,
4547    {
4548        use std::iter::Iterator;
4549        self.configs = v.into_iter().map(|i| i.into()).collect();
4550        self
4551    }
4552
4553    /// Sets the value of [source][crate::model::SkaffoldModules::source].
4554    ///
4555    /// Note that all the setters affecting `source` are mutually
4556    /// exclusive.
4557    pub fn set_source<
4558        T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
4559    >(
4560        mut self,
4561        v: T,
4562    ) -> Self {
4563        self.source = v.into();
4564        self
4565    }
4566
4567    /// The value of [source][crate::model::SkaffoldModules::source]
4568    /// if it holds a `Git`, `None` if the field is not set or
4569    /// holds a different branch.
4570    pub fn git(
4571        &self,
4572    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
4573    {
4574        #[allow(unreachable_patterns)]
4575        self.source.as_ref().and_then(|v| match v {
4576            crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
4577            _ => std::option::Option::None,
4578        })
4579    }
4580
4581    /// Sets the value of [source][crate::model::SkaffoldModules::source]
4582    /// to hold a `Git`.
4583    ///
4584    /// Note that all the setters affecting `source` are
4585    /// mutually exclusive.
4586    pub fn set_git<
4587        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
4588    >(
4589        mut self,
4590        v: T,
4591    ) -> Self {
4592        self.source =
4593            std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
4594        self
4595    }
4596
4597    /// The value of [source][crate::model::SkaffoldModules::source]
4598    /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
4599    /// holds a different branch.
4600    pub fn google_cloud_storage(
4601        &self,
4602    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
4603    {
4604        #[allow(unreachable_patterns)]
4605        self.source.as_ref().and_then(|v| match v {
4606            crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
4607                std::option::Option::Some(v)
4608            }
4609            _ => std::option::Option::None,
4610        })
4611    }
4612
4613    /// Sets the value of [source][crate::model::SkaffoldModules::source]
4614    /// to hold a `GoogleCloudStorage`.
4615    ///
4616    /// Note that all the setters affecting `source` are
4617    /// mutually exclusive.
4618    pub fn set_google_cloud_storage<
4619        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
4620    >(
4621        mut self,
4622        v: T,
4623    ) -> Self {
4624        self.source = std::option::Option::Some(
4625            crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
4626        );
4627        self
4628    }
4629
4630    /// The value of [source][crate::model::SkaffoldModules::source]
4631    /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
4632    /// holds a different branch.
4633    pub fn google_cloud_build_repo(
4634        &self,
4635    ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
4636    {
4637        #[allow(unreachable_patterns)]
4638        self.source.as_ref().and_then(|v| match v {
4639            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
4640                std::option::Option::Some(v)
4641            }
4642            _ => std::option::Option::None,
4643        })
4644    }
4645
4646    /// Sets the value of [source][crate::model::SkaffoldModules::source]
4647    /// to hold a `GoogleCloudBuildRepo`.
4648    ///
4649    /// Note that all the setters affecting `source` are
4650    /// mutually exclusive.
4651    pub fn set_google_cloud_build_repo<
4652        T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
4653    >(
4654        mut self,
4655        v: T,
4656    ) -> Self {
4657        self.source = std::option::Option::Some(
4658            crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
4659        );
4660        self
4661    }
4662}
4663
4664impl wkt::message::Message for SkaffoldModules {
4665    fn typename() -> &'static str {
4666        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
4667    }
4668}
4669
4670/// Defines additional types related to [SkaffoldModules].
4671pub mod skaffold_modules {
4672    #[allow(unused_imports)]
4673    use super::*;
4674
4675    /// Git repository containing Skaffold Config modules.
4676    #[derive(Clone, Default, PartialEq)]
4677    #[non_exhaustive]
4678    pub struct SkaffoldGitSource {
4679        /// Required. Git repository the package should be cloned from.
4680        pub repo: std::string::String,
4681
4682        /// Optional. Relative path from the repository root to the Skaffold file.
4683        pub path: std::string::String,
4684
4685        /// Optional. Git branch or tag to use when cloning the repository.
4686        pub r#ref: std::string::String,
4687
4688        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4689    }
4690
4691    impl SkaffoldGitSource {
4692        pub fn new() -> Self {
4693            std::default::Default::default()
4694        }
4695
4696        /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
4697        pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4698            self.repo = v.into();
4699            self
4700        }
4701
4702        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
4703        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4704            self.path = v.into();
4705            self
4706        }
4707
4708        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
4709        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4710            self.r#ref = v.into();
4711            self
4712        }
4713    }
4714
4715    impl wkt::message::Message for SkaffoldGitSource {
4716        fn typename() -> &'static str {
4717            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
4718        }
4719    }
4720
4721    /// Cloud Storage bucket containing Skaffold Config modules.
4722    #[derive(Clone, Default, PartialEq)]
4723    #[non_exhaustive]
4724    pub struct SkaffoldGCSSource {
4725        /// Required. Cloud Storage source paths to copy recursively. For example,
4726        /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
4727        /// all files within the "dir/configs" directory in the bucket "my-bucket".
4728        pub source: std::string::String,
4729
4730        /// Optional. Relative path from the source to the Skaffold file.
4731        pub path: std::string::String,
4732
4733        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4734    }
4735
4736    impl SkaffoldGCSSource {
4737        pub fn new() -> Self {
4738            std::default::Default::default()
4739        }
4740
4741        /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
4742        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4743            self.source = v.into();
4744            self
4745        }
4746
4747        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
4748        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4749            self.path = v.into();
4750            self
4751        }
4752    }
4753
4754    impl wkt::message::Message for SkaffoldGCSSource {
4755        fn typename() -> &'static str {
4756            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
4757        }
4758    }
4759
4760    /// Cloud Build V2 Repository containing Skaffold Configs.
4761    #[derive(Clone, Default, PartialEq)]
4762    #[non_exhaustive]
4763    pub struct SkaffoldGCBRepoSource {
4764        /// Required. Name of the Cloud Build V2 Repository.
4765        /// Format is
4766        /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
4767        pub repository: std::string::String,
4768
4769        /// Optional. Relative path from the repository root to the Skaffold Config
4770        /// file.
4771        pub path: std::string::String,
4772
4773        /// Optional. Branch or tag to use when cloning the repository.
4774        pub r#ref: std::string::String,
4775
4776        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4777    }
4778
4779    impl SkaffoldGCBRepoSource {
4780        pub fn new() -> Self {
4781            std::default::Default::default()
4782        }
4783
4784        /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
4785        pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786            self.repository = v.into();
4787            self
4788        }
4789
4790        /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
4791        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4792            self.path = v.into();
4793            self
4794        }
4795
4796        /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
4797        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4798            self.r#ref = v.into();
4799            self
4800        }
4801    }
4802
4803    impl wkt::message::Message for SkaffoldGCBRepoSource {
4804        fn typename() -> &'static str {
4805            "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
4806        }
4807    }
4808
4809    /// The source that contains the Skaffold Config modules.
4810    #[derive(Clone, Debug, PartialEq)]
4811    #[non_exhaustive]
4812    pub enum Source {
4813        /// Optional. Remote git repository containing the Skaffold Config modules.
4814        Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
4815        /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
4816        GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
4817        /// Optional. Cloud Build V2 repository containing the Skaffold Config
4818        /// modules.
4819        GoogleCloudBuildRepo(
4820            std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
4821        ),
4822    }
4823}
4824
4825/// The request object for `ListCustomTargetTypes`.
4826#[derive(Clone, Default, PartialEq)]
4827#[non_exhaustive]
4828pub struct ListCustomTargetTypesRequest {
4829    /// Required. The parent that owns this collection of custom target types.
4830    /// Format must be `projects/{project_id}/locations/{location_name}`.
4831    pub parent: std::string::String,
4832
4833    /// Optional. The maximum number of `CustomTargetType` objects to return. The
4834    /// service may return fewer than this value. If unspecified, at most 50
4835    /// `CustomTargetType` objects will be returned. The maximum value is 1000;
4836    /// values above 1000 will be set to 1000.
4837    pub page_size: i32,
4838
4839    /// Optional. A page token, received from a previous `ListCustomTargetTypes`
4840    /// call. Provide this to retrieve the subsequent page.
4841    ///
4842    /// When paginating, all other provided parameters match
4843    /// the call that provided the page token.
4844    pub page_token: std::string::String,
4845
4846    /// Optional. Filter custom target types to be returned. See
4847    /// <https://google.aip.dev/160> for more details.
4848    pub filter: std::string::String,
4849
4850    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
4851    /// more details.
4852    pub order_by: std::string::String,
4853
4854    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4855}
4856
4857impl ListCustomTargetTypesRequest {
4858    pub fn new() -> Self {
4859        std::default::Default::default()
4860    }
4861
4862    /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
4863    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4864        self.parent = v.into();
4865        self
4866    }
4867
4868    /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
4869    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4870        self.page_size = v.into();
4871        self
4872    }
4873
4874    /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
4875    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4876        self.page_token = v.into();
4877        self
4878    }
4879
4880    /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
4881    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4882        self.filter = v.into();
4883        self
4884    }
4885
4886    /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
4887    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4888        self.order_by = v.into();
4889        self
4890    }
4891}
4892
4893impl wkt::message::Message for ListCustomTargetTypesRequest {
4894    fn typename() -> &'static str {
4895        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
4896    }
4897}
4898
4899/// The response object from `ListCustomTargetTypes.`
4900#[derive(Clone, Default, PartialEq)]
4901#[non_exhaustive]
4902pub struct ListCustomTargetTypesResponse {
4903    /// The `CustomTargetType` objects.
4904    pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
4905
4906    /// A token, which can be sent as `page_token` to retrieve the next page.
4907    /// If this field is omitted, there are no subsequent pages.
4908    pub next_page_token: std::string::String,
4909
4910    /// Locations that could not be reached.
4911    pub unreachable: std::vec::Vec<std::string::String>,
4912
4913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4914}
4915
4916impl ListCustomTargetTypesResponse {
4917    pub fn new() -> Self {
4918        std::default::Default::default()
4919    }
4920
4921    /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
4922    pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
4923    where
4924        T: std::iter::IntoIterator<Item = V>,
4925        V: std::convert::Into<crate::model::CustomTargetType>,
4926    {
4927        use std::iter::Iterator;
4928        self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
4929        self
4930    }
4931
4932    /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
4933    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4934        self.next_page_token = v.into();
4935        self
4936    }
4937
4938    /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
4939    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4940    where
4941        T: std::iter::IntoIterator<Item = V>,
4942        V: std::convert::Into<std::string::String>,
4943    {
4944        use std::iter::Iterator;
4945        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4946        self
4947    }
4948}
4949
4950impl wkt::message::Message for ListCustomTargetTypesResponse {
4951    fn typename() -> &'static str {
4952        "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
4953    }
4954}
4955
4956#[doc(hidden)]
4957impl gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
4958    type PageItem = crate::model::CustomTargetType;
4959
4960    fn items(self) -> std::vec::Vec<Self::PageItem> {
4961        self.custom_target_types
4962    }
4963
4964    fn next_page_token(&self) -> std::string::String {
4965        use std::clone::Clone;
4966        self.next_page_token.clone()
4967    }
4968}
4969
4970/// The request object for `GetCustomTargetType`.
4971#[derive(Clone, Default, PartialEq)]
4972#[non_exhaustive]
4973pub struct GetCustomTargetTypeRequest {
4974    /// Required. Name of the `CustomTargetType`. Format must be
4975    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
4976    pub name: std::string::String,
4977
4978    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4979}
4980
4981impl GetCustomTargetTypeRequest {
4982    pub fn new() -> Self {
4983        std::default::Default::default()
4984    }
4985
4986    /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
4987    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4988        self.name = v.into();
4989        self
4990    }
4991}
4992
4993impl wkt::message::Message for GetCustomTargetTypeRequest {
4994    fn typename() -> &'static str {
4995        "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
4996    }
4997}
4998
4999/// The request object for `CreateCustomTargetType`.
5000#[derive(Clone, Default, PartialEq)]
5001#[non_exhaustive]
5002pub struct CreateCustomTargetTypeRequest {
5003    /// Required. The parent collection in which the `CustomTargetType` must be
5004    /// created. The format is `projects/{project_id}/locations/{location_name}`.
5005    pub parent: std::string::String,
5006
5007    /// Required. ID of the `CustomTargetType`.
5008    pub custom_target_type_id: std::string::String,
5009
5010    /// Required. The `CustomTargetType` to create.
5011    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
5012
5013    /// Optional. A request ID to identify requests. Specify a unique request ID
5014    /// so that if you must retry your request, the server knows to ignore the
5015    /// request if it has already been completed. The server guarantees that for
5016    /// at least 60 minutes after the first request.
5017    ///
5018    /// For example, consider a situation where you make an initial request and the
5019    /// request times out. If you make the request again with the same request ID,
5020    /// the server can check if original operation with the same request ID was
5021    /// received, and if so, will ignore the second request. This prevents clients
5022    /// from accidentally creating duplicate commitments.
5023    ///
5024    /// The request ID must be a valid UUID with the exception that zero UUID is
5025    /// not supported (00000000-0000-0000-0000-000000000000).
5026    pub request_id: std::string::String,
5027
5028    /// Optional. If set to true, the request is validated and the user is provided
5029    /// with an expected result, but no actual change is made.
5030    pub validate_only: bool,
5031
5032    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5033}
5034
5035impl CreateCustomTargetTypeRequest {
5036    pub fn new() -> Self {
5037        std::default::Default::default()
5038    }
5039
5040    /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
5041    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5042        self.parent = v.into();
5043        self
5044    }
5045
5046    /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
5047    pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5048        mut self,
5049        v: T,
5050    ) -> Self {
5051        self.custom_target_type_id = v.into();
5052        self
5053    }
5054
5055    /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
5056    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
5057    where
5058        T: std::convert::Into<crate::model::CustomTargetType>,
5059    {
5060        self.custom_target_type = std::option::Option::Some(v.into());
5061        self
5062    }
5063
5064    /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
5065    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
5066    where
5067        T: std::convert::Into<crate::model::CustomTargetType>,
5068    {
5069        self.custom_target_type = v.map(|x| x.into());
5070        self
5071    }
5072
5073    /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
5074    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5075        self.request_id = v.into();
5076        self
5077    }
5078
5079    /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
5080    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5081        self.validate_only = v.into();
5082        self
5083    }
5084}
5085
5086impl wkt::message::Message for CreateCustomTargetTypeRequest {
5087    fn typename() -> &'static str {
5088        "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
5089    }
5090}
5091
5092/// The request object for `UpdateCustomTargetType`.
5093#[derive(Clone, Default, PartialEq)]
5094#[non_exhaustive]
5095pub struct UpdateCustomTargetTypeRequest {
5096    /// Required. Field mask is used to specify the fields to be overwritten by the
5097    /// update in the `CustomTargetType` resource. The fields specified in the
5098    /// update_mask are relative to the resource, not the full request. A field
5099    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
5100    /// then all fields are overwritten.
5101    pub update_mask: std::option::Option<wkt::FieldMask>,
5102
5103    /// Required. The `CustomTargetType` to update.
5104    pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
5105
5106    /// Optional. A request ID to identify requests. Specify a unique request ID
5107    /// so that if you must retry your request, the server knows to ignore the
5108    /// request if it has already been completed. The server guarantees that for
5109    /// at least 60 minutes after the first request.
5110    ///
5111    /// For example, consider a situation where you make an initial request and the
5112    /// request times out. If you make the request again with the same request ID,
5113    /// the server can check if original operation with the same request ID was
5114    /// received, and if so, will ignore the second request. This prevents clients
5115    /// from accidentally creating duplicate commitments.
5116    ///
5117    /// The request ID must be a valid UUID with the exception that zero UUID is
5118    /// not supported (00000000-0000-0000-0000-000000000000).
5119    pub request_id: std::string::String,
5120
5121    /// Optional. If set to true, updating a `CustomTargetType` that does not exist
5122    /// will result in the creation of a new `CustomTargetType`.
5123    pub allow_missing: bool,
5124
5125    /// Optional. If set to true, the request is validated and the user is provided
5126    /// with an expected result, but no actual change is made.
5127    pub validate_only: bool,
5128
5129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5130}
5131
5132impl UpdateCustomTargetTypeRequest {
5133    pub fn new() -> Self {
5134        std::default::Default::default()
5135    }
5136
5137    /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
5138    pub fn set_update_mask<T>(mut self, v: T) -> Self
5139    where
5140        T: std::convert::Into<wkt::FieldMask>,
5141    {
5142        self.update_mask = std::option::Option::Some(v.into());
5143        self
5144    }
5145
5146    /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
5147    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5148    where
5149        T: std::convert::Into<wkt::FieldMask>,
5150    {
5151        self.update_mask = v.map(|x| x.into());
5152        self
5153    }
5154
5155    /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
5156    pub fn set_custom_target_type<T>(mut self, v: T) -> Self
5157    where
5158        T: std::convert::Into<crate::model::CustomTargetType>,
5159    {
5160        self.custom_target_type = std::option::Option::Some(v.into());
5161        self
5162    }
5163
5164    /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
5165    pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
5166    where
5167        T: std::convert::Into<crate::model::CustomTargetType>,
5168    {
5169        self.custom_target_type = v.map(|x| x.into());
5170        self
5171    }
5172
5173    /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
5174    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5175        self.request_id = v.into();
5176        self
5177    }
5178
5179    /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
5180    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5181        self.allow_missing = v.into();
5182        self
5183    }
5184
5185    /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
5186    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5187        self.validate_only = v.into();
5188        self
5189    }
5190}
5191
5192impl wkt::message::Message for UpdateCustomTargetTypeRequest {
5193    fn typename() -> &'static str {
5194        "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
5195    }
5196}
5197
5198/// The request object for `DeleteCustomTargetType`.
5199#[derive(Clone, Default, PartialEq)]
5200#[non_exhaustive]
5201pub struct DeleteCustomTargetTypeRequest {
5202    /// Required. The name of the `CustomTargetType` to delete. Format must be
5203    /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
5204    pub name: std::string::String,
5205
5206    /// Optional. A request ID to identify requests. Specify a unique request ID
5207    /// so that if you must retry your request, the server knows to ignore the
5208    /// request if it has already been completed. The server guarantees that for
5209    /// at least 60 minutes after the first request.
5210    ///
5211    /// For example, consider a situation where you make an initial request and the
5212    /// request times out. If you make the request again with the same request ID,
5213    /// the server can check if original operation with the same request ID was
5214    /// received, and if so, will ignore the second request. This prevents clients
5215    /// from accidentally creating duplicate commitments.
5216    ///
5217    /// The request ID must be a valid UUID with the exception that zero UUID is
5218    /// not supported (00000000-0000-0000-0000-000000000000).
5219    pub request_id: std::string::String,
5220
5221    /// Optional. If set to true, then deleting an already deleted or non-existing
5222    /// `CustomTargetType` will succeed.
5223    pub allow_missing: bool,
5224
5225    /// Optional. If set to true, the request is validated but no actual change is
5226    /// made.
5227    pub validate_only: bool,
5228
5229    /// Optional. This checksum is computed by the server based on the value of
5230    /// other fields, and may be sent on update and delete requests to ensure the
5231    /// client has an up-to-date value before proceeding.
5232    pub etag: std::string::String,
5233
5234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5235}
5236
5237impl DeleteCustomTargetTypeRequest {
5238    pub fn new() -> Self {
5239        std::default::Default::default()
5240    }
5241
5242    /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
5243    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5244        self.name = v.into();
5245        self
5246    }
5247
5248    /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
5249    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5250        self.request_id = v.into();
5251        self
5252    }
5253
5254    /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
5255    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5256        self.allow_missing = v.into();
5257        self
5258    }
5259
5260    /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
5261    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5262        self.validate_only = v.into();
5263        self
5264    }
5265
5266    /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
5267    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5268        self.etag = v.into();
5269        self
5270    }
5271}
5272
5273impl wkt::message::Message for DeleteCustomTargetTypeRequest {
5274    fn typename() -> &'static str {
5275        "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
5276    }
5277}
5278
5279/// A `DeployPolicy` resource in the Cloud Deploy API.
5280///
5281/// A `DeployPolicy` inhibits manual or automation-driven actions within a
5282/// Delivery Pipeline or Target.
5283#[derive(Clone, Default, PartialEq)]
5284#[non_exhaustive]
5285pub struct DeployPolicy {
5286    /// Output only. Name of the `DeployPolicy`. Format is
5287    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
5288    /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5289    pub name: std::string::String,
5290
5291    /// Output only. Unique identifier of the `DeployPolicy`.
5292    pub uid: std::string::String,
5293
5294    /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
5295    pub description: std::string::String,
5296
5297    /// Optional. User annotations. These attributes can only be set and used by
5298    /// the user, and not by Cloud Deploy. Annotations must meet the following
5299    /// constraints:
5300    ///
5301    /// * Annotations are key/value pairs.
5302    /// * Valid annotation keys have two segments: an optional prefix and name,
5303    ///   separated by a slash (`/`).
5304    /// * The name segment is required and must be 63 characters or less,
5305    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
5306    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
5307    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
5308    ///   a series of DNS labels separated by dots(`.`), not longer than 253
5309    ///   characters in total, followed by a slash (`/`).
5310    ///
5311    /// See
5312    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
5313    /// for more details.
5314    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5315
5316    /// Labels are attributes that can be set and used by both the
5317    /// user and by Cloud Deploy. Labels must meet the following constraints:
5318    ///
5319    /// * Keys and values can contain only lowercase letters, numeric characters,
5320    ///   underscores, and dashes.
5321    /// * All characters must use UTF-8 encoding, and international characters are
5322    ///   allowed.
5323    /// * Keys must start with a lowercase letter or international character.
5324    /// * Each resource is limited to a maximum of 64 labels.
5325    ///
5326    /// Both keys and values are additionally constrained to be <= 128 bytes.
5327    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5328
5329    /// Output only. Time at which the deploy policy was created.
5330    pub create_time: std::option::Option<wkt::Timestamp>,
5331
5332    /// Output only. Most recent time at which the deploy policy was updated.
5333    pub update_time: std::option::Option<wkt::Timestamp>,
5334
5335    /// Optional. When suspended, the policy will not prevent actions from
5336    /// occurring, even if the action violates the policy.
5337    pub suspended: bool,
5338
5339    /// Required. Selected resources to which the policy will be applied. At least
5340    /// one selector is required. If one selector matches the resource the policy
5341    /// applies. For example, if there are two selectors and the action being
5342    /// attempted matches one of them, the policy will apply to that action.
5343    pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
5344
5345    /// Required. Rules to apply. At least one rule must be present.
5346    pub rules: std::vec::Vec<crate::model::PolicyRule>,
5347
5348    /// The weak etag of the `DeployPolicy` resource.
5349    /// This checksum is computed by the server based on the value of other
5350    /// fields, and may be sent on update and delete requests to ensure the
5351    /// client has an up-to-date value before proceeding.
5352    pub etag: std::string::String,
5353
5354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5355}
5356
5357impl DeployPolicy {
5358    pub fn new() -> Self {
5359        std::default::Default::default()
5360    }
5361
5362    /// Sets the value of [name][crate::model::DeployPolicy::name].
5363    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5364        self.name = v.into();
5365        self
5366    }
5367
5368    /// Sets the value of [uid][crate::model::DeployPolicy::uid].
5369    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5370        self.uid = v.into();
5371        self
5372    }
5373
5374    /// Sets the value of [description][crate::model::DeployPolicy::description].
5375    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5376        self.description = v.into();
5377        self
5378    }
5379
5380    /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
5381    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5382    where
5383        T: std::iter::IntoIterator<Item = (K, V)>,
5384        K: std::convert::Into<std::string::String>,
5385        V: std::convert::Into<std::string::String>,
5386    {
5387        use std::iter::Iterator;
5388        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5389        self
5390    }
5391
5392    /// Sets the value of [labels][crate::model::DeployPolicy::labels].
5393    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5394    where
5395        T: std::iter::IntoIterator<Item = (K, V)>,
5396        K: std::convert::Into<std::string::String>,
5397        V: std::convert::Into<std::string::String>,
5398    {
5399        use std::iter::Iterator;
5400        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5401        self
5402    }
5403
5404    /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
5405    pub fn set_create_time<T>(mut self, v: T) -> Self
5406    where
5407        T: std::convert::Into<wkt::Timestamp>,
5408    {
5409        self.create_time = std::option::Option::Some(v.into());
5410        self
5411    }
5412
5413    /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
5414    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5415    where
5416        T: std::convert::Into<wkt::Timestamp>,
5417    {
5418        self.create_time = v.map(|x| x.into());
5419        self
5420    }
5421
5422    /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
5423    pub fn set_update_time<T>(mut self, v: T) -> Self
5424    where
5425        T: std::convert::Into<wkt::Timestamp>,
5426    {
5427        self.update_time = std::option::Option::Some(v.into());
5428        self
5429    }
5430
5431    /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
5432    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5433    where
5434        T: std::convert::Into<wkt::Timestamp>,
5435    {
5436        self.update_time = v.map(|x| x.into());
5437        self
5438    }
5439
5440    /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
5441    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5442        self.suspended = v.into();
5443        self
5444    }
5445
5446    /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
5447    pub fn set_selectors<T, V>(mut self, v: T) -> Self
5448    where
5449        T: std::iter::IntoIterator<Item = V>,
5450        V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
5451    {
5452        use std::iter::Iterator;
5453        self.selectors = v.into_iter().map(|i| i.into()).collect();
5454        self
5455    }
5456
5457    /// Sets the value of [rules][crate::model::DeployPolicy::rules].
5458    pub fn set_rules<T, V>(mut self, v: T) -> Self
5459    where
5460        T: std::iter::IntoIterator<Item = V>,
5461        V: std::convert::Into<crate::model::PolicyRule>,
5462    {
5463        use std::iter::Iterator;
5464        self.rules = v.into_iter().map(|i| i.into()).collect();
5465        self
5466    }
5467
5468    /// Sets the value of [etag][crate::model::DeployPolicy::etag].
5469    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5470        self.etag = v.into();
5471        self
5472    }
5473}
5474
5475impl wkt::message::Message for DeployPolicy {
5476    fn typename() -> &'static str {
5477        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
5478    }
5479}
5480
5481/// Defines additional types related to [DeployPolicy].
5482pub mod deploy_policy {
5483    #[allow(unused_imports)]
5484    use super::*;
5485
5486    /// What invoked the action. Filters enforcing the policy depending on what
5487    /// invoked the action.
5488    ///
5489    /// # Working with unknown values
5490    ///
5491    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5492    /// additional enum variants at any time. Adding new variants is not considered
5493    /// a breaking change. Applications should write their code in anticipation of:
5494    ///
5495    /// - New values appearing in future releases of the client library, **and**
5496    /// - New values received dynamically, without application changes.
5497    ///
5498    /// Please consult the [Working with enums] section in the user guide for some
5499    /// guidelines.
5500    ///
5501    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5502    #[derive(Clone, Debug, PartialEq)]
5503    #[non_exhaustive]
5504    pub enum Invoker {
5505        /// Unspecified.
5506        Unspecified,
5507        /// The action is user-driven. For example, creating a rollout manually via a
5508        /// gcloud create command.
5509        User,
5510        /// Automated action by Cloud Deploy.
5511        DeployAutomation,
5512        /// If set, the enum was initialized with an unknown value.
5513        ///
5514        /// Applications can examine the value using [Invoker::value] or
5515        /// [Invoker::name].
5516        UnknownValue(invoker::UnknownValue),
5517    }
5518
5519    #[doc(hidden)]
5520    pub mod invoker {
5521        #[allow(unused_imports)]
5522        use super::*;
5523        #[derive(Clone, Debug, PartialEq)]
5524        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5525    }
5526
5527    impl Invoker {
5528        /// Gets the enum value.
5529        ///
5530        /// Returns `None` if the enum contains an unknown value deserialized from
5531        /// the string representation of enums.
5532        pub fn value(&self) -> std::option::Option<i32> {
5533            match self {
5534                Self::Unspecified => std::option::Option::Some(0),
5535                Self::User => std::option::Option::Some(1),
5536                Self::DeployAutomation => std::option::Option::Some(2),
5537                Self::UnknownValue(u) => u.0.value(),
5538            }
5539        }
5540
5541        /// Gets the enum value as a string.
5542        ///
5543        /// Returns `None` if the enum contains an unknown value deserialized from
5544        /// the integer representation of enums.
5545        pub fn name(&self) -> std::option::Option<&str> {
5546            match self {
5547                Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
5548                Self::User => std::option::Option::Some("USER"),
5549                Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
5550                Self::UnknownValue(u) => u.0.name(),
5551            }
5552        }
5553    }
5554
5555    impl std::default::Default for Invoker {
5556        fn default() -> Self {
5557            use std::convert::From;
5558            Self::from(0)
5559        }
5560    }
5561
5562    impl std::fmt::Display for Invoker {
5563        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5564            wkt::internal::display_enum(f, self.name(), self.value())
5565        }
5566    }
5567
5568    impl std::convert::From<i32> for Invoker {
5569        fn from(value: i32) -> Self {
5570            match value {
5571                0 => Self::Unspecified,
5572                1 => Self::User,
5573                2 => Self::DeployAutomation,
5574                _ => Self::UnknownValue(invoker::UnknownValue(
5575                    wkt::internal::UnknownEnumValue::Integer(value),
5576                )),
5577            }
5578        }
5579    }
5580
5581    impl std::convert::From<&str> for Invoker {
5582        fn from(value: &str) -> Self {
5583            use std::string::ToString;
5584            match value {
5585                "INVOKER_UNSPECIFIED" => Self::Unspecified,
5586                "USER" => Self::User,
5587                "DEPLOY_AUTOMATION" => Self::DeployAutomation,
5588                _ => Self::UnknownValue(invoker::UnknownValue(
5589                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5590                )),
5591            }
5592        }
5593    }
5594
5595    impl serde::ser::Serialize for Invoker {
5596        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5597        where
5598            S: serde::Serializer,
5599        {
5600            match self {
5601                Self::Unspecified => serializer.serialize_i32(0),
5602                Self::User => serializer.serialize_i32(1),
5603                Self::DeployAutomation => serializer.serialize_i32(2),
5604                Self::UnknownValue(u) => u.0.serialize(serializer),
5605            }
5606        }
5607    }
5608
5609    impl<'de> serde::de::Deserialize<'de> for Invoker {
5610        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5611        where
5612            D: serde::Deserializer<'de>,
5613        {
5614            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
5615                ".google.cloud.deploy.v1.DeployPolicy.Invoker",
5616            ))
5617        }
5618    }
5619}
5620
5621/// Contains information on the resources to select for a deploy policy.
5622/// Attributes provided must all match the resource in order for policy
5623/// restrictions to apply. For example, if delivery pipelines attributes given
5624/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
5625/// match both that id and have that label in order to be subject to the policy.
5626#[derive(Clone, Default, PartialEq)]
5627#[non_exhaustive]
5628pub struct DeployPolicyResourceSelector {
5629    /// Optional. Contains attributes about a delivery pipeline.
5630    pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
5631
5632    /// Optional. Contains attributes about a target.
5633    pub target: std::option::Option<crate::model::TargetAttribute>,
5634
5635    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5636}
5637
5638impl DeployPolicyResourceSelector {
5639    pub fn new() -> Self {
5640        std::default::Default::default()
5641    }
5642
5643    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
5644    pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
5645    where
5646        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
5647    {
5648        self.delivery_pipeline = std::option::Option::Some(v.into());
5649        self
5650    }
5651
5652    /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
5653    pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
5654    where
5655        T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
5656    {
5657        self.delivery_pipeline = v.map(|x| x.into());
5658        self
5659    }
5660
5661    /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
5662    pub fn set_target<T>(mut self, v: T) -> Self
5663    where
5664        T: std::convert::Into<crate::model::TargetAttribute>,
5665    {
5666        self.target = std::option::Option::Some(v.into());
5667        self
5668    }
5669
5670    /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
5671    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5672    where
5673        T: std::convert::Into<crate::model::TargetAttribute>,
5674    {
5675        self.target = v.map(|x| x.into());
5676        self
5677    }
5678}
5679
5680impl wkt::message::Message for DeployPolicyResourceSelector {
5681    fn typename() -> &'static str {
5682        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
5683    }
5684}
5685
5686/// Contains criteria for selecting DeliveryPipelines.
5687#[derive(Clone, Default, PartialEq)]
5688#[non_exhaustive]
5689pub struct DeliveryPipelineAttribute {
5690    /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
5691    /// one of the following:
5692    ///
5693    /// * The last segment of a pipeline name
5694    /// * "*", all delivery pipelines in a location
5695    pub id: std::string::String,
5696
5697    /// DeliveryPipeline labels.
5698    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5699
5700    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5701}
5702
5703impl DeliveryPipelineAttribute {
5704    pub fn new() -> Self {
5705        std::default::Default::default()
5706    }
5707
5708    /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
5709    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5710        self.id = v.into();
5711        self
5712    }
5713
5714    /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
5715    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5716    where
5717        T: std::iter::IntoIterator<Item = (K, V)>,
5718        K: std::convert::Into<std::string::String>,
5719        V: std::convert::Into<std::string::String>,
5720    {
5721        use std::iter::Iterator;
5722        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5723        self
5724    }
5725}
5726
5727impl wkt::message::Message for DeliveryPipelineAttribute {
5728    fn typename() -> &'static str {
5729        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
5730    }
5731}
5732
5733/// Contains criteria for selecting Targets. This could be used to select targets
5734/// for a Deploy Policy or for an Automation.
5735#[derive(Clone, Default, PartialEq)]
5736#[non_exhaustive]
5737pub struct TargetAttribute {
5738    /// Optional. ID of the `Target`. The value of this field could be one of the
5739    /// following:
5740    ///
5741    /// * The last segment of a target name
5742    /// * "*", all targets in a location
5743    pub id: std::string::String,
5744
5745    /// Target labels.
5746    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5747
5748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5749}
5750
5751impl TargetAttribute {
5752    pub fn new() -> Self {
5753        std::default::Default::default()
5754    }
5755
5756    /// Sets the value of [id][crate::model::TargetAttribute::id].
5757    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5758        self.id = v.into();
5759        self
5760    }
5761
5762    /// Sets the value of [labels][crate::model::TargetAttribute::labels].
5763    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5764    where
5765        T: std::iter::IntoIterator<Item = (K, V)>,
5766        K: std::convert::Into<std::string::String>,
5767        V: std::convert::Into<std::string::String>,
5768    {
5769        use std::iter::Iterator;
5770        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5771        self
5772    }
5773}
5774
5775impl wkt::message::Message for TargetAttribute {
5776    fn typename() -> &'static str {
5777        "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
5778    }
5779}
5780
5781/// Deploy Policy rule.
5782#[derive(Clone, Default, PartialEq)]
5783#[non_exhaustive]
5784pub struct PolicyRule {
5785    pub rule: std::option::Option<crate::model::policy_rule::Rule>,
5786
5787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5788}
5789
5790impl PolicyRule {
5791    pub fn new() -> Self {
5792        std::default::Default::default()
5793    }
5794
5795    /// Sets the value of [rule][crate::model::PolicyRule::rule].
5796    ///
5797    /// Note that all the setters affecting `rule` are mutually
5798    /// exclusive.
5799    pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
5800        mut self,
5801        v: T,
5802    ) -> Self {
5803        self.rule = v.into();
5804        self
5805    }
5806
5807    /// The value of [rule][crate::model::PolicyRule::rule]
5808    /// if it holds a `RolloutRestriction`, `None` if the field is not set or
5809    /// holds a different branch.
5810    pub fn rollout_restriction(
5811        &self,
5812    ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
5813        #[allow(unreachable_patterns)]
5814        self.rule.as_ref().and_then(|v| match v {
5815            crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
5816            _ => std::option::Option::None,
5817        })
5818    }
5819
5820    /// Sets the value of [rule][crate::model::PolicyRule::rule]
5821    /// to hold a `RolloutRestriction`.
5822    ///
5823    /// Note that all the setters affecting `rule` are
5824    /// mutually exclusive.
5825    pub fn set_rollout_restriction<
5826        T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
5827    >(
5828        mut self,
5829        v: T,
5830    ) -> Self {
5831        self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
5832            v.into(),
5833        ));
5834        self
5835    }
5836}
5837
5838impl wkt::message::Message for PolicyRule {
5839    fn typename() -> &'static str {
5840        "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
5841    }
5842}
5843
5844/// Defines additional types related to [PolicyRule].
5845pub mod policy_rule {
5846    #[allow(unused_imports)]
5847    use super::*;
5848
5849    #[derive(Clone, Debug, PartialEq)]
5850    #[non_exhaustive]
5851    pub enum Rule {
5852        /// Optional. Rollout restrictions.
5853        RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
5854    }
5855}
5856
5857/// Rollout restrictions.
5858#[derive(Clone, Default, PartialEq)]
5859#[non_exhaustive]
5860pub struct RolloutRestriction {
5861    /// Required. Restriction rule ID. Required and must be unique within a
5862    /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
5863    pub id: std::string::String,
5864
5865    /// Optional. What invoked the action. If left empty, all invoker types will be
5866    /// restricted.
5867    pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
5868
5869    /// Optional. Rollout actions to be restricted as part of the policy. If left
5870    /// empty, all actions will be restricted.
5871    pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
5872
5873    /// Required. Time window within which actions are restricted.
5874    pub time_windows: std::option::Option<crate::model::TimeWindows>,
5875
5876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5877}
5878
5879impl RolloutRestriction {
5880    pub fn new() -> Self {
5881        std::default::Default::default()
5882    }
5883
5884    /// Sets the value of [id][crate::model::RolloutRestriction::id].
5885    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5886        self.id = v.into();
5887        self
5888    }
5889
5890    /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
5891    pub fn set_invokers<T, V>(mut self, v: T) -> Self
5892    where
5893        T: std::iter::IntoIterator<Item = V>,
5894        V: std::convert::Into<crate::model::deploy_policy::Invoker>,
5895    {
5896        use std::iter::Iterator;
5897        self.invokers = v.into_iter().map(|i| i.into()).collect();
5898        self
5899    }
5900
5901    /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
5902    pub fn set_actions<T, V>(mut self, v: T) -> Self
5903    where
5904        T: std::iter::IntoIterator<Item = V>,
5905        V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
5906    {
5907        use std::iter::Iterator;
5908        self.actions = v.into_iter().map(|i| i.into()).collect();
5909        self
5910    }
5911
5912    /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
5913    pub fn set_time_windows<T>(mut self, v: T) -> Self
5914    where
5915        T: std::convert::Into<crate::model::TimeWindows>,
5916    {
5917        self.time_windows = std::option::Option::Some(v.into());
5918        self
5919    }
5920
5921    /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
5922    pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
5923    where
5924        T: std::convert::Into<crate::model::TimeWindows>,
5925    {
5926        self.time_windows = v.map(|x| x.into());
5927        self
5928    }
5929}
5930
5931impl wkt::message::Message for RolloutRestriction {
5932    fn typename() -> &'static str {
5933        "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
5934    }
5935}
5936
5937/// Defines additional types related to [RolloutRestriction].
5938pub mod rollout_restriction {
5939    #[allow(unused_imports)]
5940    use super::*;
5941
5942    /// Rollout actions to be restricted as part of the policy.
5943    ///
5944    /// # Working with unknown values
5945    ///
5946    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5947    /// additional enum variants at any time. Adding new variants is not considered
5948    /// a breaking change. Applications should write their code in anticipation of:
5949    ///
5950    /// - New values appearing in future releases of the client library, **and**
5951    /// - New values received dynamically, without application changes.
5952    ///
5953    /// Please consult the [Working with enums] section in the user guide for some
5954    /// guidelines.
5955    ///
5956    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5957    #[derive(Clone, Debug, PartialEq)]
5958    #[non_exhaustive]
5959    pub enum RolloutActions {
5960        /// Unspecified.
5961        Unspecified,
5962        /// Advance the rollout to the next phase.
5963        Advance,
5964        /// Approve the rollout.
5965        Approve,
5966        /// Cancel the rollout.
5967        Cancel,
5968        /// Create a rollout.
5969        Create,
5970        /// Ignore a job result on the rollout.
5971        IgnoreJob,
5972        /// Retry a job for a rollout.
5973        RetryJob,
5974        /// Rollback a rollout.
5975        Rollback,
5976        /// Terminate a jobrun.
5977        TerminateJobrun,
5978        /// If set, the enum was initialized with an unknown value.
5979        ///
5980        /// Applications can examine the value using [RolloutActions::value] or
5981        /// [RolloutActions::name].
5982        UnknownValue(rollout_actions::UnknownValue),
5983    }
5984
5985    #[doc(hidden)]
5986    pub mod rollout_actions {
5987        #[allow(unused_imports)]
5988        use super::*;
5989        #[derive(Clone, Debug, PartialEq)]
5990        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5991    }
5992
5993    impl RolloutActions {
5994        /// Gets the enum value.
5995        ///
5996        /// Returns `None` if the enum contains an unknown value deserialized from
5997        /// the string representation of enums.
5998        pub fn value(&self) -> std::option::Option<i32> {
5999            match self {
6000                Self::Unspecified => std::option::Option::Some(0),
6001                Self::Advance => std::option::Option::Some(1),
6002                Self::Approve => std::option::Option::Some(2),
6003                Self::Cancel => std::option::Option::Some(3),
6004                Self::Create => std::option::Option::Some(4),
6005                Self::IgnoreJob => std::option::Option::Some(5),
6006                Self::RetryJob => std::option::Option::Some(6),
6007                Self::Rollback => std::option::Option::Some(7),
6008                Self::TerminateJobrun => std::option::Option::Some(8),
6009                Self::UnknownValue(u) => u.0.value(),
6010            }
6011        }
6012
6013        /// Gets the enum value as a string.
6014        ///
6015        /// Returns `None` if the enum contains an unknown value deserialized from
6016        /// the integer representation of enums.
6017        pub fn name(&self) -> std::option::Option<&str> {
6018            match self {
6019                Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
6020                Self::Advance => std::option::Option::Some("ADVANCE"),
6021                Self::Approve => std::option::Option::Some("APPROVE"),
6022                Self::Cancel => std::option::Option::Some("CANCEL"),
6023                Self::Create => std::option::Option::Some("CREATE"),
6024                Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
6025                Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
6026                Self::Rollback => std::option::Option::Some("ROLLBACK"),
6027                Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
6028                Self::UnknownValue(u) => u.0.name(),
6029            }
6030        }
6031    }
6032
6033    impl std::default::Default for RolloutActions {
6034        fn default() -> Self {
6035            use std::convert::From;
6036            Self::from(0)
6037        }
6038    }
6039
6040    impl std::fmt::Display for RolloutActions {
6041        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6042            wkt::internal::display_enum(f, self.name(), self.value())
6043        }
6044    }
6045
6046    impl std::convert::From<i32> for RolloutActions {
6047        fn from(value: i32) -> Self {
6048            match value {
6049                0 => Self::Unspecified,
6050                1 => Self::Advance,
6051                2 => Self::Approve,
6052                3 => Self::Cancel,
6053                4 => Self::Create,
6054                5 => Self::IgnoreJob,
6055                6 => Self::RetryJob,
6056                7 => Self::Rollback,
6057                8 => Self::TerminateJobrun,
6058                _ => Self::UnknownValue(rollout_actions::UnknownValue(
6059                    wkt::internal::UnknownEnumValue::Integer(value),
6060                )),
6061            }
6062        }
6063    }
6064
6065    impl std::convert::From<&str> for RolloutActions {
6066        fn from(value: &str) -> Self {
6067            use std::string::ToString;
6068            match value {
6069                "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
6070                "ADVANCE" => Self::Advance,
6071                "APPROVE" => Self::Approve,
6072                "CANCEL" => Self::Cancel,
6073                "CREATE" => Self::Create,
6074                "IGNORE_JOB" => Self::IgnoreJob,
6075                "RETRY_JOB" => Self::RetryJob,
6076                "ROLLBACK" => Self::Rollback,
6077                "TERMINATE_JOBRUN" => Self::TerminateJobrun,
6078                _ => Self::UnknownValue(rollout_actions::UnknownValue(
6079                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6080                )),
6081            }
6082        }
6083    }
6084
6085    impl serde::ser::Serialize for RolloutActions {
6086        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6087        where
6088            S: serde::Serializer,
6089        {
6090            match self {
6091                Self::Unspecified => serializer.serialize_i32(0),
6092                Self::Advance => serializer.serialize_i32(1),
6093                Self::Approve => serializer.serialize_i32(2),
6094                Self::Cancel => serializer.serialize_i32(3),
6095                Self::Create => serializer.serialize_i32(4),
6096                Self::IgnoreJob => serializer.serialize_i32(5),
6097                Self::RetryJob => serializer.serialize_i32(6),
6098                Self::Rollback => serializer.serialize_i32(7),
6099                Self::TerminateJobrun => serializer.serialize_i32(8),
6100                Self::UnknownValue(u) => u.0.serialize(serializer),
6101            }
6102        }
6103    }
6104
6105    impl<'de> serde::de::Deserialize<'de> for RolloutActions {
6106        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6107        where
6108            D: serde::Deserializer<'de>,
6109        {
6110            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
6111                ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
6112            ))
6113        }
6114    }
6115}
6116
6117/// Time windows within which actions are restricted. See the
6118/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
6119/// for more information on how to configure dates/times.
6120#[derive(Clone, Default, PartialEq)]
6121#[non_exhaustive]
6122pub struct TimeWindows {
6123    /// Required. The time zone in IANA format [IANA Time Zone
6124    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
6125    pub time_zone: std::string::String,
6126
6127    /// Optional. One-time windows within which actions are restricted.
6128    pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
6129
6130    /// Optional. Recurring weekly windows within which actions are restricted.
6131    pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
6132
6133    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6134}
6135
6136impl TimeWindows {
6137    pub fn new() -> Self {
6138        std::default::Default::default()
6139    }
6140
6141    /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
6142    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6143        self.time_zone = v.into();
6144        self
6145    }
6146
6147    /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
6148    pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
6149    where
6150        T: std::iter::IntoIterator<Item = V>,
6151        V: std::convert::Into<crate::model::OneTimeWindow>,
6152    {
6153        use std::iter::Iterator;
6154        self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
6155        self
6156    }
6157
6158    /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
6159    pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
6160    where
6161        T: std::iter::IntoIterator<Item = V>,
6162        V: std::convert::Into<crate::model::WeeklyWindow>,
6163    {
6164        use std::iter::Iterator;
6165        self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
6166        self
6167    }
6168}
6169
6170impl wkt::message::Message for TimeWindows {
6171    fn typename() -> &'static str {
6172        "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
6173    }
6174}
6175
6176/// One-time window within which actions are restricted. For example, blocking
6177/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
6178#[derive(Clone, Default, PartialEq)]
6179#[non_exhaustive]
6180pub struct OneTimeWindow {
6181    /// Required. Start date.
6182    pub start_date: std::option::Option<gtype::model::Date>,
6183
6184    /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
6185    pub start_time: std::option::Option<gtype::model::TimeOfDay>,
6186
6187    /// Required. End date.
6188    pub end_date: std::option::Option<gtype::model::Date>,
6189
6190    /// Required. End time (exclusive). You may use 24:00 for the end of the day.
6191    pub end_time: std::option::Option<gtype::model::TimeOfDay>,
6192
6193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6194}
6195
6196impl OneTimeWindow {
6197    pub fn new() -> Self {
6198        std::default::Default::default()
6199    }
6200
6201    /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
6202    pub fn set_start_date<T>(mut self, v: T) -> Self
6203    where
6204        T: std::convert::Into<gtype::model::Date>,
6205    {
6206        self.start_date = std::option::Option::Some(v.into());
6207        self
6208    }
6209
6210    /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
6211    pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
6212    where
6213        T: std::convert::Into<gtype::model::Date>,
6214    {
6215        self.start_date = v.map(|x| x.into());
6216        self
6217    }
6218
6219    /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
6220    pub fn set_start_time<T>(mut self, v: T) -> Self
6221    where
6222        T: std::convert::Into<gtype::model::TimeOfDay>,
6223    {
6224        self.start_time = std::option::Option::Some(v.into());
6225        self
6226    }
6227
6228    /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
6229    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6230    where
6231        T: std::convert::Into<gtype::model::TimeOfDay>,
6232    {
6233        self.start_time = v.map(|x| x.into());
6234        self
6235    }
6236
6237    /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
6238    pub fn set_end_date<T>(mut self, v: T) -> Self
6239    where
6240        T: std::convert::Into<gtype::model::Date>,
6241    {
6242        self.end_date = std::option::Option::Some(v.into());
6243        self
6244    }
6245
6246    /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
6247    pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
6248    where
6249        T: std::convert::Into<gtype::model::Date>,
6250    {
6251        self.end_date = v.map(|x| x.into());
6252        self
6253    }
6254
6255    /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
6256    pub fn set_end_time<T>(mut self, v: T) -> Self
6257    where
6258        T: std::convert::Into<gtype::model::TimeOfDay>,
6259    {
6260        self.end_time = std::option::Option::Some(v.into());
6261        self
6262    }
6263
6264    /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
6265    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6266    where
6267        T: std::convert::Into<gtype::model::TimeOfDay>,
6268    {
6269        self.end_time = v.map(|x| x.into());
6270        self
6271    }
6272}
6273
6274impl wkt::message::Message for OneTimeWindow {
6275    fn typename() -> &'static str {
6276        "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
6277    }
6278}
6279
6280/// Weekly windows. For example, blocking actions every Saturday and Sunday.
6281/// Another example would be blocking actions every weekday from 5pm to midnight.
6282#[derive(Clone, Default, PartialEq)]
6283#[non_exhaustive]
6284pub struct WeeklyWindow {
6285    /// Optional. Days of week. If left empty, all days of the week will be
6286    /// included.
6287    pub days_of_week: std::vec::Vec<gtype::model::DayOfWeek>,
6288
6289    /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
6290    /// If you specify start_time you must also specify end_time. If left empty,
6291    /// this will block for the entire day for the days specified in days_of_week.
6292    pub start_time: std::option::Option<gtype::model::TimeOfDay>,
6293
6294    /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
6295    /// specify end_time you must also specify start_time. If left empty, this will
6296    /// block for the entire day for the days specified in days_of_week.
6297    pub end_time: std::option::Option<gtype::model::TimeOfDay>,
6298
6299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6300}
6301
6302impl WeeklyWindow {
6303    pub fn new() -> Self {
6304        std::default::Default::default()
6305    }
6306
6307    /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
6308    pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
6309    where
6310        T: std::iter::IntoIterator<Item = V>,
6311        V: std::convert::Into<gtype::model::DayOfWeek>,
6312    {
6313        use std::iter::Iterator;
6314        self.days_of_week = v.into_iter().map(|i| i.into()).collect();
6315        self
6316    }
6317
6318    /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
6319    pub fn set_start_time<T>(mut self, v: T) -> Self
6320    where
6321        T: std::convert::Into<gtype::model::TimeOfDay>,
6322    {
6323        self.start_time = std::option::Option::Some(v.into());
6324        self
6325    }
6326
6327    /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
6328    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6329    where
6330        T: std::convert::Into<gtype::model::TimeOfDay>,
6331    {
6332        self.start_time = v.map(|x| x.into());
6333        self
6334    }
6335
6336    /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
6337    pub fn set_end_time<T>(mut self, v: T) -> Self
6338    where
6339        T: std::convert::Into<gtype::model::TimeOfDay>,
6340    {
6341        self.end_time = std::option::Option::Some(v.into());
6342        self
6343    }
6344
6345    /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
6346    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6347    where
6348        T: std::convert::Into<gtype::model::TimeOfDay>,
6349    {
6350        self.end_time = v.map(|x| x.into());
6351        self
6352    }
6353}
6354
6355impl wkt::message::Message for WeeklyWindow {
6356    fn typename() -> &'static str {
6357        "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
6358    }
6359}
6360
6361/// Returned from an action if one or more policies were
6362/// violated, and therefore the action was prevented. Contains information about
6363/// what policies were violated and why.
6364#[derive(Clone, Default, PartialEq)]
6365#[non_exhaustive]
6366pub struct PolicyViolation {
6367    /// Policy violation details.
6368    pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
6369
6370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6371}
6372
6373impl PolicyViolation {
6374    pub fn new() -> Self {
6375        std::default::Default::default()
6376    }
6377
6378    /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
6379    pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
6380    where
6381        T: std::iter::IntoIterator<Item = V>,
6382        V: std::convert::Into<crate::model::PolicyViolationDetails>,
6383    {
6384        use std::iter::Iterator;
6385        self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
6386        self
6387    }
6388}
6389
6390impl wkt::message::Message for PolicyViolation {
6391    fn typename() -> &'static str {
6392        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
6393    }
6394}
6395
6396/// Policy violation details.
6397#[derive(Clone, Default, PartialEq)]
6398#[non_exhaustive]
6399pub struct PolicyViolationDetails {
6400    /// Name of the policy that was violated.
6401    /// Policy resource will be in the format of
6402    /// `projects/{project}/locations/{location}/policies/{policy}`.
6403    pub policy: std::string::String,
6404
6405    /// Id of the rule that triggered the policy violation.
6406    pub rule_id: std::string::String,
6407
6408    /// User readable message about why the request violated a policy. This is not
6409    /// intended for machine parsing.
6410    pub failure_message: std::string::String,
6411
6412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6413}
6414
6415impl PolicyViolationDetails {
6416    pub fn new() -> Self {
6417        std::default::Default::default()
6418    }
6419
6420    /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
6421    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6422        self.policy = v.into();
6423        self
6424    }
6425
6426    /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
6427    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6428        self.rule_id = v.into();
6429        self
6430    }
6431
6432    /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
6433    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6434        self.failure_message = v.into();
6435        self
6436    }
6437}
6438
6439impl wkt::message::Message for PolicyViolationDetails {
6440    fn typename() -> &'static str {
6441        "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
6442    }
6443}
6444
6445/// A `Release` resource in the Cloud Deploy API.
6446///
6447/// A `Release` defines a specific Skaffold configuration instance
6448/// that can be deployed.
6449#[derive(Clone, Default, PartialEq)]
6450#[non_exhaustive]
6451pub struct Release {
6452    /// Identifier. Name of the `Release`. Format is
6453    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
6454    /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
6455    pub name: std::string::String,
6456
6457    /// Output only. Unique identifier of the `Release`.
6458    pub uid: std::string::String,
6459
6460    /// Optional. Description of the `Release`. Max length is 255 characters.
6461    pub description: std::string::String,
6462
6463    /// Optional. User annotations. These attributes can only be set and used by
6464    /// the user, and not by Cloud Deploy. See
6465    /// <https://google.aip.dev/128#annotations> for more details such as format and
6466    /// size limitations.
6467    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6468
6469    /// Labels are attributes that can be set and used by both the
6470    /// user and by Cloud Deploy. Labels must meet the following constraints:
6471    ///
6472    /// * Keys and values can contain only lowercase letters, numeric characters,
6473    ///   underscores, and dashes.
6474    /// * All characters must use UTF-8 encoding, and international characters are
6475    ///   allowed.
6476    /// * Keys must start with a lowercase letter or international character.
6477    /// * Each resource is limited to a maximum of 64 labels.
6478    ///
6479    /// Both keys and values are additionally constrained to be <= 128 bytes.
6480    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6481
6482    /// Output only. Indicates whether this is an abandoned release.
6483    pub abandoned: bool,
6484
6485    /// Output only. Time at which the `Release` was created.
6486    pub create_time: std::option::Option<wkt::Timestamp>,
6487
6488    /// Output only. Time at which the render began.
6489    pub render_start_time: std::option::Option<wkt::Timestamp>,
6490
6491    /// Output only. Time at which the render completed.
6492    pub render_end_time: std::option::Option<wkt::Timestamp>,
6493
6494    /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
6495    /// configuration.
6496    pub skaffold_config_uri: std::string::String,
6497
6498    /// Optional. Filepath of the Skaffold config inside of the config URI.
6499    pub skaffold_config_path: std::string::String,
6500
6501    /// Optional. List of artifacts to pass through to Skaffold command.
6502    pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
6503
6504    /// Output only. Snapshot of the parent pipeline taken at release creation
6505    /// time.
6506    pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
6507
6508    /// Output only. Snapshot of the targets taken at release creation time.
6509    pub target_snapshots: std::vec::Vec<crate::model::Target>,
6510
6511    /// Output only. Snapshot of the custom target types referenced by the targets
6512    /// taken at release creation time.
6513    pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
6514
6515    /// Output only. Current state of the render operation.
6516    pub render_state: crate::model::release::RenderState,
6517
6518    /// This checksum is computed by the server based on the value of other
6519    /// fields, and may be sent on update and delete requests to ensure the
6520    /// client has an up-to-date value before proceeding.
6521    pub etag: std::string::String,
6522
6523    /// Optional. The Skaffold version to use when operating on this release, such
6524    /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
6525    /// set of versions.
6526    ///
6527    /// If unset, the most recent supported Skaffold version will be used.
6528    pub skaffold_version: std::string::String,
6529
6530    /// Output only. Map from target ID to the target artifacts created
6531    /// during the render operation.
6532    pub target_artifacts:
6533        std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
6534
6535    /// Output only. Map from target ID to details of the render operation for that
6536    /// target.
6537    pub target_renders:
6538        std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
6539
6540    /// Output only. Information around the state of the Release.
6541    pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
6542
6543    /// Optional. The deploy parameters to use for all targets in this release.
6544    pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
6545
6546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6547}
6548
6549impl Release {
6550    pub fn new() -> Self {
6551        std::default::Default::default()
6552    }
6553
6554    /// Sets the value of [name][crate::model::Release::name].
6555    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6556        self.name = v.into();
6557        self
6558    }
6559
6560    /// Sets the value of [uid][crate::model::Release::uid].
6561    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6562        self.uid = v.into();
6563        self
6564    }
6565
6566    /// Sets the value of [description][crate::model::Release::description].
6567    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6568        self.description = v.into();
6569        self
6570    }
6571
6572    /// Sets the value of [annotations][crate::model::Release::annotations].
6573    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6574    where
6575        T: std::iter::IntoIterator<Item = (K, V)>,
6576        K: std::convert::Into<std::string::String>,
6577        V: std::convert::Into<std::string::String>,
6578    {
6579        use std::iter::Iterator;
6580        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6581        self
6582    }
6583
6584    /// Sets the value of [labels][crate::model::Release::labels].
6585    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6586    where
6587        T: std::iter::IntoIterator<Item = (K, V)>,
6588        K: std::convert::Into<std::string::String>,
6589        V: std::convert::Into<std::string::String>,
6590    {
6591        use std::iter::Iterator;
6592        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6593        self
6594    }
6595
6596    /// Sets the value of [abandoned][crate::model::Release::abandoned].
6597    pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6598        self.abandoned = v.into();
6599        self
6600    }
6601
6602    /// Sets the value of [create_time][crate::model::Release::create_time].
6603    pub fn set_create_time<T>(mut self, v: T) -> Self
6604    where
6605        T: std::convert::Into<wkt::Timestamp>,
6606    {
6607        self.create_time = std::option::Option::Some(v.into());
6608        self
6609    }
6610
6611    /// Sets or clears the value of [create_time][crate::model::Release::create_time].
6612    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6613    where
6614        T: std::convert::Into<wkt::Timestamp>,
6615    {
6616        self.create_time = v.map(|x| x.into());
6617        self
6618    }
6619
6620    /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
6621    pub fn set_render_start_time<T>(mut self, v: T) -> Self
6622    where
6623        T: std::convert::Into<wkt::Timestamp>,
6624    {
6625        self.render_start_time = std::option::Option::Some(v.into());
6626        self
6627    }
6628
6629    /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
6630    pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6631    where
6632        T: std::convert::Into<wkt::Timestamp>,
6633    {
6634        self.render_start_time = v.map(|x| x.into());
6635        self
6636    }
6637
6638    /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
6639    pub fn set_render_end_time<T>(mut self, v: T) -> Self
6640    where
6641        T: std::convert::Into<wkt::Timestamp>,
6642    {
6643        self.render_end_time = std::option::Option::Some(v.into());
6644        self
6645    }
6646
6647    /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
6648    pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6649    where
6650        T: std::convert::Into<wkt::Timestamp>,
6651    {
6652        self.render_end_time = v.map(|x| x.into());
6653        self
6654    }
6655
6656    /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
6657    pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
6658        mut self,
6659        v: T,
6660    ) -> Self {
6661        self.skaffold_config_uri = v.into();
6662        self
6663    }
6664
6665    /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
6666    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
6667        mut self,
6668        v: T,
6669    ) -> Self {
6670        self.skaffold_config_path = v.into();
6671        self
6672    }
6673
6674    /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
6675    pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
6676    where
6677        T: std::iter::IntoIterator<Item = V>,
6678        V: std::convert::Into<crate::model::BuildArtifact>,
6679    {
6680        use std::iter::Iterator;
6681        self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
6682        self
6683    }
6684
6685    /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
6686    pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
6687    where
6688        T: std::convert::Into<crate::model::DeliveryPipeline>,
6689    {
6690        self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
6691        self
6692    }
6693
6694    /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
6695    pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
6696    where
6697        T: std::convert::Into<crate::model::DeliveryPipeline>,
6698    {
6699        self.delivery_pipeline_snapshot = v.map(|x| x.into());
6700        self
6701    }
6702
6703    /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
6704    pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
6705    where
6706        T: std::iter::IntoIterator<Item = V>,
6707        V: std::convert::Into<crate::model::Target>,
6708    {
6709        use std::iter::Iterator;
6710        self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
6711        self
6712    }
6713
6714    /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
6715    pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
6716    where
6717        T: std::iter::IntoIterator<Item = V>,
6718        V: std::convert::Into<crate::model::CustomTargetType>,
6719    {
6720        use std::iter::Iterator;
6721        self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
6722        self
6723    }
6724
6725    /// Sets the value of [render_state][crate::model::Release::render_state].
6726    pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
6727        mut self,
6728        v: T,
6729    ) -> Self {
6730        self.render_state = v.into();
6731        self
6732    }
6733
6734    /// Sets the value of [etag][crate::model::Release::etag].
6735    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6736        self.etag = v.into();
6737        self
6738    }
6739
6740    /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
6741    pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
6742        mut self,
6743        v: T,
6744    ) -> Self {
6745        self.skaffold_version = v.into();
6746        self
6747    }
6748
6749    /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
6750    pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
6751    where
6752        T: std::iter::IntoIterator<Item = (K, V)>,
6753        K: std::convert::Into<std::string::String>,
6754        V: std::convert::Into<crate::model::TargetArtifact>,
6755    {
6756        use std::iter::Iterator;
6757        self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6758        self
6759    }
6760
6761    /// Sets the value of [target_renders][crate::model::Release::target_renders].
6762    pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
6763    where
6764        T: std::iter::IntoIterator<Item = (K, V)>,
6765        K: std::convert::Into<std::string::String>,
6766        V: std::convert::Into<crate::model::release::TargetRender>,
6767    {
6768        use std::iter::Iterator;
6769        self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6770        self
6771    }
6772
6773    /// Sets the value of [condition][crate::model::Release::condition].
6774    pub fn set_condition<T>(mut self, v: T) -> Self
6775    where
6776        T: std::convert::Into<crate::model::release::ReleaseCondition>,
6777    {
6778        self.condition = std::option::Option::Some(v.into());
6779        self
6780    }
6781
6782    /// Sets or clears the value of [condition][crate::model::Release::condition].
6783    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
6784    where
6785        T: std::convert::Into<crate::model::release::ReleaseCondition>,
6786    {
6787        self.condition = v.map(|x| x.into());
6788        self
6789    }
6790
6791    /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
6792    pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
6793    where
6794        T: std::iter::IntoIterator<Item = (K, V)>,
6795        K: std::convert::Into<std::string::String>,
6796        V: std::convert::Into<std::string::String>,
6797    {
6798        use std::iter::Iterator;
6799        self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6800        self
6801    }
6802}
6803
6804impl wkt::message::Message for Release {
6805    fn typename() -> &'static str {
6806        "type.googleapis.com/google.cloud.deploy.v1.Release"
6807    }
6808}
6809
6810/// Defines additional types related to [Release].
6811pub mod release {
6812    #[allow(unused_imports)]
6813    use super::*;
6814
6815    /// Details of rendering for a single target.
6816    #[derive(Clone, Default, PartialEq)]
6817    #[non_exhaustive]
6818    pub struct TargetRender {
6819        /// Output only. The resource name of the Cloud Build `Build` object that is
6820        /// used to render the manifest for this target. Format is
6821        /// `projects/{project}/locations/{location}/builds/{build}`.
6822        pub rendering_build: std::string::String,
6823
6824        /// Output only. Current state of the render operation for this Target.
6825        pub rendering_state: crate::model::release::target_render::TargetRenderState,
6826
6827        /// Output only. Metadata related to the `Release` render for this Target.
6828        pub metadata: std::option::Option<crate::model::RenderMetadata>,
6829
6830        /// Output only. Reason this render failed. This will always be unspecified
6831        /// while the render in progress.
6832        pub failure_cause: crate::model::release::target_render::FailureCause,
6833
6834        /// Output only. Additional information about the render failure, if
6835        /// available.
6836        pub failure_message: std::string::String,
6837
6838        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6839    }
6840
6841    impl TargetRender {
6842        pub fn new() -> Self {
6843            std::default::Default::default()
6844        }
6845
6846        /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
6847        pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
6848            mut self,
6849            v: T,
6850        ) -> Self {
6851            self.rendering_build = v.into();
6852            self
6853        }
6854
6855        /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
6856        pub fn set_rendering_state<
6857            T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
6858        >(
6859            mut self,
6860            v: T,
6861        ) -> Self {
6862            self.rendering_state = v.into();
6863            self
6864        }
6865
6866        /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
6867        pub fn set_metadata<T>(mut self, v: T) -> Self
6868        where
6869            T: std::convert::Into<crate::model::RenderMetadata>,
6870        {
6871            self.metadata = std::option::Option::Some(v.into());
6872            self
6873        }
6874
6875        /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
6876        pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6877        where
6878            T: std::convert::Into<crate::model::RenderMetadata>,
6879        {
6880            self.metadata = v.map(|x| x.into());
6881            self
6882        }
6883
6884        /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
6885        pub fn set_failure_cause<
6886            T: std::convert::Into<crate::model::release::target_render::FailureCause>,
6887        >(
6888            mut self,
6889            v: T,
6890        ) -> Self {
6891            self.failure_cause = v.into();
6892            self
6893        }
6894
6895        /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
6896        pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
6897            mut self,
6898            v: T,
6899        ) -> Self {
6900            self.failure_message = v.into();
6901            self
6902        }
6903    }
6904
6905    impl wkt::message::Message for TargetRender {
6906        fn typename() -> &'static str {
6907            "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
6908        }
6909    }
6910
6911    /// Defines additional types related to [TargetRender].
6912    pub mod target_render {
6913        #[allow(unused_imports)]
6914        use super::*;
6915
6916        /// Valid states of the render operation.
6917        ///
6918        /// # Working with unknown values
6919        ///
6920        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6921        /// additional enum variants at any time. Adding new variants is not considered
6922        /// a breaking change. Applications should write their code in anticipation of:
6923        ///
6924        /// - New values appearing in future releases of the client library, **and**
6925        /// - New values received dynamically, without application changes.
6926        ///
6927        /// Please consult the [Working with enums] section in the user guide for some
6928        /// guidelines.
6929        ///
6930        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6931        #[derive(Clone, Debug, PartialEq)]
6932        #[non_exhaustive]
6933        pub enum TargetRenderState {
6934            /// The render operation state is unspecified.
6935            Unspecified,
6936            /// The render operation has completed successfully.
6937            Succeeded,
6938            /// The render operation has failed.
6939            Failed,
6940            /// The render operation is in progress.
6941            InProgress,
6942            /// If set, the enum was initialized with an unknown value.
6943            ///
6944            /// Applications can examine the value using [TargetRenderState::value] or
6945            /// [TargetRenderState::name].
6946            UnknownValue(target_render_state::UnknownValue),
6947        }
6948
6949        #[doc(hidden)]
6950        pub mod target_render_state {
6951            #[allow(unused_imports)]
6952            use super::*;
6953            #[derive(Clone, Debug, PartialEq)]
6954            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6955        }
6956
6957        impl TargetRenderState {
6958            /// Gets the enum value.
6959            ///
6960            /// Returns `None` if the enum contains an unknown value deserialized from
6961            /// the string representation of enums.
6962            pub fn value(&self) -> std::option::Option<i32> {
6963                match self {
6964                    Self::Unspecified => std::option::Option::Some(0),
6965                    Self::Succeeded => std::option::Option::Some(1),
6966                    Self::Failed => std::option::Option::Some(2),
6967                    Self::InProgress => std::option::Option::Some(3),
6968                    Self::UnknownValue(u) => u.0.value(),
6969                }
6970            }
6971
6972            /// Gets the enum value as a string.
6973            ///
6974            /// Returns `None` if the enum contains an unknown value deserialized from
6975            /// the integer representation of enums.
6976            pub fn name(&self) -> std::option::Option<&str> {
6977                match self {
6978                    Self::Unspecified => {
6979                        std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
6980                    }
6981                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6982                    Self::Failed => std::option::Option::Some("FAILED"),
6983                    Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
6984                    Self::UnknownValue(u) => u.0.name(),
6985                }
6986            }
6987        }
6988
6989        impl std::default::Default for TargetRenderState {
6990            fn default() -> Self {
6991                use std::convert::From;
6992                Self::from(0)
6993            }
6994        }
6995
6996        impl std::fmt::Display for TargetRenderState {
6997            fn fmt(
6998                &self,
6999                f: &mut std::fmt::Formatter<'_>,
7000            ) -> std::result::Result<(), std::fmt::Error> {
7001                wkt::internal::display_enum(f, self.name(), self.value())
7002            }
7003        }
7004
7005        impl std::convert::From<i32> for TargetRenderState {
7006            fn from(value: i32) -> Self {
7007                match value {
7008                    0 => Self::Unspecified,
7009                    1 => Self::Succeeded,
7010                    2 => Self::Failed,
7011                    3 => Self::InProgress,
7012                    _ => Self::UnknownValue(target_render_state::UnknownValue(
7013                        wkt::internal::UnknownEnumValue::Integer(value),
7014                    )),
7015                }
7016            }
7017        }
7018
7019        impl std::convert::From<&str> for TargetRenderState {
7020            fn from(value: &str) -> Self {
7021                use std::string::ToString;
7022                match value {
7023                    "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
7024                    "SUCCEEDED" => Self::Succeeded,
7025                    "FAILED" => Self::Failed,
7026                    "IN_PROGRESS" => Self::InProgress,
7027                    _ => Self::UnknownValue(target_render_state::UnknownValue(
7028                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7029                    )),
7030                }
7031            }
7032        }
7033
7034        impl serde::ser::Serialize for TargetRenderState {
7035            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7036            where
7037                S: serde::Serializer,
7038            {
7039                match self {
7040                    Self::Unspecified => serializer.serialize_i32(0),
7041                    Self::Succeeded => serializer.serialize_i32(1),
7042                    Self::Failed => serializer.serialize_i32(2),
7043                    Self::InProgress => serializer.serialize_i32(3),
7044                    Self::UnknownValue(u) => u.0.serialize(serializer),
7045                }
7046            }
7047        }
7048
7049        impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
7050            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7051            where
7052                D: serde::Deserializer<'de>,
7053            {
7054                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
7055                    ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
7056                ))
7057            }
7058        }
7059
7060        /// Well-known rendering failures.
7061        ///
7062        /// # Working with unknown values
7063        ///
7064        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7065        /// additional enum variants at any time. Adding new variants is not considered
7066        /// a breaking change. Applications should write their code in anticipation of:
7067        ///
7068        /// - New values appearing in future releases of the client library, **and**
7069        /// - New values received dynamically, without application changes.
7070        ///
7071        /// Please consult the [Working with enums] section in the user guide for some
7072        /// guidelines.
7073        ///
7074        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7075        #[derive(Clone, Debug, PartialEq)]
7076        #[non_exhaustive]
7077        pub enum FailureCause {
7078            /// No reason for failure is specified.
7079            Unspecified,
7080            /// Cloud Build is not available, either because it is not enabled or
7081            /// because Cloud Deploy has insufficient permissions. See [required
7082            /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
7083            CloudBuildUnavailable,
7084            /// The render operation did not complete successfully; check Cloud Build
7085            /// logs.
7086            ExecutionFailed,
7087            /// Cloud Build failed to fulfill Cloud Deploy's request. See
7088            /// failure_message for additional details.
7089            CloudBuildRequestFailed,
7090            /// The render operation did not complete successfully because the
7091            /// verification stanza required for verify was not found on the Skaffold
7092            /// configuration.
7093            VerificationConfigNotFound,
7094            /// The render operation did not complete successfully because the custom
7095            /// action(s) required for Rollout jobs were not found in the Skaffold
7096            /// configuration. See failure_message for additional details.
7097            CustomActionNotFound,
7098            /// Release failed during rendering because the release configuration is
7099            /// not supported with the specified deployment strategy.
7100            DeploymentStrategyNotSupported,
7101            /// The render operation had a feature configured that is not supported.
7102            RenderFeatureNotSupported,
7103            /// If set, the enum was initialized with an unknown value.
7104            ///
7105            /// Applications can examine the value using [FailureCause::value] or
7106            /// [FailureCause::name].
7107            UnknownValue(failure_cause::UnknownValue),
7108        }
7109
7110        #[doc(hidden)]
7111        pub mod failure_cause {
7112            #[allow(unused_imports)]
7113            use super::*;
7114            #[derive(Clone, Debug, PartialEq)]
7115            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7116        }
7117
7118        impl FailureCause {
7119            /// Gets the enum value.
7120            ///
7121            /// Returns `None` if the enum contains an unknown value deserialized from
7122            /// the string representation of enums.
7123            pub fn value(&self) -> std::option::Option<i32> {
7124                match self {
7125                    Self::Unspecified => std::option::Option::Some(0),
7126                    Self::CloudBuildUnavailable => std::option::Option::Some(1),
7127                    Self::ExecutionFailed => std::option::Option::Some(2),
7128                    Self::CloudBuildRequestFailed => std::option::Option::Some(3),
7129                    Self::VerificationConfigNotFound => std::option::Option::Some(4),
7130                    Self::CustomActionNotFound => std::option::Option::Some(5),
7131                    Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
7132                    Self::RenderFeatureNotSupported => std::option::Option::Some(7),
7133                    Self::UnknownValue(u) => u.0.value(),
7134                }
7135            }
7136
7137            /// Gets the enum value as a string.
7138            ///
7139            /// Returns `None` if the enum contains an unknown value deserialized from
7140            /// the integer representation of enums.
7141            pub fn name(&self) -> std::option::Option<&str> {
7142                match self {
7143                    Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
7144                    Self::CloudBuildUnavailable => {
7145                        std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
7146                    }
7147                    Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
7148                    Self::CloudBuildRequestFailed => {
7149                        std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
7150                    }
7151                    Self::VerificationConfigNotFound => {
7152                        std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
7153                    }
7154                    Self::CustomActionNotFound => {
7155                        std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
7156                    }
7157                    Self::DeploymentStrategyNotSupported => {
7158                        std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
7159                    }
7160                    Self::RenderFeatureNotSupported => {
7161                        std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
7162                    }
7163                    Self::UnknownValue(u) => u.0.name(),
7164                }
7165            }
7166        }
7167
7168        impl std::default::Default for FailureCause {
7169            fn default() -> Self {
7170                use std::convert::From;
7171                Self::from(0)
7172            }
7173        }
7174
7175        impl std::fmt::Display for FailureCause {
7176            fn fmt(
7177                &self,
7178                f: &mut std::fmt::Formatter<'_>,
7179            ) -> std::result::Result<(), std::fmt::Error> {
7180                wkt::internal::display_enum(f, self.name(), self.value())
7181            }
7182        }
7183
7184        impl std::convert::From<i32> for FailureCause {
7185            fn from(value: i32) -> Self {
7186                match value {
7187                    0 => Self::Unspecified,
7188                    1 => Self::CloudBuildUnavailable,
7189                    2 => Self::ExecutionFailed,
7190                    3 => Self::CloudBuildRequestFailed,
7191                    4 => Self::VerificationConfigNotFound,
7192                    5 => Self::CustomActionNotFound,
7193                    6 => Self::DeploymentStrategyNotSupported,
7194                    7 => Self::RenderFeatureNotSupported,
7195                    _ => Self::UnknownValue(failure_cause::UnknownValue(
7196                        wkt::internal::UnknownEnumValue::Integer(value),
7197                    )),
7198                }
7199            }
7200        }
7201
7202        impl std::convert::From<&str> for FailureCause {
7203            fn from(value: &str) -> Self {
7204                use std::string::ToString;
7205                match value {
7206                    "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
7207                    "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
7208                    "EXECUTION_FAILED" => Self::ExecutionFailed,
7209                    "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
7210                    "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
7211                    "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
7212                    "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
7213                    "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
7214                    _ => Self::UnknownValue(failure_cause::UnknownValue(
7215                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7216                    )),
7217                }
7218            }
7219        }
7220
7221        impl serde::ser::Serialize for FailureCause {
7222            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7223            where
7224                S: serde::Serializer,
7225            {
7226                match self {
7227                    Self::Unspecified => serializer.serialize_i32(0),
7228                    Self::CloudBuildUnavailable => serializer.serialize_i32(1),
7229                    Self::ExecutionFailed => serializer.serialize_i32(2),
7230                    Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
7231                    Self::VerificationConfigNotFound => serializer.serialize_i32(4),
7232                    Self::CustomActionNotFound => serializer.serialize_i32(5),
7233                    Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
7234                    Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
7235                    Self::UnknownValue(u) => u.0.serialize(serializer),
7236                }
7237            }
7238        }
7239
7240        impl<'de> serde::de::Deserialize<'de> for FailureCause {
7241            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7242            where
7243                D: serde::Deserializer<'de>,
7244            {
7245                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
7246                    ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
7247                ))
7248            }
7249        }
7250    }
7251
7252    /// ReleaseReadyCondition contains information around the status of the
7253    /// Release. If a release is not ready, you cannot create a rollout with the
7254    /// release.
7255    #[derive(Clone, Default, PartialEq)]
7256    #[non_exhaustive]
7257    pub struct ReleaseReadyCondition {
7258        /// True if the Release is in a valid state. Otherwise at least one condition
7259        /// in `ReleaseCondition` is in an invalid state. Iterate over those
7260        /// conditions and see which condition(s) has status = false to find out what
7261        /// is wrong with the Release.
7262        pub status: bool,
7263
7264        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7265    }
7266
7267    impl ReleaseReadyCondition {
7268        pub fn new() -> Self {
7269            std::default::Default::default()
7270        }
7271
7272        /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
7273        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7274            self.status = v.into();
7275            self
7276        }
7277    }
7278
7279    impl wkt::message::Message for ReleaseReadyCondition {
7280        fn typename() -> &'static str {
7281            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
7282        }
7283    }
7284
7285    /// SkaffoldSupportedCondition contains information about when support for the
7286    /// release's version of Skaffold ends.
7287    #[derive(Clone, Default, PartialEq)]
7288    #[non_exhaustive]
7289    pub struct SkaffoldSupportedCondition {
7290        /// True if the version of Skaffold used by this release is supported.
7291        pub status: bool,
7292
7293        /// The Skaffold support state for this release's version of Skaffold.
7294        pub skaffold_support_state: crate::model::SkaffoldSupportState,
7295
7296        /// The time at which this release's version of Skaffold will enter
7297        /// maintenance mode.
7298        pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
7299
7300        /// The time at which this release's version of Skaffold will no longer be
7301        /// supported.
7302        pub support_expiration_time: std::option::Option<wkt::Timestamp>,
7303
7304        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7305    }
7306
7307    impl SkaffoldSupportedCondition {
7308        pub fn new() -> Self {
7309            std::default::Default::default()
7310        }
7311
7312        /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
7313        pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7314            self.status = v.into();
7315            self
7316        }
7317
7318        /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
7319        pub fn set_skaffold_support_state<
7320            T: std::convert::Into<crate::model::SkaffoldSupportState>,
7321        >(
7322            mut self,
7323            v: T,
7324        ) -> Self {
7325            self.skaffold_support_state = v.into();
7326            self
7327        }
7328
7329        /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
7330        pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
7331        where
7332            T: std::convert::Into<wkt::Timestamp>,
7333        {
7334            self.maintenance_mode_time = std::option::Option::Some(v.into());
7335            self
7336        }
7337
7338        /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
7339        pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
7340        where
7341            T: std::convert::Into<wkt::Timestamp>,
7342        {
7343            self.maintenance_mode_time = v.map(|x| x.into());
7344            self
7345        }
7346
7347        /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
7348        pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
7349        where
7350            T: std::convert::Into<wkt::Timestamp>,
7351        {
7352            self.support_expiration_time = std::option::Option::Some(v.into());
7353            self
7354        }
7355
7356        /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
7357        pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
7358        where
7359            T: std::convert::Into<wkt::Timestamp>,
7360        {
7361            self.support_expiration_time = v.map(|x| x.into());
7362            self
7363        }
7364    }
7365
7366    impl wkt::message::Message for SkaffoldSupportedCondition {
7367        fn typename() -> &'static str {
7368            "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
7369        }
7370    }
7371
7372    /// ReleaseCondition contains all conditions relevant to a Release.
7373    #[derive(Clone, Default, PartialEq)]
7374    #[non_exhaustive]
7375    pub struct ReleaseCondition {
7376        /// Details around the Releases's overall status.
7377        pub release_ready_condition:
7378            std::option::Option<crate::model::release::ReleaseReadyCondition>,
7379
7380        /// Details around the support state of the release's Skaffold
7381        /// version.
7382        pub skaffold_supported_condition:
7383            std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
7384
7385        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7386    }
7387
7388    impl ReleaseCondition {
7389        pub fn new() -> Self {
7390            std::default::Default::default()
7391        }
7392
7393        /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
7394        pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
7395        where
7396            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
7397        {
7398            self.release_ready_condition = std::option::Option::Some(v.into());
7399            self
7400        }
7401
7402        /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
7403        pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
7404        where
7405            T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
7406        {
7407            self.release_ready_condition = v.map(|x| x.into());
7408            self
7409        }
7410
7411        /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
7412        pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
7413        where
7414            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
7415        {
7416            self.skaffold_supported_condition = std::option::Option::Some(v.into());
7417            self
7418        }
7419
7420        /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
7421        pub fn set_or_clear_skaffold_supported_condition<T>(
7422            mut self,
7423            v: std::option::Option<T>,
7424        ) -> Self
7425        where
7426            T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
7427        {
7428            self.skaffold_supported_condition = v.map(|x| x.into());
7429            self
7430        }
7431    }
7432
7433    impl wkt::message::Message for ReleaseCondition {
7434        fn typename() -> &'static str {
7435            "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
7436        }
7437    }
7438
7439    /// Valid states of the render operation.
7440    ///
7441    /// # Working with unknown values
7442    ///
7443    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7444    /// additional enum variants at any time. Adding new variants is not considered
7445    /// a breaking change. Applications should write their code in anticipation of:
7446    ///
7447    /// - New values appearing in future releases of the client library, **and**
7448    /// - New values received dynamically, without application changes.
7449    ///
7450    /// Please consult the [Working with enums] section in the user guide for some
7451    /// guidelines.
7452    ///
7453    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7454    #[derive(Clone, Debug, PartialEq)]
7455    #[non_exhaustive]
7456    pub enum RenderState {
7457        /// The render state is unspecified.
7458        Unspecified,
7459        /// All rendering operations have completed successfully.
7460        Succeeded,
7461        /// All rendering operations have completed, and one or more have failed.
7462        Failed,
7463        /// Rendering has started and is not complete.
7464        InProgress,
7465        /// If set, the enum was initialized with an unknown value.
7466        ///
7467        /// Applications can examine the value using [RenderState::value] or
7468        /// [RenderState::name].
7469        UnknownValue(render_state::UnknownValue),
7470    }
7471
7472    #[doc(hidden)]
7473    pub mod render_state {
7474        #[allow(unused_imports)]
7475        use super::*;
7476        #[derive(Clone, Debug, PartialEq)]
7477        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7478    }
7479
7480    impl RenderState {
7481        /// Gets the enum value.
7482        ///
7483        /// Returns `None` if the enum contains an unknown value deserialized from
7484        /// the string representation of enums.
7485        pub fn value(&self) -> std::option::Option<i32> {
7486            match self {
7487                Self::Unspecified => std::option::Option::Some(0),
7488                Self::Succeeded => std::option::Option::Some(1),
7489                Self::Failed => std::option::Option::Some(2),
7490                Self::InProgress => std::option::Option::Some(3),
7491                Self::UnknownValue(u) => u.0.value(),
7492            }
7493        }
7494
7495        /// Gets the enum value as a string.
7496        ///
7497        /// Returns `None` if the enum contains an unknown value deserialized from
7498        /// the integer representation of enums.
7499        pub fn name(&self) -> std::option::Option<&str> {
7500            match self {
7501                Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
7502                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7503                Self::Failed => std::option::Option::Some("FAILED"),
7504                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
7505                Self::UnknownValue(u) => u.0.name(),
7506            }
7507        }
7508    }
7509
7510    impl std::default::Default for RenderState {
7511        fn default() -> Self {
7512            use std::convert::From;
7513            Self::from(0)
7514        }
7515    }
7516
7517    impl std::fmt::Display for RenderState {
7518        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7519            wkt::internal::display_enum(f, self.name(), self.value())
7520        }
7521    }
7522
7523    impl std::convert::From<i32> for RenderState {
7524        fn from(value: i32) -> Self {
7525            match value {
7526                0 => Self::Unspecified,
7527                1 => Self::Succeeded,
7528                2 => Self::Failed,
7529                3 => Self::InProgress,
7530                _ => Self::UnknownValue(render_state::UnknownValue(
7531                    wkt::internal::UnknownEnumValue::Integer(value),
7532                )),
7533            }
7534        }
7535    }
7536
7537    impl std::convert::From<&str> for RenderState {
7538        fn from(value: &str) -> Self {
7539            use std::string::ToString;
7540            match value {
7541                "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
7542                "SUCCEEDED" => Self::Succeeded,
7543                "FAILED" => Self::Failed,
7544                "IN_PROGRESS" => Self::InProgress,
7545                _ => Self::UnknownValue(render_state::UnknownValue(
7546                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7547                )),
7548            }
7549        }
7550    }
7551
7552    impl serde::ser::Serialize for RenderState {
7553        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7554        where
7555            S: serde::Serializer,
7556        {
7557            match self {
7558                Self::Unspecified => serializer.serialize_i32(0),
7559                Self::Succeeded => serializer.serialize_i32(1),
7560                Self::Failed => serializer.serialize_i32(2),
7561                Self::InProgress => serializer.serialize_i32(3),
7562                Self::UnknownValue(u) => u.0.serialize(serializer),
7563            }
7564        }
7565    }
7566
7567    impl<'de> serde::de::Deserialize<'de> for RenderState {
7568        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7569        where
7570            D: serde::Deserializer<'de>,
7571        {
7572            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
7573                ".google.cloud.deploy.v1.Release.RenderState",
7574            ))
7575        }
7576    }
7577}
7578
7579/// The request object for `CreateDeployPolicy`.
7580#[derive(Clone, Default, PartialEq)]
7581#[non_exhaustive]
7582pub struct CreateDeployPolicyRequest {
7583    /// Required. The parent collection in which the `DeployPolicy` must be
7584    /// created. The format is `projects/{project_id}/locations/{location_name}`.
7585    pub parent: std::string::String,
7586
7587    /// Required. ID of the `DeployPolicy`.
7588    pub deploy_policy_id: std::string::String,
7589
7590    /// Required. The `DeployPolicy` to create.
7591    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
7592
7593    /// Optional. A request ID to identify requests. Specify a unique request ID
7594    /// so that if you must retry your request, the server knows to ignore the
7595    /// request if it has already been completed. The server guarantees that for
7596    /// at least 60 minutes after the first request.
7597    ///
7598    /// For example, consider a situation where you make an initial request and the
7599    /// request times out. If you make the request again with the same request ID,
7600    /// the server can check if original operation with the same request ID was
7601    /// received, and if so, will ignore the second request. This prevents clients
7602    /// from accidentally creating duplicate commitments.
7603    ///
7604    /// The request ID must be a valid UUID with the exception that zero UUID is
7605    /// not supported (00000000-0000-0000-0000-000000000000).
7606    pub request_id: std::string::String,
7607
7608    /// Optional. If set to true, the request is validated and the user is provided
7609    /// with an expected result, but no actual change is made.
7610    pub validate_only: bool,
7611
7612    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7613}
7614
7615impl CreateDeployPolicyRequest {
7616    pub fn new() -> Self {
7617        std::default::Default::default()
7618    }
7619
7620    /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
7621    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7622        self.parent = v.into();
7623        self
7624    }
7625
7626    /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
7627    pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
7628        mut self,
7629        v: T,
7630    ) -> Self {
7631        self.deploy_policy_id = v.into();
7632        self
7633    }
7634
7635    /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
7636    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
7637    where
7638        T: std::convert::Into<crate::model::DeployPolicy>,
7639    {
7640        self.deploy_policy = std::option::Option::Some(v.into());
7641        self
7642    }
7643
7644    /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
7645    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
7646    where
7647        T: std::convert::Into<crate::model::DeployPolicy>,
7648    {
7649        self.deploy_policy = v.map(|x| x.into());
7650        self
7651    }
7652
7653    /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
7654    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7655        self.request_id = v.into();
7656        self
7657    }
7658
7659    /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
7660    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7661        self.validate_only = v.into();
7662        self
7663    }
7664}
7665
7666impl wkt::message::Message for CreateDeployPolicyRequest {
7667    fn typename() -> &'static str {
7668        "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
7669    }
7670}
7671
7672/// The request object for `UpdateDeployPolicy`.
7673#[derive(Clone, Default, PartialEq)]
7674#[non_exhaustive]
7675pub struct UpdateDeployPolicyRequest {
7676    /// Required. Field mask is used to specify the fields to be overwritten by the
7677    /// update in the `DeployPolicy` resource. The fields specified in the
7678    /// update_mask are relative to the resource, not the full request. A field
7679    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
7680    /// then all fields are overwritten.
7681    pub update_mask: std::option::Option<wkt::FieldMask>,
7682
7683    /// Required. The `DeployPolicy` to update.
7684    pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
7685
7686    /// Optional. A request ID to identify requests. Specify a unique request ID
7687    /// so that if you must retry your request, the server knows to ignore the
7688    /// request if it has already been completed. The server guarantees that for
7689    /// at least 60 minutes after the first request.
7690    ///
7691    /// For example, consider a situation where you make an initial request and the
7692    /// request times out. If you make the request again with the same request ID,
7693    /// the server can check if original operation with the same request ID was
7694    /// received, and if so, will ignore the second request. This prevents clients
7695    /// from accidentally creating duplicate commitments.
7696    ///
7697    /// The request ID must be a valid UUID with the exception that zero UUID is
7698    /// not supported (00000000-0000-0000-0000-000000000000).
7699    pub request_id: std::string::String,
7700
7701    /// Optional. If set to true, updating a `DeployPolicy` that does not exist
7702    /// will result in the creation of a new `DeployPolicy`.
7703    pub allow_missing: bool,
7704
7705    /// Optional. If set to true, the request is validated and the user is provided
7706    /// with an expected result, but no actual change is made.
7707    pub validate_only: bool,
7708
7709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7710}
7711
7712impl UpdateDeployPolicyRequest {
7713    pub fn new() -> Self {
7714        std::default::Default::default()
7715    }
7716
7717    /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
7718    pub fn set_update_mask<T>(mut self, v: T) -> Self
7719    where
7720        T: std::convert::Into<wkt::FieldMask>,
7721    {
7722        self.update_mask = std::option::Option::Some(v.into());
7723        self
7724    }
7725
7726    /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
7727    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7728    where
7729        T: std::convert::Into<wkt::FieldMask>,
7730    {
7731        self.update_mask = v.map(|x| x.into());
7732        self
7733    }
7734
7735    /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
7736    pub fn set_deploy_policy<T>(mut self, v: T) -> Self
7737    where
7738        T: std::convert::Into<crate::model::DeployPolicy>,
7739    {
7740        self.deploy_policy = std::option::Option::Some(v.into());
7741        self
7742    }
7743
7744    /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
7745    pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
7746    where
7747        T: std::convert::Into<crate::model::DeployPolicy>,
7748    {
7749        self.deploy_policy = v.map(|x| x.into());
7750        self
7751    }
7752
7753    /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
7754    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7755        self.request_id = v.into();
7756        self
7757    }
7758
7759    /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
7760    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7761        self.allow_missing = v.into();
7762        self
7763    }
7764
7765    /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
7766    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7767        self.validate_only = v.into();
7768        self
7769    }
7770}
7771
7772impl wkt::message::Message for UpdateDeployPolicyRequest {
7773    fn typename() -> &'static str {
7774        "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
7775    }
7776}
7777
7778/// The request object for `DeleteDeployPolicy`.
7779#[derive(Clone, Default, PartialEq)]
7780#[non_exhaustive]
7781pub struct DeleteDeployPolicyRequest {
7782    /// Required. The name of the `DeployPolicy` to delete. The format is
7783    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
7784    pub name: std::string::String,
7785
7786    /// Optional. A request ID to identify requests. Specify a unique request ID
7787    /// so that if you must retry your request, the server knows to ignore the
7788    /// request if it has already been completed. The server guarantees that for
7789    /// at least 60 minutes after the first request.
7790    ///
7791    /// For example, consider a situation where you make an initial request and the
7792    /// request times out. If you make the request again with the same request ID,
7793    /// the server can check if original operation with the same request ID was
7794    /// received, and if so, will ignore the second request. This prevents clients
7795    /// from accidentally creating duplicate commitments.
7796    ///
7797    /// The request ID must be a valid UUID with the exception that zero UUID is
7798    /// not supported (00000000-0000-0000-0000-000000000000).
7799    pub request_id: std::string::String,
7800
7801    /// Optional. If set to true, then deleting an already deleted or non-existing
7802    /// `DeployPolicy` will succeed.
7803    pub allow_missing: bool,
7804
7805    /// Optional. If set, validate the request and preview the review, but do not
7806    /// actually post it.
7807    pub validate_only: bool,
7808
7809    /// Optional. This checksum is computed by the server based on the value of
7810    /// other fields, and may be sent on update and delete requests to ensure the
7811    /// client has an up-to-date value before proceeding.
7812    pub etag: std::string::String,
7813
7814    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7815}
7816
7817impl DeleteDeployPolicyRequest {
7818    pub fn new() -> Self {
7819        std::default::Default::default()
7820    }
7821
7822    /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
7823    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7824        self.name = v.into();
7825        self
7826    }
7827
7828    /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
7829    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7830        self.request_id = v.into();
7831        self
7832    }
7833
7834    /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
7835    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7836        self.allow_missing = v.into();
7837        self
7838    }
7839
7840    /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
7841    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7842        self.validate_only = v.into();
7843        self
7844    }
7845
7846    /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
7847    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7848        self.etag = v.into();
7849        self
7850    }
7851}
7852
7853impl wkt::message::Message for DeleteDeployPolicyRequest {
7854    fn typename() -> &'static str {
7855        "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
7856    }
7857}
7858
7859/// The request object for `ListDeployPolicies`.
7860#[derive(Clone, Default, PartialEq)]
7861#[non_exhaustive]
7862pub struct ListDeployPoliciesRequest {
7863    /// Required. The parent, which owns this collection of deploy policies. Format
7864    /// must be `projects/{project_id}/locations/{location_name}`.
7865    pub parent: std::string::String,
7866
7867    /// The maximum number of deploy policies to return. The service may return
7868    /// fewer than this value. If unspecified, at most 50 deploy policies will
7869    /// be returned. The maximum value is 1000; values above 1000 will be set
7870    /// to 1000.
7871    pub page_size: i32,
7872
7873    /// A page token, received from a previous `ListDeployPolicies` call.
7874    /// Provide this to retrieve the subsequent page.
7875    ///
7876    /// When paginating, all other provided parameters match
7877    /// the call that provided the page token.
7878    pub page_token: std::string::String,
7879
7880    /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
7881    /// more details. All fields can be used in the filter.
7882    pub filter: std::string::String,
7883
7884    /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
7885    pub order_by: std::string::String,
7886
7887    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7888}
7889
7890impl ListDeployPoliciesRequest {
7891    pub fn new() -> Self {
7892        std::default::Default::default()
7893    }
7894
7895    /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
7896    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7897        self.parent = v.into();
7898        self
7899    }
7900
7901    /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
7902    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7903        self.page_size = v.into();
7904        self
7905    }
7906
7907    /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
7908    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7909        self.page_token = v.into();
7910        self
7911    }
7912
7913    /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
7914    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7915        self.filter = v.into();
7916        self
7917    }
7918
7919    /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
7920    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7921        self.order_by = v.into();
7922        self
7923    }
7924}
7925
7926impl wkt::message::Message for ListDeployPoliciesRequest {
7927    fn typename() -> &'static str {
7928        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
7929    }
7930}
7931
7932/// The response object from `ListDeployPolicies`.
7933#[derive(Clone, Default, PartialEq)]
7934#[non_exhaustive]
7935pub struct ListDeployPoliciesResponse {
7936    /// The `DeployPolicy` objects.
7937    pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
7938
7939    /// A token, which can be sent as `page_token` to retrieve the next page.
7940    /// If this field is omitted, there are no subsequent pages.
7941    pub next_page_token: std::string::String,
7942
7943    /// Locations that could not be reached.
7944    pub unreachable: std::vec::Vec<std::string::String>,
7945
7946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7947}
7948
7949impl ListDeployPoliciesResponse {
7950    pub fn new() -> Self {
7951        std::default::Default::default()
7952    }
7953
7954    /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
7955    pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
7956    where
7957        T: std::iter::IntoIterator<Item = V>,
7958        V: std::convert::Into<crate::model::DeployPolicy>,
7959    {
7960        use std::iter::Iterator;
7961        self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
7962        self
7963    }
7964
7965    /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
7966    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7967        self.next_page_token = v.into();
7968        self
7969    }
7970
7971    /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
7972    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7973    where
7974        T: std::iter::IntoIterator<Item = V>,
7975        V: std::convert::Into<std::string::String>,
7976    {
7977        use std::iter::Iterator;
7978        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7979        self
7980    }
7981}
7982
7983impl wkt::message::Message for ListDeployPoliciesResponse {
7984    fn typename() -> &'static str {
7985        "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
7986    }
7987}
7988
7989#[doc(hidden)]
7990impl gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
7991    type PageItem = crate::model::DeployPolicy;
7992
7993    fn items(self) -> std::vec::Vec<Self::PageItem> {
7994        self.deploy_policies
7995    }
7996
7997    fn next_page_token(&self) -> std::string::String {
7998        use std::clone::Clone;
7999        self.next_page_token.clone()
8000    }
8001}
8002
8003/// The request object for `GetDeployPolicy`
8004#[derive(Clone, Default, PartialEq)]
8005#[non_exhaustive]
8006pub struct GetDeployPolicyRequest {
8007    /// Required. Name of the `DeployPolicy`. Format must be
8008    /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
8009    pub name: std::string::String,
8010
8011    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8012}
8013
8014impl GetDeployPolicyRequest {
8015    pub fn new() -> Self {
8016        std::default::Default::default()
8017    }
8018
8019    /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
8020    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8021        self.name = v.into();
8022        self
8023    }
8024}
8025
8026impl wkt::message::Message for GetDeployPolicyRequest {
8027    fn typename() -> &'static str {
8028        "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
8029    }
8030}
8031
8032/// Description of an a image to use during Skaffold rendering.
8033#[derive(Clone, Default, PartialEq)]
8034#[non_exhaustive]
8035pub struct BuildArtifact {
8036    /// Optional. Image name in Skaffold configuration.
8037    pub image: std::string::String,
8038
8039    /// Optional. Image tag to use. This will generally be the full path to an
8040    /// image, such as "gcr.io/my-project/busybox:1.2.3" or
8041    /// "gcr.io/my-project/busybox@sha256:abc123".
8042    pub tag: std::string::String,
8043
8044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8045}
8046
8047impl BuildArtifact {
8048    pub fn new() -> Self {
8049        std::default::Default::default()
8050    }
8051
8052    /// Sets the value of [image][crate::model::BuildArtifact::image].
8053    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8054        self.image = v.into();
8055        self
8056    }
8057
8058    /// Sets the value of [tag][crate::model::BuildArtifact::tag].
8059    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8060        self.tag = v.into();
8061        self
8062    }
8063}
8064
8065impl wkt::message::Message for BuildArtifact {
8066    fn typename() -> &'static str {
8067        "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
8068    }
8069}
8070
8071/// The artifacts produced by a target render operation.
8072#[derive(Clone, Default, PartialEq)]
8073#[non_exhaustive]
8074pub struct TargetArtifact {
8075    /// Output only. File path of the resolved Skaffold configuration for the
8076    /// stable phase, relative to the URI.
8077    pub skaffold_config_path: std::string::String,
8078
8079    /// Output only. File path of the rendered manifest relative to the URI for the
8080    /// stable phase.
8081    pub manifest_path: std::string::String,
8082
8083    /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
8084    pub phase_artifacts: std::collections::HashMap<
8085        std::string::String,
8086        crate::model::target_artifact::PhaseArtifact,
8087    >,
8088
8089    pub uri: std::option::Option<crate::model::target_artifact::Uri>,
8090
8091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8092}
8093
8094impl TargetArtifact {
8095    pub fn new() -> Self {
8096        std::default::Default::default()
8097    }
8098
8099    /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
8100    pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
8101        mut self,
8102        v: T,
8103    ) -> Self {
8104        self.skaffold_config_path = v.into();
8105        self
8106    }
8107
8108    /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
8109    pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8110        self.manifest_path = v.into();
8111        self
8112    }
8113
8114    /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
8115    pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
8116    where
8117        T: std::iter::IntoIterator<Item = (K, V)>,
8118        K: std::convert::Into<std::string::String>,
8119        V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
8120    {
8121        use std::iter::Iterator;
8122        self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8123        self
8124    }
8125
8126    /// Sets the value of [uri][crate::model::TargetArtifact::uri].
8127    ///
8128    /// Note that all the setters affecting `uri` are mutually
8129    /// exclusive.
8130    pub fn set_uri<
8131        T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
8132    >(
8133        mut self,
8134        v: T,
8135    ) -> Self {
8136        self.uri = v.into();
8137        self
8138    }
8139
8140    /// The value of [uri][crate::model::TargetArtifact::uri]
8141    /// if it holds a `ArtifactUri`, `None` if the field is not set or
8142    /// holds a different branch.
8143    pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
8144        #[allow(unreachable_patterns)]
8145        self.uri.as_ref().and_then(|v| match v {
8146            crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
8147            _ => std::option::Option::None,
8148        })
8149    }
8150
8151    /// Sets the value of [uri][crate::model::TargetArtifact::uri]
8152    /// to hold a `ArtifactUri`.
8153    ///
8154    /// Note that all the setters affecting `uri` are
8155    /// mutually exclusive.
8156    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8157        self.uri =
8158            std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
8159        self
8160    }
8161}
8162
8163impl wkt::message::Message for TargetArtifact {
8164    fn typename() -> &'static str {
8165        "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
8166    }
8167}
8168
8169/// Defines additional types related to [TargetArtifact].
8170pub mod target_artifact {
8171    #[allow(unused_imports)]
8172    use super::*;
8173
8174    /// Contains the paths to the artifacts, relative to the URI, for a phase.
8175    #[derive(Clone, Default, PartialEq)]
8176    #[non_exhaustive]
8177    pub struct PhaseArtifact {
8178        /// Output only. File path of the resolved Skaffold configuration relative to
8179        /// the URI.
8180        pub skaffold_config_path: std::string::String,
8181
8182        /// Output only. File path of the rendered manifest relative to the URI.
8183        pub manifest_path: std::string::String,
8184
8185        /// Output only. File path of the directory of rendered job manifests
8186        /// relative to the URI. This is only set if it is applicable.
8187        pub job_manifests_path: std::string::String,
8188
8189        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8190    }
8191
8192    impl PhaseArtifact {
8193        pub fn new() -> Self {
8194            std::default::Default::default()
8195        }
8196
8197        /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
8198        pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
8199            mut self,
8200            v: T,
8201        ) -> Self {
8202            self.skaffold_config_path = v.into();
8203            self
8204        }
8205
8206        /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
8207        pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
8208            mut self,
8209            v: T,
8210        ) -> Self {
8211            self.manifest_path = v.into();
8212            self
8213        }
8214
8215        /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
8216        pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
8217            mut self,
8218            v: T,
8219        ) -> Self {
8220            self.job_manifests_path = v.into();
8221            self
8222        }
8223    }
8224
8225    impl wkt::message::Message for PhaseArtifact {
8226        fn typename() -> &'static str {
8227            "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
8228        }
8229    }
8230
8231    #[derive(Clone, Debug, PartialEq)]
8232    #[non_exhaustive]
8233    pub enum Uri {
8234        /// Output only. URI of a directory containing the artifacts. This contains
8235        /// deployment configuration used by Skaffold during a rollout, and all
8236        /// paths are relative to this location.
8237        ArtifactUri(std::string::String),
8238    }
8239}
8240
8241/// The artifacts produced by a deploy operation.
8242#[derive(Clone, Default, PartialEq)]
8243#[non_exhaustive]
8244pub struct DeployArtifact {
8245    /// Output only. URI of a directory containing the artifacts. All paths are
8246    /// relative to this location.
8247    pub artifact_uri: std::string::String,
8248
8249    /// Output only. File paths of the manifests applied during the deploy
8250    /// operation relative to the URI.
8251    pub manifest_paths: std::vec::Vec<std::string::String>,
8252
8253    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8254}
8255
8256impl DeployArtifact {
8257    pub fn new() -> Self {
8258        std::default::Default::default()
8259    }
8260
8261    /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
8262    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8263        self.artifact_uri = v.into();
8264        self
8265    }
8266
8267    /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
8268    pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
8269    where
8270        T: std::iter::IntoIterator<Item = V>,
8271        V: std::convert::Into<std::string::String>,
8272    {
8273        use std::iter::Iterator;
8274        self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
8275        self
8276    }
8277}
8278
8279impl wkt::message::Message for DeployArtifact {
8280    fn typename() -> &'static str {
8281        "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
8282    }
8283}
8284
8285/// CloudRunRenderMetadata contains Cloud Run information associated with a
8286/// `Release` render.
8287#[derive(Clone, Default, PartialEq)]
8288#[non_exhaustive]
8289pub struct CloudRunRenderMetadata {
8290    /// Output only. The name of the Cloud Run Service in the rendered manifest.
8291    /// Format is `projects/{project}/locations/{location}/services/{service}`.
8292    pub service: std::string::String,
8293
8294    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8295}
8296
8297impl CloudRunRenderMetadata {
8298    pub fn new() -> Self {
8299        std::default::Default::default()
8300    }
8301
8302    /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
8303    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8304        self.service = v.into();
8305        self
8306    }
8307}
8308
8309impl wkt::message::Message for CloudRunRenderMetadata {
8310    fn typename() -> &'static str {
8311        "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
8312    }
8313}
8314
8315/// RenderMetadata includes information associated with a `Release` render.
8316#[derive(Clone, Default, PartialEq)]
8317#[non_exhaustive]
8318pub struct RenderMetadata {
8319    /// Output only. Metadata associated with rendering for Cloud Run.
8320    pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
8321
8322    /// Output only. Custom metadata provided by user-defined render operation.
8323    pub custom: std::option::Option<crate::model::CustomMetadata>,
8324
8325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8326}
8327
8328impl RenderMetadata {
8329    pub fn new() -> Self {
8330        std::default::Default::default()
8331    }
8332
8333    /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
8334    pub fn set_cloud_run<T>(mut self, v: T) -> Self
8335    where
8336        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
8337    {
8338        self.cloud_run = std::option::Option::Some(v.into());
8339        self
8340    }
8341
8342    /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
8343    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
8344    where
8345        T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
8346    {
8347        self.cloud_run = v.map(|x| x.into());
8348        self
8349    }
8350
8351    /// Sets the value of [custom][crate::model::RenderMetadata::custom].
8352    pub fn set_custom<T>(mut self, v: T) -> Self
8353    where
8354        T: std::convert::Into<crate::model::CustomMetadata>,
8355    {
8356        self.custom = std::option::Option::Some(v.into());
8357        self
8358    }
8359
8360    /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
8361    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
8362    where
8363        T: std::convert::Into<crate::model::CustomMetadata>,
8364    {
8365        self.custom = v.map(|x| x.into());
8366        self
8367    }
8368}
8369
8370impl wkt::message::Message for RenderMetadata {
8371    fn typename() -> &'static str {
8372        "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
8373    }
8374}
8375
8376/// The request object for `ListReleases`.
8377#[derive(Clone, Default, PartialEq)]
8378#[non_exhaustive]
8379pub struct ListReleasesRequest {
8380    /// Required. The `DeliveryPipeline` which owns this collection of `Release`
8381    /// objects.
8382    pub parent: std::string::String,
8383
8384    /// Optional. The maximum number of `Release` objects to return. The service
8385    /// may return fewer than this value. If unspecified, at most 50 `Release`
8386    /// objects will be returned. The maximum value is 1000; values above 1000 will
8387    /// be set to 1000.
8388    pub page_size: i32,
8389
8390    /// Optional. A page token, received from a previous `ListReleases` call.
8391    /// Provide this to retrieve the subsequent page.
8392    ///
8393    /// When paginating, all other provided parameters match
8394    /// the call that provided the page token.
8395    pub page_token: std::string::String,
8396
8397    /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
8398    /// for more details.
8399    pub filter: std::string::String,
8400
8401    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
8402    /// more details.
8403    pub order_by: std::string::String,
8404
8405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8406}
8407
8408impl ListReleasesRequest {
8409    pub fn new() -> Self {
8410        std::default::Default::default()
8411    }
8412
8413    /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
8414    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8415        self.parent = v.into();
8416        self
8417    }
8418
8419    /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
8420    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8421        self.page_size = v.into();
8422        self
8423    }
8424
8425    /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
8426    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8427        self.page_token = v.into();
8428        self
8429    }
8430
8431    /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
8432    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8433        self.filter = v.into();
8434        self
8435    }
8436
8437    /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
8438    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8439        self.order_by = v.into();
8440        self
8441    }
8442}
8443
8444impl wkt::message::Message for ListReleasesRequest {
8445    fn typename() -> &'static str {
8446        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
8447    }
8448}
8449
8450/// The response object from `ListReleases`.
8451#[derive(Clone, Default, PartialEq)]
8452#[non_exhaustive]
8453pub struct ListReleasesResponse {
8454    /// The `Release` objects.
8455    pub releases: std::vec::Vec<crate::model::Release>,
8456
8457    /// A token, which can be sent as `page_token` to retrieve the next page.
8458    /// If this field is omitted, there are no subsequent pages.
8459    pub next_page_token: std::string::String,
8460
8461    /// Locations that could not be reached.
8462    pub unreachable: std::vec::Vec<std::string::String>,
8463
8464    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8465}
8466
8467impl ListReleasesResponse {
8468    pub fn new() -> Self {
8469        std::default::Default::default()
8470    }
8471
8472    /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
8473    pub fn set_releases<T, V>(mut self, v: T) -> Self
8474    where
8475        T: std::iter::IntoIterator<Item = V>,
8476        V: std::convert::Into<crate::model::Release>,
8477    {
8478        use std::iter::Iterator;
8479        self.releases = v.into_iter().map(|i| i.into()).collect();
8480        self
8481    }
8482
8483    /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
8484    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8485        self.next_page_token = v.into();
8486        self
8487    }
8488
8489    /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
8490    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8491    where
8492        T: std::iter::IntoIterator<Item = V>,
8493        V: std::convert::Into<std::string::String>,
8494    {
8495        use std::iter::Iterator;
8496        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8497        self
8498    }
8499}
8500
8501impl wkt::message::Message for ListReleasesResponse {
8502    fn typename() -> &'static str {
8503        "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
8504    }
8505}
8506
8507#[doc(hidden)]
8508impl gax::paginator::internal::PageableResponse for ListReleasesResponse {
8509    type PageItem = crate::model::Release;
8510
8511    fn items(self) -> std::vec::Vec<Self::PageItem> {
8512        self.releases
8513    }
8514
8515    fn next_page_token(&self) -> std::string::String {
8516        use std::clone::Clone;
8517        self.next_page_token.clone()
8518    }
8519}
8520
8521/// The request object for `GetRelease`.
8522#[derive(Clone, Default, PartialEq)]
8523#[non_exhaustive]
8524pub struct GetReleaseRequest {
8525    /// Required. Name of the `Release`. Format must be
8526    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
8527    pub name: std::string::String,
8528
8529    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8530}
8531
8532impl GetReleaseRequest {
8533    pub fn new() -> Self {
8534        std::default::Default::default()
8535    }
8536
8537    /// Sets the value of [name][crate::model::GetReleaseRequest::name].
8538    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8539        self.name = v.into();
8540        self
8541    }
8542}
8543
8544impl wkt::message::Message for GetReleaseRequest {
8545    fn typename() -> &'static str {
8546        "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
8547    }
8548}
8549
8550/// The request object for `CreateRelease`,
8551#[derive(Clone, Default, PartialEq)]
8552#[non_exhaustive]
8553pub struct CreateReleaseRequest {
8554    /// Required. The parent collection in which the `Release` is created.
8555    /// The format is
8556    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
8557    pub parent: std::string::String,
8558
8559    /// Required. ID of the `Release`.
8560    pub release_id: std::string::String,
8561
8562    /// Required. The `Release` to create.
8563    pub release: std::option::Option<crate::model::Release>,
8564
8565    /// Optional. A request ID to identify requests. Specify a unique request ID
8566    /// so that if you must retry your request, the server knows to ignore the
8567    /// request if it has already been completed. The server guarantees that for
8568    /// at least 60 minutes after the first request.
8569    ///
8570    /// For example, consider a situation where you make an initial request and the
8571    /// request times out. If you make the request again with the same request ID,
8572    /// the server can check if original operation with the same request ID was
8573    /// received, and if so, will ignore the second request. This prevents clients
8574    /// from accidentally creating duplicate commitments.
8575    ///
8576    /// The request ID must be a valid UUID with the exception that zero UUID is
8577    /// not supported (00000000-0000-0000-0000-000000000000).
8578    pub request_id: std::string::String,
8579
8580    /// Optional. If set to true, the request is validated and the user is provided
8581    /// with an expected result, but no actual change is made.
8582    pub validate_only: bool,
8583
8584    /// Optional. Deploy policies to override. Format is
8585    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
8586    pub override_deploy_policy: std::vec::Vec<std::string::String>,
8587
8588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8589}
8590
8591impl CreateReleaseRequest {
8592    pub fn new() -> Self {
8593        std::default::Default::default()
8594    }
8595
8596    /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
8597    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8598        self.parent = v.into();
8599        self
8600    }
8601
8602    /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
8603    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8604        self.release_id = v.into();
8605        self
8606    }
8607
8608    /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
8609    pub fn set_release<T>(mut self, v: T) -> Self
8610    where
8611        T: std::convert::Into<crate::model::Release>,
8612    {
8613        self.release = std::option::Option::Some(v.into());
8614        self
8615    }
8616
8617    /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
8618    pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
8619    where
8620        T: std::convert::Into<crate::model::Release>,
8621    {
8622        self.release = v.map(|x| x.into());
8623        self
8624    }
8625
8626    /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
8627    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8628        self.request_id = v.into();
8629        self
8630    }
8631
8632    /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
8633    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8634        self.validate_only = v.into();
8635        self
8636    }
8637
8638    /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
8639    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
8640    where
8641        T: std::iter::IntoIterator<Item = V>,
8642        V: std::convert::Into<std::string::String>,
8643    {
8644        use std::iter::Iterator;
8645        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
8646        self
8647    }
8648}
8649
8650impl wkt::message::Message for CreateReleaseRequest {
8651    fn typename() -> &'static str {
8652        "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
8653    }
8654}
8655
8656/// A `Rollout` resource in the Cloud Deploy API.
8657///
8658/// A `Rollout` contains information around a specific deployment to a `Target`.
8659#[derive(Clone, Default, PartialEq)]
8660#[non_exhaustive]
8661pub struct Rollout {
8662    /// Identifier. Name of the `Rollout`. Format is
8663    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
8664    /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8665    pub name: std::string::String,
8666
8667    /// Output only. Unique identifier of the `Rollout`.
8668    pub uid: std::string::String,
8669
8670    /// Optional. Description of the `Rollout` for user purposes. Max length is 255
8671    /// characters.
8672    pub description: std::string::String,
8673
8674    /// Optional. User annotations. These attributes can only be set and used by
8675    /// the user, and not by Cloud Deploy. See
8676    /// <https://google.aip.dev/128#annotations> for more details such as format and
8677    /// size limitations.
8678    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8679
8680    /// Labels are attributes that can be set and used by both the
8681    /// user and by Cloud Deploy. Labels must meet the following constraints:
8682    ///
8683    /// * Keys and values can contain only lowercase letters, numeric characters,
8684    ///   underscores, and dashes.
8685    /// * All characters must use UTF-8 encoding, and international characters are
8686    ///   allowed.
8687    /// * Keys must start with a lowercase letter or international character.
8688    /// * Each resource is limited to a maximum of 64 labels.
8689    ///
8690    /// Both keys and values are additionally constrained to be <= 128 bytes.
8691    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8692
8693    /// Output only. Time at which the `Rollout` was created.
8694    pub create_time: std::option::Option<wkt::Timestamp>,
8695
8696    /// Output only. Time at which the `Rollout` was approved.
8697    pub approve_time: std::option::Option<wkt::Timestamp>,
8698
8699    /// Output only. Time at which the `Rollout` was enqueued.
8700    pub enqueue_time: std::option::Option<wkt::Timestamp>,
8701
8702    /// Output only. Time at which the `Rollout` started deploying.
8703    pub deploy_start_time: std::option::Option<wkt::Timestamp>,
8704
8705    /// Output only. Time at which the `Rollout` finished deploying.
8706    pub deploy_end_time: std::option::Option<wkt::Timestamp>,
8707
8708    /// Required. The ID of Target to which this `Rollout` is deploying.
8709    pub target_id: std::string::String,
8710
8711    /// Output only. Approval state of the `Rollout`.
8712    pub approval_state: crate::model::rollout::ApprovalState,
8713
8714    /// Output only. Current state of the `Rollout`.
8715    pub state: crate::model::rollout::State,
8716
8717    /// Output only. Additional information about the rollout failure, if
8718    /// available.
8719    pub failure_reason: std::string::String,
8720
8721    /// Output only. The resource name of the Cloud Build `Build` object that is
8722    /// used to deploy the Rollout. Format is
8723    /// `projects/{project}/locations/{location}/builds/{build}`.
8724    pub deploying_build: std::string::String,
8725
8726    /// This checksum is computed by the server based on the value of other
8727    /// fields, and may be sent on update and delete requests to ensure the
8728    /// client has an up-to-date value before proceeding.
8729    pub etag: std::string::String,
8730
8731    /// Output only. The reason this rollout failed. This will always be
8732    /// unspecified while the rollout is in progress.
8733    pub deploy_failure_cause: crate::model::rollout::FailureCause,
8734
8735    /// Output only. The phases that represent the workflows of this `Rollout`.
8736    pub phases: std::vec::Vec<crate::model::Phase>,
8737
8738    /// Output only. Metadata contains information about the rollout.
8739    pub metadata: std::option::Option<crate::model::Metadata>,
8740
8741    /// Output only. Name of the `ControllerRollout`. Format is
8742    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
8743    pub controller_rollout: std::string::String,
8744
8745    /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
8746    /// Empty if this `Rollout` wasn't created as a rollback.
8747    pub rollback_of_rollout: std::string::String,
8748
8749    /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
8750    pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
8751
8752    /// Output only. The AutomationRun actively repairing the rollout.
8753    pub active_repair_automation_run: std::string::String,
8754
8755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8756}
8757
8758impl Rollout {
8759    pub fn new() -> Self {
8760        std::default::Default::default()
8761    }
8762
8763    /// Sets the value of [name][crate::model::Rollout::name].
8764    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8765        self.name = v.into();
8766        self
8767    }
8768
8769    /// Sets the value of [uid][crate::model::Rollout::uid].
8770    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8771        self.uid = v.into();
8772        self
8773    }
8774
8775    /// Sets the value of [description][crate::model::Rollout::description].
8776    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8777        self.description = v.into();
8778        self
8779    }
8780
8781    /// Sets the value of [annotations][crate::model::Rollout::annotations].
8782    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
8783    where
8784        T: std::iter::IntoIterator<Item = (K, V)>,
8785        K: std::convert::Into<std::string::String>,
8786        V: std::convert::Into<std::string::String>,
8787    {
8788        use std::iter::Iterator;
8789        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8790        self
8791    }
8792
8793    /// Sets the value of [labels][crate::model::Rollout::labels].
8794    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8795    where
8796        T: std::iter::IntoIterator<Item = (K, V)>,
8797        K: std::convert::Into<std::string::String>,
8798        V: std::convert::Into<std::string::String>,
8799    {
8800        use std::iter::Iterator;
8801        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8802        self
8803    }
8804
8805    /// Sets the value of [create_time][crate::model::Rollout::create_time].
8806    pub fn set_create_time<T>(mut self, v: T) -> Self
8807    where
8808        T: std::convert::Into<wkt::Timestamp>,
8809    {
8810        self.create_time = std::option::Option::Some(v.into());
8811        self
8812    }
8813
8814    /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
8815    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8816    where
8817        T: std::convert::Into<wkt::Timestamp>,
8818    {
8819        self.create_time = v.map(|x| x.into());
8820        self
8821    }
8822
8823    /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
8824    pub fn set_approve_time<T>(mut self, v: T) -> Self
8825    where
8826        T: std::convert::Into<wkt::Timestamp>,
8827    {
8828        self.approve_time = std::option::Option::Some(v.into());
8829        self
8830    }
8831
8832    /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
8833    pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
8834    where
8835        T: std::convert::Into<wkt::Timestamp>,
8836    {
8837        self.approve_time = v.map(|x| x.into());
8838        self
8839    }
8840
8841    /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
8842    pub fn set_enqueue_time<T>(mut self, v: T) -> Self
8843    where
8844        T: std::convert::Into<wkt::Timestamp>,
8845    {
8846        self.enqueue_time = std::option::Option::Some(v.into());
8847        self
8848    }
8849
8850    /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
8851    pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
8852    where
8853        T: std::convert::Into<wkt::Timestamp>,
8854    {
8855        self.enqueue_time = v.map(|x| x.into());
8856        self
8857    }
8858
8859    /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
8860    pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
8861    where
8862        T: std::convert::Into<wkt::Timestamp>,
8863    {
8864        self.deploy_start_time = std::option::Option::Some(v.into());
8865        self
8866    }
8867
8868    /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
8869    pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8870    where
8871        T: std::convert::Into<wkt::Timestamp>,
8872    {
8873        self.deploy_start_time = v.map(|x| x.into());
8874        self
8875    }
8876
8877    /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
8878    pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
8879    where
8880        T: std::convert::Into<wkt::Timestamp>,
8881    {
8882        self.deploy_end_time = std::option::Option::Some(v.into());
8883        self
8884    }
8885
8886    /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
8887    pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8888    where
8889        T: std::convert::Into<wkt::Timestamp>,
8890    {
8891        self.deploy_end_time = v.map(|x| x.into());
8892        self
8893    }
8894
8895    /// Sets the value of [target_id][crate::model::Rollout::target_id].
8896    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8897        self.target_id = v.into();
8898        self
8899    }
8900
8901    /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
8902    pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
8903        mut self,
8904        v: T,
8905    ) -> Self {
8906        self.approval_state = v.into();
8907        self
8908    }
8909
8910    /// Sets the value of [state][crate::model::Rollout::state].
8911    pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
8912        self.state = v.into();
8913        self
8914    }
8915
8916    /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
8917    pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8918        self.failure_reason = v.into();
8919        self
8920    }
8921
8922    /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
8923    pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8924        self.deploying_build = v.into();
8925        self
8926    }
8927
8928    /// Sets the value of [etag][crate::model::Rollout::etag].
8929    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8930        self.etag = v.into();
8931        self
8932    }
8933
8934    /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
8935    pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
8936        mut self,
8937        v: T,
8938    ) -> Self {
8939        self.deploy_failure_cause = v.into();
8940        self
8941    }
8942
8943    /// Sets the value of [phases][crate::model::Rollout::phases].
8944    pub fn set_phases<T, V>(mut self, v: T) -> Self
8945    where
8946        T: std::iter::IntoIterator<Item = V>,
8947        V: std::convert::Into<crate::model::Phase>,
8948    {
8949        use std::iter::Iterator;
8950        self.phases = v.into_iter().map(|i| i.into()).collect();
8951        self
8952    }
8953
8954    /// Sets the value of [metadata][crate::model::Rollout::metadata].
8955    pub fn set_metadata<T>(mut self, v: T) -> Self
8956    where
8957        T: std::convert::Into<crate::model::Metadata>,
8958    {
8959        self.metadata = std::option::Option::Some(v.into());
8960        self
8961    }
8962
8963    /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
8964    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
8965    where
8966        T: std::convert::Into<crate::model::Metadata>,
8967    {
8968        self.metadata = v.map(|x| x.into());
8969        self
8970    }
8971
8972    /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
8973    pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
8974        mut self,
8975        v: T,
8976    ) -> Self {
8977        self.controller_rollout = v.into();
8978        self
8979    }
8980
8981    /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
8982    pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
8983        mut self,
8984        v: T,
8985    ) -> Self {
8986        self.rollback_of_rollout = v.into();
8987        self
8988    }
8989
8990    /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
8991    pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
8992    where
8993        T: std::iter::IntoIterator<Item = V>,
8994        V: std::convert::Into<std::string::String>,
8995    {
8996        use std::iter::Iterator;
8997        self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
8998        self
8999    }
9000
9001    /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
9002    pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
9003        mut self,
9004        v: T,
9005    ) -> Self {
9006        self.active_repair_automation_run = v.into();
9007        self
9008    }
9009}
9010
9011impl wkt::message::Message for Rollout {
9012    fn typename() -> &'static str {
9013        "type.googleapis.com/google.cloud.deploy.v1.Rollout"
9014    }
9015}
9016
9017/// Defines additional types related to [Rollout].
9018pub mod rollout {
9019    #[allow(unused_imports)]
9020    use super::*;
9021
9022    /// Valid approval states of a `Rollout`.
9023    ///
9024    /// # Working with unknown values
9025    ///
9026    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9027    /// additional enum variants at any time. Adding new variants is not considered
9028    /// a breaking change. Applications should write their code in anticipation of:
9029    ///
9030    /// - New values appearing in future releases of the client library, **and**
9031    /// - New values received dynamically, without application changes.
9032    ///
9033    /// Please consult the [Working with enums] section in the user guide for some
9034    /// guidelines.
9035    ///
9036    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9037    #[derive(Clone, Debug, PartialEq)]
9038    #[non_exhaustive]
9039    pub enum ApprovalState {
9040        /// The `Rollout` has an unspecified approval state.
9041        Unspecified,
9042        /// The `Rollout` requires approval.
9043        NeedsApproval,
9044        /// The `Rollout` does not require approval.
9045        DoesNotNeedApproval,
9046        /// The `Rollout` has been approved.
9047        Approved,
9048        /// The `Rollout` has been rejected.
9049        Rejected,
9050        /// If set, the enum was initialized with an unknown value.
9051        ///
9052        /// Applications can examine the value using [ApprovalState::value] or
9053        /// [ApprovalState::name].
9054        UnknownValue(approval_state::UnknownValue),
9055    }
9056
9057    #[doc(hidden)]
9058    pub mod approval_state {
9059        #[allow(unused_imports)]
9060        use super::*;
9061        #[derive(Clone, Debug, PartialEq)]
9062        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9063    }
9064
9065    impl ApprovalState {
9066        /// Gets the enum value.
9067        ///
9068        /// Returns `None` if the enum contains an unknown value deserialized from
9069        /// the string representation of enums.
9070        pub fn value(&self) -> std::option::Option<i32> {
9071            match self {
9072                Self::Unspecified => std::option::Option::Some(0),
9073                Self::NeedsApproval => std::option::Option::Some(1),
9074                Self::DoesNotNeedApproval => std::option::Option::Some(2),
9075                Self::Approved => std::option::Option::Some(3),
9076                Self::Rejected => std::option::Option::Some(4),
9077                Self::UnknownValue(u) => u.0.value(),
9078            }
9079        }
9080
9081        /// Gets the enum value as a string.
9082        ///
9083        /// Returns `None` if the enum contains an unknown value deserialized from
9084        /// the integer representation of enums.
9085        pub fn name(&self) -> std::option::Option<&str> {
9086            match self {
9087                Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
9088                Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
9089                Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
9090                Self::Approved => std::option::Option::Some("APPROVED"),
9091                Self::Rejected => std::option::Option::Some("REJECTED"),
9092                Self::UnknownValue(u) => u.0.name(),
9093            }
9094        }
9095    }
9096
9097    impl std::default::Default for ApprovalState {
9098        fn default() -> Self {
9099            use std::convert::From;
9100            Self::from(0)
9101        }
9102    }
9103
9104    impl std::fmt::Display for ApprovalState {
9105        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9106            wkt::internal::display_enum(f, self.name(), self.value())
9107        }
9108    }
9109
9110    impl std::convert::From<i32> for ApprovalState {
9111        fn from(value: i32) -> Self {
9112            match value {
9113                0 => Self::Unspecified,
9114                1 => Self::NeedsApproval,
9115                2 => Self::DoesNotNeedApproval,
9116                3 => Self::Approved,
9117                4 => Self::Rejected,
9118                _ => Self::UnknownValue(approval_state::UnknownValue(
9119                    wkt::internal::UnknownEnumValue::Integer(value),
9120                )),
9121            }
9122        }
9123    }
9124
9125    impl std::convert::From<&str> for ApprovalState {
9126        fn from(value: &str) -> Self {
9127            use std::string::ToString;
9128            match value {
9129                "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
9130                "NEEDS_APPROVAL" => Self::NeedsApproval,
9131                "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
9132                "APPROVED" => Self::Approved,
9133                "REJECTED" => Self::Rejected,
9134                _ => Self::UnknownValue(approval_state::UnknownValue(
9135                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9136                )),
9137            }
9138        }
9139    }
9140
9141    impl serde::ser::Serialize for ApprovalState {
9142        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9143        where
9144            S: serde::Serializer,
9145        {
9146            match self {
9147                Self::Unspecified => serializer.serialize_i32(0),
9148                Self::NeedsApproval => serializer.serialize_i32(1),
9149                Self::DoesNotNeedApproval => serializer.serialize_i32(2),
9150                Self::Approved => serializer.serialize_i32(3),
9151                Self::Rejected => serializer.serialize_i32(4),
9152                Self::UnknownValue(u) => u.0.serialize(serializer),
9153            }
9154        }
9155    }
9156
9157    impl<'de> serde::de::Deserialize<'de> for ApprovalState {
9158        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9159        where
9160            D: serde::Deserializer<'de>,
9161        {
9162            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
9163                ".google.cloud.deploy.v1.Rollout.ApprovalState",
9164            ))
9165        }
9166    }
9167
9168    /// Valid states of a `Rollout`.
9169    ///
9170    /// # Working with unknown values
9171    ///
9172    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9173    /// additional enum variants at any time. Adding new variants is not considered
9174    /// a breaking change. Applications should write their code in anticipation of:
9175    ///
9176    /// - New values appearing in future releases of the client library, **and**
9177    /// - New values received dynamically, without application changes.
9178    ///
9179    /// Please consult the [Working with enums] section in the user guide for some
9180    /// guidelines.
9181    ///
9182    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9183    #[derive(Clone, Debug, PartialEq)]
9184    #[non_exhaustive]
9185    pub enum State {
9186        /// The `Rollout` has an unspecified state.
9187        Unspecified,
9188        /// The `Rollout` has completed successfully.
9189        Succeeded,
9190        /// The `Rollout` has failed.
9191        Failed,
9192        /// The `Rollout` is being deployed.
9193        InProgress,
9194        /// The `Rollout` needs approval.
9195        PendingApproval,
9196        /// An approver rejected the `Rollout`.
9197        ApprovalRejected,
9198        /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
9199        /// `Target`.
9200        Pending,
9201        /// The `Rollout` is waiting for the `Release` to be fully rendered.
9202        PendingRelease,
9203        /// The `Rollout` is in the process of being cancelled.
9204        Cancelling,
9205        /// The `Rollout` has been cancelled.
9206        Cancelled,
9207        /// The `Rollout` is halted.
9208        Halted,
9209        /// If set, the enum was initialized with an unknown value.
9210        ///
9211        /// Applications can examine the value using [State::value] or
9212        /// [State::name].
9213        UnknownValue(state::UnknownValue),
9214    }
9215
9216    #[doc(hidden)]
9217    pub mod state {
9218        #[allow(unused_imports)]
9219        use super::*;
9220        #[derive(Clone, Debug, PartialEq)]
9221        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9222    }
9223
9224    impl State {
9225        /// Gets the enum value.
9226        ///
9227        /// Returns `None` if the enum contains an unknown value deserialized from
9228        /// the string representation of enums.
9229        pub fn value(&self) -> std::option::Option<i32> {
9230            match self {
9231                Self::Unspecified => std::option::Option::Some(0),
9232                Self::Succeeded => std::option::Option::Some(1),
9233                Self::Failed => std::option::Option::Some(2),
9234                Self::InProgress => std::option::Option::Some(3),
9235                Self::PendingApproval => std::option::Option::Some(4),
9236                Self::ApprovalRejected => std::option::Option::Some(5),
9237                Self::Pending => std::option::Option::Some(6),
9238                Self::PendingRelease => std::option::Option::Some(7),
9239                Self::Cancelling => std::option::Option::Some(8),
9240                Self::Cancelled => std::option::Option::Some(9),
9241                Self::Halted => std::option::Option::Some(10),
9242                Self::UnknownValue(u) => u.0.value(),
9243            }
9244        }
9245
9246        /// Gets the enum value as a string.
9247        ///
9248        /// Returns `None` if the enum contains an unknown value deserialized from
9249        /// the integer representation of enums.
9250        pub fn name(&self) -> std::option::Option<&str> {
9251            match self {
9252                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9253                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9254                Self::Failed => std::option::Option::Some("FAILED"),
9255                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9256                Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
9257                Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
9258                Self::Pending => std::option::Option::Some("PENDING"),
9259                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
9260                Self::Cancelling => std::option::Option::Some("CANCELLING"),
9261                Self::Cancelled => std::option::Option::Some("CANCELLED"),
9262                Self::Halted => std::option::Option::Some("HALTED"),
9263                Self::UnknownValue(u) => u.0.name(),
9264            }
9265        }
9266    }
9267
9268    impl std::default::Default for State {
9269        fn default() -> Self {
9270            use std::convert::From;
9271            Self::from(0)
9272        }
9273    }
9274
9275    impl std::fmt::Display for State {
9276        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9277            wkt::internal::display_enum(f, self.name(), self.value())
9278        }
9279    }
9280
9281    impl std::convert::From<i32> for State {
9282        fn from(value: i32) -> Self {
9283            match value {
9284                0 => Self::Unspecified,
9285                1 => Self::Succeeded,
9286                2 => Self::Failed,
9287                3 => Self::InProgress,
9288                4 => Self::PendingApproval,
9289                5 => Self::ApprovalRejected,
9290                6 => Self::Pending,
9291                7 => Self::PendingRelease,
9292                8 => Self::Cancelling,
9293                9 => Self::Cancelled,
9294                10 => Self::Halted,
9295                _ => Self::UnknownValue(state::UnknownValue(
9296                    wkt::internal::UnknownEnumValue::Integer(value),
9297                )),
9298            }
9299        }
9300    }
9301
9302    impl std::convert::From<&str> for State {
9303        fn from(value: &str) -> Self {
9304            use std::string::ToString;
9305            match value {
9306                "STATE_UNSPECIFIED" => Self::Unspecified,
9307                "SUCCEEDED" => Self::Succeeded,
9308                "FAILED" => Self::Failed,
9309                "IN_PROGRESS" => Self::InProgress,
9310                "PENDING_APPROVAL" => Self::PendingApproval,
9311                "APPROVAL_REJECTED" => Self::ApprovalRejected,
9312                "PENDING" => Self::Pending,
9313                "PENDING_RELEASE" => Self::PendingRelease,
9314                "CANCELLING" => Self::Cancelling,
9315                "CANCELLED" => Self::Cancelled,
9316                "HALTED" => Self::Halted,
9317                _ => Self::UnknownValue(state::UnknownValue(
9318                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9319                )),
9320            }
9321        }
9322    }
9323
9324    impl serde::ser::Serialize for State {
9325        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9326        where
9327            S: serde::Serializer,
9328        {
9329            match self {
9330                Self::Unspecified => serializer.serialize_i32(0),
9331                Self::Succeeded => serializer.serialize_i32(1),
9332                Self::Failed => serializer.serialize_i32(2),
9333                Self::InProgress => serializer.serialize_i32(3),
9334                Self::PendingApproval => serializer.serialize_i32(4),
9335                Self::ApprovalRejected => serializer.serialize_i32(5),
9336                Self::Pending => serializer.serialize_i32(6),
9337                Self::PendingRelease => serializer.serialize_i32(7),
9338                Self::Cancelling => serializer.serialize_i32(8),
9339                Self::Cancelled => serializer.serialize_i32(9),
9340                Self::Halted => serializer.serialize_i32(10),
9341                Self::UnknownValue(u) => u.0.serialize(serializer),
9342            }
9343        }
9344    }
9345
9346    impl<'de> serde::de::Deserialize<'de> for State {
9347        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9348        where
9349            D: serde::Deserializer<'de>,
9350        {
9351            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9352                ".google.cloud.deploy.v1.Rollout.State",
9353            ))
9354        }
9355    }
9356
9357    /// Well-known rollout failures.
9358    ///
9359    /// # Working with unknown values
9360    ///
9361    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9362    /// additional enum variants at any time. Adding new variants is not considered
9363    /// a breaking change. Applications should write their code in anticipation of:
9364    ///
9365    /// - New values appearing in future releases of the client library, **and**
9366    /// - New values received dynamically, without application changes.
9367    ///
9368    /// Please consult the [Working with enums] section in the user guide for some
9369    /// guidelines.
9370    ///
9371    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9372    #[derive(Clone, Debug, PartialEq)]
9373    #[non_exhaustive]
9374    pub enum FailureCause {
9375        /// No reason for failure is specified.
9376        Unspecified,
9377        /// Cloud Build is not available, either because it is not enabled or because
9378        /// Cloud Deploy has insufficient permissions. See [required
9379        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9380        CloudBuildUnavailable,
9381        /// The deploy operation did not complete successfully; check Cloud Build
9382        /// logs.
9383        ExecutionFailed,
9384        /// Deployment did not complete within the allotted time.
9385        DeadlineExceeded,
9386        /// Release is in a failed state.
9387        ReleaseFailed,
9388        /// Release is abandoned.
9389        ReleaseAbandoned,
9390        /// No Skaffold verify configuration was found.
9391        VerificationConfigNotFound,
9392        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
9393        /// for additional details.
9394        CloudBuildRequestFailed,
9395        /// A Rollout operation had a feature configured that is not supported.
9396        OperationFeatureNotSupported,
9397        /// If set, the enum was initialized with an unknown value.
9398        ///
9399        /// Applications can examine the value using [FailureCause::value] or
9400        /// [FailureCause::name].
9401        UnknownValue(failure_cause::UnknownValue),
9402    }
9403
9404    #[doc(hidden)]
9405    pub mod failure_cause {
9406        #[allow(unused_imports)]
9407        use super::*;
9408        #[derive(Clone, Debug, PartialEq)]
9409        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9410    }
9411
9412    impl FailureCause {
9413        /// Gets the enum value.
9414        ///
9415        /// Returns `None` if the enum contains an unknown value deserialized from
9416        /// the string representation of enums.
9417        pub fn value(&self) -> std::option::Option<i32> {
9418            match self {
9419                Self::Unspecified => std::option::Option::Some(0),
9420                Self::CloudBuildUnavailable => std::option::Option::Some(1),
9421                Self::ExecutionFailed => std::option::Option::Some(2),
9422                Self::DeadlineExceeded => std::option::Option::Some(3),
9423                Self::ReleaseFailed => std::option::Option::Some(4),
9424                Self::ReleaseAbandoned => std::option::Option::Some(5),
9425                Self::VerificationConfigNotFound => std::option::Option::Some(6),
9426                Self::CloudBuildRequestFailed => std::option::Option::Some(7),
9427                Self::OperationFeatureNotSupported => std::option::Option::Some(8),
9428                Self::UnknownValue(u) => u.0.value(),
9429            }
9430        }
9431
9432        /// Gets the enum value as a string.
9433        ///
9434        /// Returns `None` if the enum contains an unknown value deserialized from
9435        /// the integer representation of enums.
9436        pub fn name(&self) -> std::option::Option<&str> {
9437            match self {
9438                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9439                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
9440                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9441                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
9442                Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
9443                Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
9444                Self::VerificationConfigNotFound => {
9445                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9446                }
9447                Self::CloudBuildRequestFailed => {
9448                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9449                }
9450                Self::OperationFeatureNotSupported => {
9451                    std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
9452                }
9453                Self::UnknownValue(u) => u.0.name(),
9454            }
9455        }
9456    }
9457
9458    impl std::default::Default for FailureCause {
9459        fn default() -> Self {
9460            use std::convert::From;
9461            Self::from(0)
9462        }
9463    }
9464
9465    impl std::fmt::Display for FailureCause {
9466        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9467            wkt::internal::display_enum(f, self.name(), self.value())
9468        }
9469    }
9470
9471    impl std::convert::From<i32> for FailureCause {
9472        fn from(value: i32) -> Self {
9473            match value {
9474                0 => Self::Unspecified,
9475                1 => Self::CloudBuildUnavailable,
9476                2 => Self::ExecutionFailed,
9477                3 => Self::DeadlineExceeded,
9478                4 => Self::ReleaseFailed,
9479                5 => Self::ReleaseAbandoned,
9480                6 => Self::VerificationConfigNotFound,
9481                7 => Self::CloudBuildRequestFailed,
9482                8 => Self::OperationFeatureNotSupported,
9483                _ => Self::UnknownValue(failure_cause::UnknownValue(
9484                    wkt::internal::UnknownEnumValue::Integer(value),
9485                )),
9486            }
9487        }
9488    }
9489
9490    impl std::convert::From<&str> for FailureCause {
9491        fn from(value: &str) -> Self {
9492            use std::string::ToString;
9493            match value {
9494                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9495                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9496                "EXECUTION_FAILED" => Self::ExecutionFailed,
9497                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
9498                "RELEASE_FAILED" => Self::ReleaseFailed,
9499                "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
9500                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9501                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9502                "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
9503                _ => Self::UnknownValue(failure_cause::UnknownValue(
9504                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9505                )),
9506            }
9507        }
9508    }
9509
9510    impl serde::ser::Serialize for FailureCause {
9511        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9512        where
9513            S: serde::Serializer,
9514        {
9515            match self {
9516                Self::Unspecified => serializer.serialize_i32(0),
9517                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9518                Self::ExecutionFailed => serializer.serialize_i32(2),
9519                Self::DeadlineExceeded => serializer.serialize_i32(3),
9520                Self::ReleaseFailed => serializer.serialize_i32(4),
9521                Self::ReleaseAbandoned => serializer.serialize_i32(5),
9522                Self::VerificationConfigNotFound => serializer.serialize_i32(6),
9523                Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
9524                Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
9525                Self::UnknownValue(u) => u.0.serialize(serializer),
9526            }
9527        }
9528    }
9529
9530    impl<'de> serde::de::Deserialize<'de> for FailureCause {
9531        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9532        where
9533            D: serde::Deserializer<'de>,
9534        {
9535            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9536                ".google.cloud.deploy.v1.Rollout.FailureCause",
9537            ))
9538        }
9539    }
9540}
9541
9542/// Metadata includes information associated with a `Rollout`.
9543#[derive(Clone, Default, PartialEq)]
9544#[non_exhaustive]
9545pub struct Metadata {
9546    /// Output only. The name of the Cloud Run Service that is associated with a
9547    /// `Rollout`.
9548    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
9549
9550    /// Output only. AutomationRolloutMetadata contains the information about the
9551    /// interactions between Automation service and this rollout.
9552    pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
9553
9554    /// Output only. Custom metadata provided by user-defined `Rollout` operations.
9555    pub custom: std::option::Option<crate::model::CustomMetadata>,
9556
9557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9558}
9559
9560impl Metadata {
9561    pub fn new() -> Self {
9562        std::default::Default::default()
9563    }
9564
9565    /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
9566    pub fn set_cloud_run<T>(mut self, v: T) -> Self
9567    where
9568        T: std::convert::Into<crate::model::CloudRunMetadata>,
9569    {
9570        self.cloud_run = std::option::Option::Some(v.into());
9571        self
9572    }
9573
9574    /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
9575    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
9576    where
9577        T: std::convert::Into<crate::model::CloudRunMetadata>,
9578    {
9579        self.cloud_run = v.map(|x| x.into());
9580        self
9581    }
9582
9583    /// Sets the value of [automation][crate::model::Metadata::automation].
9584    pub fn set_automation<T>(mut self, v: T) -> Self
9585    where
9586        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
9587    {
9588        self.automation = std::option::Option::Some(v.into());
9589        self
9590    }
9591
9592    /// Sets or clears the value of [automation][crate::model::Metadata::automation].
9593    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
9594    where
9595        T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
9596    {
9597        self.automation = v.map(|x| x.into());
9598        self
9599    }
9600
9601    /// Sets the value of [custom][crate::model::Metadata::custom].
9602    pub fn set_custom<T>(mut self, v: T) -> Self
9603    where
9604        T: std::convert::Into<crate::model::CustomMetadata>,
9605    {
9606        self.custom = std::option::Option::Some(v.into());
9607        self
9608    }
9609
9610    /// Sets or clears the value of [custom][crate::model::Metadata::custom].
9611    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
9612    where
9613        T: std::convert::Into<crate::model::CustomMetadata>,
9614    {
9615        self.custom = v.map(|x| x.into());
9616        self
9617    }
9618}
9619
9620impl wkt::message::Message for Metadata {
9621    fn typename() -> &'static str {
9622        "type.googleapis.com/google.cloud.deploy.v1.Metadata"
9623    }
9624}
9625
9626/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
9627/// the user.
9628#[derive(Clone, Default, PartialEq)]
9629#[non_exhaustive]
9630pub struct DeployJobRunMetadata {
9631    /// Output only. The name of the Cloud Run Service that is associated with a
9632    /// `DeployJobRun`.
9633    pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
9634
9635    /// Output only. Custom Target metadata associated with a `DeployJobRun`.
9636    pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
9637
9638    /// Output only. Custom metadata provided by user-defined deploy operation.
9639    pub custom: std::option::Option<crate::model::CustomMetadata>,
9640
9641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9642}
9643
9644impl DeployJobRunMetadata {
9645    pub fn new() -> Self {
9646        std::default::Default::default()
9647    }
9648
9649    /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
9650    pub fn set_cloud_run<T>(mut self, v: T) -> Self
9651    where
9652        T: std::convert::Into<crate::model::CloudRunMetadata>,
9653    {
9654        self.cloud_run = std::option::Option::Some(v.into());
9655        self
9656    }
9657
9658    /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
9659    pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
9660    where
9661        T: std::convert::Into<crate::model::CloudRunMetadata>,
9662    {
9663        self.cloud_run = v.map(|x| x.into());
9664        self
9665    }
9666
9667    /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
9668    pub fn set_custom_target<T>(mut self, v: T) -> Self
9669    where
9670        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
9671    {
9672        self.custom_target = std::option::Option::Some(v.into());
9673        self
9674    }
9675
9676    /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
9677    pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
9678    where
9679        T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
9680    {
9681        self.custom_target = v.map(|x| x.into());
9682        self
9683    }
9684
9685    /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
9686    pub fn set_custom<T>(mut self, v: T) -> Self
9687    where
9688        T: std::convert::Into<crate::model::CustomMetadata>,
9689    {
9690        self.custom = std::option::Option::Some(v.into());
9691        self
9692    }
9693
9694    /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
9695    pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
9696    where
9697        T: std::convert::Into<crate::model::CustomMetadata>,
9698    {
9699        self.custom = v.map(|x| x.into());
9700        self
9701    }
9702}
9703
9704impl wkt::message::Message for DeployJobRunMetadata {
9705    fn typename() -> &'static str {
9706        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
9707    }
9708}
9709
9710/// CloudRunMetadata contains information from a Cloud Run deployment.
9711#[derive(Clone, Default, PartialEq)]
9712#[non_exhaustive]
9713pub struct CloudRunMetadata {
9714    /// Output only. The name of the Cloud Run Service that is associated with a
9715    /// `Rollout`. Format is
9716    /// `projects/{project}/locations/{location}/services/{service}`.
9717    pub service: std::string::String,
9718
9719    /// Output only. The Cloud Run Service urls that are associated with a
9720    /// `Rollout`.
9721    pub service_urls: std::vec::Vec<std::string::String>,
9722
9723    /// Output only. The Cloud Run Revision id associated with a `Rollout`.
9724    pub revision: std::string::String,
9725
9726    /// Output only. The name of the Cloud Run job that is associated with a
9727    /// `Rollout`. Format is
9728    /// `projects/{project}/locations/{location}/jobs/{job_name}`.
9729    pub job: std::string::String,
9730
9731    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9732}
9733
9734impl CloudRunMetadata {
9735    pub fn new() -> Self {
9736        std::default::Default::default()
9737    }
9738
9739    /// Sets the value of [service][crate::model::CloudRunMetadata::service].
9740    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9741        self.service = v.into();
9742        self
9743    }
9744
9745    /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
9746    pub fn set_service_urls<T, V>(mut self, v: T) -> Self
9747    where
9748        T: std::iter::IntoIterator<Item = V>,
9749        V: std::convert::Into<std::string::String>,
9750    {
9751        use std::iter::Iterator;
9752        self.service_urls = v.into_iter().map(|i| i.into()).collect();
9753        self
9754    }
9755
9756    /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
9757    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9758        self.revision = v.into();
9759        self
9760    }
9761
9762    /// Sets the value of [job][crate::model::CloudRunMetadata::job].
9763    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9764        self.job = v.into();
9765        self
9766    }
9767}
9768
9769impl wkt::message::Message for CloudRunMetadata {
9770    fn typename() -> &'static str {
9771        "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
9772    }
9773}
9774
9775/// CustomTargetDeployMetadata contains information from a Custom Target
9776/// deploy operation.
9777#[derive(Clone, Default, PartialEq)]
9778#[non_exhaustive]
9779pub struct CustomTargetDeployMetadata {
9780    /// Output only. Skip message provided in the results of a custom deploy
9781    /// operation.
9782    pub skip_message: std::string::String,
9783
9784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9785}
9786
9787impl CustomTargetDeployMetadata {
9788    pub fn new() -> Self {
9789        std::default::Default::default()
9790    }
9791
9792    /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
9793    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9794        self.skip_message = v.into();
9795        self
9796    }
9797}
9798
9799impl wkt::message::Message for CustomTargetDeployMetadata {
9800    fn typename() -> &'static str {
9801        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
9802    }
9803}
9804
9805/// AutomationRolloutMetadata contains Automation-related actions that
9806/// were performed on a rollout.
9807#[derive(Clone, Default, PartialEq)]
9808#[non_exhaustive]
9809pub struct AutomationRolloutMetadata {
9810    /// Output only. The name of the AutomationRun initiated by a promote release
9811    /// rule.
9812    pub promote_automation_run: std::string::String,
9813
9814    /// Output only. The names of the AutomationRuns initiated by an advance
9815    /// rollout rule.
9816    pub advance_automation_runs: std::vec::Vec<std::string::String>,
9817
9818    /// Output only. The names of the AutomationRuns initiated by a repair rollout
9819    /// rule.
9820    pub repair_automation_runs: std::vec::Vec<std::string::String>,
9821
9822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9823}
9824
9825impl AutomationRolloutMetadata {
9826    pub fn new() -> Self {
9827        std::default::Default::default()
9828    }
9829
9830    /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
9831    pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
9832        mut self,
9833        v: T,
9834    ) -> Self {
9835        self.promote_automation_run = v.into();
9836        self
9837    }
9838
9839    /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
9840    pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
9841    where
9842        T: std::iter::IntoIterator<Item = V>,
9843        V: std::convert::Into<std::string::String>,
9844    {
9845        use std::iter::Iterator;
9846        self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
9847        self
9848    }
9849
9850    /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
9851    pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
9852    where
9853        T: std::iter::IntoIterator<Item = V>,
9854        V: std::convert::Into<std::string::String>,
9855    {
9856        use std::iter::Iterator;
9857        self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
9858        self
9859    }
9860}
9861
9862impl wkt::message::Message for AutomationRolloutMetadata {
9863    fn typename() -> &'static str {
9864        "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
9865    }
9866}
9867
9868/// CustomMetadata contains information from a user-defined operation.
9869#[derive(Clone, Default, PartialEq)]
9870#[non_exhaustive]
9871pub struct CustomMetadata {
9872    /// Output only. Key-value pairs provided by the user-defined operation.
9873    pub values: std::collections::HashMap<std::string::String, std::string::String>,
9874
9875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9876}
9877
9878impl CustomMetadata {
9879    pub fn new() -> Self {
9880        std::default::Default::default()
9881    }
9882
9883    /// Sets the value of [values][crate::model::CustomMetadata::values].
9884    pub fn set_values<T, K, V>(mut self, v: T) -> Self
9885    where
9886        T: std::iter::IntoIterator<Item = (K, V)>,
9887        K: std::convert::Into<std::string::String>,
9888        V: std::convert::Into<std::string::String>,
9889    {
9890        use std::iter::Iterator;
9891        self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9892        self
9893    }
9894}
9895
9896impl wkt::message::Message for CustomMetadata {
9897    fn typename() -> &'static str {
9898        "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
9899    }
9900}
9901
9902/// Phase represents a collection of jobs that are logically grouped together
9903/// for a `Rollout`.
9904#[derive(Clone, Default, PartialEq)]
9905#[non_exhaustive]
9906pub struct Phase {
9907    /// Output only. The ID of the Phase.
9908    pub id: std::string::String,
9909
9910    /// Output only. Current state of the Phase.
9911    pub state: crate::model::phase::State,
9912
9913    /// Output only. Additional information on why the Phase was skipped, if
9914    /// available.
9915    pub skip_message: std::string::String,
9916
9917    /// The job composition of this Phase.
9918    pub jobs: std::option::Option<crate::model::phase::Jobs>,
9919
9920    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9921}
9922
9923impl Phase {
9924    pub fn new() -> Self {
9925        std::default::Default::default()
9926    }
9927
9928    /// Sets the value of [id][crate::model::Phase::id].
9929    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9930        self.id = v.into();
9931        self
9932    }
9933
9934    /// Sets the value of [state][crate::model::Phase::state].
9935    pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
9936        self.state = v.into();
9937        self
9938    }
9939
9940    /// Sets the value of [skip_message][crate::model::Phase::skip_message].
9941    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9942        self.skip_message = v.into();
9943        self
9944    }
9945
9946    /// Sets the value of [jobs][crate::model::Phase::jobs].
9947    ///
9948    /// Note that all the setters affecting `jobs` are mutually
9949    /// exclusive.
9950    pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
9951        mut self,
9952        v: T,
9953    ) -> Self {
9954        self.jobs = v.into();
9955        self
9956    }
9957
9958    /// The value of [jobs][crate::model::Phase::jobs]
9959    /// if it holds a `DeploymentJobs`, `None` if the field is not set or
9960    /// holds a different branch.
9961    pub fn deployment_jobs(
9962        &self,
9963    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
9964        #[allow(unreachable_patterns)]
9965        self.jobs.as_ref().and_then(|v| match v {
9966            crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
9967            _ => std::option::Option::None,
9968        })
9969    }
9970
9971    /// Sets the value of [jobs][crate::model::Phase::jobs]
9972    /// to hold a `DeploymentJobs`.
9973    ///
9974    /// Note that all the setters affecting `jobs` are
9975    /// mutually exclusive.
9976    pub fn set_deployment_jobs<
9977        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
9978    >(
9979        mut self,
9980        v: T,
9981    ) -> Self {
9982        self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
9983        self
9984    }
9985
9986    /// The value of [jobs][crate::model::Phase::jobs]
9987    /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
9988    /// holds a different branch.
9989    pub fn child_rollout_jobs(
9990        &self,
9991    ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
9992        #[allow(unreachable_patterns)]
9993        self.jobs.as_ref().and_then(|v| match v {
9994            crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
9995            _ => std::option::Option::None,
9996        })
9997    }
9998
9999    /// Sets the value of [jobs][crate::model::Phase::jobs]
10000    /// to hold a `ChildRolloutJobs`.
10001    ///
10002    /// Note that all the setters affecting `jobs` are
10003    /// mutually exclusive.
10004    pub fn set_child_rollout_jobs<
10005        T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
10006    >(
10007        mut self,
10008        v: T,
10009    ) -> Self {
10010        self.jobs =
10011            std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
10012        self
10013    }
10014}
10015
10016impl wkt::message::Message for Phase {
10017    fn typename() -> &'static str {
10018        "type.googleapis.com/google.cloud.deploy.v1.Phase"
10019    }
10020}
10021
10022/// Defines additional types related to [Phase].
10023pub mod phase {
10024    #[allow(unused_imports)]
10025    use super::*;
10026
10027    /// Valid states of a Phase.
10028    ///
10029    /// # Working with unknown values
10030    ///
10031    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10032    /// additional enum variants at any time. Adding new variants is not considered
10033    /// a breaking change. Applications should write their code in anticipation of:
10034    ///
10035    /// - New values appearing in future releases of the client library, **and**
10036    /// - New values received dynamically, without application changes.
10037    ///
10038    /// Please consult the [Working with enums] section in the user guide for some
10039    /// guidelines.
10040    ///
10041    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10042    #[derive(Clone, Debug, PartialEq)]
10043    #[non_exhaustive]
10044    pub enum State {
10045        /// The Phase has an unspecified state.
10046        Unspecified,
10047        /// The Phase is waiting for an earlier Phase(s) to complete.
10048        Pending,
10049        /// The Phase is in progress.
10050        InProgress,
10051        /// The Phase has succeeded.
10052        Succeeded,
10053        /// The Phase has failed.
10054        Failed,
10055        /// The Phase was aborted.
10056        Aborted,
10057        /// The Phase was skipped.
10058        Skipped,
10059        /// If set, the enum was initialized with an unknown value.
10060        ///
10061        /// Applications can examine the value using [State::value] or
10062        /// [State::name].
10063        UnknownValue(state::UnknownValue),
10064    }
10065
10066    #[doc(hidden)]
10067    pub mod state {
10068        #[allow(unused_imports)]
10069        use super::*;
10070        #[derive(Clone, Debug, PartialEq)]
10071        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10072    }
10073
10074    impl State {
10075        /// Gets the enum value.
10076        ///
10077        /// Returns `None` if the enum contains an unknown value deserialized from
10078        /// the string representation of enums.
10079        pub fn value(&self) -> std::option::Option<i32> {
10080            match self {
10081                Self::Unspecified => std::option::Option::Some(0),
10082                Self::Pending => std::option::Option::Some(1),
10083                Self::InProgress => std::option::Option::Some(2),
10084                Self::Succeeded => std::option::Option::Some(3),
10085                Self::Failed => std::option::Option::Some(4),
10086                Self::Aborted => std::option::Option::Some(5),
10087                Self::Skipped => std::option::Option::Some(6),
10088                Self::UnknownValue(u) => u.0.value(),
10089            }
10090        }
10091
10092        /// Gets the enum value as a string.
10093        ///
10094        /// Returns `None` if the enum contains an unknown value deserialized from
10095        /// the integer representation of enums.
10096        pub fn name(&self) -> std::option::Option<&str> {
10097            match self {
10098                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10099                Self::Pending => std::option::Option::Some("PENDING"),
10100                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10101                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10102                Self::Failed => std::option::Option::Some("FAILED"),
10103                Self::Aborted => std::option::Option::Some("ABORTED"),
10104                Self::Skipped => std::option::Option::Some("SKIPPED"),
10105                Self::UnknownValue(u) => u.0.name(),
10106            }
10107        }
10108    }
10109
10110    impl std::default::Default for State {
10111        fn default() -> Self {
10112            use std::convert::From;
10113            Self::from(0)
10114        }
10115    }
10116
10117    impl std::fmt::Display for State {
10118        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10119            wkt::internal::display_enum(f, self.name(), self.value())
10120        }
10121    }
10122
10123    impl std::convert::From<i32> for State {
10124        fn from(value: i32) -> Self {
10125            match value {
10126                0 => Self::Unspecified,
10127                1 => Self::Pending,
10128                2 => Self::InProgress,
10129                3 => Self::Succeeded,
10130                4 => Self::Failed,
10131                5 => Self::Aborted,
10132                6 => Self::Skipped,
10133                _ => Self::UnknownValue(state::UnknownValue(
10134                    wkt::internal::UnknownEnumValue::Integer(value),
10135                )),
10136            }
10137        }
10138    }
10139
10140    impl std::convert::From<&str> for State {
10141        fn from(value: &str) -> Self {
10142            use std::string::ToString;
10143            match value {
10144                "STATE_UNSPECIFIED" => Self::Unspecified,
10145                "PENDING" => Self::Pending,
10146                "IN_PROGRESS" => Self::InProgress,
10147                "SUCCEEDED" => Self::Succeeded,
10148                "FAILED" => Self::Failed,
10149                "ABORTED" => Self::Aborted,
10150                "SKIPPED" => Self::Skipped,
10151                _ => Self::UnknownValue(state::UnknownValue(
10152                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10153                )),
10154            }
10155        }
10156    }
10157
10158    impl serde::ser::Serialize for State {
10159        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10160        where
10161            S: serde::Serializer,
10162        {
10163            match self {
10164                Self::Unspecified => serializer.serialize_i32(0),
10165                Self::Pending => serializer.serialize_i32(1),
10166                Self::InProgress => serializer.serialize_i32(2),
10167                Self::Succeeded => serializer.serialize_i32(3),
10168                Self::Failed => serializer.serialize_i32(4),
10169                Self::Aborted => serializer.serialize_i32(5),
10170                Self::Skipped => serializer.serialize_i32(6),
10171                Self::UnknownValue(u) => u.0.serialize(serializer),
10172            }
10173        }
10174    }
10175
10176    impl<'de> serde::de::Deserialize<'de> for State {
10177        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10178        where
10179            D: serde::Deserializer<'de>,
10180        {
10181            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10182                ".google.cloud.deploy.v1.Phase.State",
10183            ))
10184        }
10185    }
10186
10187    /// The job composition of this Phase.
10188    #[derive(Clone, Debug, PartialEq)]
10189    #[non_exhaustive]
10190    pub enum Jobs {
10191        /// Output only. Deployment job composition.
10192        DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
10193        /// Output only. ChildRollout job composition.
10194        ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
10195    }
10196}
10197
10198/// Deployment job composition.
10199#[derive(Clone, Default, PartialEq)]
10200#[non_exhaustive]
10201pub struct DeploymentJobs {
10202    /// Output only. The predeploy Job, which is the first job on the phase.
10203    pub predeploy_job: std::option::Option<crate::model::Job>,
10204
10205    /// Output only. The deploy Job. This is the deploy job in the phase.
10206    pub deploy_job: std::option::Option<crate::model::Job>,
10207
10208    /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
10209    pub verify_job: std::option::Option<crate::model::Job>,
10210
10211    /// Output only. The postdeploy Job, which is the last job on the phase.
10212    pub postdeploy_job: std::option::Option<crate::model::Job>,
10213
10214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10215}
10216
10217impl DeploymentJobs {
10218    pub fn new() -> Self {
10219        std::default::Default::default()
10220    }
10221
10222    /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
10223    pub fn set_predeploy_job<T>(mut self, v: T) -> Self
10224    where
10225        T: std::convert::Into<crate::model::Job>,
10226    {
10227        self.predeploy_job = std::option::Option::Some(v.into());
10228        self
10229    }
10230
10231    /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
10232    pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
10233    where
10234        T: std::convert::Into<crate::model::Job>,
10235    {
10236        self.predeploy_job = v.map(|x| x.into());
10237        self
10238    }
10239
10240    /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
10241    pub fn set_deploy_job<T>(mut self, v: T) -> Self
10242    where
10243        T: std::convert::Into<crate::model::Job>,
10244    {
10245        self.deploy_job = std::option::Option::Some(v.into());
10246        self
10247    }
10248
10249    /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
10250    pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
10251    where
10252        T: std::convert::Into<crate::model::Job>,
10253    {
10254        self.deploy_job = v.map(|x| x.into());
10255        self
10256    }
10257
10258    /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
10259    pub fn set_verify_job<T>(mut self, v: T) -> Self
10260    where
10261        T: std::convert::Into<crate::model::Job>,
10262    {
10263        self.verify_job = std::option::Option::Some(v.into());
10264        self
10265    }
10266
10267    /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
10268    pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
10269    where
10270        T: std::convert::Into<crate::model::Job>,
10271    {
10272        self.verify_job = v.map(|x| x.into());
10273        self
10274    }
10275
10276    /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
10277    pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
10278    where
10279        T: std::convert::Into<crate::model::Job>,
10280    {
10281        self.postdeploy_job = std::option::Option::Some(v.into());
10282        self
10283    }
10284
10285    /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
10286    pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
10287    where
10288        T: std::convert::Into<crate::model::Job>,
10289    {
10290        self.postdeploy_job = v.map(|x| x.into());
10291        self
10292    }
10293}
10294
10295impl wkt::message::Message for DeploymentJobs {
10296    fn typename() -> &'static str {
10297        "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
10298    }
10299}
10300
10301/// ChildRollouts job composition
10302#[derive(Clone, Default, PartialEq)]
10303#[non_exhaustive]
10304pub struct ChildRolloutJobs {
10305    /// Output only. List of CreateChildRolloutJobs
10306    pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
10307
10308    /// Output only. List of AdvanceChildRolloutJobs
10309    pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
10310
10311    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10312}
10313
10314impl ChildRolloutJobs {
10315    pub fn new() -> Self {
10316        std::default::Default::default()
10317    }
10318
10319    /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
10320    pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
10321    where
10322        T: std::iter::IntoIterator<Item = V>,
10323        V: std::convert::Into<crate::model::Job>,
10324    {
10325        use std::iter::Iterator;
10326        self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
10327        self
10328    }
10329
10330    /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
10331    pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
10332    where
10333        T: std::iter::IntoIterator<Item = V>,
10334        V: std::convert::Into<crate::model::Job>,
10335    {
10336        use std::iter::Iterator;
10337        self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
10338        self
10339    }
10340}
10341
10342impl wkt::message::Message for ChildRolloutJobs {
10343    fn typename() -> &'static str {
10344        "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
10345    }
10346}
10347
10348/// Job represents an operation for a `Rollout`.
10349#[derive(Clone, Default, PartialEq)]
10350#[non_exhaustive]
10351pub struct Job {
10352    /// Output only. The ID of the Job.
10353    pub id: std::string::String,
10354
10355    /// Output only. The current state of the Job.
10356    pub state: crate::model::job::State,
10357
10358    /// Output only. Additional information on why the Job was skipped, if
10359    /// available.
10360    pub skip_message: std::string::String,
10361
10362    /// Output only. The name of the `JobRun` responsible for the most recent
10363    /// invocation of this Job.
10364    pub job_run: std::string::String,
10365
10366    /// The type of Job.
10367    pub job_type: std::option::Option<crate::model::job::JobType>,
10368
10369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10370}
10371
10372impl Job {
10373    pub fn new() -> Self {
10374        std::default::Default::default()
10375    }
10376
10377    /// Sets the value of [id][crate::model::Job::id].
10378    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10379        self.id = v.into();
10380        self
10381    }
10382
10383    /// Sets the value of [state][crate::model::Job::state].
10384    pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
10385        self.state = v.into();
10386        self
10387    }
10388
10389    /// Sets the value of [skip_message][crate::model::Job::skip_message].
10390    pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10391        self.skip_message = v.into();
10392        self
10393    }
10394
10395    /// Sets the value of [job_run][crate::model::Job::job_run].
10396    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10397        self.job_run = v.into();
10398        self
10399    }
10400
10401    /// Sets the value of [job_type][crate::model::Job::job_type].
10402    ///
10403    /// Note that all the setters affecting `job_type` are mutually
10404    /// exclusive.
10405    pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
10406        mut self,
10407        v: T,
10408    ) -> Self {
10409        self.job_type = v.into();
10410        self
10411    }
10412
10413    /// The value of [job_type][crate::model::Job::job_type]
10414    /// if it holds a `DeployJob`, `None` if the field is not set or
10415    /// holds a different branch.
10416    pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
10417        #[allow(unreachable_patterns)]
10418        self.job_type.as_ref().and_then(|v| match v {
10419            crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
10420            _ => std::option::Option::None,
10421        })
10422    }
10423
10424    /// Sets the value of [job_type][crate::model::Job::job_type]
10425    /// to hold a `DeployJob`.
10426    ///
10427    /// Note that all the setters affecting `job_type` are
10428    /// mutually exclusive.
10429    pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
10430        mut self,
10431        v: T,
10432    ) -> Self {
10433        self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
10434        self
10435    }
10436
10437    /// The value of [job_type][crate::model::Job::job_type]
10438    /// if it holds a `VerifyJob`, `None` if the field is not set or
10439    /// holds a different branch.
10440    pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
10441        #[allow(unreachable_patterns)]
10442        self.job_type.as_ref().and_then(|v| match v {
10443            crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
10444            _ => std::option::Option::None,
10445        })
10446    }
10447
10448    /// Sets the value of [job_type][crate::model::Job::job_type]
10449    /// to hold a `VerifyJob`.
10450    ///
10451    /// Note that all the setters affecting `job_type` are
10452    /// mutually exclusive.
10453    pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
10454        mut self,
10455        v: T,
10456    ) -> Self {
10457        self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
10458        self
10459    }
10460
10461    /// The value of [job_type][crate::model::Job::job_type]
10462    /// if it holds a `PredeployJob`, `None` if the field is not set or
10463    /// holds a different branch.
10464    pub fn predeploy_job(
10465        &self,
10466    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
10467        #[allow(unreachable_patterns)]
10468        self.job_type.as_ref().and_then(|v| match v {
10469            crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
10470            _ => std::option::Option::None,
10471        })
10472    }
10473
10474    /// Sets the value of [job_type][crate::model::Job::job_type]
10475    /// to hold a `PredeployJob`.
10476    ///
10477    /// Note that all the setters affecting `job_type` are
10478    /// mutually exclusive.
10479    pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
10480        mut self,
10481        v: T,
10482    ) -> Self {
10483        self.job_type =
10484            std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
10485        self
10486    }
10487
10488    /// The value of [job_type][crate::model::Job::job_type]
10489    /// if it holds a `PostdeployJob`, `None` if the field is not set or
10490    /// holds a different branch.
10491    pub fn postdeploy_job(
10492        &self,
10493    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
10494        #[allow(unreachable_patterns)]
10495        self.job_type.as_ref().and_then(|v| match v {
10496            crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
10497            _ => std::option::Option::None,
10498        })
10499    }
10500
10501    /// Sets the value of [job_type][crate::model::Job::job_type]
10502    /// to hold a `PostdeployJob`.
10503    ///
10504    /// Note that all the setters affecting `job_type` are
10505    /// mutually exclusive.
10506    pub fn set_postdeploy_job<
10507        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
10508    >(
10509        mut self,
10510        v: T,
10511    ) -> Self {
10512        self.job_type =
10513            std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
10514        self
10515    }
10516
10517    /// The value of [job_type][crate::model::Job::job_type]
10518    /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
10519    /// holds a different branch.
10520    pub fn create_child_rollout_job(
10521        &self,
10522    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
10523        #[allow(unreachable_patterns)]
10524        self.job_type.as_ref().and_then(|v| match v {
10525            crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
10526            _ => std::option::Option::None,
10527        })
10528    }
10529
10530    /// Sets the value of [job_type][crate::model::Job::job_type]
10531    /// to hold a `CreateChildRolloutJob`.
10532    ///
10533    /// Note that all the setters affecting `job_type` are
10534    /// mutually exclusive.
10535    pub fn set_create_child_rollout_job<
10536        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
10537    >(
10538        mut self,
10539        v: T,
10540    ) -> Self {
10541        self.job_type =
10542            std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
10543        self
10544    }
10545
10546    /// The value of [job_type][crate::model::Job::job_type]
10547    /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
10548    /// holds a different branch.
10549    pub fn advance_child_rollout_job(
10550        &self,
10551    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
10552        #[allow(unreachable_patterns)]
10553        self.job_type.as_ref().and_then(|v| match v {
10554            crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
10555            _ => std::option::Option::None,
10556        })
10557    }
10558
10559    /// Sets the value of [job_type][crate::model::Job::job_type]
10560    /// to hold a `AdvanceChildRolloutJob`.
10561    ///
10562    /// Note that all the setters affecting `job_type` are
10563    /// mutually exclusive.
10564    pub fn set_advance_child_rollout_job<
10565        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
10566    >(
10567        mut self,
10568        v: T,
10569    ) -> Self {
10570        self.job_type =
10571            std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
10572        self
10573    }
10574}
10575
10576impl wkt::message::Message for Job {
10577    fn typename() -> &'static str {
10578        "type.googleapis.com/google.cloud.deploy.v1.Job"
10579    }
10580}
10581
10582/// Defines additional types related to [Job].
10583pub mod job {
10584    #[allow(unused_imports)]
10585    use super::*;
10586
10587    /// Valid states of a Job.
10588    ///
10589    /// # Working with unknown values
10590    ///
10591    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10592    /// additional enum variants at any time. Adding new variants is not considered
10593    /// a breaking change. Applications should write their code in anticipation of:
10594    ///
10595    /// - New values appearing in future releases of the client library, **and**
10596    /// - New values received dynamically, without application changes.
10597    ///
10598    /// Please consult the [Working with enums] section in the user guide for some
10599    /// guidelines.
10600    ///
10601    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10602    #[derive(Clone, Debug, PartialEq)]
10603    #[non_exhaustive]
10604    pub enum State {
10605        /// The Job has an unspecified state.
10606        Unspecified,
10607        /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
10608        Pending,
10609        /// The Job is disabled.
10610        Disabled,
10611        /// The Job is in progress.
10612        InProgress,
10613        /// The Job succeeded.
10614        Succeeded,
10615        /// The Job failed.
10616        Failed,
10617        /// The Job was aborted.
10618        Aborted,
10619        /// The Job was skipped.
10620        Skipped,
10621        /// The Job was ignored.
10622        Ignored,
10623        /// If set, the enum was initialized with an unknown value.
10624        ///
10625        /// Applications can examine the value using [State::value] or
10626        /// [State::name].
10627        UnknownValue(state::UnknownValue),
10628    }
10629
10630    #[doc(hidden)]
10631    pub mod state {
10632        #[allow(unused_imports)]
10633        use super::*;
10634        #[derive(Clone, Debug, PartialEq)]
10635        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10636    }
10637
10638    impl State {
10639        /// Gets the enum value.
10640        ///
10641        /// Returns `None` if the enum contains an unknown value deserialized from
10642        /// the string representation of enums.
10643        pub fn value(&self) -> std::option::Option<i32> {
10644            match self {
10645                Self::Unspecified => std::option::Option::Some(0),
10646                Self::Pending => std::option::Option::Some(1),
10647                Self::Disabled => std::option::Option::Some(2),
10648                Self::InProgress => std::option::Option::Some(3),
10649                Self::Succeeded => std::option::Option::Some(4),
10650                Self::Failed => std::option::Option::Some(5),
10651                Self::Aborted => std::option::Option::Some(6),
10652                Self::Skipped => std::option::Option::Some(7),
10653                Self::Ignored => std::option::Option::Some(8),
10654                Self::UnknownValue(u) => u.0.value(),
10655            }
10656        }
10657
10658        /// Gets the enum value as a string.
10659        ///
10660        /// Returns `None` if the enum contains an unknown value deserialized from
10661        /// the integer representation of enums.
10662        pub fn name(&self) -> std::option::Option<&str> {
10663            match self {
10664                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10665                Self::Pending => std::option::Option::Some("PENDING"),
10666                Self::Disabled => std::option::Option::Some("DISABLED"),
10667                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10668                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10669                Self::Failed => std::option::Option::Some("FAILED"),
10670                Self::Aborted => std::option::Option::Some("ABORTED"),
10671                Self::Skipped => std::option::Option::Some("SKIPPED"),
10672                Self::Ignored => std::option::Option::Some("IGNORED"),
10673                Self::UnknownValue(u) => u.0.name(),
10674            }
10675        }
10676    }
10677
10678    impl std::default::Default for State {
10679        fn default() -> Self {
10680            use std::convert::From;
10681            Self::from(0)
10682        }
10683    }
10684
10685    impl std::fmt::Display for State {
10686        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10687            wkt::internal::display_enum(f, self.name(), self.value())
10688        }
10689    }
10690
10691    impl std::convert::From<i32> for State {
10692        fn from(value: i32) -> Self {
10693            match value {
10694                0 => Self::Unspecified,
10695                1 => Self::Pending,
10696                2 => Self::Disabled,
10697                3 => Self::InProgress,
10698                4 => Self::Succeeded,
10699                5 => Self::Failed,
10700                6 => Self::Aborted,
10701                7 => Self::Skipped,
10702                8 => Self::Ignored,
10703                _ => Self::UnknownValue(state::UnknownValue(
10704                    wkt::internal::UnknownEnumValue::Integer(value),
10705                )),
10706            }
10707        }
10708    }
10709
10710    impl std::convert::From<&str> for State {
10711        fn from(value: &str) -> Self {
10712            use std::string::ToString;
10713            match value {
10714                "STATE_UNSPECIFIED" => Self::Unspecified,
10715                "PENDING" => Self::Pending,
10716                "DISABLED" => Self::Disabled,
10717                "IN_PROGRESS" => Self::InProgress,
10718                "SUCCEEDED" => Self::Succeeded,
10719                "FAILED" => Self::Failed,
10720                "ABORTED" => Self::Aborted,
10721                "SKIPPED" => Self::Skipped,
10722                "IGNORED" => Self::Ignored,
10723                _ => Self::UnknownValue(state::UnknownValue(
10724                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10725                )),
10726            }
10727        }
10728    }
10729
10730    impl serde::ser::Serialize for State {
10731        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10732        where
10733            S: serde::Serializer,
10734        {
10735            match self {
10736                Self::Unspecified => serializer.serialize_i32(0),
10737                Self::Pending => serializer.serialize_i32(1),
10738                Self::Disabled => serializer.serialize_i32(2),
10739                Self::InProgress => serializer.serialize_i32(3),
10740                Self::Succeeded => serializer.serialize_i32(4),
10741                Self::Failed => serializer.serialize_i32(5),
10742                Self::Aborted => serializer.serialize_i32(6),
10743                Self::Skipped => serializer.serialize_i32(7),
10744                Self::Ignored => serializer.serialize_i32(8),
10745                Self::UnknownValue(u) => u.0.serialize(serializer),
10746            }
10747        }
10748    }
10749
10750    impl<'de> serde::de::Deserialize<'de> for State {
10751        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10752        where
10753            D: serde::Deserializer<'de>,
10754        {
10755            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10756                ".google.cloud.deploy.v1.Job.State",
10757            ))
10758        }
10759    }
10760
10761    /// The type of Job.
10762    #[derive(Clone, Debug, PartialEq)]
10763    #[non_exhaustive]
10764    pub enum JobType {
10765        /// Output only. A deploy Job.
10766        DeployJob(std::boxed::Box<crate::model::DeployJob>),
10767        /// Output only. A verify Job.
10768        VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
10769        /// Output only. A predeploy Job.
10770        PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
10771        /// Output only. A postdeploy Job.
10772        PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
10773        /// Output only. A createChildRollout Job.
10774        CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
10775        /// Output only. An advanceChildRollout Job.
10776        AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
10777    }
10778}
10779
10780/// A deploy Job.
10781#[derive(Clone, Default, PartialEq)]
10782#[non_exhaustive]
10783pub struct DeployJob {
10784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10785}
10786
10787impl DeployJob {
10788    pub fn new() -> Self {
10789        std::default::Default::default()
10790    }
10791}
10792
10793impl wkt::message::Message for DeployJob {
10794    fn typename() -> &'static str {
10795        "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
10796    }
10797}
10798
10799/// A verify Job.
10800#[derive(Clone, Default, PartialEq)]
10801#[non_exhaustive]
10802pub struct VerifyJob {
10803    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10804}
10805
10806impl VerifyJob {
10807    pub fn new() -> Self {
10808        std::default::Default::default()
10809    }
10810}
10811
10812impl wkt::message::Message for VerifyJob {
10813    fn typename() -> &'static str {
10814        "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
10815    }
10816}
10817
10818/// A predeploy Job.
10819#[derive(Clone, Default, PartialEq)]
10820#[non_exhaustive]
10821pub struct PredeployJob {
10822    /// Output only. The custom actions that the predeploy Job executes.
10823    pub actions: std::vec::Vec<std::string::String>,
10824
10825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10826}
10827
10828impl PredeployJob {
10829    pub fn new() -> Self {
10830        std::default::Default::default()
10831    }
10832
10833    /// Sets the value of [actions][crate::model::PredeployJob::actions].
10834    pub fn set_actions<T, V>(mut self, v: T) -> Self
10835    where
10836        T: std::iter::IntoIterator<Item = V>,
10837        V: std::convert::Into<std::string::String>,
10838    {
10839        use std::iter::Iterator;
10840        self.actions = v.into_iter().map(|i| i.into()).collect();
10841        self
10842    }
10843}
10844
10845impl wkt::message::Message for PredeployJob {
10846    fn typename() -> &'static str {
10847        "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
10848    }
10849}
10850
10851/// A postdeploy Job.
10852#[derive(Clone, Default, PartialEq)]
10853#[non_exhaustive]
10854pub struct PostdeployJob {
10855    /// Output only. The custom actions that the postdeploy Job executes.
10856    pub actions: std::vec::Vec<std::string::String>,
10857
10858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10859}
10860
10861impl PostdeployJob {
10862    pub fn new() -> Self {
10863        std::default::Default::default()
10864    }
10865
10866    /// Sets the value of [actions][crate::model::PostdeployJob::actions].
10867    pub fn set_actions<T, V>(mut self, v: T) -> Self
10868    where
10869        T: std::iter::IntoIterator<Item = V>,
10870        V: std::convert::Into<std::string::String>,
10871    {
10872        use std::iter::Iterator;
10873        self.actions = v.into_iter().map(|i| i.into()).collect();
10874        self
10875    }
10876}
10877
10878impl wkt::message::Message for PostdeployJob {
10879    fn typename() -> &'static str {
10880        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
10881    }
10882}
10883
10884/// A createChildRollout Job.
10885#[derive(Clone, Default, PartialEq)]
10886#[non_exhaustive]
10887pub struct CreateChildRolloutJob {
10888    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10889}
10890
10891impl CreateChildRolloutJob {
10892    pub fn new() -> Self {
10893        std::default::Default::default()
10894    }
10895}
10896
10897impl wkt::message::Message for CreateChildRolloutJob {
10898    fn typename() -> &'static str {
10899        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
10900    }
10901}
10902
10903/// An advanceChildRollout Job.
10904#[derive(Clone, Default, PartialEq)]
10905#[non_exhaustive]
10906pub struct AdvanceChildRolloutJob {
10907    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10908}
10909
10910impl AdvanceChildRolloutJob {
10911    pub fn new() -> Self {
10912        std::default::Default::default()
10913    }
10914}
10915
10916impl wkt::message::Message for AdvanceChildRolloutJob {
10917    fn typename() -> &'static str {
10918        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
10919    }
10920}
10921
10922/// ListRolloutsRequest is the request object used by `ListRollouts`.
10923#[derive(Clone, Default, PartialEq)]
10924#[non_exhaustive]
10925pub struct ListRolloutsRequest {
10926    /// Required. The `Release` which owns this collection of `Rollout` objects.
10927    pub parent: std::string::String,
10928
10929    /// Optional. The maximum number of `Rollout` objects to return. The service
10930    /// may return fewer than this value. If unspecified, at most 50 `Rollout`
10931    /// objects will be returned. The maximum value is 1000; values above 1000 will
10932    /// be set to 1000.
10933    pub page_size: i32,
10934
10935    /// Optional. A page token, received from a previous `ListRollouts` call.
10936    /// Provide this to retrieve the subsequent page.
10937    ///
10938    /// When paginating, all other provided parameters match
10939    /// the call that provided the page token.
10940    pub page_token: std::string::String,
10941
10942    /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
10943    /// for more details.
10944    pub filter: std::string::String,
10945
10946    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
10947    /// more details.
10948    pub order_by: std::string::String,
10949
10950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10951}
10952
10953impl ListRolloutsRequest {
10954    pub fn new() -> Self {
10955        std::default::Default::default()
10956    }
10957
10958    /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
10959    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10960        self.parent = v.into();
10961        self
10962    }
10963
10964    /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
10965    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10966        self.page_size = v.into();
10967        self
10968    }
10969
10970    /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
10971    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10972        self.page_token = v.into();
10973        self
10974    }
10975
10976    /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
10977    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10978        self.filter = v.into();
10979        self
10980    }
10981
10982    /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
10983    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10984        self.order_by = v.into();
10985        self
10986    }
10987}
10988
10989impl wkt::message::Message for ListRolloutsRequest {
10990    fn typename() -> &'static str {
10991        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
10992    }
10993}
10994
10995/// ListRolloutsResponse is the response object returned by `ListRollouts`.
10996#[derive(Clone, Default, PartialEq)]
10997#[non_exhaustive]
10998pub struct ListRolloutsResponse {
10999    /// The `Rollout` objects.
11000    pub rollouts: std::vec::Vec<crate::model::Rollout>,
11001
11002    /// A token, which can be sent as `page_token` to retrieve the next page.
11003    /// If this field is omitted, there are no subsequent pages.
11004    pub next_page_token: std::string::String,
11005
11006    /// Locations that could not be reached.
11007    pub unreachable: std::vec::Vec<std::string::String>,
11008
11009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11010}
11011
11012impl ListRolloutsResponse {
11013    pub fn new() -> Self {
11014        std::default::Default::default()
11015    }
11016
11017    /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
11018    pub fn set_rollouts<T, V>(mut self, v: T) -> Self
11019    where
11020        T: std::iter::IntoIterator<Item = V>,
11021        V: std::convert::Into<crate::model::Rollout>,
11022    {
11023        use std::iter::Iterator;
11024        self.rollouts = v.into_iter().map(|i| i.into()).collect();
11025        self
11026    }
11027
11028    /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
11029    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11030        self.next_page_token = v.into();
11031        self
11032    }
11033
11034    /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
11035    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11036    where
11037        T: std::iter::IntoIterator<Item = V>,
11038        V: std::convert::Into<std::string::String>,
11039    {
11040        use std::iter::Iterator;
11041        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11042        self
11043    }
11044}
11045
11046impl wkt::message::Message for ListRolloutsResponse {
11047    fn typename() -> &'static str {
11048        "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
11049    }
11050}
11051
11052#[doc(hidden)]
11053impl gax::paginator::internal::PageableResponse for ListRolloutsResponse {
11054    type PageItem = crate::model::Rollout;
11055
11056    fn items(self) -> std::vec::Vec<Self::PageItem> {
11057        self.rollouts
11058    }
11059
11060    fn next_page_token(&self) -> std::string::String {
11061        use std::clone::Clone;
11062        self.next_page_token.clone()
11063    }
11064}
11065
11066/// GetRolloutRequest is the request object used by `GetRollout`.
11067#[derive(Clone, Default, PartialEq)]
11068#[non_exhaustive]
11069pub struct GetRolloutRequest {
11070    /// Required. Name of the `Rollout`. Format must be
11071    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
11072    pub name: std::string::String,
11073
11074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11075}
11076
11077impl GetRolloutRequest {
11078    pub fn new() -> Self {
11079        std::default::Default::default()
11080    }
11081
11082    /// Sets the value of [name][crate::model::GetRolloutRequest::name].
11083    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11084        self.name = v.into();
11085        self
11086    }
11087}
11088
11089impl wkt::message::Message for GetRolloutRequest {
11090    fn typename() -> &'static str {
11091        "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
11092    }
11093}
11094
11095/// CreateRolloutRequest is the request object used by `CreateRollout`.
11096#[derive(Clone, Default, PartialEq)]
11097#[non_exhaustive]
11098pub struct CreateRolloutRequest {
11099    /// Required. The parent collection in which the `Rollout` must be created.
11100    /// The format is
11101    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11102    pub parent: std::string::String,
11103
11104    /// Required. ID of the `Rollout`.
11105    pub rollout_id: std::string::String,
11106
11107    /// Required. The `Rollout` to create.
11108    pub rollout: std::option::Option<crate::model::Rollout>,
11109
11110    /// Optional. A request ID to identify requests. Specify a unique request ID
11111    /// so that if you must retry your request, the server knows to ignore the
11112    /// request if it has already been completed. The server guarantees that for
11113    /// at least 60 minutes after the first request.
11114    ///
11115    /// For example, consider a situation where you make an initial request and the
11116    /// request times out. If you make the request again with the same request ID,
11117    /// the server can check if original operation with the same request ID was
11118    /// received, and if so, will ignore the second request. This prevents clients
11119    /// from accidentally creating duplicate commitments.
11120    ///
11121    /// The request ID must be a valid UUID with the exception that zero UUID is
11122    /// not supported (00000000-0000-0000-0000-000000000000).
11123    pub request_id: std::string::String,
11124
11125    /// Optional. If set to true, the request is validated and the user is provided
11126    /// with an expected result, but no actual change is made.
11127    pub validate_only: bool,
11128
11129    /// Optional. Deploy policies to override. Format is
11130    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11131    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11132
11133    /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
11134    /// will start at the first phase.
11135    pub starting_phase_id: std::string::String,
11136
11137    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11138}
11139
11140impl CreateRolloutRequest {
11141    pub fn new() -> Self {
11142        std::default::Default::default()
11143    }
11144
11145    /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
11146    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11147        self.parent = v.into();
11148        self
11149    }
11150
11151    /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
11152    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11153        self.rollout_id = v.into();
11154        self
11155    }
11156
11157    /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
11158    pub fn set_rollout<T>(mut self, v: T) -> Self
11159    where
11160        T: std::convert::Into<crate::model::Rollout>,
11161    {
11162        self.rollout = std::option::Option::Some(v.into());
11163        self
11164    }
11165
11166    /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
11167    pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
11168    where
11169        T: std::convert::Into<crate::model::Rollout>,
11170    {
11171        self.rollout = v.map(|x| x.into());
11172        self
11173    }
11174
11175    /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
11176    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11177        self.request_id = v.into();
11178        self
11179    }
11180
11181    /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
11182    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11183        self.validate_only = v.into();
11184        self
11185    }
11186
11187    /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
11188    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11189    where
11190        T: std::iter::IntoIterator<Item = V>,
11191        V: std::convert::Into<std::string::String>,
11192    {
11193        use std::iter::Iterator;
11194        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11195        self
11196    }
11197
11198    /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
11199    pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
11200        mut self,
11201        v: T,
11202    ) -> Self {
11203        self.starting_phase_id = v.into();
11204        self
11205    }
11206}
11207
11208impl wkt::message::Message for CreateRolloutRequest {
11209    fn typename() -> &'static str {
11210        "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
11211    }
11212}
11213
11214/// Represents the metadata of the long-running operation.
11215#[derive(Clone, Default, PartialEq)]
11216#[non_exhaustive]
11217pub struct OperationMetadata {
11218    /// Output only. The time the operation was created.
11219    pub create_time: std::option::Option<wkt::Timestamp>,
11220
11221    /// Output only. The time the operation finished running.
11222    pub end_time: std::option::Option<wkt::Timestamp>,
11223
11224    /// Output only. Server-defined resource path for the target of the operation.
11225    pub target: std::string::String,
11226
11227    /// Output only. Name of the verb executed by the operation.
11228    pub verb: std::string::String,
11229
11230    /// Output only. Human-readable status of the operation, if any.
11231    pub status_message: std::string::String,
11232
11233    /// Output only. Identifies whether the user has requested cancellation
11234    /// of the operation. Operations that have successfully been cancelled
11235    /// have
11236    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
11237    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
11238    /// corresponding to `Code.CANCELLED`.
11239    ///
11240    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
11241    /// [google.rpc.Status.code]: rpc::model::Status::code
11242    pub requested_cancellation: bool,
11243
11244    /// Output only. API version used to start the operation.
11245    pub api_version: std::string::String,
11246
11247    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11248}
11249
11250impl OperationMetadata {
11251    pub fn new() -> Self {
11252        std::default::Default::default()
11253    }
11254
11255    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
11256    pub fn set_create_time<T>(mut self, v: T) -> Self
11257    where
11258        T: std::convert::Into<wkt::Timestamp>,
11259    {
11260        self.create_time = std::option::Option::Some(v.into());
11261        self
11262    }
11263
11264    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
11265    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11266    where
11267        T: std::convert::Into<wkt::Timestamp>,
11268    {
11269        self.create_time = v.map(|x| x.into());
11270        self
11271    }
11272
11273    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
11274    pub fn set_end_time<T>(mut self, v: T) -> Self
11275    where
11276        T: std::convert::Into<wkt::Timestamp>,
11277    {
11278        self.end_time = std::option::Option::Some(v.into());
11279        self
11280    }
11281
11282    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
11283    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11284    where
11285        T: std::convert::Into<wkt::Timestamp>,
11286    {
11287        self.end_time = v.map(|x| x.into());
11288        self
11289    }
11290
11291    /// Sets the value of [target][crate::model::OperationMetadata::target].
11292    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11293        self.target = v.into();
11294        self
11295    }
11296
11297    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
11298    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11299        self.verb = v.into();
11300        self
11301    }
11302
11303    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
11304    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11305        self.status_message = v.into();
11306        self
11307    }
11308
11309    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
11310    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11311        self.requested_cancellation = v.into();
11312        self
11313    }
11314
11315    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
11316    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11317        self.api_version = v.into();
11318        self
11319    }
11320}
11321
11322impl wkt::message::Message for OperationMetadata {
11323    fn typename() -> &'static str {
11324        "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
11325    }
11326}
11327
11328/// The request object used by `ApproveRollout`.
11329#[derive(Clone, Default, PartialEq)]
11330#[non_exhaustive]
11331pub struct ApproveRolloutRequest {
11332    /// Required. Name of the Rollout. Format is
11333    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11334    pub name: std::string::String,
11335
11336    /// Required. True = approve; false = reject
11337    pub approved: bool,
11338
11339    /// Optional. Deploy policies to override. Format is
11340    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11341    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11342
11343    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11344}
11345
11346impl ApproveRolloutRequest {
11347    pub fn new() -> Self {
11348        std::default::Default::default()
11349    }
11350
11351    /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
11352    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11353        self.name = v.into();
11354        self
11355    }
11356
11357    /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
11358    pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11359        self.approved = v.into();
11360        self
11361    }
11362
11363    /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
11364    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11365    where
11366        T: std::iter::IntoIterator<Item = V>,
11367        V: std::convert::Into<std::string::String>,
11368    {
11369        use std::iter::Iterator;
11370        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11371        self
11372    }
11373}
11374
11375impl wkt::message::Message for ApproveRolloutRequest {
11376    fn typename() -> &'static str {
11377        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
11378    }
11379}
11380
11381/// The response object from `ApproveRollout`.
11382#[derive(Clone, Default, PartialEq)]
11383#[non_exhaustive]
11384pub struct ApproveRolloutResponse {
11385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11386}
11387
11388impl ApproveRolloutResponse {
11389    pub fn new() -> Self {
11390        std::default::Default::default()
11391    }
11392}
11393
11394impl wkt::message::Message for ApproveRolloutResponse {
11395    fn typename() -> &'static str {
11396        "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
11397    }
11398}
11399
11400/// The request object used by `AdvanceRollout`.
11401#[derive(Clone, Default, PartialEq)]
11402#[non_exhaustive]
11403pub struct AdvanceRolloutRequest {
11404    /// Required. Name of the Rollout. Format is
11405    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11406    pub name: std::string::String,
11407
11408    /// Required. The phase ID to advance the `Rollout` to.
11409    pub phase_id: std::string::String,
11410
11411    /// Optional. Deploy policies to override. Format is
11412    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11413    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11414
11415    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11416}
11417
11418impl AdvanceRolloutRequest {
11419    pub fn new() -> Self {
11420        std::default::Default::default()
11421    }
11422
11423    /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
11424    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11425        self.name = v.into();
11426        self
11427    }
11428
11429    /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
11430    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11431        self.phase_id = v.into();
11432        self
11433    }
11434
11435    /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
11436    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11437    where
11438        T: std::iter::IntoIterator<Item = V>,
11439        V: std::convert::Into<std::string::String>,
11440    {
11441        use std::iter::Iterator;
11442        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11443        self
11444    }
11445}
11446
11447impl wkt::message::Message for AdvanceRolloutRequest {
11448    fn typename() -> &'static str {
11449        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
11450    }
11451}
11452
11453/// The response object from `AdvanceRollout`.
11454#[derive(Clone, Default, PartialEq)]
11455#[non_exhaustive]
11456pub struct AdvanceRolloutResponse {
11457    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11458}
11459
11460impl AdvanceRolloutResponse {
11461    pub fn new() -> Self {
11462        std::default::Default::default()
11463    }
11464}
11465
11466impl wkt::message::Message for AdvanceRolloutResponse {
11467    fn typename() -> &'static str {
11468        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
11469    }
11470}
11471
11472/// The request object used by `CancelRollout`.
11473#[derive(Clone, Default, PartialEq)]
11474#[non_exhaustive]
11475pub struct CancelRolloutRequest {
11476    /// Required. Name of the Rollout. Format is
11477    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11478    pub name: std::string::String,
11479
11480    /// Optional. Deploy policies to override. Format is
11481    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11482    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11483
11484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11485}
11486
11487impl CancelRolloutRequest {
11488    pub fn new() -> Self {
11489        std::default::Default::default()
11490    }
11491
11492    /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
11493    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11494        self.name = v.into();
11495        self
11496    }
11497
11498    /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
11499    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11500    where
11501        T: std::iter::IntoIterator<Item = V>,
11502        V: std::convert::Into<std::string::String>,
11503    {
11504        use std::iter::Iterator;
11505        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11506        self
11507    }
11508}
11509
11510impl wkt::message::Message for CancelRolloutRequest {
11511    fn typename() -> &'static str {
11512        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
11513    }
11514}
11515
11516/// The response object from `CancelRollout`.
11517#[derive(Clone, Default, PartialEq)]
11518#[non_exhaustive]
11519pub struct CancelRolloutResponse {
11520    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11521}
11522
11523impl CancelRolloutResponse {
11524    pub fn new() -> Self {
11525        std::default::Default::default()
11526    }
11527}
11528
11529impl wkt::message::Message for CancelRolloutResponse {
11530    fn typename() -> &'static str {
11531        "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
11532    }
11533}
11534
11535/// The request object used by `IgnoreJob`.
11536#[derive(Clone, Default, PartialEq)]
11537#[non_exhaustive]
11538pub struct IgnoreJobRequest {
11539    /// Required. Name of the Rollout. Format is
11540    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11541    pub rollout: std::string::String,
11542
11543    /// Required. The phase ID the Job to ignore belongs to.
11544    pub phase_id: std::string::String,
11545
11546    /// Required. The job ID for the Job to ignore.
11547    pub job_id: std::string::String,
11548
11549    /// Optional. Deploy policies to override. Format is
11550    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11551    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11552
11553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11554}
11555
11556impl IgnoreJobRequest {
11557    pub fn new() -> Self {
11558        std::default::Default::default()
11559    }
11560
11561    /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
11562    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11563        self.rollout = v.into();
11564        self
11565    }
11566
11567    /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
11568    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11569        self.phase_id = v.into();
11570        self
11571    }
11572
11573    /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
11574    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11575        self.job_id = v.into();
11576        self
11577    }
11578
11579    /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
11580    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11581    where
11582        T: std::iter::IntoIterator<Item = V>,
11583        V: std::convert::Into<std::string::String>,
11584    {
11585        use std::iter::Iterator;
11586        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11587        self
11588    }
11589}
11590
11591impl wkt::message::Message for IgnoreJobRequest {
11592    fn typename() -> &'static str {
11593        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
11594    }
11595}
11596
11597/// The response object from `IgnoreJob`.
11598#[derive(Clone, Default, PartialEq)]
11599#[non_exhaustive]
11600pub struct IgnoreJobResponse {
11601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11602}
11603
11604impl IgnoreJobResponse {
11605    pub fn new() -> Self {
11606        std::default::Default::default()
11607    }
11608}
11609
11610impl wkt::message::Message for IgnoreJobResponse {
11611    fn typename() -> &'static str {
11612        "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
11613    }
11614}
11615
11616/// RetryJobRequest is the request object used by `RetryJob`.
11617#[derive(Clone, Default, PartialEq)]
11618#[non_exhaustive]
11619pub struct RetryJobRequest {
11620    /// Required. Name of the Rollout. Format is
11621    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11622    pub rollout: std::string::String,
11623
11624    /// Required. The phase ID the Job to retry belongs to.
11625    pub phase_id: std::string::String,
11626
11627    /// Required. The job ID for the Job to retry.
11628    pub job_id: std::string::String,
11629
11630    /// Optional. Deploy policies to override. Format is
11631    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11632    pub override_deploy_policy: std::vec::Vec<std::string::String>,
11633
11634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11635}
11636
11637impl RetryJobRequest {
11638    pub fn new() -> Self {
11639        std::default::Default::default()
11640    }
11641
11642    /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
11643    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11644        self.rollout = v.into();
11645        self
11646    }
11647
11648    /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
11649    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11650        self.phase_id = v.into();
11651        self
11652    }
11653
11654    /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
11655    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11656        self.job_id = v.into();
11657        self
11658    }
11659
11660    /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
11661    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11662    where
11663        T: std::iter::IntoIterator<Item = V>,
11664        V: std::convert::Into<std::string::String>,
11665    {
11666        use std::iter::Iterator;
11667        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11668        self
11669    }
11670}
11671
11672impl wkt::message::Message for RetryJobRequest {
11673    fn typename() -> &'static str {
11674        "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
11675    }
11676}
11677
11678/// The response object from 'RetryJob'.
11679#[derive(Clone, Default, PartialEq)]
11680#[non_exhaustive]
11681pub struct RetryJobResponse {
11682    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11683}
11684
11685impl RetryJobResponse {
11686    pub fn new() -> Self {
11687        std::default::Default::default()
11688    }
11689}
11690
11691impl wkt::message::Message for RetryJobResponse {
11692    fn typename() -> &'static str {
11693        "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
11694    }
11695}
11696
11697/// The request object used by `AbandonRelease`.
11698#[derive(Clone, Default, PartialEq)]
11699#[non_exhaustive]
11700pub struct AbandonReleaseRequest {
11701    /// Required. Name of the Release. Format is
11702    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
11703    pub name: std::string::String,
11704
11705    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11706}
11707
11708impl AbandonReleaseRequest {
11709    pub fn new() -> Self {
11710        std::default::Default::default()
11711    }
11712
11713    /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
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 AbandonReleaseRequest {
11721    fn typename() -> &'static str {
11722        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
11723    }
11724}
11725
11726/// The response object for `AbandonRelease`.
11727#[derive(Clone, Default, PartialEq)]
11728#[non_exhaustive]
11729pub struct AbandonReleaseResponse {
11730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11731}
11732
11733impl AbandonReleaseResponse {
11734    pub fn new() -> Self {
11735        std::default::Default::default()
11736    }
11737}
11738
11739impl wkt::message::Message for AbandonReleaseResponse {
11740    fn typename() -> &'static str {
11741        "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
11742    }
11743}
11744
11745/// A `JobRun` resource in the Cloud Deploy API.
11746///
11747/// A `JobRun` contains information of a single `Rollout` job evaluation.
11748#[derive(Clone, Default, PartialEq)]
11749#[non_exhaustive]
11750pub struct JobRun {
11751    /// Output only. Name of the `JobRun`. Format is
11752    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
11753    pub name: std::string::String,
11754
11755    /// Output only. Unique identifier of the `JobRun`.
11756    pub uid: std::string::String,
11757
11758    /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
11759    pub phase_id: std::string::String,
11760
11761    /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
11762    pub job_id: std::string::String,
11763
11764    /// Output only. Time at which the `JobRun` was created.
11765    pub create_time: std::option::Option<wkt::Timestamp>,
11766
11767    /// Output only. Time at which the `JobRun` was started.
11768    pub start_time: std::option::Option<wkt::Timestamp>,
11769
11770    /// Output only. Time at which the `JobRun` ended.
11771    pub end_time: std::option::Option<wkt::Timestamp>,
11772
11773    /// Output only. The current state of the `JobRun`.
11774    pub state: crate::model::job_run::State,
11775
11776    /// Output only. This checksum is computed by the server based on the value of
11777    /// other fields, and may be sent on update and delete requests to ensure the
11778    /// client has an up-to-date value before proceeding.
11779    pub etag: std::string::String,
11780
11781    /// The `JobRun` type and the information for that type.
11782    pub job_run: std::option::Option<crate::model::job_run::JobRun>,
11783
11784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11785}
11786
11787impl JobRun {
11788    pub fn new() -> Self {
11789        std::default::Default::default()
11790    }
11791
11792    /// Sets the value of [name][crate::model::JobRun::name].
11793    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11794        self.name = v.into();
11795        self
11796    }
11797
11798    /// Sets the value of [uid][crate::model::JobRun::uid].
11799    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11800        self.uid = v.into();
11801        self
11802    }
11803
11804    /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
11805    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11806        self.phase_id = v.into();
11807        self
11808    }
11809
11810    /// Sets the value of [job_id][crate::model::JobRun::job_id].
11811    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11812        self.job_id = v.into();
11813        self
11814    }
11815
11816    /// Sets the value of [create_time][crate::model::JobRun::create_time].
11817    pub fn set_create_time<T>(mut self, v: T) -> Self
11818    where
11819        T: std::convert::Into<wkt::Timestamp>,
11820    {
11821        self.create_time = std::option::Option::Some(v.into());
11822        self
11823    }
11824
11825    /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
11826    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11827    where
11828        T: std::convert::Into<wkt::Timestamp>,
11829    {
11830        self.create_time = v.map(|x| x.into());
11831        self
11832    }
11833
11834    /// Sets the value of [start_time][crate::model::JobRun::start_time].
11835    pub fn set_start_time<T>(mut self, v: T) -> Self
11836    where
11837        T: std::convert::Into<wkt::Timestamp>,
11838    {
11839        self.start_time = std::option::Option::Some(v.into());
11840        self
11841    }
11842
11843    /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
11844    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
11845    where
11846        T: std::convert::Into<wkt::Timestamp>,
11847    {
11848        self.start_time = v.map(|x| x.into());
11849        self
11850    }
11851
11852    /// Sets the value of [end_time][crate::model::JobRun::end_time].
11853    pub fn set_end_time<T>(mut self, v: T) -> Self
11854    where
11855        T: std::convert::Into<wkt::Timestamp>,
11856    {
11857        self.end_time = std::option::Option::Some(v.into());
11858        self
11859    }
11860
11861    /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
11862    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11863    where
11864        T: std::convert::Into<wkt::Timestamp>,
11865    {
11866        self.end_time = v.map(|x| x.into());
11867        self
11868    }
11869
11870    /// Sets the value of [state][crate::model::JobRun::state].
11871    pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
11872        self.state = v.into();
11873        self
11874    }
11875
11876    /// Sets the value of [etag][crate::model::JobRun::etag].
11877    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11878        self.etag = v.into();
11879        self
11880    }
11881
11882    /// Sets the value of [job_run][crate::model::JobRun::job_run].
11883    ///
11884    /// Note that all the setters affecting `job_run` are mutually
11885    /// exclusive.
11886    pub fn set_job_run<
11887        T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
11888    >(
11889        mut self,
11890        v: T,
11891    ) -> Self {
11892        self.job_run = v.into();
11893        self
11894    }
11895
11896    /// The value of [job_run][crate::model::JobRun::job_run]
11897    /// if it holds a `DeployJobRun`, `None` if the field is not set or
11898    /// holds a different branch.
11899    pub fn deploy_job_run(
11900        &self,
11901    ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
11902        #[allow(unreachable_patterns)]
11903        self.job_run.as_ref().and_then(|v| match v {
11904            crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
11905            _ => std::option::Option::None,
11906        })
11907    }
11908
11909    /// Sets the value of [job_run][crate::model::JobRun::job_run]
11910    /// to hold a `DeployJobRun`.
11911    ///
11912    /// Note that all the setters affecting `job_run` are
11913    /// mutually exclusive.
11914    pub fn set_deploy_job_run<
11915        T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
11916    >(
11917        mut self,
11918        v: T,
11919    ) -> Self {
11920        self.job_run =
11921            std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
11922        self
11923    }
11924
11925    /// The value of [job_run][crate::model::JobRun::job_run]
11926    /// if it holds a `VerifyJobRun`, `None` if the field is not set or
11927    /// holds a different branch.
11928    pub fn verify_job_run(
11929        &self,
11930    ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
11931        #[allow(unreachable_patterns)]
11932        self.job_run.as_ref().and_then(|v| match v {
11933            crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
11934            _ => std::option::Option::None,
11935        })
11936    }
11937
11938    /// Sets the value of [job_run][crate::model::JobRun::job_run]
11939    /// to hold a `VerifyJobRun`.
11940    ///
11941    /// Note that all the setters affecting `job_run` are
11942    /// mutually exclusive.
11943    pub fn set_verify_job_run<
11944        T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
11945    >(
11946        mut self,
11947        v: T,
11948    ) -> Self {
11949        self.job_run =
11950            std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
11951        self
11952    }
11953
11954    /// The value of [job_run][crate::model::JobRun::job_run]
11955    /// if it holds a `PredeployJobRun`, `None` if the field is not set or
11956    /// holds a different branch.
11957    pub fn predeploy_job_run(
11958        &self,
11959    ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
11960        #[allow(unreachable_patterns)]
11961        self.job_run.as_ref().and_then(|v| match v {
11962            crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
11963            _ => std::option::Option::None,
11964        })
11965    }
11966
11967    /// Sets the value of [job_run][crate::model::JobRun::job_run]
11968    /// to hold a `PredeployJobRun`.
11969    ///
11970    /// Note that all the setters affecting `job_run` are
11971    /// mutually exclusive.
11972    pub fn set_predeploy_job_run<
11973        T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
11974    >(
11975        mut self,
11976        v: T,
11977    ) -> Self {
11978        self.job_run =
11979            std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
11980        self
11981    }
11982
11983    /// The value of [job_run][crate::model::JobRun::job_run]
11984    /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
11985    /// holds a different branch.
11986    pub fn postdeploy_job_run(
11987        &self,
11988    ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
11989        #[allow(unreachable_patterns)]
11990        self.job_run.as_ref().and_then(|v| match v {
11991            crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
11992            _ => std::option::Option::None,
11993        })
11994    }
11995
11996    /// Sets the value of [job_run][crate::model::JobRun::job_run]
11997    /// to hold a `PostdeployJobRun`.
11998    ///
11999    /// Note that all the setters affecting `job_run` are
12000    /// mutually exclusive.
12001    pub fn set_postdeploy_job_run<
12002        T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
12003    >(
12004        mut self,
12005        v: T,
12006    ) -> Self {
12007        self.job_run =
12008            std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
12009        self
12010    }
12011
12012    /// The value of [job_run][crate::model::JobRun::job_run]
12013    /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
12014    /// holds a different branch.
12015    pub fn create_child_rollout_job_run(
12016        &self,
12017    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
12018        #[allow(unreachable_patterns)]
12019        self.job_run.as_ref().and_then(|v| match v {
12020            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
12021                std::option::Option::Some(v)
12022            }
12023            _ => std::option::Option::None,
12024        })
12025    }
12026
12027    /// Sets the value of [job_run][crate::model::JobRun::job_run]
12028    /// to hold a `CreateChildRolloutJobRun`.
12029    ///
12030    /// Note that all the setters affecting `job_run` are
12031    /// mutually exclusive.
12032    pub fn set_create_child_rollout_job_run<
12033        T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
12034    >(
12035        mut self,
12036        v: T,
12037    ) -> Self {
12038        self.job_run = std::option::Option::Some(
12039            crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
12040        );
12041        self
12042    }
12043
12044    /// The value of [job_run][crate::model::JobRun::job_run]
12045    /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
12046    /// holds a different branch.
12047    pub fn advance_child_rollout_job_run(
12048        &self,
12049    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
12050        #[allow(unreachable_patterns)]
12051        self.job_run.as_ref().and_then(|v| match v {
12052            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
12053                std::option::Option::Some(v)
12054            }
12055            _ => std::option::Option::None,
12056        })
12057    }
12058
12059    /// Sets the value of [job_run][crate::model::JobRun::job_run]
12060    /// to hold a `AdvanceChildRolloutJobRun`.
12061    ///
12062    /// Note that all the setters affecting `job_run` are
12063    /// mutually exclusive.
12064    pub fn set_advance_child_rollout_job_run<
12065        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
12066    >(
12067        mut self,
12068        v: T,
12069    ) -> Self {
12070        self.job_run = std::option::Option::Some(
12071            crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
12072        );
12073        self
12074    }
12075}
12076
12077impl wkt::message::Message for JobRun {
12078    fn typename() -> &'static str {
12079        "type.googleapis.com/google.cloud.deploy.v1.JobRun"
12080    }
12081}
12082
12083/// Defines additional types related to [JobRun].
12084pub mod job_run {
12085    #[allow(unused_imports)]
12086    use super::*;
12087
12088    /// Valid states of a `JobRun`.
12089    ///
12090    /// # Working with unknown values
12091    ///
12092    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12093    /// additional enum variants at any time. Adding new variants is not considered
12094    /// a breaking change. Applications should write their code in anticipation of:
12095    ///
12096    /// - New values appearing in future releases of the client library, **and**
12097    /// - New values received dynamically, without application changes.
12098    ///
12099    /// Please consult the [Working with enums] section in the user guide for some
12100    /// guidelines.
12101    ///
12102    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12103    #[derive(Clone, Debug, PartialEq)]
12104    #[non_exhaustive]
12105    pub enum State {
12106        /// The `JobRun` has an unspecified state.
12107        Unspecified,
12108        /// The `JobRun` is in progress.
12109        InProgress,
12110        /// The `JobRun` has succeeded.
12111        Succeeded,
12112        /// The `JobRun` has failed.
12113        Failed,
12114        /// The `JobRun` is terminating.
12115        Terminating,
12116        /// The `JobRun` was terminated.
12117        Terminated,
12118        /// If set, the enum was initialized with an unknown value.
12119        ///
12120        /// Applications can examine the value using [State::value] or
12121        /// [State::name].
12122        UnknownValue(state::UnknownValue),
12123    }
12124
12125    #[doc(hidden)]
12126    pub mod state {
12127        #[allow(unused_imports)]
12128        use super::*;
12129        #[derive(Clone, Debug, PartialEq)]
12130        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12131    }
12132
12133    impl State {
12134        /// Gets the enum value.
12135        ///
12136        /// Returns `None` if the enum contains an unknown value deserialized from
12137        /// the string representation of enums.
12138        pub fn value(&self) -> std::option::Option<i32> {
12139            match self {
12140                Self::Unspecified => std::option::Option::Some(0),
12141                Self::InProgress => std::option::Option::Some(1),
12142                Self::Succeeded => std::option::Option::Some(2),
12143                Self::Failed => std::option::Option::Some(3),
12144                Self::Terminating => std::option::Option::Some(4),
12145                Self::Terminated => std::option::Option::Some(5),
12146                Self::UnknownValue(u) => u.0.value(),
12147            }
12148        }
12149
12150        /// Gets the enum value as a string.
12151        ///
12152        /// Returns `None` if the enum contains an unknown value deserialized from
12153        /// the integer representation of enums.
12154        pub fn name(&self) -> std::option::Option<&str> {
12155            match self {
12156                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12157                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12158                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12159                Self::Failed => std::option::Option::Some("FAILED"),
12160                Self::Terminating => std::option::Option::Some("TERMINATING"),
12161                Self::Terminated => std::option::Option::Some("TERMINATED"),
12162                Self::UnknownValue(u) => u.0.name(),
12163            }
12164        }
12165    }
12166
12167    impl std::default::Default for State {
12168        fn default() -> Self {
12169            use std::convert::From;
12170            Self::from(0)
12171        }
12172    }
12173
12174    impl std::fmt::Display for State {
12175        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12176            wkt::internal::display_enum(f, self.name(), self.value())
12177        }
12178    }
12179
12180    impl std::convert::From<i32> for State {
12181        fn from(value: i32) -> Self {
12182            match value {
12183                0 => Self::Unspecified,
12184                1 => Self::InProgress,
12185                2 => Self::Succeeded,
12186                3 => Self::Failed,
12187                4 => Self::Terminating,
12188                5 => Self::Terminated,
12189                _ => Self::UnknownValue(state::UnknownValue(
12190                    wkt::internal::UnknownEnumValue::Integer(value),
12191                )),
12192            }
12193        }
12194    }
12195
12196    impl std::convert::From<&str> for State {
12197        fn from(value: &str) -> Self {
12198            use std::string::ToString;
12199            match value {
12200                "STATE_UNSPECIFIED" => Self::Unspecified,
12201                "IN_PROGRESS" => Self::InProgress,
12202                "SUCCEEDED" => Self::Succeeded,
12203                "FAILED" => Self::Failed,
12204                "TERMINATING" => Self::Terminating,
12205                "TERMINATED" => Self::Terminated,
12206                _ => Self::UnknownValue(state::UnknownValue(
12207                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12208                )),
12209            }
12210        }
12211    }
12212
12213    impl serde::ser::Serialize for State {
12214        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12215        where
12216            S: serde::Serializer,
12217        {
12218            match self {
12219                Self::Unspecified => serializer.serialize_i32(0),
12220                Self::InProgress => serializer.serialize_i32(1),
12221                Self::Succeeded => serializer.serialize_i32(2),
12222                Self::Failed => serializer.serialize_i32(3),
12223                Self::Terminating => serializer.serialize_i32(4),
12224                Self::Terminated => serializer.serialize_i32(5),
12225                Self::UnknownValue(u) => u.0.serialize(serializer),
12226            }
12227        }
12228    }
12229
12230    impl<'de> serde::de::Deserialize<'de> for State {
12231        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12232        where
12233            D: serde::Deserializer<'de>,
12234        {
12235            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12236                ".google.cloud.deploy.v1.JobRun.State",
12237            ))
12238        }
12239    }
12240
12241    /// The `JobRun` type and the information for that type.
12242    #[derive(Clone, Debug, PartialEq)]
12243    #[non_exhaustive]
12244    pub enum JobRun {
12245        /// Output only. Information specific to a deploy `JobRun`.
12246        DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
12247        /// Output only. Information specific to a verify `JobRun`.
12248        VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
12249        /// Output only. Information specific to a predeploy `JobRun`.
12250        PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
12251        /// Output only. Information specific to a postdeploy `JobRun`.
12252        PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
12253        /// Output only. Information specific to a createChildRollout `JobRun`.
12254        CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
12255        /// Output only. Information specific to an advanceChildRollout `JobRun`
12256        AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
12257    }
12258}
12259
12260/// DeployJobRun contains information specific to a deploy `JobRun`.
12261#[derive(Clone, Default, PartialEq)]
12262#[non_exhaustive]
12263pub struct DeployJobRun {
12264    /// Output only. The resource name of the Cloud Build `Build` object that is
12265    /// used to deploy. Format is
12266    /// `projects/{project}/locations/{location}/builds/{build}`.
12267    pub build: std::string::String,
12268
12269    /// Output only. The reason the deploy failed. This will always be unspecified
12270    /// while the deploy is in progress or if it succeeded.
12271    pub failure_cause: crate::model::deploy_job_run::FailureCause,
12272
12273    /// Output only. Additional information about the deploy failure, if available.
12274    pub failure_message: std::string::String,
12275
12276    /// Output only. Metadata containing information about the deploy job run.
12277    pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
12278
12279    /// Output only. The artifact of a deploy job run, if available.
12280    pub artifact: std::option::Option<crate::model::DeployArtifact>,
12281
12282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12283}
12284
12285impl DeployJobRun {
12286    pub fn new() -> Self {
12287        std::default::Default::default()
12288    }
12289
12290    /// Sets the value of [build][crate::model::DeployJobRun::build].
12291    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12292        self.build = v.into();
12293        self
12294    }
12295
12296    /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
12297    pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
12298        mut self,
12299        v: T,
12300    ) -> Self {
12301        self.failure_cause = v.into();
12302        self
12303    }
12304
12305    /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
12306    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12307        self.failure_message = v.into();
12308        self
12309    }
12310
12311    /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
12312    pub fn set_metadata<T>(mut self, v: T) -> Self
12313    where
12314        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
12315    {
12316        self.metadata = std::option::Option::Some(v.into());
12317        self
12318    }
12319
12320    /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
12321    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12322    where
12323        T: std::convert::Into<crate::model::DeployJobRunMetadata>,
12324    {
12325        self.metadata = v.map(|x| x.into());
12326        self
12327    }
12328
12329    /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
12330    pub fn set_artifact<T>(mut self, v: T) -> Self
12331    where
12332        T: std::convert::Into<crate::model::DeployArtifact>,
12333    {
12334        self.artifact = std::option::Option::Some(v.into());
12335        self
12336    }
12337
12338    /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
12339    pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
12340    where
12341        T: std::convert::Into<crate::model::DeployArtifact>,
12342    {
12343        self.artifact = v.map(|x| x.into());
12344        self
12345    }
12346}
12347
12348impl wkt::message::Message for DeployJobRun {
12349    fn typename() -> &'static str {
12350        "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
12351    }
12352}
12353
12354/// Defines additional types related to [DeployJobRun].
12355pub mod deploy_job_run {
12356    #[allow(unused_imports)]
12357    use super::*;
12358
12359    /// Well-known deploy failures.
12360    ///
12361    /// # Working with unknown values
12362    ///
12363    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12364    /// additional enum variants at any time. Adding new variants is not considered
12365    /// a breaking change. Applications should write their code in anticipation of:
12366    ///
12367    /// - New values appearing in future releases of the client library, **and**
12368    /// - New values received dynamically, without application changes.
12369    ///
12370    /// Please consult the [Working with enums] section in the user guide for some
12371    /// guidelines.
12372    ///
12373    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12374    #[derive(Clone, Debug, PartialEq)]
12375    #[non_exhaustive]
12376    pub enum FailureCause {
12377        /// No reason for failure is specified.
12378        Unspecified,
12379        /// Cloud Build is not available, either because it is not enabled or because
12380        /// Cloud Deploy has insufficient permissions. See [Required
12381        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12382        CloudBuildUnavailable,
12383        /// The deploy operation did not complete successfully; check Cloud Build
12384        /// logs.
12385        ExecutionFailed,
12386        /// The deploy job run did not complete within the allotted time.
12387        DeadlineExceeded,
12388        /// There were missing resources in the runtime environment required for a
12389        /// canary deployment. Check the Cloud Build logs for more information.
12390        MissingResourcesForCanary,
12391        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12392        /// for additional details.
12393        CloudBuildRequestFailed,
12394        /// The deploy operation had a feature configured that is not supported.
12395        DeployFeatureNotSupported,
12396        /// If set, the enum was initialized with an unknown value.
12397        ///
12398        /// Applications can examine the value using [FailureCause::value] or
12399        /// [FailureCause::name].
12400        UnknownValue(failure_cause::UnknownValue),
12401    }
12402
12403    #[doc(hidden)]
12404    pub mod failure_cause {
12405        #[allow(unused_imports)]
12406        use super::*;
12407        #[derive(Clone, Debug, PartialEq)]
12408        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12409    }
12410
12411    impl FailureCause {
12412        /// Gets the enum value.
12413        ///
12414        /// Returns `None` if the enum contains an unknown value deserialized from
12415        /// the string representation of enums.
12416        pub fn value(&self) -> std::option::Option<i32> {
12417            match self {
12418                Self::Unspecified => std::option::Option::Some(0),
12419                Self::CloudBuildUnavailable => std::option::Option::Some(1),
12420                Self::ExecutionFailed => std::option::Option::Some(2),
12421                Self::DeadlineExceeded => std::option::Option::Some(3),
12422                Self::MissingResourcesForCanary => std::option::Option::Some(4),
12423                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
12424                Self::DeployFeatureNotSupported => std::option::Option::Some(6),
12425                Self::UnknownValue(u) => u.0.value(),
12426            }
12427        }
12428
12429        /// Gets the enum value as a string.
12430        ///
12431        /// Returns `None` if the enum contains an unknown value deserialized from
12432        /// the integer representation of enums.
12433        pub fn name(&self) -> std::option::Option<&str> {
12434            match self {
12435                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12436                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12437                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12438                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12439                Self::MissingResourcesForCanary => {
12440                    std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
12441                }
12442                Self::CloudBuildRequestFailed => {
12443                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12444                }
12445                Self::DeployFeatureNotSupported => {
12446                    std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
12447                }
12448                Self::UnknownValue(u) => u.0.name(),
12449            }
12450        }
12451    }
12452
12453    impl std::default::Default for FailureCause {
12454        fn default() -> Self {
12455            use std::convert::From;
12456            Self::from(0)
12457        }
12458    }
12459
12460    impl std::fmt::Display for FailureCause {
12461        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12462            wkt::internal::display_enum(f, self.name(), self.value())
12463        }
12464    }
12465
12466    impl std::convert::From<i32> for FailureCause {
12467        fn from(value: i32) -> Self {
12468            match value {
12469                0 => Self::Unspecified,
12470                1 => Self::CloudBuildUnavailable,
12471                2 => Self::ExecutionFailed,
12472                3 => Self::DeadlineExceeded,
12473                4 => Self::MissingResourcesForCanary,
12474                5 => Self::CloudBuildRequestFailed,
12475                6 => Self::DeployFeatureNotSupported,
12476                _ => Self::UnknownValue(failure_cause::UnknownValue(
12477                    wkt::internal::UnknownEnumValue::Integer(value),
12478                )),
12479            }
12480        }
12481    }
12482
12483    impl std::convert::From<&str> for FailureCause {
12484        fn from(value: &str) -> Self {
12485            use std::string::ToString;
12486            match value {
12487                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12488                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12489                "EXECUTION_FAILED" => Self::ExecutionFailed,
12490                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12491                "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
12492                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12493                "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
12494                _ => Self::UnknownValue(failure_cause::UnknownValue(
12495                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12496                )),
12497            }
12498        }
12499    }
12500
12501    impl serde::ser::Serialize for FailureCause {
12502        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12503        where
12504            S: serde::Serializer,
12505        {
12506            match self {
12507                Self::Unspecified => serializer.serialize_i32(0),
12508                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12509                Self::ExecutionFailed => serializer.serialize_i32(2),
12510                Self::DeadlineExceeded => serializer.serialize_i32(3),
12511                Self::MissingResourcesForCanary => serializer.serialize_i32(4),
12512                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
12513                Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
12514                Self::UnknownValue(u) => u.0.serialize(serializer),
12515            }
12516        }
12517    }
12518
12519    impl<'de> serde::de::Deserialize<'de> for FailureCause {
12520        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12521        where
12522            D: serde::Deserializer<'de>,
12523        {
12524            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12525                ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
12526            ))
12527        }
12528    }
12529}
12530
12531/// VerifyJobRun contains information specific to a verify `JobRun`.
12532#[derive(Clone, Default, PartialEq)]
12533#[non_exhaustive]
12534pub struct VerifyJobRun {
12535    /// Output only. The resource name of the Cloud Build `Build` object that is
12536    /// used to verify. Format is
12537    /// `projects/{project}/locations/{location}/builds/{build}`.
12538    pub build: std::string::String,
12539
12540    /// Output only. URI of a directory containing the verify artifacts. This
12541    /// contains the Skaffold event log.
12542    pub artifact_uri: std::string::String,
12543
12544    /// Output only. File path of the Skaffold event log relative to the artifact
12545    /// URI.
12546    pub event_log_path: std::string::String,
12547
12548    /// Output only. The reason the verify failed. This will always be unspecified
12549    /// while the verify is in progress or if it succeeded.
12550    pub failure_cause: crate::model::verify_job_run::FailureCause,
12551
12552    /// Output only. Additional information about the verify failure, if available.
12553    pub failure_message: std::string::String,
12554
12555    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12556}
12557
12558impl VerifyJobRun {
12559    pub fn new() -> Self {
12560        std::default::Default::default()
12561    }
12562
12563    /// Sets the value of [build][crate::model::VerifyJobRun::build].
12564    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12565        self.build = v.into();
12566        self
12567    }
12568
12569    /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
12570    pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12571        self.artifact_uri = v.into();
12572        self
12573    }
12574
12575    /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
12576    pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12577        self.event_log_path = v.into();
12578        self
12579    }
12580
12581    /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
12582    pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
12583        mut self,
12584        v: T,
12585    ) -> Self {
12586        self.failure_cause = v.into();
12587        self
12588    }
12589
12590    /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
12591    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12592        self.failure_message = v.into();
12593        self
12594    }
12595}
12596
12597impl wkt::message::Message for VerifyJobRun {
12598    fn typename() -> &'static str {
12599        "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
12600    }
12601}
12602
12603/// Defines additional types related to [VerifyJobRun].
12604pub mod verify_job_run {
12605    #[allow(unused_imports)]
12606    use super::*;
12607
12608    /// Well-known verify failures.
12609    ///
12610    /// # Working with unknown values
12611    ///
12612    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12613    /// additional enum variants at any time. Adding new variants is not considered
12614    /// a breaking change. Applications should write their code in anticipation of:
12615    ///
12616    /// - New values appearing in future releases of the client library, **and**
12617    /// - New values received dynamically, without application changes.
12618    ///
12619    /// Please consult the [Working with enums] section in the user guide for some
12620    /// guidelines.
12621    ///
12622    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12623    #[derive(Clone, Debug, PartialEq)]
12624    #[non_exhaustive]
12625    pub enum FailureCause {
12626        /// No reason for failure is specified.
12627        Unspecified,
12628        /// Cloud Build is not available, either because it is not enabled or because
12629        /// Cloud Deploy has insufficient permissions. See [required
12630        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12631        CloudBuildUnavailable,
12632        /// The verify operation did not complete successfully; check Cloud Build
12633        /// logs.
12634        ExecutionFailed,
12635        /// The verify job run did not complete within the allotted time.
12636        DeadlineExceeded,
12637        /// No Skaffold verify configuration was found.
12638        VerificationConfigNotFound,
12639        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12640        /// for additional details.
12641        CloudBuildRequestFailed,
12642        /// If set, the enum was initialized with an unknown value.
12643        ///
12644        /// Applications can examine the value using [FailureCause::value] or
12645        /// [FailureCause::name].
12646        UnknownValue(failure_cause::UnknownValue),
12647    }
12648
12649    #[doc(hidden)]
12650    pub mod failure_cause {
12651        #[allow(unused_imports)]
12652        use super::*;
12653        #[derive(Clone, Debug, PartialEq)]
12654        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12655    }
12656
12657    impl FailureCause {
12658        /// Gets the enum value.
12659        ///
12660        /// Returns `None` if the enum contains an unknown value deserialized from
12661        /// the string representation of enums.
12662        pub fn value(&self) -> std::option::Option<i32> {
12663            match self {
12664                Self::Unspecified => std::option::Option::Some(0),
12665                Self::CloudBuildUnavailable => std::option::Option::Some(1),
12666                Self::ExecutionFailed => std::option::Option::Some(2),
12667                Self::DeadlineExceeded => std::option::Option::Some(3),
12668                Self::VerificationConfigNotFound => std::option::Option::Some(4),
12669                Self::CloudBuildRequestFailed => std::option::Option::Some(5),
12670                Self::UnknownValue(u) => u.0.value(),
12671            }
12672        }
12673
12674        /// Gets the enum value as a string.
12675        ///
12676        /// Returns `None` if the enum contains an unknown value deserialized from
12677        /// the integer representation of enums.
12678        pub fn name(&self) -> std::option::Option<&str> {
12679            match self {
12680                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12681                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12682                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12683                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12684                Self::VerificationConfigNotFound => {
12685                    std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12686                }
12687                Self::CloudBuildRequestFailed => {
12688                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12689                }
12690                Self::UnknownValue(u) => u.0.name(),
12691            }
12692        }
12693    }
12694
12695    impl std::default::Default for FailureCause {
12696        fn default() -> Self {
12697            use std::convert::From;
12698            Self::from(0)
12699        }
12700    }
12701
12702    impl std::fmt::Display for FailureCause {
12703        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12704            wkt::internal::display_enum(f, self.name(), self.value())
12705        }
12706    }
12707
12708    impl std::convert::From<i32> for FailureCause {
12709        fn from(value: i32) -> Self {
12710            match value {
12711                0 => Self::Unspecified,
12712                1 => Self::CloudBuildUnavailable,
12713                2 => Self::ExecutionFailed,
12714                3 => Self::DeadlineExceeded,
12715                4 => Self::VerificationConfigNotFound,
12716                5 => Self::CloudBuildRequestFailed,
12717                _ => Self::UnknownValue(failure_cause::UnknownValue(
12718                    wkt::internal::UnknownEnumValue::Integer(value),
12719                )),
12720            }
12721        }
12722    }
12723
12724    impl std::convert::From<&str> for FailureCause {
12725        fn from(value: &str) -> Self {
12726            use std::string::ToString;
12727            match value {
12728                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12729                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12730                "EXECUTION_FAILED" => Self::ExecutionFailed,
12731                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12732                "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12733                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12734                _ => Self::UnknownValue(failure_cause::UnknownValue(
12735                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12736                )),
12737            }
12738        }
12739    }
12740
12741    impl serde::ser::Serialize for FailureCause {
12742        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12743        where
12744            S: serde::Serializer,
12745        {
12746            match self {
12747                Self::Unspecified => serializer.serialize_i32(0),
12748                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12749                Self::ExecutionFailed => serializer.serialize_i32(2),
12750                Self::DeadlineExceeded => serializer.serialize_i32(3),
12751                Self::VerificationConfigNotFound => serializer.serialize_i32(4),
12752                Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
12753                Self::UnknownValue(u) => u.0.serialize(serializer),
12754            }
12755        }
12756    }
12757
12758    impl<'de> serde::de::Deserialize<'de> for FailureCause {
12759        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12760        where
12761            D: serde::Deserializer<'de>,
12762        {
12763            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12764                ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
12765            ))
12766        }
12767    }
12768}
12769
12770/// PredeployJobRun contains information specific to a predeploy `JobRun`.
12771#[derive(Clone, Default, PartialEq)]
12772#[non_exhaustive]
12773pub struct PredeployJobRun {
12774    /// Output only. The resource name of the Cloud Build `Build` object that is
12775    /// used to execute the custom actions associated with the predeploy Job.
12776    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
12777    pub build: std::string::String,
12778
12779    /// Output only. The reason the predeploy failed. This will always be
12780    /// unspecified while the predeploy is in progress or if it succeeded.
12781    pub failure_cause: crate::model::predeploy_job_run::FailureCause,
12782
12783    /// Output only. Additional information about the predeploy failure, if
12784    /// available.
12785    pub failure_message: std::string::String,
12786
12787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12788}
12789
12790impl PredeployJobRun {
12791    pub fn new() -> Self {
12792        std::default::Default::default()
12793    }
12794
12795    /// Sets the value of [build][crate::model::PredeployJobRun::build].
12796    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12797        self.build = v.into();
12798        self
12799    }
12800
12801    /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
12802    pub fn set_failure_cause<
12803        T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
12804    >(
12805        mut self,
12806        v: T,
12807    ) -> Self {
12808        self.failure_cause = v.into();
12809        self
12810    }
12811
12812    /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
12813    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12814        self.failure_message = v.into();
12815        self
12816    }
12817}
12818
12819impl wkt::message::Message for PredeployJobRun {
12820    fn typename() -> &'static str {
12821        "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
12822    }
12823}
12824
12825/// Defines additional types related to [PredeployJobRun].
12826pub mod predeploy_job_run {
12827    #[allow(unused_imports)]
12828    use super::*;
12829
12830    /// Well-known predeploy failures.
12831    ///
12832    /// # Working with unknown values
12833    ///
12834    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12835    /// additional enum variants at any time. Adding new variants is not considered
12836    /// a breaking change. Applications should write their code in anticipation of:
12837    ///
12838    /// - New values appearing in future releases of the client library, **and**
12839    /// - New values received dynamically, without application changes.
12840    ///
12841    /// Please consult the [Working with enums] section in the user guide for some
12842    /// guidelines.
12843    ///
12844    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12845    #[derive(Clone, Debug, PartialEq)]
12846    #[non_exhaustive]
12847    pub enum FailureCause {
12848        /// No reason for failure is specified.
12849        Unspecified,
12850        /// Cloud Build is not available, either because it is not enabled or because
12851        /// Cloud Deploy has insufficient permissions. See [required
12852        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12853        CloudBuildUnavailable,
12854        /// The predeploy operation did not complete successfully; check Cloud Build
12855        /// logs.
12856        ExecutionFailed,
12857        /// The predeploy job run did not complete within the allotted time.
12858        DeadlineExceeded,
12859        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12860        /// for additional details.
12861        CloudBuildRequestFailed,
12862        /// If set, the enum was initialized with an unknown value.
12863        ///
12864        /// Applications can examine the value using [FailureCause::value] or
12865        /// [FailureCause::name].
12866        UnknownValue(failure_cause::UnknownValue),
12867    }
12868
12869    #[doc(hidden)]
12870    pub mod failure_cause {
12871        #[allow(unused_imports)]
12872        use super::*;
12873        #[derive(Clone, Debug, PartialEq)]
12874        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12875    }
12876
12877    impl FailureCause {
12878        /// Gets the enum value.
12879        ///
12880        /// Returns `None` if the enum contains an unknown value deserialized from
12881        /// the string representation of enums.
12882        pub fn value(&self) -> std::option::Option<i32> {
12883            match self {
12884                Self::Unspecified => std::option::Option::Some(0),
12885                Self::CloudBuildUnavailable => std::option::Option::Some(1),
12886                Self::ExecutionFailed => std::option::Option::Some(2),
12887                Self::DeadlineExceeded => std::option::Option::Some(3),
12888                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
12889                Self::UnknownValue(u) => u.0.value(),
12890            }
12891        }
12892
12893        /// Gets the enum value as a string.
12894        ///
12895        /// Returns `None` if the enum contains an unknown value deserialized from
12896        /// the integer representation of enums.
12897        pub fn name(&self) -> std::option::Option<&str> {
12898            match self {
12899                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12900                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12901                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12902                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12903                Self::CloudBuildRequestFailed => {
12904                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12905                }
12906                Self::UnknownValue(u) => u.0.name(),
12907            }
12908        }
12909    }
12910
12911    impl std::default::Default for FailureCause {
12912        fn default() -> Self {
12913            use std::convert::From;
12914            Self::from(0)
12915        }
12916    }
12917
12918    impl std::fmt::Display for FailureCause {
12919        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12920            wkt::internal::display_enum(f, self.name(), self.value())
12921        }
12922    }
12923
12924    impl std::convert::From<i32> for FailureCause {
12925        fn from(value: i32) -> Self {
12926            match value {
12927                0 => Self::Unspecified,
12928                1 => Self::CloudBuildUnavailable,
12929                2 => Self::ExecutionFailed,
12930                3 => Self::DeadlineExceeded,
12931                4 => Self::CloudBuildRequestFailed,
12932                _ => Self::UnknownValue(failure_cause::UnknownValue(
12933                    wkt::internal::UnknownEnumValue::Integer(value),
12934                )),
12935            }
12936        }
12937    }
12938
12939    impl std::convert::From<&str> for FailureCause {
12940        fn from(value: &str) -> Self {
12941            use std::string::ToString;
12942            match value {
12943                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12944                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12945                "EXECUTION_FAILED" => Self::ExecutionFailed,
12946                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12947                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12948                _ => Self::UnknownValue(failure_cause::UnknownValue(
12949                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12950                )),
12951            }
12952        }
12953    }
12954
12955    impl serde::ser::Serialize for FailureCause {
12956        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12957        where
12958            S: serde::Serializer,
12959        {
12960            match self {
12961                Self::Unspecified => serializer.serialize_i32(0),
12962                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12963                Self::ExecutionFailed => serializer.serialize_i32(2),
12964                Self::DeadlineExceeded => serializer.serialize_i32(3),
12965                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
12966                Self::UnknownValue(u) => u.0.serialize(serializer),
12967            }
12968        }
12969    }
12970
12971    impl<'de> serde::de::Deserialize<'de> for FailureCause {
12972        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12973        where
12974            D: serde::Deserializer<'de>,
12975        {
12976            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12977                ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
12978            ))
12979        }
12980    }
12981}
12982
12983/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
12984#[derive(Clone, Default, PartialEq)]
12985#[non_exhaustive]
12986pub struct PostdeployJobRun {
12987    /// Output only. The resource name of the Cloud Build `Build` object that is
12988    /// used to execute the custom actions associated with the postdeploy Job.
12989    /// Format is `projects/{project}/locations/{location}/builds/{build}`.
12990    pub build: std::string::String,
12991
12992    /// Output only. The reason the postdeploy failed. This will always be
12993    /// unspecified while the postdeploy is in progress or if it succeeded.
12994    pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
12995
12996    /// Output only. Additional information about the postdeploy failure, if
12997    /// available.
12998    pub failure_message: std::string::String,
12999
13000    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13001}
13002
13003impl PostdeployJobRun {
13004    pub fn new() -> Self {
13005        std::default::Default::default()
13006    }
13007
13008    /// Sets the value of [build][crate::model::PostdeployJobRun::build].
13009    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13010        self.build = v.into();
13011        self
13012    }
13013
13014    /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
13015    pub fn set_failure_cause<
13016        T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
13017    >(
13018        mut self,
13019        v: T,
13020    ) -> Self {
13021        self.failure_cause = v.into();
13022        self
13023    }
13024
13025    /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
13026    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13027        self.failure_message = v.into();
13028        self
13029    }
13030}
13031
13032impl wkt::message::Message for PostdeployJobRun {
13033    fn typename() -> &'static str {
13034        "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
13035    }
13036}
13037
13038/// Defines additional types related to [PostdeployJobRun].
13039pub mod postdeploy_job_run {
13040    #[allow(unused_imports)]
13041    use super::*;
13042
13043    /// Well-known postdeploy failures.
13044    ///
13045    /// # Working with unknown values
13046    ///
13047    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13048    /// additional enum variants at any time. Adding new variants is not considered
13049    /// a breaking change. Applications should write their code in anticipation of:
13050    ///
13051    /// - New values appearing in future releases of the client library, **and**
13052    /// - New values received dynamically, without application changes.
13053    ///
13054    /// Please consult the [Working with enums] section in the user guide for some
13055    /// guidelines.
13056    ///
13057    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13058    #[derive(Clone, Debug, PartialEq)]
13059    #[non_exhaustive]
13060    pub enum FailureCause {
13061        /// No reason for failure is specified.
13062        Unspecified,
13063        /// Cloud Build is not available, either because it is not enabled or because
13064        /// Cloud Deploy has insufficient permissions. See [required
13065        /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
13066        CloudBuildUnavailable,
13067        /// The postdeploy operation did not complete successfully; check Cloud Build
13068        /// logs.
13069        ExecutionFailed,
13070        /// The postdeploy job run did not complete within the allotted time.
13071        DeadlineExceeded,
13072        /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
13073        /// for additional details.
13074        CloudBuildRequestFailed,
13075        /// If set, the enum was initialized with an unknown value.
13076        ///
13077        /// Applications can examine the value using [FailureCause::value] or
13078        /// [FailureCause::name].
13079        UnknownValue(failure_cause::UnknownValue),
13080    }
13081
13082    #[doc(hidden)]
13083    pub mod failure_cause {
13084        #[allow(unused_imports)]
13085        use super::*;
13086        #[derive(Clone, Debug, PartialEq)]
13087        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13088    }
13089
13090    impl FailureCause {
13091        /// Gets the enum value.
13092        ///
13093        /// Returns `None` if the enum contains an unknown value deserialized from
13094        /// the string representation of enums.
13095        pub fn value(&self) -> std::option::Option<i32> {
13096            match self {
13097                Self::Unspecified => std::option::Option::Some(0),
13098                Self::CloudBuildUnavailable => std::option::Option::Some(1),
13099                Self::ExecutionFailed => std::option::Option::Some(2),
13100                Self::DeadlineExceeded => std::option::Option::Some(3),
13101                Self::CloudBuildRequestFailed => std::option::Option::Some(4),
13102                Self::UnknownValue(u) => u.0.value(),
13103            }
13104        }
13105
13106        /// Gets the enum value as a string.
13107        ///
13108        /// Returns `None` if the enum contains an unknown value deserialized from
13109        /// the integer representation of enums.
13110        pub fn name(&self) -> std::option::Option<&str> {
13111            match self {
13112                Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
13113                Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
13114                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
13115                Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
13116                Self::CloudBuildRequestFailed => {
13117                    std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
13118                }
13119                Self::UnknownValue(u) => u.0.name(),
13120            }
13121        }
13122    }
13123
13124    impl std::default::Default for FailureCause {
13125        fn default() -> Self {
13126            use std::convert::From;
13127            Self::from(0)
13128        }
13129    }
13130
13131    impl std::fmt::Display for FailureCause {
13132        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13133            wkt::internal::display_enum(f, self.name(), self.value())
13134        }
13135    }
13136
13137    impl std::convert::From<i32> for FailureCause {
13138        fn from(value: i32) -> Self {
13139            match value {
13140                0 => Self::Unspecified,
13141                1 => Self::CloudBuildUnavailable,
13142                2 => Self::ExecutionFailed,
13143                3 => Self::DeadlineExceeded,
13144                4 => Self::CloudBuildRequestFailed,
13145                _ => Self::UnknownValue(failure_cause::UnknownValue(
13146                    wkt::internal::UnknownEnumValue::Integer(value),
13147                )),
13148            }
13149        }
13150    }
13151
13152    impl std::convert::From<&str> for FailureCause {
13153        fn from(value: &str) -> Self {
13154            use std::string::ToString;
13155            match value {
13156                "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
13157                "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
13158                "EXECUTION_FAILED" => Self::ExecutionFailed,
13159                "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
13160                "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
13161                _ => Self::UnknownValue(failure_cause::UnknownValue(
13162                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13163                )),
13164            }
13165        }
13166    }
13167
13168    impl serde::ser::Serialize for FailureCause {
13169        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13170        where
13171            S: serde::Serializer,
13172        {
13173            match self {
13174                Self::Unspecified => serializer.serialize_i32(0),
13175                Self::CloudBuildUnavailable => serializer.serialize_i32(1),
13176                Self::ExecutionFailed => serializer.serialize_i32(2),
13177                Self::DeadlineExceeded => serializer.serialize_i32(3),
13178                Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
13179                Self::UnknownValue(u) => u.0.serialize(serializer),
13180            }
13181        }
13182    }
13183
13184    impl<'de> serde::de::Deserialize<'de> for FailureCause {
13185        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13186        where
13187            D: serde::Deserializer<'de>,
13188        {
13189            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
13190                ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
13191            ))
13192        }
13193    }
13194}
13195
13196/// CreateChildRolloutJobRun contains information specific to a
13197/// createChildRollout `JobRun`.
13198#[derive(Clone, Default, PartialEq)]
13199#[non_exhaustive]
13200pub struct CreateChildRolloutJobRun {
13201    /// Output only. Name of the `ChildRollout`. Format is
13202    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
13203    pub rollout: std::string::String,
13204
13205    /// Output only. The ID of the childRollout Phase initiated by this JobRun.
13206    pub rollout_phase_id: std::string::String,
13207
13208    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13209}
13210
13211impl CreateChildRolloutJobRun {
13212    pub fn new() -> Self {
13213        std::default::Default::default()
13214    }
13215
13216    /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
13217    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13218        self.rollout = v.into();
13219        self
13220    }
13221
13222    /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
13223    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
13224        mut self,
13225        v: T,
13226    ) -> Self {
13227        self.rollout_phase_id = v.into();
13228        self
13229    }
13230}
13231
13232impl wkt::message::Message for CreateChildRolloutJobRun {
13233    fn typename() -> &'static str {
13234        "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
13235    }
13236}
13237
13238/// AdvanceChildRolloutJobRun contains information specific to a
13239/// advanceChildRollout `JobRun`.
13240#[derive(Clone, Default, PartialEq)]
13241#[non_exhaustive]
13242pub struct AdvanceChildRolloutJobRun {
13243    /// Output only. Name of the `ChildRollout`. Format is
13244    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
13245    pub rollout: std::string::String,
13246
13247    /// Output only. the ID of the ChildRollout's Phase.
13248    pub rollout_phase_id: std::string::String,
13249
13250    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13251}
13252
13253impl AdvanceChildRolloutJobRun {
13254    pub fn new() -> Self {
13255        std::default::Default::default()
13256    }
13257
13258    /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
13259    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13260        self.rollout = v.into();
13261        self
13262    }
13263
13264    /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
13265    pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
13266        mut self,
13267        v: T,
13268    ) -> Self {
13269        self.rollout_phase_id = v.into();
13270        self
13271    }
13272}
13273
13274impl wkt::message::Message for AdvanceChildRolloutJobRun {
13275    fn typename() -> &'static str {
13276        "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
13277    }
13278}
13279
13280/// ListJobRunsRequest is the request object used by `ListJobRuns`.
13281#[derive(Clone, Default, PartialEq)]
13282#[non_exhaustive]
13283pub struct ListJobRunsRequest {
13284    /// Required. The `Rollout` which owns this collection of `JobRun` objects.
13285    pub parent: std::string::String,
13286
13287    /// Optional. The maximum number of `JobRun` objects to return. The service may
13288    /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
13289    /// will be returned. The maximum value is 1000; values above 1000 will be set
13290    /// to 1000.
13291    pub page_size: i32,
13292
13293    /// Optional. A page token, received from a previous `ListJobRuns` call.
13294    /// Provide this to retrieve the subsequent page.
13295    ///
13296    /// When paginating, all other provided parameters match the call that provided
13297    /// the page token.
13298    pub page_token: std::string::String,
13299
13300    /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
13301    /// more details.
13302    pub filter: std::string::String,
13303
13304    /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
13305    /// more details.
13306    pub order_by: std::string::String,
13307
13308    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13309}
13310
13311impl ListJobRunsRequest {
13312    pub fn new() -> Self {
13313        std::default::Default::default()
13314    }
13315
13316    /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
13317    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13318        self.parent = v.into();
13319        self
13320    }
13321
13322    /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
13323    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13324        self.page_size = v.into();
13325        self
13326    }
13327
13328    /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
13329    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13330        self.page_token = v.into();
13331        self
13332    }
13333
13334    /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
13335    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13336        self.filter = v.into();
13337        self
13338    }
13339
13340    /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
13341    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13342        self.order_by = v.into();
13343        self
13344    }
13345}
13346
13347impl wkt::message::Message for ListJobRunsRequest {
13348    fn typename() -> &'static str {
13349        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
13350    }
13351}
13352
13353/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
13354#[derive(Clone, Default, PartialEq)]
13355#[non_exhaustive]
13356pub struct ListJobRunsResponse {
13357    /// The `JobRun` objects.
13358    pub job_runs: std::vec::Vec<crate::model::JobRun>,
13359
13360    /// A token, which can be sent as `page_token` to retrieve the next page. If
13361    /// this field is omitted, there are no subsequent pages.
13362    pub next_page_token: std::string::String,
13363
13364    /// Locations that could not be reached
13365    pub unreachable: std::vec::Vec<std::string::String>,
13366
13367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13368}
13369
13370impl ListJobRunsResponse {
13371    pub fn new() -> Self {
13372        std::default::Default::default()
13373    }
13374
13375    /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
13376    pub fn set_job_runs<T, V>(mut self, v: T) -> Self
13377    where
13378        T: std::iter::IntoIterator<Item = V>,
13379        V: std::convert::Into<crate::model::JobRun>,
13380    {
13381        use std::iter::Iterator;
13382        self.job_runs = v.into_iter().map(|i| i.into()).collect();
13383        self
13384    }
13385
13386    /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
13387    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13388        self.next_page_token = v.into();
13389        self
13390    }
13391
13392    /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
13393    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13394    where
13395        T: std::iter::IntoIterator<Item = V>,
13396        V: std::convert::Into<std::string::String>,
13397    {
13398        use std::iter::Iterator;
13399        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13400        self
13401    }
13402}
13403
13404impl wkt::message::Message for ListJobRunsResponse {
13405    fn typename() -> &'static str {
13406        "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
13407    }
13408}
13409
13410#[doc(hidden)]
13411impl gax::paginator::internal::PageableResponse for ListJobRunsResponse {
13412    type PageItem = crate::model::JobRun;
13413
13414    fn items(self) -> std::vec::Vec<Self::PageItem> {
13415        self.job_runs
13416    }
13417
13418    fn next_page_token(&self) -> std::string::String {
13419        use std::clone::Clone;
13420        self.next_page_token.clone()
13421    }
13422}
13423
13424/// GetJobRunRequest is the request object used by `GetJobRun`.
13425#[derive(Clone, Default, PartialEq)]
13426#[non_exhaustive]
13427pub struct GetJobRunRequest {
13428    /// Required. Name of the `JobRun`. Format must be
13429    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
13430    pub name: std::string::String,
13431
13432    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13433}
13434
13435impl GetJobRunRequest {
13436    pub fn new() -> Self {
13437        std::default::Default::default()
13438    }
13439
13440    /// Sets the value of [name][crate::model::GetJobRunRequest::name].
13441    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13442        self.name = v.into();
13443        self
13444    }
13445}
13446
13447impl wkt::message::Message for GetJobRunRequest {
13448    fn typename() -> &'static str {
13449        "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
13450    }
13451}
13452
13453/// The request object used by `TerminateJobRun`.
13454#[derive(Clone, Default, PartialEq)]
13455#[non_exhaustive]
13456pub struct TerminateJobRunRequest {
13457    /// Required. Name of the `JobRun`. Format must be
13458    /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
13459    pub name: std::string::String,
13460
13461    /// Optional. Deploy policies to override. Format is
13462    /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
13463    pub override_deploy_policy: std::vec::Vec<std::string::String>,
13464
13465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13466}
13467
13468impl TerminateJobRunRequest {
13469    pub fn new() -> Self {
13470        std::default::Default::default()
13471    }
13472
13473    /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
13474    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13475        self.name = v.into();
13476        self
13477    }
13478
13479    /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
13480    pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
13481    where
13482        T: std::iter::IntoIterator<Item = V>,
13483        V: std::convert::Into<std::string::String>,
13484    {
13485        use std::iter::Iterator;
13486        self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
13487        self
13488    }
13489}
13490
13491impl wkt::message::Message for TerminateJobRunRequest {
13492    fn typename() -> &'static str {
13493        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
13494    }
13495}
13496
13497/// The response object from `TerminateJobRun`.
13498#[derive(Clone, Default, PartialEq)]
13499#[non_exhaustive]
13500pub struct TerminateJobRunResponse {
13501    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13502}
13503
13504impl TerminateJobRunResponse {
13505    pub fn new() -> Self {
13506        std::default::Default::default()
13507    }
13508}
13509
13510impl wkt::message::Message for TerminateJobRunResponse {
13511    fn typename() -> &'static str {
13512        "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
13513    }
13514}
13515
13516/// Service-wide configuration.
13517#[derive(Clone, Default, PartialEq)]
13518#[non_exhaustive]
13519pub struct Config {
13520    /// Name of the configuration.
13521    pub name: std::string::String,
13522
13523    /// All supported versions of Skaffold.
13524    pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
13525
13526    /// Default Skaffold version that is assigned when a Release is created without
13527    /// specifying a Skaffold version.
13528    pub default_skaffold_version: std::string::String,
13529
13530    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13531}
13532
13533impl Config {
13534    pub fn new() -> Self {
13535        std::default::Default::default()
13536    }
13537
13538    /// Sets the value of [name][crate::model::Config::name].
13539    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13540        self.name = v.into();
13541        self
13542    }
13543
13544    /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
13545    pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
13546    where
13547        T: std::iter::IntoIterator<Item = V>,
13548        V: std::convert::Into<crate::model::SkaffoldVersion>,
13549    {
13550        use std::iter::Iterator;
13551        self.supported_versions = v.into_iter().map(|i| i.into()).collect();
13552        self
13553    }
13554
13555    /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
13556    pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
13557        mut self,
13558        v: T,
13559    ) -> Self {
13560        self.default_skaffold_version = v.into();
13561        self
13562    }
13563}
13564
13565impl wkt::message::Message for Config {
13566    fn typename() -> &'static str {
13567        "type.googleapis.com/google.cloud.deploy.v1.Config"
13568    }
13569}
13570
13571/// Details of a supported Skaffold version.
13572#[derive(Clone, Default, PartialEq)]
13573#[non_exhaustive]
13574pub struct SkaffoldVersion {
13575    /// Release version number. For example, "1.20.3".
13576    pub version: std::string::String,
13577
13578    /// The time at which this version of Skaffold will enter maintenance mode.
13579    pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
13580
13581    /// The time at which this version of Skaffold will no longer be supported.
13582    pub support_expiration_time: std::option::Option<wkt::Timestamp>,
13583
13584    /// Date when this version is expected to no longer be supported.
13585    pub support_end_date: std::option::Option<gtype::model::Date>,
13586
13587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13588}
13589
13590impl SkaffoldVersion {
13591    pub fn new() -> Self {
13592        std::default::Default::default()
13593    }
13594
13595    /// Sets the value of [version][crate::model::SkaffoldVersion::version].
13596    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13597        self.version = v.into();
13598        self
13599    }
13600
13601    /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
13602    pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
13603    where
13604        T: std::convert::Into<wkt::Timestamp>,
13605    {
13606        self.maintenance_mode_time = std::option::Option::Some(v.into());
13607        self
13608    }
13609
13610    /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
13611    pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
13612    where
13613        T: std::convert::Into<wkt::Timestamp>,
13614    {
13615        self.maintenance_mode_time = v.map(|x| x.into());
13616        self
13617    }
13618
13619    /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
13620    pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
13621    where
13622        T: std::convert::Into<wkt::Timestamp>,
13623    {
13624        self.support_expiration_time = std::option::Option::Some(v.into());
13625        self
13626    }
13627
13628    /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
13629    pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
13630    where
13631        T: std::convert::Into<wkt::Timestamp>,
13632    {
13633        self.support_expiration_time = v.map(|x| x.into());
13634        self
13635    }
13636
13637    /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
13638    pub fn set_support_end_date<T>(mut self, v: T) -> Self
13639    where
13640        T: std::convert::Into<gtype::model::Date>,
13641    {
13642        self.support_end_date = std::option::Option::Some(v.into());
13643        self
13644    }
13645
13646    /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
13647    pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
13648    where
13649        T: std::convert::Into<gtype::model::Date>,
13650    {
13651        self.support_end_date = v.map(|x| x.into());
13652        self
13653    }
13654}
13655
13656impl wkt::message::Message for SkaffoldVersion {
13657    fn typename() -> &'static str {
13658        "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
13659    }
13660}
13661
13662/// Request to get a configuration.
13663#[derive(Clone, Default, PartialEq)]
13664#[non_exhaustive]
13665pub struct GetConfigRequest {
13666    /// Required. Name of requested configuration.
13667    pub name: std::string::String,
13668
13669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13670}
13671
13672impl GetConfigRequest {
13673    pub fn new() -> Self {
13674        std::default::Default::default()
13675    }
13676
13677    /// Sets the value of [name][crate::model::GetConfigRequest::name].
13678    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13679        self.name = v.into();
13680        self
13681    }
13682}
13683
13684impl wkt::message::Message for GetConfigRequest {
13685    fn typename() -> &'static str {
13686        "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
13687    }
13688}
13689
13690/// An `Automation` resource in the Cloud Deploy API.
13691///
13692/// An `Automation` enables the automation of manually driven actions for
13693/// a Delivery Pipeline, which includes Release promotion among Targets,
13694/// Rollout repair and Rollout deployment strategy advancement. The intention
13695/// of Automation is to reduce manual intervention in the continuous delivery
13696/// process.
13697#[derive(Clone, Default, PartialEq)]
13698#[non_exhaustive]
13699pub struct Automation {
13700    /// Output only. Name of the `Automation`. Format is
13701    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
13702    pub name: std::string::String,
13703
13704    /// Output only. Unique identifier of the `Automation`.
13705    pub uid: std::string::String,
13706
13707    /// Optional. Description of the `Automation`. Max length is 255 characters.
13708    pub description: std::string::String,
13709
13710    /// Output only. Time at which the automation was created.
13711    pub create_time: std::option::Option<wkt::Timestamp>,
13712
13713    /// Output only. Time at which the automation was updated.
13714    pub update_time: std::option::Option<wkt::Timestamp>,
13715
13716    /// Optional. User annotations. These attributes can only be set and used by
13717    /// the user, and not by Cloud Deploy. Annotations must meet the following
13718    /// constraints:
13719    ///
13720    /// * Annotations are key/value pairs.
13721    /// * Valid annotation keys have two segments: an optional prefix and name,
13722    ///   separated by a slash (`/`).
13723    /// * The name segment is required and must be 63 characters or less,
13724    ///   beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
13725    ///   dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
13726    /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
13727    ///   a series of DNS labels separated by dots(`.`), not longer than 253
13728    ///   characters in total, followed by a slash (`/`).
13729    ///
13730    /// See
13731    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
13732    /// for more details.
13733    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
13734
13735    /// Optional. Labels are attributes that can be set and used by both the
13736    /// user and by Cloud Deploy. Labels must meet the following constraints:
13737    ///
13738    /// * Keys and values can contain only lowercase letters, numeric characters,
13739    ///   underscores, and dashes.
13740    /// * All characters must use UTF-8 encoding, and international characters are
13741    ///   allowed.
13742    /// * Keys must start with a lowercase letter or international character.
13743    /// * Each resource is limited to a maximum of 64 labels.
13744    ///
13745    /// Both keys and values are additionally constrained to be <= 63 characters.
13746    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13747
13748    /// Optional. The weak etag of the `Automation` resource.
13749    /// This checksum is computed by the server based on the value of other
13750    /// fields, and may be sent on update and delete requests to ensure the
13751    /// client has an up-to-date value before proceeding.
13752    pub etag: std::string::String,
13753
13754    /// Optional. When Suspended, automation is deactivated from execution.
13755    pub suspended: bool,
13756
13757    /// Required. Email address of the user-managed IAM service account that
13758    /// creates Cloud Deploy release and rollout resources.
13759    pub service_account: std::string::String,
13760
13761    /// Required. Selected resources to which the automation will be applied.
13762    pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
13763
13764    /// Required. List of Automation rules associated with the Automation resource.
13765    /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
13766    /// Note: the order of the rules here is not the same as the order of
13767    /// execution.
13768    pub rules: std::vec::Vec<crate::model::AutomationRule>,
13769
13770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13771}
13772
13773impl Automation {
13774    pub fn new() -> Self {
13775        std::default::Default::default()
13776    }
13777
13778    /// Sets the value of [name][crate::model::Automation::name].
13779    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13780        self.name = v.into();
13781        self
13782    }
13783
13784    /// Sets the value of [uid][crate::model::Automation::uid].
13785    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13786        self.uid = v.into();
13787        self
13788    }
13789
13790    /// Sets the value of [description][crate::model::Automation::description].
13791    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13792        self.description = v.into();
13793        self
13794    }
13795
13796    /// Sets the value of [create_time][crate::model::Automation::create_time].
13797    pub fn set_create_time<T>(mut self, v: T) -> Self
13798    where
13799        T: std::convert::Into<wkt::Timestamp>,
13800    {
13801        self.create_time = std::option::Option::Some(v.into());
13802        self
13803    }
13804
13805    /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
13806    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13807    where
13808        T: std::convert::Into<wkt::Timestamp>,
13809    {
13810        self.create_time = v.map(|x| x.into());
13811        self
13812    }
13813
13814    /// Sets the value of [update_time][crate::model::Automation::update_time].
13815    pub fn set_update_time<T>(mut self, v: T) -> Self
13816    where
13817        T: std::convert::Into<wkt::Timestamp>,
13818    {
13819        self.update_time = std::option::Option::Some(v.into());
13820        self
13821    }
13822
13823    /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
13824    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13825    where
13826        T: std::convert::Into<wkt::Timestamp>,
13827    {
13828        self.update_time = v.map(|x| x.into());
13829        self
13830    }
13831
13832    /// Sets the value of [annotations][crate::model::Automation::annotations].
13833    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
13834    where
13835        T: std::iter::IntoIterator<Item = (K, V)>,
13836        K: std::convert::Into<std::string::String>,
13837        V: std::convert::Into<std::string::String>,
13838    {
13839        use std::iter::Iterator;
13840        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13841        self
13842    }
13843
13844    /// Sets the value of [labels][crate::model::Automation::labels].
13845    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13846    where
13847        T: std::iter::IntoIterator<Item = (K, V)>,
13848        K: std::convert::Into<std::string::String>,
13849        V: std::convert::Into<std::string::String>,
13850    {
13851        use std::iter::Iterator;
13852        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13853        self
13854    }
13855
13856    /// Sets the value of [etag][crate::model::Automation::etag].
13857    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13858        self.etag = v.into();
13859        self
13860    }
13861
13862    /// Sets the value of [suspended][crate::model::Automation::suspended].
13863    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13864        self.suspended = v.into();
13865        self
13866    }
13867
13868    /// Sets the value of [service_account][crate::model::Automation::service_account].
13869    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13870        self.service_account = v.into();
13871        self
13872    }
13873
13874    /// Sets the value of [selector][crate::model::Automation::selector].
13875    pub fn set_selector<T>(mut self, v: T) -> Self
13876    where
13877        T: std::convert::Into<crate::model::AutomationResourceSelector>,
13878    {
13879        self.selector = std::option::Option::Some(v.into());
13880        self
13881    }
13882
13883    /// Sets or clears the value of [selector][crate::model::Automation::selector].
13884    pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
13885    where
13886        T: std::convert::Into<crate::model::AutomationResourceSelector>,
13887    {
13888        self.selector = v.map(|x| x.into());
13889        self
13890    }
13891
13892    /// Sets the value of [rules][crate::model::Automation::rules].
13893    pub fn set_rules<T, V>(mut self, v: T) -> Self
13894    where
13895        T: std::iter::IntoIterator<Item = V>,
13896        V: std::convert::Into<crate::model::AutomationRule>,
13897    {
13898        use std::iter::Iterator;
13899        self.rules = v.into_iter().map(|i| i.into()).collect();
13900        self
13901    }
13902}
13903
13904impl wkt::message::Message for Automation {
13905    fn typename() -> &'static str {
13906        "type.googleapis.com/google.cloud.deploy.v1.Automation"
13907    }
13908}
13909
13910/// AutomationResourceSelector contains the information to select the resources
13911/// to which an Automation is going to be applied.
13912#[derive(Clone, Default, PartialEq)]
13913#[non_exhaustive]
13914pub struct AutomationResourceSelector {
13915    /// Optional. Contains attributes about a target.
13916    pub targets: std::vec::Vec<crate::model::TargetAttribute>,
13917
13918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13919}
13920
13921impl AutomationResourceSelector {
13922    pub fn new() -> Self {
13923        std::default::Default::default()
13924    }
13925
13926    /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
13927    pub fn set_targets<T, V>(mut self, v: T) -> Self
13928    where
13929        T: std::iter::IntoIterator<Item = V>,
13930        V: std::convert::Into<crate::model::TargetAttribute>,
13931    {
13932        use std::iter::Iterator;
13933        self.targets = v.into_iter().map(|i| i.into()).collect();
13934        self
13935    }
13936}
13937
13938impl wkt::message::Message for AutomationResourceSelector {
13939    fn typename() -> &'static str {
13940        "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
13941    }
13942}
13943
13944/// `AutomationRule` defines the automation activities.
13945#[derive(Clone, Default, PartialEq)]
13946#[non_exhaustive]
13947pub struct AutomationRule {
13948    /// The configuration of the Automation rule.
13949    pub rule: std::option::Option<crate::model::automation_rule::Rule>,
13950
13951    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13952}
13953
13954impl AutomationRule {
13955    pub fn new() -> Self {
13956        std::default::Default::default()
13957    }
13958
13959    /// Sets the value of [rule][crate::model::AutomationRule::rule].
13960    ///
13961    /// Note that all the setters affecting `rule` are mutually
13962    /// exclusive.
13963    pub fn set_rule<
13964        T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
13965    >(
13966        mut self,
13967        v: T,
13968    ) -> Self {
13969        self.rule = v.into();
13970        self
13971    }
13972
13973    /// The value of [rule][crate::model::AutomationRule::rule]
13974    /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
13975    /// holds a different branch.
13976    pub fn promote_release_rule(
13977        &self,
13978    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
13979        #[allow(unreachable_patterns)]
13980        self.rule.as_ref().and_then(|v| match v {
13981            crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
13982                std::option::Option::Some(v)
13983            }
13984            _ => std::option::Option::None,
13985        })
13986    }
13987
13988    /// Sets the value of [rule][crate::model::AutomationRule::rule]
13989    /// to hold a `PromoteReleaseRule`.
13990    ///
13991    /// Note that all the setters affecting `rule` are
13992    /// mutually exclusive.
13993    pub fn set_promote_release_rule<
13994        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
13995    >(
13996        mut self,
13997        v: T,
13998    ) -> Self {
13999        self.rule = std::option::Option::Some(
14000            crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
14001        );
14002        self
14003    }
14004
14005    /// The value of [rule][crate::model::AutomationRule::rule]
14006    /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
14007    /// holds a different branch.
14008    pub fn advance_rollout_rule(
14009        &self,
14010    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
14011        #[allow(unreachable_patterns)]
14012        self.rule.as_ref().and_then(|v| match v {
14013            crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
14014                std::option::Option::Some(v)
14015            }
14016            _ => std::option::Option::None,
14017        })
14018    }
14019
14020    /// Sets the value of [rule][crate::model::AutomationRule::rule]
14021    /// to hold a `AdvanceRolloutRule`.
14022    ///
14023    /// Note that all the setters affecting `rule` are
14024    /// mutually exclusive.
14025    pub fn set_advance_rollout_rule<
14026        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
14027    >(
14028        mut self,
14029        v: T,
14030    ) -> Self {
14031        self.rule = std::option::Option::Some(
14032            crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
14033        );
14034        self
14035    }
14036
14037    /// The value of [rule][crate::model::AutomationRule::rule]
14038    /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
14039    /// holds a different branch.
14040    pub fn repair_rollout_rule(
14041        &self,
14042    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
14043        #[allow(unreachable_patterns)]
14044        self.rule.as_ref().and_then(|v| match v {
14045            crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
14046                std::option::Option::Some(v)
14047            }
14048            _ => std::option::Option::None,
14049        })
14050    }
14051
14052    /// Sets the value of [rule][crate::model::AutomationRule::rule]
14053    /// to hold a `RepairRolloutRule`.
14054    ///
14055    /// Note that all the setters affecting `rule` are
14056    /// mutually exclusive.
14057    pub fn set_repair_rollout_rule<
14058        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
14059    >(
14060        mut self,
14061        v: T,
14062    ) -> Self {
14063        self.rule = std::option::Option::Some(
14064            crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
14065        );
14066        self
14067    }
14068
14069    /// The value of [rule][crate::model::AutomationRule::rule]
14070    /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
14071    /// holds a different branch.
14072    pub fn timed_promote_release_rule(
14073        &self,
14074    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
14075        #[allow(unreachable_patterns)]
14076        self.rule.as_ref().and_then(|v| match v {
14077            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
14078                std::option::Option::Some(v)
14079            }
14080            _ => std::option::Option::None,
14081        })
14082    }
14083
14084    /// Sets the value of [rule][crate::model::AutomationRule::rule]
14085    /// to hold a `TimedPromoteReleaseRule`.
14086    ///
14087    /// Note that all the setters affecting `rule` are
14088    /// mutually exclusive.
14089    pub fn set_timed_promote_release_rule<
14090        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
14091    >(
14092        mut self,
14093        v: T,
14094    ) -> Self {
14095        self.rule = std::option::Option::Some(
14096            crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
14097        );
14098        self
14099    }
14100}
14101
14102impl wkt::message::Message for AutomationRule {
14103    fn typename() -> &'static str {
14104        "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
14105    }
14106}
14107
14108/// Defines additional types related to [AutomationRule].
14109pub mod automation_rule {
14110    #[allow(unused_imports)]
14111    use super::*;
14112
14113    /// The configuration of the Automation rule.
14114    #[derive(Clone, Debug, PartialEq)]
14115    #[non_exhaustive]
14116    pub enum Rule {
14117        /// Optional. `PromoteReleaseRule` will automatically promote a release from
14118        /// the current target to a specified target.
14119        PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
14120        /// Optional. The `AdvanceRolloutRule` will automatically advance a
14121        /// successful Rollout.
14122        AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
14123        /// Optional. The `RepairRolloutRule` will automatically repair a failed
14124        /// rollout.
14125        RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
14126        /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
14127        /// release from the current target(s) to the specified target(s) on a
14128        /// configured schedule.
14129        TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
14130    }
14131}
14132
14133/// The `TimedPromoteReleaseRule` will automatically promote a release from the
14134/// current target(s) to the specified target(s) on a configured schedule.
14135#[derive(Clone, Default, PartialEq)]
14136#[non_exhaustive]
14137pub struct TimedPromoteReleaseRule {
14138    /// Required. ID of the rule. This ID must be unique in the `Automation`
14139    /// resource to which this rule belongs. The format is
14140    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
14141    pub id: std::string::String,
14142
14143    /// Optional. The ID of the stage in the pipeline to which this `Release` is
14144    /// deploying. If unspecified, default it to the next stage in the promotion
14145    /// flow. The value of this field could be one of the following:
14146    ///
14147    /// * The last segment of a target name
14148    /// * "@next", the next target in the promotion sequence
14149    pub destination_target_id: std::string::String,
14150
14151    /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
14152    /// 9am.
14153    pub schedule: std::string::String,
14154
14155    /// Required. The time zone in IANA format [IANA Time Zone
14156    /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
14157    pub time_zone: std::string::String,
14158
14159    /// Output only. Information around the state of the Automation rule.
14160    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
14161
14162    /// Optional. The starting phase of the rollout created by this rule. Default
14163    /// to the first phase.
14164    pub destination_phase: std::string::String,
14165
14166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14167}
14168
14169impl TimedPromoteReleaseRule {
14170    pub fn new() -> Self {
14171        std::default::Default::default()
14172    }
14173
14174    /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
14175    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14176        self.id = v.into();
14177        self
14178    }
14179
14180    /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
14181    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
14182        mut self,
14183        v: T,
14184    ) -> Self {
14185        self.destination_target_id = v.into();
14186        self
14187    }
14188
14189    /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
14190    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14191        self.schedule = v.into();
14192        self
14193    }
14194
14195    /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
14196    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14197        self.time_zone = v.into();
14198        self
14199    }
14200
14201    /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
14202    pub fn set_condition<T>(mut self, v: T) -> Self
14203    where
14204        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14205    {
14206        self.condition = std::option::Option::Some(v.into());
14207        self
14208    }
14209
14210    /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
14211    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
14212    where
14213        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14214    {
14215        self.condition = v.map(|x| x.into());
14216        self
14217    }
14218
14219    /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
14220    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
14221        mut self,
14222        v: T,
14223    ) -> Self {
14224        self.destination_phase = v.into();
14225        self
14226    }
14227}
14228
14229impl wkt::message::Message for TimedPromoteReleaseRule {
14230    fn typename() -> &'static str {
14231        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
14232    }
14233}
14234
14235/// The `PromoteRelease` rule will automatically promote a release from the
14236/// current target to a specified target.
14237#[derive(Clone, Default, PartialEq)]
14238#[non_exhaustive]
14239pub struct PromoteReleaseRule {
14240    /// Required. ID of the rule. This id must be unique in the `Automation`
14241    /// resource to which this rule belongs. The format is
14242    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
14243    pub id: std::string::String,
14244
14245    /// Optional. How long the release need to be paused until being promoted to
14246    /// the next target.
14247    pub wait: std::option::Option<wkt::Duration>,
14248
14249    /// Optional. The ID of the stage in the pipeline to which this `Release` is
14250    /// deploying. If unspecified, default it to the next stage in the promotion
14251    /// flow. The value of this field could be one of the following:
14252    ///
14253    /// * The last segment of a target name
14254    /// * "@next", the next target in the promotion sequence
14255    pub destination_target_id: std::string::String,
14256
14257    /// Output only. Information around the state of the Automation rule.
14258    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
14259
14260    /// Optional. The starting phase of the rollout created by this operation.
14261    /// Default to the first phase.
14262    pub destination_phase: std::string::String,
14263
14264    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14265}
14266
14267impl PromoteReleaseRule {
14268    pub fn new() -> Self {
14269        std::default::Default::default()
14270    }
14271
14272    /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
14273    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14274        self.id = v.into();
14275        self
14276    }
14277
14278    /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
14279    pub fn set_wait<T>(mut self, v: T) -> Self
14280    where
14281        T: std::convert::Into<wkt::Duration>,
14282    {
14283        self.wait = std::option::Option::Some(v.into());
14284        self
14285    }
14286
14287    /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
14288    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
14289    where
14290        T: std::convert::Into<wkt::Duration>,
14291    {
14292        self.wait = v.map(|x| x.into());
14293        self
14294    }
14295
14296    /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
14297    pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
14298        mut self,
14299        v: T,
14300    ) -> Self {
14301        self.destination_target_id = v.into();
14302        self
14303    }
14304
14305    /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
14306    pub fn set_condition<T>(mut self, v: T) -> Self
14307    where
14308        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14309    {
14310        self.condition = std::option::Option::Some(v.into());
14311        self
14312    }
14313
14314    /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
14315    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
14316    where
14317        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14318    {
14319        self.condition = v.map(|x| x.into());
14320        self
14321    }
14322
14323    /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
14324    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
14325        mut self,
14326        v: T,
14327    ) -> Self {
14328        self.destination_phase = v.into();
14329        self
14330    }
14331}
14332
14333impl wkt::message::Message for PromoteReleaseRule {
14334    fn typename() -> &'static str {
14335        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
14336    }
14337}
14338
14339/// The `AdvanceRollout` automation rule will automatically advance a successful
14340/// Rollout to the next phase.
14341#[derive(Clone, Default, PartialEq)]
14342#[non_exhaustive]
14343pub struct AdvanceRolloutRule {
14344    /// Required. ID of the rule. This id must be unique in the `Automation`
14345    /// resource to which this rule belongs. The format is
14346    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
14347    pub id: std::string::String,
14348
14349    /// Optional. Proceeds only after phase name matched any one in the list.
14350    /// This value must consist of lower-case letters, numbers, and hyphens,
14351    /// start with a letter and end with a letter or a number, and have a max
14352    /// length of 63 characters. In other words, it must match the following
14353    /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
14354    pub source_phases: std::vec::Vec<std::string::String>,
14355
14356    /// Optional. How long to wait after a rollout is finished.
14357    pub wait: std::option::Option<wkt::Duration>,
14358
14359    /// Output only. Information around the state of the Automation rule.
14360    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
14361
14362    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14363}
14364
14365impl AdvanceRolloutRule {
14366    pub fn new() -> Self {
14367        std::default::Default::default()
14368    }
14369
14370    /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
14371    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14372        self.id = v.into();
14373        self
14374    }
14375
14376    /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
14377    pub fn set_source_phases<T, V>(mut self, v: T) -> Self
14378    where
14379        T: std::iter::IntoIterator<Item = V>,
14380        V: std::convert::Into<std::string::String>,
14381    {
14382        use std::iter::Iterator;
14383        self.source_phases = v.into_iter().map(|i| i.into()).collect();
14384        self
14385    }
14386
14387    /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
14388    pub fn set_wait<T>(mut self, v: T) -> Self
14389    where
14390        T: std::convert::Into<wkt::Duration>,
14391    {
14392        self.wait = std::option::Option::Some(v.into());
14393        self
14394    }
14395
14396    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
14397    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
14398    where
14399        T: std::convert::Into<wkt::Duration>,
14400    {
14401        self.wait = v.map(|x| x.into());
14402        self
14403    }
14404
14405    /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
14406    pub fn set_condition<T>(mut self, v: T) -> Self
14407    where
14408        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14409    {
14410        self.condition = std::option::Option::Some(v.into());
14411        self
14412    }
14413
14414    /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
14415    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
14416    where
14417        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14418    {
14419        self.condition = v.map(|x| x.into());
14420        self
14421    }
14422}
14423
14424impl wkt::message::Message for AdvanceRolloutRule {
14425    fn typename() -> &'static str {
14426        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
14427    }
14428}
14429
14430/// The `RepairRolloutRule` automation rule will automatically repair a failed
14431/// `Rollout`.
14432#[derive(Clone, Default, PartialEq)]
14433#[non_exhaustive]
14434pub struct RepairRolloutRule {
14435    /// Required. ID of the rule. This id must be unique in the `Automation`
14436    /// resource to which this rule belongs. The format is
14437    /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
14438    pub id: std::string::String,
14439
14440    /// Optional. Phases within which jobs are subject to automatic repair actions
14441    /// on failure. Proceeds only after phase name matched any one in the list, or
14442    /// for all phases if unspecified. This value must consist of lower-case
14443    /// letters, numbers, and hyphens, start with a letter and end with a letter or
14444    /// a number, and have a max length of 63 characters. In other words, it must
14445    /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
14446    pub phases: std::vec::Vec<std::string::String>,
14447
14448    /// Optional. Jobs to repair. Proceeds only after job name matched any one in
14449    /// the list, or for all jobs if unspecified or empty. The phase that includes
14450    /// the job must match the phase ID specified in `source_phase`. This value
14451    /// must consist of lower-case letters, numbers, and hyphens, start with a
14452    /// letter and end with a letter or a number, and have a max length of 63
14453    /// characters. In other words, it must match the following regex:
14454    /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
14455    pub jobs: std::vec::Vec<std::string::String>,
14456
14457    /// Output only. Information around the state of the 'Automation' rule.
14458    pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
14459
14460    /// Required. Defines the types of automatic repair phases for failed jobs.
14461    pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
14462
14463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14464}
14465
14466impl RepairRolloutRule {
14467    pub fn new() -> Self {
14468        std::default::Default::default()
14469    }
14470
14471    /// Sets the value of [id][crate::model::RepairRolloutRule::id].
14472    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14473        self.id = v.into();
14474        self
14475    }
14476
14477    /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
14478    pub fn set_phases<T, V>(mut self, v: T) -> Self
14479    where
14480        T: std::iter::IntoIterator<Item = V>,
14481        V: std::convert::Into<std::string::String>,
14482    {
14483        use std::iter::Iterator;
14484        self.phases = v.into_iter().map(|i| i.into()).collect();
14485        self
14486    }
14487
14488    /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
14489    pub fn set_jobs<T, V>(mut self, v: T) -> Self
14490    where
14491        T: std::iter::IntoIterator<Item = V>,
14492        V: std::convert::Into<std::string::String>,
14493    {
14494        use std::iter::Iterator;
14495        self.jobs = v.into_iter().map(|i| i.into()).collect();
14496        self
14497    }
14498
14499    /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
14500    pub fn set_condition<T>(mut self, v: T) -> Self
14501    where
14502        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14503    {
14504        self.condition = std::option::Option::Some(v.into());
14505        self
14506    }
14507
14508    /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
14509    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
14510    where
14511        T: std::convert::Into<crate::model::AutomationRuleCondition>,
14512    {
14513        self.condition = v.map(|x| x.into());
14514        self
14515    }
14516
14517    /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
14518    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
14519    where
14520        T: std::iter::IntoIterator<Item = V>,
14521        V: std::convert::Into<crate::model::RepairPhaseConfig>,
14522    {
14523        use std::iter::Iterator;
14524        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
14525        self
14526    }
14527}
14528
14529impl wkt::message::Message for RepairRolloutRule {
14530    fn typename() -> &'static str {
14531        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
14532    }
14533}
14534
14535/// Configuration of the repair phase.
14536#[derive(Clone, Default, PartialEq)]
14537#[non_exhaustive]
14538pub struct RepairPhaseConfig {
14539    /// The repair phase to perform.
14540    pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
14541
14542    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14543}
14544
14545impl RepairPhaseConfig {
14546    pub fn new() -> Self {
14547        std::default::Default::default()
14548    }
14549
14550    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
14551    ///
14552    /// Note that all the setters affecting `repair_phase` are mutually
14553    /// exclusive.
14554    pub fn set_repair_phase<
14555        T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
14556    >(
14557        mut self,
14558        v: T,
14559    ) -> Self {
14560        self.repair_phase = v.into();
14561        self
14562    }
14563
14564    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
14565    /// if it holds a `Retry`, `None` if the field is not set or
14566    /// holds a different branch.
14567    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
14568        #[allow(unreachable_patterns)]
14569        self.repair_phase.as_ref().and_then(|v| match v {
14570            crate::model::repair_phase_config::RepairPhase::Retry(v) => {
14571                std::option::Option::Some(v)
14572            }
14573            _ => std::option::Option::None,
14574        })
14575    }
14576
14577    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
14578    /// to hold a `Retry`.
14579    ///
14580    /// Note that all the setters affecting `repair_phase` are
14581    /// mutually exclusive.
14582    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
14583        mut self,
14584        v: T,
14585    ) -> Self {
14586        self.repair_phase = std::option::Option::Some(
14587            crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
14588        );
14589        self
14590    }
14591
14592    /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
14593    /// if it holds a `Rollback`, `None` if the field is not set or
14594    /// holds a different branch.
14595    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
14596        #[allow(unreachable_patterns)]
14597        self.repair_phase.as_ref().and_then(|v| match v {
14598            crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
14599                std::option::Option::Some(v)
14600            }
14601            _ => std::option::Option::None,
14602        })
14603    }
14604
14605    /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
14606    /// to hold a `Rollback`.
14607    ///
14608    /// Note that all the setters affecting `repair_phase` are
14609    /// mutually exclusive.
14610    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
14611        mut self,
14612        v: T,
14613    ) -> Self {
14614        self.repair_phase = std::option::Option::Some(
14615            crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
14616        );
14617        self
14618    }
14619}
14620
14621impl wkt::message::Message for RepairPhaseConfig {
14622    fn typename() -> &'static str {
14623        "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
14624    }
14625}
14626
14627/// Defines additional types related to [RepairPhaseConfig].
14628pub mod repair_phase_config {
14629    #[allow(unused_imports)]
14630    use super::*;
14631
14632    /// The repair phase to perform.
14633    #[derive(Clone, Debug, PartialEq)]
14634    #[non_exhaustive]
14635    pub enum RepairPhase {
14636        /// Optional. Retries a failed job.
14637        Retry(std::boxed::Box<crate::model::Retry>),
14638        /// Optional. Rolls back a `Rollout`.
14639        Rollback(std::boxed::Box<crate::model::Rollback>),
14640    }
14641}
14642
14643/// Retries the failed job.
14644#[derive(Clone, Default, PartialEq)]
14645#[non_exhaustive]
14646pub struct Retry {
14647    /// Required. Total number of retries. Retry is skipped if set to 0; The
14648    /// minimum value is 1, and the maximum value is 10.
14649    pub attempts: i64,
14650
14651    /// Optional. How long to wait for the first retry. Default is 0, and the
14652    /// maximum value is 14d.
14653    pub wait: std::option::Option<wkt::Duration>,
14654
14655    /// Optional. The pattern of how wait time will be increased. Default is
14656    /// linear. Backoff mode will be ignored if `wait` is 0.
14657    pub backoff_mode: crate::model::BackoffMode,
14658
14659    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14660}
14661
14662impl Retry {
14663    pub fn new() -> Self {
14664        std::default::Default::default()
14665    }
14666
14667    /// Sets the value of [attempts][crate::model::Retry::attempts].
14668    pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14669        self.attempts = v.into();
14670        self
14671    }
14672
14673    /// Sets the value of [wait][crate::model::Retry::wait].
14674    pub fn set_wait<T>(mut self, v: T) -> Self
14675    where
14676        T: std::convert::Into<wkt::Duration>,
14677    {
14678        self.wait = std::option::Option::Some(v.into());
14679        self
14680    }
14681
14682    /// Sets or clears the value of [wait][crate::model::Retry::wait].
14683    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
14684    where
14685        T: std::convert::Into<wkt::Duration>,
14686    {
14687        self.wait = v.map(|x| x.into());
14688        self
14689    }
14690
14691    /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
14692    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
14693        mut self,
14694        v: T,
14695    ) -> Self {
14696        self.backoff_mode = v.into();
14697        self
14698    }
14699}
14700
14701impl wkt::message::Message for Retry {
14702    fn typename() -> &'static str {
14703        "type.googleapis.com/google.cloud.deploy.v1.Retry"
14704    }
14705}
14706
14707/// Rolls back a `Rollout`.
14708#[derive(Clone, Default, PartialEq)]
14709#[non_exhaustive]
14710pub struct Rollback {
14711    /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
14712    /// `Rollout` will start in the stable phase.
14713    pub destination_phase: std::string::String,
14714
14715    /// Optional. If pending rollout exists on the target, the rollback operation
14716    /// will be aborted.
14717    pub disable_rollback_if_rollout_pending: bool,
14718
14719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14720}
14721
14722impl Rollback {
14723    pub fn new() -> Self {
14724        std::default::Default::default()
14725    }
14726
14727    /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
14728    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
14729        mut self,
14730        v: T,
14731    ) -> Self {
14732        self.destination_phase = v.into();
14733        self
14734    }
14735
14736    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
14737    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
14738        mut self,
14739        v: T,
14740    ) -> Self {
14741        self.disable_rollback_if_rollout_pending = v.into();
14742        self
14743    }
14744}
14745
14746impl wkt::message::Message for Rollback {
14747    fn typename() -> &'static str {
14748        "type.googleapis.com/google.cloud.deploy.v1.Rollback"
14749    }
14750}
14751
14752/// `AutomationRuleCondition` contains conditions relevant to an
14753/// `Automation` rule.
14754#[derive(Clone, Default, PartialEq)]
14755#[non_exhaustive]
14756pub struct AutomationRuleCondition {
14757    /// Optional. Details around targets enumerated in the rule.
14758    pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
14759
14760    /// Details specific to the automation rule type.
14761    pub rule_type_condition:
14762        std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
14763
14764    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14765}
14766
14767impl AutomationRuleCondition {
14768    pub fn new() -> Self {
14769        std::default::Default::default()
14770    }
14771
14772    /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
14773    pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
14774    where
14775        T: std::convert::Into<crate::model::TargetsPresentCondition>,
14776    {
14777        self.targets_present_condition = std::option::Option::Some(v.into());
14778        self
14779    }
14780
14781    /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
14782    pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
14783    where
14784        T: std::convert::Into<crate::model::TargetsPresentCondition>,
14785    {
14786        self.targets_present_condition = v.map(|x| x.into());
14787        self
14788    }
14789
14790    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
14791    ///
14792    /// Note that all the setters affecting `rule_type_condition` are mutually
14793    /// exclusive.
14794    pub fn set_rule_type_condition<
14795        T: std::convert::Into<
14796                std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
14797            >,
14798    >(
14799        mut self,
14800        v: T,
14801    ) -> Self {
14802        self.rule_type_condition = v.into();
14803        self
14804    }
14805
14806    /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
14807    /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
14808    /// holds a different branch.
14809    pub fn timed_promote_release_condition(
14810        &self,
14811    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
14812        #[allow(unreachable_patterns)]
14813        self.rule_type_condition.as_ref().and_then(|v| match v {
14814            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
14815            _ => std::option::Option::None,
14816        })
14817    }
14818
14819    /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
14820    /// to hold a `TimedPromoteReleaseCondition`.
14821    ///
14822    /// Note that all the setters affecting `rule_type_condition` are
14823    /// mutually exclusive.
14824    pub fn set_timed_promote_release_condition<
14825        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
14826    >(
14827        mut self,
14828        v: T,
14829    ) -> Self {
14830        self.rule_type_condition = std::option::Option::Some(
14831            crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
14832                v.into()
14833            )
14834        );
14835        self
14836    }
14837}
14838
14839impl wkt::message::Message for AutomationRuleCondition {
14840    fn typename() -> &'static str {
14841        "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
14842    }
14843}
14844
14845/// Defines additional types related to [AutomationRuleCondition].
14846pub mod automation_rule_condition {
14847    #[allow(unused_imports)]
14848    use super::*;
14849
14850    /// Details specific to the automation rule type.
14851    #[derive(Clone, Debug, PartialEq)]
14852    #[non_exhaustive]
14853    pub enum RuleTypeCondition {
14854        /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
14855        /// to a an Automation with a timed promote release rule defined.
14856        TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
14857    }
14858}
14859
14860/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
14861/// with a Timed Promote Release rule defined.
14862#[derive(Clone, Default, PartialEq)]
14863#[non_exhaustive]
14864pub struct TimedPromoteReleaseCondition {
14865    /// Output only. When the next scheduled promotion(s) will occur.
14866    pub next_promotion_time: std::option::Option<wkt::Timestamp>,
14867
14868    /// Output only. A list of targets involved in the upcoming timed promotion(s).
14869    pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
14870
14871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14872}
14873
14874impl TimedPromoteReleaseCondition {
14875    pub fn new() -> Self {
14876        std::default::Default::default()
14877    }
14878
14879    /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
14880    pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
14881    where
14882        T: std::convert::Into<wkt::Timestamp>,
14883    {
14884        self.next_promotion_time = std::option::Option::Some(v.into());
14885        self
14886    }
14887
14888    /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
14889    pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
14890    where
14891        T: std::convert::Into<wkt::Timestamp>,
14892    {
14893        self.next_promotion_time = v.map(|x| x.into());
14894        self
14895    }
14896
14897    /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
14898    pub fn set_targets_list<T, V>(mut self, v: T) -> Self
14899    where
14900        T: std::iter::IntoIterator<Item = V>,
14901        V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
14902    {
14903        use std::iter::Iterator;
14904        self.targets_list = v.into_iter().map(|i| i.into()).collect();
14905        self
14906    }
14907}
14908
14909impl wkt::message::Message for TimedPromoteReleaseCondition {
14910    fn typename() -> &'static str {
14911        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
14912    }
14913}
14914
14915/// Defines additional types related to [TimedPromoteReleaseCondition].
14916pub mod timed_promote_release_condition {
14917    #[allow(unused_imports)]
14918    use super::*;
14919
14920    /// The targets involved in a single timed promotion.
14921    #[derive(Clone, Default, PartialEq)]
14922    #[non_exhaustive]
14923    pub struct Targets {
14924        /// Optional. The source target ID.
14925        pub source_target_id: std::string::String,
14926
14927        /// Optional. The destination target ID.
14928        pub destination_target_id: std::string::String,
14929
14930        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14931    }
14932
14933    impl Targets {
14934        pub fn new() -> Self {
14935            std::default::Default::default()
14936        }
14937
14938        /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
14939        pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
14940            mut self,
14941            v: T,
14942        ) -> Self {
14943            self.source_target_id = v.into();
14944            self
14945        }
14946
14947        /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
14948        pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
14949            mut self,
14950            v: T,
14951        ) -> Self {
14952            self.destination_target_id = v.into();
14953            self
14954        }
14955    }
14956
14957    impl wkt::message::Message for Targets {
14958        fn typename() -> &'static str {
14959            "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
14960        }
14961    }
14962}
14963
14964/// The request object for `CreateAutomation`.
14965#[derive(Clone, Default, PartialEq)]
14966#[non_exhaustive]
14967pub struct CreateAutomationRequest {
14968    /// Required. The parent collection in which the `Automation` must be created.
14969    /// The format is
14970    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
14971    pub parent: std::string::String,
14972
14973    /// Required. ID of the `Automation`.
14974    pub automation_id: std::string::String,
14975
14976    /// Required. The `Automation` to create.
14977    pub automation: std::option::Option<crate::model::Automation>,
14978
14979    /// Optional. A request ID to identify requests. Specify a unique request ID
14980    /// so that if you must retry your request, the server knows to ignore the
14981    /// request if it has already been completed. The server guarantees that for
14982    /// at least 60 minutes after the first request.
14983    ///
14984    /// For example, consider a situation where you make an initial request and the
14985    /// request times out. If you make the request again with the same request ID,
14986    /// the server can check if original operation with the same request ID was
14987    /// received, and if so, will ignore the second request. This prevents clients
14988    /// from accidentally creating duplicate commitments.
14989    ///
14990    /// The request ID must be a valid UUID with the exception that zero UUID is
14991    /// not supported (00000000-0000-0000-0000-000000000000).
14992    pub request_id: std::string::String,
14993
14994    /// Optional. If set to true, the request is validated and the user is provided
14995    /// with an expected result, but no actual change is made.
14996    pub validate_only: bool,
14997
14998    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14999}
15000
15001impl CreateAutomationRequest {
15002    pub fn new() -> Self {
15003        std::default::Default::default()
15004    }
15005
15006    /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
15007    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15008        self.parent = v.into();
15009        self
15010    }
15011
15012    /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
15013    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15014        self.automation_id = v.into();
15015        self
15016    }
15017
15018    /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
15019    pub fn set_automation<T>(mut self, v: T) -> Self
15020    where
15021        T: std::convert::Into<crate::model::Automation>,
15022    {
15023        self.automation = std::option::Option::Some(v.into());
15024        self
15025    }
15026
15027    /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
15028    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
15029    where
15030        T: std::convert::Into<crate::model::Automation>,
15031    {
15032        self.automation = v.map(|x| x.into());
15033        self
15034    }
15035
15036    /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
15037    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15038        self.request_id = v.into();
15039        self
15040    }
15041
15042    /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
15043    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15044        self.validate_only = v.into();
15045        self
15046    }
15047}
15048
15049impl wkt::message::Message for CreateAutomationRequest {
15050    fn typename() -> &'static str {
15051        "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
15052    }
15053}
15054
15055/// The request object for `UpdateAutomation`.
15056#[derive(Clone, Default, PartialEq)]
15057#[non_exhaustive]
15058pub struct UpdateAutomationRequest {
15059    /// Required. Field mask is used to specify the fields to be overwritten by the
15060    /// update in the `Automation` resource. The fields specified in the
15061    /// update_mask are relative to the resource, not the full request. A field
15062    /// will be overwritten if it's in the mask. If the user doesn't provide a mask
15063    /// then all fields are overwritten.
15064    pub update_mask: std::option::Option<wkt::FieldMask>,
15065
15066    /// Required. The `Automation` to update.
15067    pub automation: std::option::Option<crate::model::Automation>,
15068
15069    /// Optional. A request ID to identify requests. Specify a unique request ID
15070    /// so that if you must retry your request, the server knows to ignore the
15071    /// request if it has already been completed. The server guarantees that for
15072    /// at least 60 minutes after the first request.
15073    ///
15074    /// For example, consider a situation where you make an initial request and the
15075    /// request times out. If you make the request again with the same request ID,
15076    /// the server can check if original operation with the same request ID was
15077    /// received, and if so, will ignore the second request. This prevents clients
15078    /// from accidentally creating duplicate commitments.
15079    ///
15080    /// The request ID must be a valid UUID with the exception that zero UUID is
15081    /// not supported (00000000-0000-0000-0000-000000000000).
15082    pub request_id: std::string::String,
15083
15084    /// Optional. If set to true, updating a `Automation` that does not exist will
15085    /// result in the creation of a new `Automation`.
15086    pub allow_missing: bool,
15087
15088    /// Optional. If set to true, the request is validated and the user is provided
15089    /// with an expected result, but no actual change is made.
15090    pub validate_only: bool,
15091
15092    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15093}
15094
15095impl UpdateAutomationRequest {
15096    pub fn new() -> Self {
15097        std::default::Default::default()
15098    }
15099
15100    /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
15101    pub fn set_update_mask<T>(mut self, v: T) -> Self
15102    where
15103        T: std::convert::Into<wkt::FieldMask>,
15104    {
15105        self.update_mask = std::option::Option::Some(v.into());
15106        self
15107    }
15108
15109    /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
15110    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15111    where
15112        T: std::convert::Into<wkt::FieldMask>,
15113    {
15114        self.update_mask = v.map(|x| x.into());
15115        self
15116    }
15117
15118    /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
15119    pub fn set_automation<T>(mut self, v: T) -> Self
15120    where
15121        T: std::convert::Into<crate::model::Automation>,
15122    {
15123        self.automation = std::option::Option::Some(v.into());
15124        self
15125    }
15126
15127    /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
15128    pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
15129    where
15130        T: std::convert::Into<crate::model::Automation>,
15131    {
15132        self.automation = v.map(|x| x.into());
15133        self
15134    }
15135
15136    /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
15137    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15138        self.request_id = v.into();
15139        self
15140    }
15141
15142    /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
15143    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15144        self.allow_missing = v.into();
15145        self
15146    }
15147
15148    /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
15149    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15150        self.validate_only = v.into();
15151        self
15152    }
15153}
15154
15155impl wkt::message::Message for UpdateAutomationRequest {
15156    fn typename() -> &'static str {
15157        "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
15158    }
15159}
15160
15161/// The request object for `DeleteAutomation`.
15162#[derive(Clone, Default, PartialEq)]
15163#[non_exhaustive]
15164pub struct DeleteAutomationRequest {
15165    /// Required. The name of the `Automation` to delete. The format is
15166    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
15167    pub name: std::string::String,
15168
15169    /// Optional. A request ID to identify requests. Specify a unique request ID
15170    /// so that if you must retry your request, the server knows to ignore the
15171    /// request if it has already been completed. The server guarantees that for
15172    /// at least 60 minutes after the first request.
15173    ///
15174    /// For example, consider a situation where you make an initial request and the
15175    /// request times out. If you make the request again with the same request ID,
15176    /// the server can check if original operation with the same request ID was
15177    /// received, and if so, will ignore the second request. This prevents clients
15178    /// from accidentally creating duplicate commitments.
15179    ///
15180    /// The request ID must be a valid UUID with the exception that zero UUID is
15181    /// not supported (00000000-0000-0000-0000-000000000000).
15182    pub request_id: std::string::String,
15183
15184    /// Optional. If set to true, then deleting an already deleted or non-existing
15185    /// `Automation` will succeed.
15186    pub allow_missing: bool,
15187
15188    /// Optional. If set, validate the request and verify whether the resource
15189    /// exists, but do not actually post it.
15190    pub validate_only: bool,
15191
15192    /// Optional. The weak etag of the request.
15193    /// This checksum is computed by the server based on the value of other
15194    /// fields, and may be sent on update and delete requests to ensure the
15195    /// client has an up-to-date value before proceeding.
15196    pub etag: std::string::String,
15197
15198    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15199}
15200
15201impl DeleteAutomationRequest {
15202    pub fn new() -> Self {
15203        std::default::Default::default()
15204    }
15205
15206    /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
15207    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15208        self.name = v.into();
15209        self
15210    }
15211
15212    /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
15213    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15214        self.request_id = v.into();
15215        self
15216    }
15217
15218    /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
15219    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15220        self.allow_missing = v.into();
15221        self
15222    }
15223
15224    /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
15225    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15226        self.validate_only = v.into();
15227        self
15228    }
15229
15230    /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
15231    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15232        self.etag = v.into();
15233        self
15234    }
15235}
15236
15237impl wkt::message::Message for DeleteAutomationRequest {
15238    fn typename() -> &'static str {
15239        "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
15240    }
15241}
15242
15243/// The request object for `ListAutomations`.
15244#[derive(Clone, Default, PartialEq)]
15245#[non_exhaustive]
15246pub struct ListAutomationsRequest {
15247    /// Required. The parent `Delivery Pipeline`, which owns this collection of
15248    /// automations. Format must be
15249    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
15250    pub parent: std::string::String,
15251
15252    /// The maximum number of automations to return. The service may return
15253    /// fewer than this value. If unspecified, at most 50 automations will
15254    /// be returned. The maximum value is 1000; values above 1000 will be set
15255    /// to 1000.
15256    pub page_size: i32,
15257
15258    /// A page token, received from a previous `ListAutomations` call.
15259    /// Provide this to retrieve the subsequent page.
15260    ///
15261    /// When paginating, all other provided parameters match
15262    /// the call that provided the page token.
15263    pub page_token: std::string::String,
15264
15265    /// Filter automations to be returned. All fields can be used in the
15266    /// filter.
15267    pub filter: std::string::String,
15268
15269    /// Field to sort by.
15270    pub order_by: std::string::String,
15271
15272    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15273}
15274
15275impl ListAutomationsRequest {
15276    pub fn new() -> Self {
15277        std::default::Default::default()
15278    }
15279
15280    /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
15281    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15282        self.parent = v.into();
15283        self
15284    }
15285
15286    /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
15287    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15288        self.page_size = v.into();
15289        self
15290    }
15291
15292    /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
15293    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15294        self.page_token = v.into();
15295        self
15296    }
15297
15298    /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
15299    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15300        self.filter = v.into();
15301        self
15302    }
15303
15304    /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
15305    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15306        self.order_by = v.into();
15307        self
15308    }
15309}
15310
15311impl wkt::message::Message for ListAutomationsRequest {
15312    fn typename() -> &'static str {
15313        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
15314    }
15315}
15316
15317/// The response object from `ListAutomations`.
15318#[derive(Clone, Default, PartialEq)]
15319#[non_exhaustive]
15320pub struct ListAutomationsResponse {
15321    /// The `Automation` objects.
15322    pub automations: std::vec::Vec<crate::model::Automation>,
15323
15324    /// A token, which can be sent as `page_token` to retrieve the next page.
15325    /// If this field is omitted, there are no subsequent pages.
15326    pub next_page_token: std::string::String,
15327
15328    /// Locations that could not be reached.
15329    pub unreachable: std::vec::Vec<std::string::String>,
15330
15331    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15332}
15333
15334impl ListAutomationsResponse {
15335    pub fn new() -> Self {
15336        std::default::Default::default()
15337    }
15338
15339    /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
15340    pub fn set_automations<T, V>(mut self, v: T) -> Self
15341    where
15342        T: std::iter::IntoIterator<Item = V>,
15343        V: std::convert::Into<crate::model::Automation>,
15344    {
15345        use std::iter::Iterator;
15346        self.automations = v.into_iter().map(|i| i.into()).collect();
15347        self
15348    }
15349
15350    /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
15351    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15352        self.next_page_token = v.into();
15353        self
15354    }
15355
15356    /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
15357    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15358    where
15359        T: std::iter::IntoIterator<Item = V>,
15360        V: std::convert::Into<std::string::String>,
15361    {
15362        use std::iter::Iterator;
15363        self.unreachable = v.into_iter().map(|i| i.into()).collect();
15364        self
15365    }
15366}
15367
15368impl wkt::message::Message for ListAutomationsResponse {
15369    fn typename() -> &'static str {
15370        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
15371    }
15372}
15373
15374#[doc(hidden)]
15375impl gax::paginator::internal::PageableResponse for ListAutomationsResponse {
15376    type PageItem = crate::model::Automation;
15377
15378    fn items(self) -> std::vec::Vec<Self::PageItem> {
15379        self.automations
15380    }
15381
15382    fn next_page_token(&self) -> std::string::String {
15383        use std::clone::Clone;
15384        self.next_page_token.clone()
15385    }
15386}
15387
15388/// The request object for `GetAutomation`
15389#[derive(Clone, Default, PartialEq)]
15390#[non_exhaustive]
15391pub struct GetAutomationRequest {
15392    /// Required. Name of the `Automation`. Format must be
15393    /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
15394    pub name: std::string::String,
15395
15396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15397}
15398
15399impl GetAutomationRequest {
15400    pub fn new() -> Self {
15401        std::default::Default::default()
15402    }
15403
15404    /// Sets the value of [name][crate::model::GetAutomationRequest::name].
15405    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15406        self.name = v.into();
15407        self
15408    }
15409}
15410
15411impl wkt::message::Message for GetAutomationRequest {
15412    fn typename() -> &'static str {
15413        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
15414    }
15415}
15416
15417/// An `AutomationRun` resource in the Cloud Deploy API.
15418///
15419/// An `AutomationRun` represents an execution instance of an
15420/// automation rule.
15421#[derive(Clone, Default, PartialEq)]
15422#[non_exhaustive]
15423pub struct AutomationRun {
15424    /// Output only. Name of the `AutomationRun`. Format is
15425    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
15426    pub name: std::string::String,
15427
15428    /// Output only. Time at which the `AutomationRun` was created.
15429    pub create_time: std::option::Option<wkt::Timestamp>,
15430
15431    /// Output only. Time at which the automationRun was updated.
15432    pub update_time: std::option::Option<wkt::Timestamp>,
15433
15434    /// Output only. The weak etag of the `AutomationRun` resource.
15435    /// This checksum is computed by the server based on the value of other
15436    /// fields, and may be sent on update and delete requests to ensure the
15437    /// client has an up-to-date value before proceeding.
15438    pub etag: std::string::String,
15439
15440    /// Output only. Email address of the user-managed IAM service account that
15441    /// performs the operations against Cloud Deploy resources.
15442    pub service_account: std::string::String,
15443
15444    /// Output only. Snapshot of the Automation taken at AutomationRun creation
15445    /// time.
15446    pub automation_snapshot: std::option::Option<crate::model::Automation>,
15447
15448    /// Output only. The ID of the source target that initiates the
15449    /// `AutomationRun`. The value of this field is the last segment of a target
15450    /// name.
15451    pub target_id: std::string::String,
15452
15453    /// Output only. Current state of the `AutomationRun`.
15454    pub state: crate::model::automation_run::State,
15455
15456    /// Output only. Explains the current state of the `AutomationRun`. Present
15457    /// only when an explanation is needed.
15458    pub state_description: std::string::String,
15459
15460    /// Output only. Contains information about what policies prevented the
15461    /// `AutomationRun` from proceeding.
15462    pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
15463
15464    /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
15465    /// after 14 days from its creation date.
15466    pub expire_time: std::option::Option<wkt::Timestamp>,
15467
15468    /// Output only. The ID of the automation rule that initiated the operation.
15469    pub rule_id: std::string::String,
15470
15471    /// Output only. The ID of the automation that initiated the operation.
15472    pub automation_id: std::string::String,
15473
15474    /// Output only. Earliest time the `AutomationRun` will attempt to resume.
15475    /// Wait-time is configured by `wait` in automation rule.
15476    pub wait_until_time: std::option::Option<wkt::Timestamp>,
15477
15478    /// The operation that the `AutomationRun` will perform.
15479    pub operation: std::option::Option<crate::model::automation_run::Operation>,
15480
15481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15482}
15483
15484impl AutomationRun {
15485    pub fn new() -> Self {
15486        std::default::Default::default()
15487    }
15488
15489    /// Sets the value of [name][crate::model::AutomationRun::name].
15490    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15491        self.name = v.into();
15492        self
15493    }
15494
15495    /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
15496    pub fn set_create_time<T>(mut self, v: T) -> Self
15497    where
15498        T: std::convert::Into<wkt::Timestamp>,
15499    {
15500        self.create_time = std::option::Option::Some(v.into());
15501        self
15502    }
15503
15504    /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
15505    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15506    where
15507        T: std::convert::Into<wkt::Timestamp>,
15508    {
15509        self.create_time = v.map(|x| x.into());
15510        self
15511    }
15512
15513    /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
15514    pub fn set_update_time<T>(mut self, v: T) -> Self
15515    where
15516        T: std::convert::Into<wkt::Timestamp>,
15517    {
15518        self.update_time = std::option::Option::Some(v.into());
15519        self
15520    }
15521
15522    /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
15523    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15524    where
15525        T: std::convert::Into<wkt::Timestamp>,
15526    {
15527        self.update_time = v.map(|x| x.into());
15528        self
15529    }
15530
15531    /// Sets the value of [etag][crate::model::AutomationRun::etag].
15532    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15533        self.etag = v.into();
15534        self
15535    }
15536
15537    /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
15538    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15539        self.service_account = v.into();
15540        self
15541    }
15542
15543    /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
15544    pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
15545    where
15546        T: std::convert::Into<crate::model::Automation>,
15547    {
15548        self.automation_snapshot = std::option::Option::Some(v.into());
15549        self
15550    }
15551
15552    /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
15553    pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
15554    where
15555        T: std::convert::Into<crate::model::Automation>,
15556    {
15557        self.automation_snapshot = v.map(|x| x.into());
15558        self
15559    }
15560
15561    /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
15562    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15563        self.target_id = v.into();
15564        self
15565    }
15566
15567    /// Sets the value of [state][crate::model::AutomationRun::state].
15568    pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
15569        mut self,
15570        v: T,
15571    ) -> Self {
15572        self.state = v.into();
15573        self
15574    }
15575
15576    /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
15577    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
15578        mut self,
15579        v: T,
15580    ) -> Self {
15581        self.state_description = v.into();
15582        self
15583    }
15584
15585    /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
15586    pub fn set_policy_violation<T>(mut self, v: T) -> Self
15587    where
15588        T: std::convert::Into<crate::model::PolicyViolation>,
15589    {
15590        self.policy_violation = std::option::Option::Some(v.into());
15591        self
15592    }
15593
15594    /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
15595    pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
15596    where
15597        T: std::convert::Into<crate::model::PolicyViolation>,
15598    {
15599        self.policy_violation = v.map(|x| x.into());
15600        self
15601    }
15602
15603    /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
15604    pub fn set_expire_time<T>(mut self, v: T) -> Self
15605    where
15606        T: std::convert::Into<wkt::Timestamp>,
15607    {
15608        self.expire_time = std::option::Option::Some(v.into());
15609        self
15610    }
15611
15612    /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
15613    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
15614    where
15615        T: std::convert::Into<wkt::Timestamp>,
15616    {
15617        self.expire_time = v.map(|x| x.into());
15618        self
15619    }
15620
15621    /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
15622    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15623        self.rule_id = v.into();
15624        self
15625    }
15626
15627    /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
15628    pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15629        self.automation_id = v.into();
15630        self
15631    }
15632
15633    /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
15634    pub fn set_wait_until_time<T>(mut self, v: T) -> Self
15635    where
15636        T: std::convert::Into<wkt::Timestamp>,
15637    {
15638        self.wait_until_time = std::option::Option::Some(v.into());
15639        self
15640    }
15641
15642    /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
15643    pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
15644    where
15645        T: std::convert::Into<wkt::Timestamp>,
15646    {
15647        self.wait_until_time = v.map(|x| x.into());
15648        self
15649    }
15650
15651    /// Sets the value of [operation][crate::model::AutomationRun::operation].
15652    ///
15653    /// Note that all the setters affecting `operation` are mutually
15654    /// exclusive.
15655    pub fn set_operation<
15656        T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
15657    >(
15658        mut self,
15659        v: T,
15660    ) -> Self {
15661        self.operation = v.into();
15662        self
15663    }
15664
15665    /// The value of [operation][crate::model::AutomationRun::operation]
15666    /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
15667    /// holds a different branch.
15668    pub fn promote_release_operation(
15669        &self,
15670    ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
15671        #[allow(unreachable_patterns)]
15672        self.operation.as_ref().and_then(|v| match v {
15673            crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
15674                std::option::Option::Some(v)
15675            }
15676            _ => std::option::Option::None,
15677        })
15678    }
15679
15680    /// Sets the value of [operation][crate::model::AutomationRun::operation]
15681    /// to hold a `PromoteReleaseOperation`.
15682    ///
15683    /// Note that all the setters affecting `operation` are
15684    /// mutually exclusive.
15685    pub fn set_promote_release_operation<
15686        T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
15687    >(
15688        mut self,
15689        v: T,
15690    ) -> Self {
15691        self.operation = std::option::Option::Some(
15692            crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
15693        );
15694        self
15695    }
15696
15697    /// The value of [operation][crate::model::AutomationRun::operation]
15698    /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
15699    /// holds a different branch.
15700    pub fn advance_rollout_operation(
15701        &self,
15702    ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
15703        #[allow(unreachable_patterns)]
15704        self.operation.as_ref().and_then(|v| match v {
15705            crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
15706                std::option::Option::Some(v)
15707            }
15708            _ => std::option::Option::None,
15709        })
15710    }
15711
15712    /// Sets the value of [operation][crate::model::AutomationRun::operation]
15713    /// to hold a `AdvanceRolloutOperation`.
15714    ///
15715    /// Note that all the setters affecting `operation` are
15716    /// mutually exclusive.
15717    pub fn set_advance_rollout_operation<
15718        T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
15719    >(
15720        mut self,
15721        v: T,
15722    ) -> Self {
15723        self.operation = std::option::Option::Some(
15724            crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
15725        );
15726        self
15727    }
15728
15729    /// The value of [operation][crate::model::AutomationRun::operation]
15730    /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
15731    /// holds a different branch.
15732    pub fn repair_rollout_operation(
15733        &self,
15734    ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
15735        #[allow(unreachable_patterns)]
15736        self.operation.as_ref().and_then(|v| match v {
15737            crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
15738                std::option::Option::Some(v)
15739            }
15740            _ => std::option::Option::None,
15741        })
15742    }
15743
15744    /// Sets the value of [operation][crate::model::AutomationRun::operation]
15745    /// to hold a `RepairRolloutOperation`.
15746    ///
15747    /// Note that all the setters affecting `operation` are
15748    /// mutually exclusive.
15749    pub fn set_repair_rollout_operation<
15750        T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
15751    >(
15752        mut self,
15753        v: T,
15754    ) -> Self {
15755        self.operation = std::option::Option::Some(
15756            crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
15757        );
15758        self
15759    }
15760
15761    /// The value of [operation][crate::model::AutomationRun::operation]
15762    /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
15763    /// holds a different branch.
15764    pub fn timed_promote_release_operation(
15765        &self,
15766    ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
15767        #[allow(unreachable_patterns)]
15768        self.operation.as_ref().and_then(|v| match v {
15769            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
15770                std::option::Option::Some(v)
15771            }
15772            _ => std::option::Option::None,
15773        })
15774    }
15775
15776    /// Sets the value of [operation][crate::model::AutomationRun::operation]
15777    /// to hold a `TimedPromoteReleaseOperation`.
15778    ///
15779    /// Note that all the setters affecting `operation` are
15780    /// mutually exclusive.
15781    pub fn set_timed_promote_release_operation<
15782        T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
15783    >(
15784        mut self,
15785        v: T,
15786    ) -> Self {
15787        self.operation = std::option::Option::Some(
15788            crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
15789        );
15790        self
15791    }
15792}
15793
15794impl wkt::message::Message for AutomationRun {
15795    fn typename() -> &'static str {
15796        "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
15797    }
15798}
15799
15800/// Defines additional types related to [AutomationRun].
15801pub mod automation_run {
15802    #[allow(unused_imports)]
15803    use super::*;
15804
15805    /// Valid state of an `AutomationRun`.
15806    ///
15807    /// # Working with unknown values
15808    ///
15809    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15810    /// additional enum variants at any time. Adding new variants is not considered
15811    /// a breaking change. Applications should write their code in anticipation of:
15812    ///
15813    /// - New values appearing in future releases of the client library, **and**
15814    /// - New values received dynamically, without application changes.
15815    ///
15816    /// Please consult the [Working with enums] section in the user guide for some
15817    /// guidelines.
15818    ///
15819    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15820    #[derive(Clone, Debug, PartialEq)]
15821    #[non_exhaustive]
15822    pub enum State {
15823        /// The `AutomationRun` has an unspecified state.
15824        Unspecified,
15825        /// The `AutomationRun` has succeeded.
15826        Succeeded,
15827        /// The `AutomationRun` was cancelled.
15828        Cancelled,
15829        /// The `AutomationRun` has failed.
15830        Failed,
15831        /// The `AutomationRun` is in progress.
15832        InProgress,
15833        /// The `AutomationRun` is pending.
15834        Pending,
15835        /// The `AutomationRun` was aborted.
15836        Aborted,
15837        /// If set, the enum was initialized with an unknown value.
15838        ///
15839        /// Applications can examine the value using [State::value] or
15840        /// [State::name].
15841        UnknownValue(state::UnknownValue),
15842    }
15843
15844    #[doc(hidden)]
15845    pub mod state {
15846        #[allow(unused_imports)]
15847        use super::*;
15848        #[derive(Clone, Debug, PartialEq)]
15849        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15850    }
15851
15852    impl State {
15853        /// Gets the enum value.
15854        ///
15855        /// Returns `None` if the enum contains an unknown value deserialized from
15856        /// the string representation of enums.
15857        pub fn value(&self) -> std::option::Option<i32> {
15858            match self {
15859                Self::Unspecified => std::option::Option::Some(0),
15860                Self::Succeeded => std::option::Option::Some(1),
15861                Self::Cancelled => std::option::Option::Some(2),
15862                Self::Failed => std::option::Option::Some(3),
15863                Self::InProgress => std::option::Option::Some(4),
15864                Self::Pending => std::option::Option::Some(5),
15865                Self::Aborted => std::option::Option::Some(6),
15866                Self::UnknownValue(u) => u.0.value(),
15867            }
15868        }
15869
15870        /// Gets the enum value as a string.
15871        ///
15872        /// Returns `None` if the enum contains an unknown value deserialized from
15873        /// the integer representation of enums.
15874        pub fn name(&self) -> std::option::Option<&str> {
15875            match self {
15876                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15877                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
15878                Self::Cancelled => std::option::Option::Some("CANCELLED"),
15879                Self::Failed => std::option::Option::Some("FAILED"),
15880                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
15881                Self::Pending => std::option::Option::Some("PENDING"),
15882                Self::Aborted => std::option::Option::Some("ABORTED"),
15883                Self::UnknownValue(u) => u.0.name(),
15884            }
15885        }
15886    }
15887
15888    impl std::default::Default for State {
15889        fn default() -> Self {
15890            use std::convert::From;
15891            Self::from(0)
15892        }
15893    }
15894
15895    impl std::fmt::Display for State {
15896        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15897            wkt::internal::display_enum(f, self.name(), self.value())
15898        }
15899    }
15900
15901    impl std::convert::From<i32> for State {
15902        fn from(value: i32) -> Self {
15903            match value {
15904                0 => Self::Unspecified,
15905                1 => Self::Succeeded,
15906                2 => Self::Cancelled,
15907                3 => Self::Failed,
15908                4 => Self::InProgress,
15909                5 => Self::Pending,
15910                6 => Self::Aborted,
15911                _ => Self::UnknownValue(state::UnknownValue(
15912                    wkt::internal::UnknownEnumValue::Integer(value),
15913                )),
15914            }
15915        }
15916    }
15917
15918    impl std::convert::From<&str> for State {
15919        fn from(value: &str) -> Self {
15920            use std::string::ToString;
15921            match value {
15922                "STATE_UNSPECIFIED" => Self::Unspecified,
15923                "SUCCEEDED" => Self::Succeeded,
15924                "CANCELLED" => Self::Cancelled,
15925                "FAILED" => Self::Failed,
15926                "IN_PROGRESS" => Self::InProgress,
15927                "PENDING" => Self::Pending,
15928                "ABORTED" => Self::Aborted,
15929                _ => Self::UnknownValue(state::UnknownValue(
15930                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15931                )),
15932            }
15933        }
15934    }
15935
15936    impl serde::ser::Serialize for State {
15937        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15938        where
15939            S: serde::Serializer,
15940        {
15941            match self {
15942                Self::Unspecified => serializer.serialize_i32(0),
15943                Self::Succeeded => serializer.serialize_i32(1),
15944                Self::Cancelled => serializer.serialize_i32(2),
15945                Self::Failed => serializer.serialize_i32(3),
15946                Self::InProgress => serializer.serialize_i32(4),
15947                Self::Pending => serializer.serialize_i32(5),
15948                Self::Aborted => serializer.serialize_i32(6),
15949                Self::UnknownValue(u) => u.0.serialize(serializer),
15950            }
15951        }
15952    }
15953
15954    impl<'de> serde::de::Deserialize<'de> for State {
15955        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15956        where
15957            D: serde::Deserializer<'de>,
15958        {
15959            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15960                ".google.cloud.deploy.v1.AutomationRun.State",
15961            ))
15962        }
15963    }
15964
15965    /// The operation that the `AutomationRun` will perform.
15966    #[derive(Clone, Debug, PartialEq)]
15967    #[non_exhaustive]
15968    pub enum Operation {
15969        /// Output only. Promotes a release to a specified 'Target'.
15970        PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
15971        /// Output only. Advances a rollout to the next phase.
15972        AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
15973        /// Output only. Repairs a failed 'Rollout'.
15974        RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
15975        /// Output only. Promotes a release to a specified 'Target' as defined in a
15976        /// Timed Promote Release rule.
15977        TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
15978    }
15979}
15980
15981/// Contains the information of an automated promote-release operation.
15982#[derive(Clone, Default, PartialEq)]
15983#[non_exhaustive]
15984pub struct PromoteReleaseOperation {
15985    /// Output only. The ID of the target that represents the promotion stage to
15986    /// which the release will be promoted. The value of this field is the last
15987    /// segment of a target name.
15988    pub target_id: std::string::String,
15989
15990    /// Output only. How long the operation will be paused.
15991    pub wait: std::option::Option<wkt::Duration>,
15992
15993    /// Output only. The name of the rollout that initiates the `AutomationRun`.
15994    pub rollout: std::string::String,
15995
15996    /// Output only. The starting phase of the rollout created by this operation.
15997    pub phase: std::string::String,
15998
15999    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16000}
16001
16002impl PromoteReleaseOperation {
16003    pub fn new() -> Self {
16004        std::default::Default::default()
16005    }
16006
16007    /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
16008    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16009        self.target_id = v.into();
16010        self
16011    }
16012
16013    /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
16014    pub fn set_wait<T>(mut self, v: T) -> Self
16015    where
16016        T: std::convert::Into<wkt::Duration>,
16017    {
16018        self.wait = std::option::Option::Some(v.into());
16019        self
16020    }
16021
16022    /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
16023    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
16024    where
16025        T: std::convert::Into<wkt::Duration>,
16026    {
16027        self.wait = v.map(|x| x.into());
16028        self
16029    }
16030
16031    /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
16032    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16033        self.rollout = v.into();
16034        self
16035    }
16036
16037    /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
16038    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16039        self.phase = v.into();
16040        self
16041    }
16042}
16043
16044impl wkt::message::Message for PromoteReleaseOperation {
16045    fn typename() -> &'static str {
16046        "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
16047    }
16048}
16049
16050/// Contains the information of an automated advance-rollout operation.
16051#[derive(Clone, Default, PartialEq)]
16052#[non_exhaustive]
16053pub struct AdvanceRolloutOperation {
16054    /// Output only. The phase of a deployment that initiated the operation.
16055    pub source_phase: std::string::String,
16056
16057    /// Output only. How long the operation will be paused.
16058    pub wait: std::option::Option<wkt::Duration>,
16059
16060    /// Output only. The name of the rollout that initiates the `AutomationRun`.
16061    pub rollout: std::string::String,
16062
16063    /// Output only. The phase the rollout will be advanced to.
16064    pub destination_phase: std::string::String,
16065
16066    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16067}
16068
16069impl AdvanceRolloutOperation {
16070    pub fn new() -> Self {
16071        std::default::Default::default()
16072    }
16073
16074    /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
16075    pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16076        self.source_phase = v.into();
16077        self
16078    }
16079
16080    /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
16081    pub fn set_wait<T>(mut self, v: T) -> Self
16082    where
16083        T: std::convert::Into<wkt::Duration>,
16084    {
16085        self.wait = std::option::Option::Some(v.into());
16086        self
16087    }
16088
16089    /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
16090    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
16091    where
16092        T: std::convert::Into<wkt::Duration>,
16093    {
16094        self.wait = v.map(|x| x.into());
16095        self
16096    }
16097
16098    /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
16099    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16100        self.rollout = v.into();
16101        self
16102    }
16103
16104    /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
16105    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
16106        mut self,
16107        v: T,
16108    ) -> Self {
16109        self.destination_phase = v.into();
16110        self
16111    }
16112}
16113
16114impl wkt::message::Message for AdvanceRolloutOperation {
16115    fn typename() -> &'static str {
16116        "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
16117    }
16118}
16119
16120/// Contains the information for an automated `repair rollout` operation.
16121#[derive(Clone, Default, PartialEq)]
16122#[non_exhaustive]
16123pub struct RepairRolloutOperation {
16124    /// Output only. The name of the rollout that initiates the `AutomationRun`.
16125    pub rollout: std::string::String,
16126
16127    /// Output only. The index of the current repair action in the repair sequence.
16128    pub current_repair_phase_index: i64,
16129
16130    /// Output only. Records of the repair attempts. Each repair phase may have
16131    /// multiple retry attempts or single rollback attempt.
16132    pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
16133
16134    /// Output only. The phase ID of the phase that includes the job being
16135    /// repaired.
16136    pub phase_id: std::string::String,
16137
16138    /// Output only. The job ID for the Job to repair.
16139    pub job_id: std::string::String,
16140
16141    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16142}
16143
16144impl RepairRolloutOperation {
16145    pub fn new() -> Self {
16146        std::default::Default::default()
16147    }
16148
16149    /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
16150    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16151        self.rollout = v.into();
16152        self
16153    }
16154
16155    /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
16156    pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16157        self.current_repair_phase_index = v.into();
16158        self
16159    }
16160
16161    /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
16162    pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
16163    where
16164        T: std::iter::IntoIterator<Item = V>,
16165        V: std::convert::Into<crate::model::RepairPhase>,
16166    {
16167        use std::iter::Iterator;
16168        self.repair_phases = v.into_iter().map(|i| i.into()).collect();
16169        self
16170    }
16171
16172    /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
16173    pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16174        self.phase_id = v.into();
16175        self
16176    }
16177
16178    /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
16179    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16180        self.job_id = v.into();
16181        self
16182    }
16183}
16184
16185impl wkt::message::Message for RepairRolloutOperation {
16186    fn typename() -> &'static str {
16187        "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
16188    }
16189}
16190
16191/// Contains the information of an automated timed promote-release operation.
16192#[derive(Clone, Default, PartialEq)]
16193#[non_exhaustive]
16194pub struct TimedPromoteReleaseOperation {
16195    /// Output only. The ID of the target that represents the promotion stage to
16196    /// which the release will be promoted. The value of this field is the last
16197    /// segment of a target name.
16198    pub target_id: std::string::String,
16199
16200    /// Output only. The name of the release to be promoted.
16201    pub release: std::string::String,
16202
16203    /// Output only. The starting phase of the rollout created by this operation.
16204    pub phase: std::string::String,
16205
16206    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16207}
16208
16209impl TimedPromoteReleaseOperation {
16210    pub fn new() -> Self {
16211        std::default::Default::default()
16212    }
16213
16214    /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
16215    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16216        self.target_id = v.into();
16217        self
16218    }
16219
16220    /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
16221    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16222        self.release = v.into();
16223        self
16224    }
16225
16226    /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
16227    pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16228        self.phase = v.into();
16229        self
16230    }
16231}
16232
16233impl wkt::message::Message for TimedPromoteReleaseOperation {
16234    fn typename() -> &'static str {
16235        "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
16236    }
16237}
16238
16239/// RepairPhase tracks the repair attempts that have been made for
16240/// each `RepairPhaseConfig` specified in the `Automation` resource.
16241#[derive(Clone, Default, PartialEq)]
16242#[non_exhaustive]
16243pub struct RepairPhase {
16244    /// The `RepairPhase` type and the information for that type.
16245    pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
16246
16247    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16248}
16249
16250impl RepairPhase {
16251    pub fn new() -> Self {
16252        std::default::Default::default()
16253    }
16254
16255    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
16256    ///
16257    /// Note that all the setters affecting `repair_phase` are mutually
16258    /// exclusive.
16259    pub fn set_repair_phase<
16260        T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
16261    >(
16262        mut self,
16263        v: T,
16264    ) -> Self {
16265        self.repair_phase = v.into();
16266        self
16267    }
16268
16269    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
16270    /// if it holds a `Retry`, `None` if the field is not set or
16271    /// holds a different branch.
16272    pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
16273        #[allow(unreachable_patterns)]
16274        self.repair_phase.as_ref().and_then(|v| match v {
16275            crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
16276            _ => std::option::Option::None,
16277        })
16278    }
16279
16280    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
16281    /// to hold a `Retry`.
16282    ///
16283    /// Note that all the setters affecting `repair_phase` are
16284    /// mutually exclusive.
16285    pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
16286        mut self,
16287        v: T,
16288    ) -> Self {
16289        self.repair_phase =
16290            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
16291        self
16292    }
16293
16294    /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
16295    /// if it holds a `Rollback`, `None` if the field is not set or
16296    /// holds a different branch.
16297    pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
16298        #[allow(unreachable_patterns)]
16299        self.repair_phase.as_ref().and_then(|v| match v {
16300            crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
16301            _ => std::option::Option::None,
16302        })
16303    }
16304
16305    /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
16306    /// to hold a `Rollback`.
16307    ///
16308    /// Note that all the setters affecting `repair_phase` are
16309    /// mutually exclusive.
16310    pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
16311        mut self,
16312        v: T,
16313    ) -> Self {
16314        self.repair_phase =
16315            std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
16316        self
16317    }
16318}
16319
16320impl wkt::message::Message for RepairPhase {
16321    fn typename() -> &'static str {
16322        "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
16323    }
16324}
16325
16326/// Defines additional types related to [RepairPhase].
16327pub mod repair_phase {
16328    #[allow(unused_imports)]
16329    use super::*;
16330
16331    /// The `RepairPhase` type and the information for that type.
16332    #[derive(Clone, Debug, PartialEq)]
16333    #[non_exhaustive]
16334    pub enum RepairPhase {
16335        /// Output only. Records of the retry attempts for retry repair mode.
16336        Retry(std::boxed::Box<crate::model::RetryPhase>),
16337        /// Output only. Rollback attempt for rollback repair mode .
16338        Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
16339    }
16340}
16341
16342/// RetryPhase contains the retry attempts and the metadata for initiating a
16343/// new attempt.
16344#[derive(Clone, Default, PartialEq)]
16345#[non_exhaustive]
16346pub struct RetryPhase {
16347    /// Output only. The number of attempts that have been made.
16348    pub total_attempts: i64,
16349
16350    /// Output only. The pattern of how the wait time of the retry attempt is
16351    /// calculated.
16352    pub backoff_mode: crate::model::BackoffMode,
16353
16354    /// Output only. Detail of a retry action.
16355    pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
16356
16357    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16358}
16359
16360impl RetryPhase {
16361    pub fn new() -> Self {
16362        std::default::Default::default()
16363    }
16364
16365    /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
16366    pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16367        self.total_attempts = v.into();
16368        self
16369    }
16370
16371    /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
16372    pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
16373        mut self,
16374        v: T,
16375    ) -> Self {
16376        self.backoff_mode = v.into();
16377        self
16378    }
16379
16380    /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
16381    pub fn set_attempts<T, V>(mut self, v: T) -> Self
16382    where
16383        T: std::iter::IntoIterator<Item = V>,
16384        V: std::convert::Into<crate::model::RetryAttempt>,
16385    {
16386        use std::iter::Iterator;
16387        self.attempts = v.into_iter().map(|i| i.into()).collect();
16388        self
16389    }
16390}
16391
16392impl wkt::message::Message for RetryPhase {
16393    fn typename() -> &'static str {
16394        "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
16395    }
16396}
16397
16398/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
16399#[derive(Clone, Default, PartialEq)]
16400#[non_exhaustive]
16401pub struct RetryAttempt {
16402    /// Output only. The index of this retry attempt.
16403    pub attempt: i64,
16404
16405    /// Output only. How long the operation will be paused.
16406    pub wait: std::option::Option<wkt::Duration>,
16407
16408    /// Output only. Valid state of this retry action.
16409    pub state: crate::model::RepairState,
16410
16411    /// Output only. Description of the state of the Retry.
16412    pub state_desc: std::string::String,
16413
16414    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16415}
16416
16417impl RetryAttempt {
16418    pub fn new() -> Self {
16419        std::default::Default::default()
16420    }
16421
16422    /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
16423    pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16424        self.attempt = v.into();
16425        self
16426    }
16427
16428    /// Sets the value of [wait][crate::model::RetryAttempt::wait].
16429    pub fn set_wait<T>(mut self, v: T) -> Self
16430    where
16431        T: std::convert::Into<wkt::Duration>,
16432    {
16433        self.wait = std::option::Option::Some(v.into());
16434        self
16435    }
16436
16437    /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
16438    pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
16439    where
16440        T: std::convert::Into<wkt::Duration>,
16441    {
16442        self.wait = v.map(|x| x.into());
16443        self
16444    }
16445
16446    /// Sets the value of [state][crate::model::RetryAttempt::state].
16447    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
16448        self.state = v.into();
16449        self
16450    }
16451
16452    /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
16453    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16454        self.state_desc = v.into();
16455        self
16456    }
16457}
16458
16459impl wkt::message::Message for RetryAttempt {
16460    fn typename() -> &'static str {
16461        "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
16462    }
16463}
16464
16465/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
16466#[derive(Clone, Default, PartialEq)]
16467#[non_exhaustive]
16468pub struct RollbackAttempt {
16469    /// Output only. The phase to which the rollout will be rolled back to.
16470    pub destination_phase: std::string::String,
16471
16472    /// Output only. ID of the rollback `Rollout` to create.
16473    pub rollout_id: std::string::String,
16474
16475    /// Output only. Valid state of this rollback action.
16476    pub state: crate::model::RepairState,
16477
16478    /// Output only. Description of the state of the Rollback.
16479    pub state_desc: std::string::String,
16480
16481    /// Output only. If active rollout exists on the target, abort this rollback.
16482    pub disable_rollback_if_rollout_pending: bool,
16483
16484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16485}
16486
16487impl RollbackAttempt {
16488    pub fn new() -> Self {
16489        std::default::Default::default()
16490    }
16491
16492    /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
16493    pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
16494        mut self,
16495        v: T,
16496    ) -> Self {
16497        self.destination_phase = v.into();
16498        self
16499    }
16500
16501    /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
16502    pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16503        self.rollout_id = v.into();
16504        self
16505    }
16506
16507    /// Sets the value of [state][crate::model::RollbackAttempt::state].
16508    pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
16509        self.state = v.into();
16510        self
16511    }
16512
16513    /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
16514    pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16515        self.state_desc = v.into();
16516        self
16517    }
16518
16519    /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
16520    pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
16521        mut self,
16522        v: T,
16523    ) -> Self {
16524        self.disable_rollback_if_rollout_pending = v.into();
16525        self
16526    }
16527}
16528
16529impl wkt::message::Message for RollbackAttempt {
16530    fn typename() -> &'static str {
16531        "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
16532    }
16533}
16534
16535/// The request object for `ListAutomationRuns`.
16536#[derive(Clone, Default, PartialEq)]
16537#[non_exhaustive]
16538pub struct ListAutomationRunsRequest {
16539    /// Required. The parent `Delivery Pipeline`, which owns this collection of
16540    /// automationRuns. Format must be
16541    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
16542    pub parent: std::string::String,
16543
16544    /// The maximum number of automationRuns to return. The service may return
16545    /// fewer than this value. If unspecified, at most 50 automationRuns will
16546    /// be returned. The maximum value is 1000; values above 1000 will be set
16547    /// to 1000.
16548    pub page_size: i32,
16549
16550    /// A page token, received from a previous `ListAutomationRuns` call.
16551    /// Provide this to retrieve the subsequent page.
16552    ///
16553    /// When paginating, all other provided parameters match
16554    /// the call that provided the page token.
16555    pub page_token: std::string::String,
16556
16557    /// Filter automationRuns to be returned. All fields can be used in the
16558    /// filter.
16559    pub filter: std::string::String,
16560
16561    /// Field to sort by.
16562    pub order_by: std::string::String,
16563
16564    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16565}
16566
16567impl ListAutomationRunsRequest {
16568    pub fn new() -> Self {
16569        std::default::Default::default()
16570    }
16571
16572    /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
16573    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16574        self.parent = v.into();
16575        self
16576    }
16577
16578    /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
16579    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16580        self.page_size = v.into();
16581        self
16582    }
16583
16584    /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
16585    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16586        self.page_token = v.into();
16587        self
16588    }
16589
16590    /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
16591    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16592        self.filter = v.into();
16593        self
16594    }
16595
16596    /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
16597    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16598        self.order_by = v.into();
16599        self
16600    }
16601}
16602
16603impl wkt::message::Message for ListAutomationRunsRequest {
16604    fn typename() -> &'static str {
16605        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
16606    }
16607}
16608
16609/// The response object from `ListAutomationRuns`.
16610#[derive(Clone, Default, PartialEq)]
16611#[non_exhaustive]
16612pub struct ListAutomationRunsResponse {
16613    /// The `AutomationRuns` objects.
16614    pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
16615
16616    /// A token, which can be sent as `page_token` to retrieve the next page.
16617    /// If this field is omitted, there are no subsequent pages.
16618    pub next_page_token: std::string::String,
16619
16620    /// Locations that could not be reached.
16621    pub unreachable: std::vec::Vec<std::string::String>,
16622
16623    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16624}
16625
16626impl ListAutomationRunsResponse {
16627    pub fn new() -> Self {
16628        std::default::Default::default()
16629    }
16630
16631    /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
16632    pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
16633    where
16634        T: std::iter::IntoIterator<Item = V>,
16635        V: std::convert::Into<crate::model::AutomationRun>,
16636    {
16637        use std::iter::Iterator;
16638        self.automation_runs = v.into_iter().map(|i| i.into()).collect();
16639        self
16640    }
16641
16642    /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
16643    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16644        self.next_page_token = v.into();
16645        self
16646    }
16647
16648    /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
16649    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16650    where
16651        T: std::iter::IntoIterator<Item = V>,
16652        V: std::convert::Into<std::string::String>,
16653    {
16654        use std::iter::Iterator;
16655        self.unreachable = v.into_iter().map(|i| i.into()).collect();
16656        self
16657    }
16658}
16659
16660impl wkt::message::Message for ListAutomationRunsResponse {
16661    fn typename() -> &'static str {
16662        "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
16663    }
16664}
16665
16666#[doc(hidden)]
16667impl gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
16668    type PageItem = crate::model::AutomationRun;
16669
16670    fn items(self) -> std::vec::Vec<Self::PageItem> {
16671        self.automation_runs
16672    }
16673
16674    fn next_page_token(&self) -> std::string::String {
16675        use std::clone::Clone;
16676        self.next_page_token.clone()
16677    }
16678}
16679
16680/// The request object for `GetAutomationRun`
16681#[derive(Clone, Default, PartialEq)]
16682#[non_exhaustive]
16683pub struct GetAutomationRunRequest {
16684    /// Required. Name of the `AutomationRun`. Format must be
16685    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
16686    pub name: std::string::String,
16687
16688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16689}
16690
16691impl GetAutomationRunRequest {
16692    pub fn new() -> Self {
16693        std::default::Default::default()
16694    }
16695
16696    /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
16697    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16698        self.name = v.into();
16699        self
16700    }
16701}
16702
16703impl wkt::message::Message for GetAutomationRunRequest {
16704    fn typename() -> &'static str {
16705        "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
16706    }
16707}
16708
16709/// The request object used by `CancelAutomationRun`.
16710#[derive(Clone, Default, PartialEq)]
16711#[non_exhaustive]
16712pub struct CancelAutomationRunRequest {
16713    /// Required. Name of the `AutomationRun`. Format is
16714    /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
16715    pub name: std::string::String,
16716
16717    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16718}
16719
16720impl CancelAutomationRunRequest {
16721    pub fn new() -> Self {
16722        std::default::Default::default()
16723    }
16724
16725    /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
16726    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16727        self.name = v.into();
16728        self
16729    }
16730}
16731
16732impl wkt::message::Message for CancelAutomationRunRequest {
16733    fn typename() -> &'static str {
16734        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
16735    }
16736}
16737
16738/// The response object from `CancelAutomationRun`.
16739#[derive(Clone, Default, PartialEq)]
16740#[non_exhaustive]
16741pub struct CancelAutomationRunResponse {
16742    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16743}
16744
16745impl CancelAutomationRunResponse {
16746    pub fn new() -> Self {
16747        std::default::Default::default()
16748    }
16749}
16750
16751impl wkt::message::Message for CancelAutomationRunResponse {
16752    fn typename() -> &'static str {
16753        "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
16754    }
16755}
16756
16757/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
16758/// Platform Log event that describes the failure to send a custom target type
16759/// status change Pub/Sub notification.
16760#[derive(Clone, Default, PartialEq)]
16761#[non_exhaustive]
16762pub struct CustomTargetTypeNotificationEvent {
16763    /// Debug message for when a notification fails to send.
16764    pub message: std::string::String,
16765
16766    /// Unique identifier of the `CustomTargetType`.
16767    pub custom_target_type_uid: std::string::String,
16768
16769    /// The name of the `CustomTargetType`.
16770    pub custom_target_type: std::string::String,
16771
16772    /// Type of this notification, e.g. for a Pub/Sub failure.
16773    pub r#type: crate::model::Type,
16774
16775    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16776}
16777
16778impl CustomTargetTypeNotificationEvent {
16779    pub fn new() -> Self {
16780        std::default::Default::default()
16781    }
16782
16783    /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
16784    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16785        self.message = v.into();
16786        self
16787    }
16788
16789    /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
16790    pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
16791        mut self,
16792        v: T,
16793    ) -> Self {
16794        self.custom_target_type_uid = v.into();
16795        self
16796    }
16797
16798    /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
16799    pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
16800        mut self,
16801        v: T,
16802    ) -> Self {
16803        self.custom_target_type = v.into();
16804        self
16805    }
16806
16807    /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
16808    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
16809        self.r#type = v.into();
16810        self
16811    }
16812}
16813
16814impl wkt::message::Message for CustomTargetTypeNotificationEvent {
16815    fn typename() -> &'static str {
16816        "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
16817    }
16818}
16819
16820/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
16821/// Platform Log event that describes the failure to send delivery pipeline
16822/// status change Pub/Sub notification.
16823#[derive(Clone, Default, PartialEq)]
16824#[non_exhaustive]
16825pub struct DeliveryPipelineNotificationEvent {
16826    /// Debug message for when a notification fails to send.
16827    pub message: std::string::String,
16828
16829    /// Unique identifier of the `DeliveryPipeline`.
16830    pub pipeline_uid: std::string::String,
16831
16832    /// The name of the `Delivery Pipeline`.
16833    pub delivery_pipeline: std::string::String,
16834
16835    /// Type of this notification, e.g. for a Pub/Sub failure.
16836    pub r#type: crate::model::Type,
16837
16838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16839}
16840
16841impl DeliveryPipelineNotificationEvent {
16842    pub fn new() -> Self {
16843        std::default::Default::default()
16844    }
16845
16846    /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
16847    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16848        self.message = v.into();
16849        self
16850    }
16851
16852    /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
16853    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16854        self.pipeline_uid = v.into();
16855        self
16856    }
16857
16858    /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
16859    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
16860        mut self,
16861        v: T,
16862    ) -> Self {
16863        self.delivery_pipeline = v.into();
16864        self
16865    }
16866
16867    /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
16868    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
16869        self.r#type = v.into();
16870        self
16871    }
16872}
16873
16874impl wkt::message::Message for DeliveryPipelineNotificationEvent {
16875    fn typename() -> &'static str {
16876        "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
16877    }
16878}
16879
16880/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
16881/// Platform Log event that describes the deploy policy evaluation event.
16882#[derive(Clone, Default, PartialEq)]
16883#[non_exhaustive]
16884pub struct DeployPolicyEvaluationEvent {
16885    /// Debug message for when a deploy policy event occurs.
16886    pub message: std::string::String,
16887
16888    /// Rule type (e.g. Restrict Rollouts).
16889    pub rule_type: std::string::String,
16890
16891    /// Rule id.
16892    pub rule: std::string::String,
16893
16894    /// Unique identifier of the `Delivery Pipeline`.
16895    pub pipeline_uid: std::string::String,
16896
16897    /// The name of the `Delivery Pipeline`.
16898    pub delivery_pipeline: std::string::String,
16899
16900    /// Unique identifier of the `Target`. This is an optional field, as a `Target`
16901    /// may not always be applicable to a policy.
16902    pub target_uid: std::string::String,
16903
16904    /// The name of the `Target`. This is an optional field, as a `Target` may not
16905    /// always be applicable to a policy.
16906    pub target: std::string::String,
16907
16908    /// What invoked the action (e.g. a user or automation).
16909    pub invoker: crate::model::deploy_policy::Invoker,
16910
16911    /// The name of the `DeployPolicy`.
16912    pub deploy_policy: std::string::String,
16913
16914    /// Unique identifier of the `DeployPolicy`.
16915    pub deploy_policy_uid: std::string::String,
16916
16917    /// Whether the request is allowed. Allowed is set as true if:
16918    /// (1) the request complies with the policy; or
16919    /// (2) the request doesn't comply with the policy but the policy was
16920    /// overridden; or
16921    /// (3) the request doesn't comply with the policy but the policy was suspended
16922    pub allowed: bool,
16923
16924    /// The policy verdict of the request.
16925    pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
16926
16927    /// Things that could have overridden the policy verdict. Overrides together
16928    /// with verdict decide whether the request is allowed.
16929    pub overrides:
16930        std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
16931
16932    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16933}
16934
16935impl DeployPolicyEvaluationEvent {
16936    pub fn new() -> Self {
16937        std::default::Default::default()
16938    }
16939
16940    /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
16941    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16942        self.message = v.into();
16943        self
16944    }
16945
16946    /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
16947    pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16948        self.rule_type = v.into();
16949        self
16950    }
16951
16952    /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
16953    pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16954        self.rule = v.into();
16955        self
16956    }
16957
16958    /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
16959    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16960        self.pipeline_uid = v.into();
16961        self
16962    }
16963
16964    /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
16965    pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
16966        mut self,
16967        v: T,
16968    ) -> Self {
16969        self.delivery_pipeline = v.into();
16970        self
16971    }
16972
16973    /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
16974    pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16975        self.target_uid = v.into();
16976        self
16977    }
16978
16979    /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
16980    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16981        self.target = v.into();
16982        self
16983    }
16984
16985    /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
16986    pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
16987        mut self,
16988        v: T,
16989    ) -> Self {
16990        self.invoker = v.into();
16991        self
16992    }
16993
16994    /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
16995    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16996        self.deploy_policy = v.into();
16997        self
16998    }
16999
17000    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
17001    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
17002        mut self,
17003        v: T,
17004    ) -> Self {
17005        self.deploy_policy_uid = v.into();
17006        self
17007    }
17008
17009    /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
17010    pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17011        self.allowed = v.into();
17012        self
17013    }
17014
17015    /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
17016    pub fn set_verdict<
17017        T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
17018    >(
17019        mut self,
17020        v: T,
17021    ) -> Self {
17022        self.verdict = v.into();
17023        self
17024    }
17025
17026    /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
17027    pub fn set_overrides<T, V>(mut self, v: T) -> Self
17028    where
17029        T: std::iter::IntoIterator<Item = V>,
17030        V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
17031    {
17032        use std::iter::Iterator;
17033        self.overrides = v.into_iter().map(|i| i.into()).collect();
17034        self
17035    }
17036}
17037
17038impl wkt::message::Message for DeployPolicyEvaluationEvent {
17039    fn typename() -> &'static str {
17040        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
17041    }
17042}
17043
17044/// Defines additional types related to [DeployPolicyEvaluationEvent].
17045pub mod deploy_policy_evaluation_event {
17046    #[allow(unused_imports)]
17047    use super::*;
17048
17049    /// The policy verdict of the request.
17050    ///
17051    /// # Working with unknown values
17052    ///
17053    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17054    /// additional enum variants at any time. Adding new variants is not considered
17055    /// a breaking change. Applications should write their code in anticipation of:
17056    ///
17057    /// - New values appearing in future releases of the client library, **and**
17058    /// - New values received dynamically, without application changes.
17059    ///
17060    /// Please consult the [Working with enums] section in the user guide for some
17061    /// guidelines.
17062    ///
17063    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17064    #[derive(Clone, Debug, PartialEq)]
17065    #[non_exhaustive]
17066    pub enum PolicyVerdict {
17067        /// This should never happen.
17068        Unspecified,
17069        /// Allowed by policy. This enum value is not currently used but may be used
17070        /// in the future. Currently logs are only generated when a request is denied
17071        /// by policy.
17072        AllowedByPolicy,
17073        /// Denied by policy.
17074        DeniedByPolicy,
17075        /// If set, the enum was initialized with an unknown value.
17076        ///
17077        /// Applications can examine the value using [PolicyVerdict::value] or
17078        /// [PolicyVerdict::name].
17079        UnknownValue(policy_verdict::UnknownValue),
17080    }
17081
17082    #[doc(hidden)]
17083    pub mod policy_verdict {
17084        #[allow(unused_imports)]
17085        use super::*;
17086        #[derive(Clone, Debug, PartialEq)]
17087        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17088    }
17089
17090    impl PolicyVerdict {
17091        /// Gets the enum value.
17092        ///
17093        /// Returns `None` if the enum contains an unknown value deserialized from
17094        /// the string representation of enums.
17095        pub fn value(&self) -> std::option::Option<i32> {
17096            match self {
17097                Self::Unspecified => std::option::Option::Some(0),
17098                Self::AllowedByPolicy => std::option::Option::Some(1),
17099                Self::DeniedByPolicy => std::option::Option::Some(2),
17100                Self::UnknownValue(u) => u.0.value(),
17101            }
17102        }
17103
17104        /// Gets the enum value as a string.
17105        ///
17106        /// Returns `None` if the enum contains an unknown value deserialized from
17107        /// the integer representation of enums.
17108        pub fn name(&self) -> std::option::Option<&str> {
17109            match self {
17110                Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
17111                Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
17112                Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
17113                Self::UnknownValue(u) => u.0.name(),
17114            }
17115        }
17116    }
17117
17118    impl std::default::Default for PolicyVerdict {
17119        fn default() -> Self {
17120            use std::convert::From;
17121            Self::from(0)
17122        }
17123    }
17124
17125    impl std::fmt::Display for PolicyVerdict {
17126        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17127            wkt::internal::display_enum(f, self.name(), self.value())
17128        }
17129    }
17130
17131    impl std::convert::From<i32> for PolicyVerdict {
17132        fn from(value: i32) -> Self {
17133            match value {
17134                0 => Self::Unspecified,
17135                1 => Self::AllowedByPolicy,
17136                2 => Self::DeniedByPolicy,
17137                _ => Self::UnknownValue(policy_verdict::UnknownValue(
17138                    wkt::internal::UnknownEnumValue::Integer(value),
17139                )),
17140            }
17141        }
17142    }
17143
17144    impl std::convert::From<&str> for PolicyVerdict {
17145        fn from(value: &str) -> Self {
17146            use std::string::ToString;
17147            match value {
17148                "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
17149                "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
17150                "DENIED_BY_POLICY" => Self::DeniedByPolicy,
17151                _ => Self::UnknownValue(policy_verdict::UnknownValue(
17152                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17153                )),
17154            }
17155        }
17156    }
17157
17158    impl serde::ser::Serialize for PolicyVerdict {
17159        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17160        where
17161            S: serde::Serializer,
17162        {
17163            match self {
17164                Self::Unspecified => serializer.serialize_i32(0),
17165                Self::AllowedByPolicy => serializer.serialize_i32(1),
17166                Self::DeniedByPolicy => serializer.serialize_i32(2),
17167                Self::UnknownValue(u) => u.0.serialize(serializer),
17168            }
17169        }
17170    }
17171
17172    impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
17173        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17174        where
17175            D: serde::Deserializer<'de>,
17176        {
17177            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
17178                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
17179            ))
17180        }
17181    }
17182
17183    /// Things that could have overridden the policy verdict. When overrides are
17184    /// used, the request will be allowed even if it is DENIED_BY_POLICY.
17185    ///
17186    /// # Working with unknown values
17187    ///
17188    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17189    /// additional enum variants at any time. Adding new variants is not considered
17190    /// a breaking change. Applications should write their code in anticipation of:
17191    ///
17192    /// - New values appearing in future releases of the client library, **and**
17193    /// - New values received dynamically, without application changes.
17194    ///
17195    /// Please consult the [Working with enums] section in the user guide for some
17196    /// guidelines.
17197    ///
17198    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17199    #[derive(Clone, Debug, PartialEq)]
17200    #[non_exhaustive]
17201    pub enum PolicyVerdictOverride {
17202        /// This should never happen.
17203        Unspecified,
17204        /// The policy was overridden.
17205        PolicyOverridden,
17206        /// The policy was suspended.
17207        PolicySuspended,
17208        /// If set, the enum was initialized with an unknown value.
17209        ///
17210        /// Applications can examine the value using [PolicyVerdictOverride::value] or
17211        /// [PolicyVerdictOverride::name].
17212        UnknownValue(policy_verdict_override::UnknownValue),
17213    }
17214
17215    #[doc(hidden)]
17216    pub mod policy_verdict_override {
17217        #[allow(unused_imports)]
17218        use super::*;
17219        #[derive(Clone, Debug, PartialEq)]
17220        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17221    }
17222
17223    impl PolicyVerdictOverride {
17224        /// Gets the enum value.
17225        ///
17226        /// Returns `None` if the enum contains an unknown value deserialized from
17227        /// the string representation of enums.
17228        pub fn value(&self) -> std::option::Option<i32> {
17229            match self {
17230                Self::Unspecified => std::option::Option::Some(0),
17231                Self::PolicyOverridden => std::option::Option::Some(1),
17232                Self::PolicySuspended => std::option::Option::Some(2),
17233                Self::UnknownValue(u) => u.0.value(),
17234            }
17235        }
17236
17237        /// Gets the enum value as a string.
17238        ///
17239        /// Returns `None` if the enum contains an unknown value deserialized from
17240        /// the integer representation of enums.
17241        pub fn name(&self) -> std::option::Option<&str> {
17242            match self {
17243                Self::Unspecified => {
17244                    std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
17245                }
17246                Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
17247                Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
17248                Self::UnknownValue(u) => u.0.name(),
17249            }
17250        }
17251    }
17252
17253    impl std::default::Default for PolicyVerdictOverride {
17254        fn default() -> Self {
17255            use std::convert::From;
17256            Self::from(0)
17257        }
17258    }
17259
17260    impl std::fmt::Display for PolicyVerdictOverride {
17261        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17262            wkt::internal::display_enum(f, self.name(), self.value())
17263        }
17264    }
17265
17266    impl std::convert::From<i32> for PolicyVerdictOverride {
17267        fn from(value: i32) -> Self {
17268            match value {
17269                0 => Self::Unspecified,
17270                1 => Self::PolicyOverridden,
17271                2 => Self::PolicySuspended,
17272                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
17273                    wkt::internal::UnknownEnumValue::Integer(value),
17274                )),
17275            }
17276        }
17277    }
17278
17279    impl std::convert::From<&str> for PolicyVerdictOverride {
17280        fn from(value: &str) -> Self {
17281            use std::string::ToString;
17282            match value {
17283                "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
17284                "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
17285                "POLICY_SUSPENDED" => Self::PolicySuspended,
17286                _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
17287                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17288                )),
17289            }
17290        }
17291    }
17292
17293    impl serde::ser::Serialize for PolicyVerdictOverride {
17294        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17295        where
17296            S: serde::Serializer,
17297        {
17298            match self {
17299                Self::Unspecified => serializer.serialize_i32(0),
17300                Self::PolicyOverridden => serializer.serialize_i32(1),
17301                Self::PolicySuspended => serializer.serialize_i32(2),
17302                Self::UnknownValue(u) => u.0.serialize(serializer),
17303            }
17304        }
17305    }
17306
17307    impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
17308        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17309        where
17310            D: serde::Deserializer<'de>,
17311        {
17312            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
17313                ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
17314            ))
17315        }
17316    }
17317}
17318
17319/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
17320/// Platform Log event that describes the failure to send a pub/sub notification
17321/// when there is a DeployPolicy status change.
17322#[derive(Clone, Default, PartialEq)]
17323#[non_exhaustive]
17324pub struct DeployPolicyNotificationEvent {
17325    /// Debug message for when a deploy policy fails to send a pub/sub
17326    /// notification.
17327    pub message: std::string::String,
17328
17329    /// The name of the `DeployPolicy`.
17330    pub deploy_policy: std::string::String,
17331
17332    /// Unique identifier of the deploy policy.
17333    pub deploy_policy_uid: std::string::String,
17334
17335    /// Type of this notification, e.g. for a Pub/Sub failure.
17336    pub r#type: crate::model::Type,
17337
17338    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17339}
17340
17341impl DeployPolicyNotificationEvent {
17342    pub fn new() -> Self {
17343        std::default::Default::default()
17344    }
17345
17346    /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
17347    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17348        self.message = v.into();
17349        self
17350    }
17351
17352    /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
17353    pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17354        self.deploy_policy = v.into();
17355        self
17356    }
17357
17358    /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
17359    pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
17360        mut self,
17361        v: T,
17362    ) -> Self {
17363        self.deploy_policy_uid = v.into();
17364        self
17365    }
17366
17367    /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
17368    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
17369        self.r#type = v.into();
17370        self
17371    }
17372}
17373
17374impl wkt::message::Message for DeployPolicyNotificationEvent {
17375    fn typename() -> &'static str {
17376        "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
17377    }
17378}
17379
17380/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
17381/// Platform Log event that describes the failure to send JobRun resource update
17382/// Pub/Sub notification.
17383#[derive(Clone, Default, PartialEq)]
17384#[non_exhaustive]
17385pub struct JobRunNotificationEvent {
17386    /// Debug message for when a notification fails to send.
17387    pub message: std::string::String,
17388
17389    /// The name of the `JobRun`.
17390    pub job_run: std::string::String,
17391
17392    /// Unique identifier of the `DeliveryPipeline`.
17393    pub pipeline_uid: std::string::String,
17394
17395    /// Unique identifier of the `Release`.
17396    pub release_uid: std::string::String,
17397
17398    /// The name of the `Release`.
17399    pub release: std::string::String,
17400
17401    /// Unique identifier of the `Rollout`.
17402    pub rollout_uid: std::string::String,
17403
17404    /// The name of the `Rollout`.
17405    pub rollout: std::string::String,
17406
17407    /// ID of the `Target`.
17408    pub target_id: std::string::String,
17409
17410    /// Type of this notification, e.g. for a Pub/Sub failure.
17411    pub r#type: crate::model::Type,
17412
17413    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17414}
17415
17416impl JobRunNotificationEvent {
17417    pub fn new() -> Self {
17418        std::default::Default::default()
17419    }
17420
17421    /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
17422    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17423        self.message = v.into();
17424        self
17425    }
17426
17427    /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
17428    pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17429        self.job_run = v.into();
17430        self
17431    }
17432
17433    /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
17434    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17435        self.pipeline_uid = v.into();
17436        self
17437    }
17438
17439    /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
17440    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17441        self.release_uid = v.into();
17442        self
17443    }
17444
17445    /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
17446    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17447        self.release = v.into();
17448        self
17449    }
17450
17451    /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
17452    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17453        self.rollout_uid = v.into();
17454        self
17455    }
17456
17457    /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
17458    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17459        self.rollout = v.into();
17460        self
17461    }
17462
17463    /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
17464    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17465        self.target_id = v.into();
17466        self
17467    }
17468
17469    /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
17470    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
17471        self.r#type = v.into();
17472        self
17473    }
17474}
17475
17476impl wkt::message::Message for JobRunNotificationEvent {
17477    fn typename() -> &'static str {
17478        "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
17479    }
17480}
17481
17482/// Payload proto for "clouddeploy.googleapis.com/release_notification"
17483/// Platform Log event that describes the failure to send release status change
17484/// Pub/Sub notification.
17485#[derive(Clone, Default, PartialEq)]
17486#[non_exhaustive]
17487pub struct ReleaseNotificationEvent {
17488    /// Debug message for when a notification fails to send.
17489    pub message: std::string::String,
17490
17491    /// Unique identifier of the `DeliveryPipeline`.
17492    pub pipeline_uid: std::string::String,
17493
17494    /// Unique identifier of the `Release`.
17495    pub release_uid: std::string::String,
17496
17497    /// The name of the `Release`.
17498    pub release: std::string::String,
17499
17500    /// Type of this notification, e.g. for a Pub/Sub failure.
17501    pub r#type: crate::model::Type,
17502
17503    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17504}
17505
17506impl ReleaseNotificationEvent {
17507    pub fn new() -> Self {
17508        std::default::Default::default()
17509    }
17510
17511    /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
17512    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17513        self.message = v.into();
17514        self
17515    }
17516
17517    /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
17518    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17519        self.pipeline_uid = v.into();
17520        self
17521    }
17522
17523    /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
17524    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17525        self.release_uid = v.into();
17526        self
17527    }
17528
17529    /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
17530    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17531        self.release = v.into();
17532        self
17533    }
17534
17535    /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
17536    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
17537        self.r#type = v.into();
17538        self
17539    }
17540}
17541
17542impl wkt::message::Message for ReleaseNotificationEvent {
17543    fn typename() -> &'static str {
17544        "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
17545    }
17546}
17547
17548/// Payload proto for "clouddeploy.googleapis.com/release_render"
17549/// Platform Log event that describes the render status change.
17550#[derive(Clone, Default, PartialEq)]
17551#[non_exhaustive]
17552pub struct ReleaseRenderEvent {
17553    /// Debug message for when a render transition occurs. Provides further
17554    /// details as rendering progresses through render states.
17555    pub message: std::string::String,
17556
17557    /// Unique identifier of the `DeliveryPipeline`.
17558    pub pipeline_uid: std::string::String,
17559
17560    /// The name of the release.
17561    /// release_uid is not in this log message because we write some of these log
17562    /// messages at release creation time, before we've generated the uid.
17563    pub release: std::string::String,
17564
17565    /// Type of this notification, e.g. for a release render state change event.
17566    pub r#type: crate::model::Type,
17567
17568    /// The state of the release render.
17569    pub release_render_state: crate::model::release::RenderState,
17570
17571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17572}
17573
17574impl ReleaseRenderEvent {
17575    pub fn new() -> Self {
17576        std::default::Default::default()
17577    }
17578
17579    /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
17580    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17581        self.message = v.into();
17582        self
17583    }
17584
17585    /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
17586    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17587        self.pipeline_uid = v.into();
17588        self
17589    }
17590
17591    /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
17592    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17593        self.release = v.into();
17594        self
17595    }
17596
17597    /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
17598    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
17599        self.r#type = v.into();
17600        self
17601    }
17602
17603    /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
17604    pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
17605        mut self,
17606        v: T,
17607    ) -> Self {
17608        self.release_render_state = v.into();
17609        self
17610    }
17611}
17612
17613impl wkt::message::Message for ReleaseRenderEvent {
17614    fn typename() -> &'static str {
17615        "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
17616    }
17617}
17618
17619/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
17620/// Platform Log event that describes the failure to send rollout status change
17621/// Pub/Sub notification.
17622#[derive(Clone, Default, PartialEq)]
17623#[non_exhaustive]
17624pub struct RolloutNotificationEvent {
17625    /// Debug message for when a notification fails to send.
17626    pub message: std::string::String,
17627
17628    /// Unique identifier of the `DeliveryPipeline`.
17629    pub pipeline_uid: std::string::String,
17630
17631    /// Unique identifier of the `Release`.
17632    pub release_uid: std::string::String,
17633
17634    /// The name of the `Release`.
17635    pub release: std::string::String,
17636
17637    /// Unique identifier of the `Rollout`.
17638    pub rollout_uid: std::string::String,
17639
17640    /// The name of the `Rollout`.
17641    pub rollout: std::string::String,
17642
17643    /// ID of the `Target` that the rollout is deployed to.
17644    pub target_id: std::string::String,
17645
17646    /// Type of this notification, e.g. for a Pub/Sub failure.
17647    pub r#type: crate::model::Type,
17648
17649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17650}
17651
17652impl RolloutNotificationEvent {
17653    pub fn new() -> Self {
17654        std::default::Default::default()
17655    }
17656
17657    /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
17658    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17659        self.message = v.into();
17660        self
17661    }
17662
17663    /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
17664    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17665        self.pipeline_uid = v.into();
17666        self
17667    }
17668
17669    /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
17670    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17671        self.release_uid = v.into();
17672        self
17673    }
17674
17675    /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
17676    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17677        self.release = v.into();
17678        self
17679    }
17680
17681    /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
17682    pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17683        self.rollout_uid = v.into();
17684        self
17685    }
17686
17687    /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
17688    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17689        self.rollout = v.into();
17690        self
17691    }
17692
17693    /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
17694    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17695        self.target_id = v.into();
17696        self
17697    }
17698
17699    /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
17700    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
17701        self.r#type = v.into();
17702        self
17703    }
17704}
17705
17706impl wkt::message::Message for RolloutNotificationEvent {
17707    fn typename() -> &'static str {
17708        "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
17709    }
17710}
17711
17712/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
17713/// Platform Log event that describes the rollout update event.
17714#[derive(Clone, Default, PartialEq)]
17715#[non_exhaustive]
17716pub struct RolloutUpdateEvent {
17717    /// Debug message for when a rollout update event occurs.
17718    pub message: std::string::String,
17719
17720    /// Unique identifier of the pipeline.
17721    pub pipeline_uid: std::string::String,
17722
17723    /// Unique identifier of the release.
17724    pub release_uid: std::string::String,
17725
17726    /// The name of the `Release`.
17727    pub release: std::string::String,
17728
17729    /// The name of the rollout.
17730    /// rollout_uid is not in this log message because we write some of these log
17731    /// messages at rollout creation time, before we've generated the uid.
17732    pub rollout: std::string::String,
17733
17734    /// ID of the target.
17735    pub target_id: std::string::String,
17736
17737    /// Type of this notification, e.g. for a rollout update event.
17738    pub r#type: crate::model::Type,
17739
17740    /// The type of the rollout update.
17741    pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
17742
17743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17744}
17745
17746impl RolloutUpdateEvent {
17747    pub fn new() -> Self {
17748        std::default::Default::default()
17749    }
17750
17751    /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
17752    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17753        self.message = v.into();
17754        self
17755    }
17756
17757    /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
17758    pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17759        self.pipeline_uid = v.into();
17760        self
17761    }
17762
17763    /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
17764    pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17765        self.release_uid = v.into();
17766        self
17767    }
17768
17769    /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
17770    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17771        self.release = v.into();
17772        self
17773    }
17774
17775    /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
17776    pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17777        self.rollout = v.into();
17778        self
17779    }
17780
17781    /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
17782    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17783        self.target_id = v.into();
17784        self
17785    }
17786
17787    /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
17788    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
17789        self.r#type = v.into();
17790        self
17791    }
17792
17793    /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
17794    pub fn set_rollout_update_type<
17795        T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
17796    >(
17797        mut self,
17798        v: T,
17799    ) -> Self {
17800        self.rollout_update_type = v.into();
17801        self
17802    }
17803}
17804
17805impl wkt::message::Message for RolloutUpdateEvent {
17806    fn typename() -> &'static str {
17807        "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
17808    }
17809}
17810
17811/// Defines additional types related to [RolloutUpdateEvent].
17812pub mod rollout_update_event {
17813    #[allow(unused_imports)]
17814    use super::*;
17815
17816    /// RolloutUpdateType indicates the type of the rollout update.
17817    ///
17818    /// # Working with unknown values
17819    ///
17820    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17821    /// additional enum variants at any time. Adding new variants is not considered
17822    /// a breaking change. Applications should write their code in anticipation of:
17823    ///
17824    /// - New values appearing in future releases of the client library, **and**
17825    /// - New values received dynamically, without application changes.
17826    ///
17827    /// Please consult the [Working with enums] section in the user guide for some
17828    /// guidelines.
17829    ///
17830    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17831    #[derive(Clone, Debug, PartialEq)]
17832    #[non_exhaustive]
17833    pub enum RolloutUpdateType {
17834        /// Rollout update type unspecified.
17835        Unspecified,
17836        /// rollout state updated to pending.
17837        Pending,
17838        /// Rollout state updated to pending release.
17839        PendingRelease,
17840        /// Rollout state updated to in progress.
17841        InProgress,
17842        /// Rollout state updated to cancelling.
17843        Cancelling,
17844        /// Rollout state updated to cancelled.
17845        Cancelled,
17846        /// Rollout state updated to halted.
17847        Halted,
17848        /// Rollout state updated to succeeded.
17849        Succeeded,
17850        /// Rollout state updated to failed.
17851        Failed,
17852        /// Rollout requires approval.
17853        ApprovalRequired,
17854        /// Rollout has been approved.
17855        Approved,
17856        /// Rollout has been rejected.
17857        Rejected,
17858        /// Rollout requires advance to the next phase.
17859        AdvanceRequired,
17860        /// Rollout has been advanced.
17861        Advanced,
17862        /// If set, the enum was initialized with an unknown value.
17863        ///
17864        /// Applications can examine the value using [RolloutUpdateType::value] or
17865        /// [RolloutUpdateType::name].
17866        UnknownValue(rollout_update_type::UnknownValue),
17867    }
17868
17869    #[doc(hidden)]
17870    pub mod rollout_update_type {
17871        #[allow(unused_imports)]
17872        use super::*;
17873        #[derive(Clone, Debug, PartialEq)]
17874        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17875    }
17876
17877    impl RolloutUpdateType {
17878        /// Gets the enum value.
17879        ///
17880        /// Returns `None` if the enum contains an unknown value deserialized from
17881        /// the string representation of enums.
17882        pub fn value(&self) -> std::option::Option<i32> {
17883            match self {
17884                Self::Unspecified => std::option::Option::Some(0),
17885                Self::Pending => std::option::Option::Some(1),
17886                Self::PendingRelease => std::option::Option::Some(2),
17887                Self::InProgress => std::option::Option::Some(3),
17888                Self::Cancelling => std::option::Option::Some(4),
17889                Self::Cancelled => std::option::Option::Some(5),
17890                Self::Halted => std::option::Option::Some(6),
17891                Self::Succeeded => std::option::Option::Some(7),
17892                Self::Failed => std::option::Option::Some(8),
17893                Self::ApprovalRequired => std::option::Option::Some(9),
17894                Self::Approved => std::option::Option::Some(10),
17895                Self::Rejected => std::option::Option::Some(11),
17896                Self::AdvanceRequired => std::option::Option::Some(12),
17897                Self::Advanced => std::option::Option::Some(13),
17898                Self::UnknownValue(u) => u.0.value(),
17899            }
17900        }
17901
17902        /// Gets the enum value as a string.
17903        ///
17904        /// Returns `None` if the enum contains an unknown value deserialized from
17905        /// the integer representation of enums.
17906        pub fn name(&self) -> std::option::Option<&str> {
17907            match self {
17908                Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
17909                Self::Pending => std::option::Option::Some("PENDING"),
17910                Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
17911                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
17912                Self::Cancelling => std::option::Option::Some("CANCELLING"),
17913                Self::Cancelled => std::option::Option::Some("CANCELLED"),
17914                Self::Halted => std::option::Option::Some("HALTED"),
17915                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
17916                Self::Failed => std::option::Option::Some("FAILED"),
17917                Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
17918                Self::Approved => std::option::Option::Some("APPROVED"),
17919                Self::Rejected => std::option::Option::Some("REJECTED"),
17920                Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
17921                Self::Advanced => std::option::Option::Some("ADVANCED"),
17922                Self::UnknownValue(u) => u.0.name(),
17923            }
17924        }
17925    }
17926
17927    impl std::default::Default for RolloutUpdateType {
17928        fn default() -> Self {
17929            use std::convert::From;
17930            Self::from(0)
17931        }
17932    }
17933
17934    impl std::fmt::Display for RolloutUpdateType {
17935        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17936            wkt::internal::display_enum(f, self.name(), self.value())
17937        }
17938    }
17939
17940    impl std::convert::From<i32> for RolloutUpdateType {
17941        fn from(value: i32) -> Self {
17942            match value {
17943                0 => Self::Unspecified,
17944                1 => Self::Pending,
17945                2 => Self::PendingRelease,
17946                3 => Self::InProgress,
17947                4 => Self::Cancelling,
17948                5 => Self::Cancelled,
17949                6 => Self::Halted,
17950                7 => Self::Succeeded,
17951                8 => Self::Failed,
17952                9 => Self::ApprovalRequired,
17953                10 => Self::Approved,
17954                11 => Self::Rejected,
17955                12 => Self::AdvanceRequired,
17956                13 => Self::Advanced,
17957                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
17958                    wkt::internal::UnknownEnumValue::Integer(value),
17959                )),
17960            }
17961        }
17962    }
17963
17964    impl std::convert::From<&str> for RolloutUpdateType {
17965        fn from(value: &str) -> Self {
17966            use std::string::ToString;
17967            match value {
17968                "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
17969                "PENDING" => Self::Pending,
17970                "PENDING_RELEASE" => Self::PendingRelease,
17971                "IN_PROGRESS" => Self::InProgress,
17972                "CANCELLING" => Self::Cancelling,
17973                "CANCELLED" => Self::Cancelled,
17974                "HALTED" => Self::Halted,
17975                "SUCCEEDED" => Self::Succeeded,
17976                "FAILED" => Self::Failed,
17977                "APPROVAL_REQUIRED" => Self::ApprovalRequired,
17978                "APPROVED" => Self::Approved,
17979                "REJECTED" => Self::Rejected,
17980                "ADVANCE_REQUIRED" => Self::AdvanceRequired,
17981                "ADVANCED" => Self::Advanced,
17982                _ => Self::UnknownValue(rollout_update_type::UnknownValue(
17983                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17984                )),
17985            }
17986        }
17987    }
17988
17989    impl serde::ser::Serialize for RolloutUpdateType {
17990        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17991        where
17992            S: serde::Serializer,
17993        {
17994            match self {
17995                Self::Unspecified => serializer.serialize_i32(0),
17996                Self::Pending => serializer.serialize_i32(1),
17997                Self::PendingRelease => serializer.serialize_i32(2),
17998                Self::InProgress => serializer.serialize_i32(3),
17999                Self::Cancelling => serializer.serialize_i32(4),
18000                Self::Cancelled => serializer.serialize_i32(5),
18001                Self::Halted => serializer.serialize_i32(6),
18002                Self::Succeeded => serializer.serialize_i32(7),
18003                Self::Failed => serializer.serialize_i32(8),
18004                Self::ApprovalRequired => serializer.serialize_i32(9),
18005                Self::Approved => serializer.serialize_i32(10),
18006                Self::Rejected => serializer.serialize_i32(11),
18007                Self::AdvanceRequired => serializer.serialize_i32(12),
18008                Self::Advanced => serializer.serialize_i32(13),
18009                Self::UnknownValue(u) => u.0.serialize(serializer),
18010            }
18011        }
18012    }
18013
18014    impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
18015        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18016        where
18017            D: serde::Deserializer<'de>,
18018        {
18019            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
18020                ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
18021            ))
18022        }
18023    }
18024}
18025
18026/// Payload proto for "clouddeploy.googleapis.com/target_notification"
18027/// Platform Log event that describes the failure to send target status change
18028/// Pub/Sub notification.
18029#[derive(Clone, Default, PartialEq)]
18030#[non_exhaustive]
18031pub struct TargetNotificationEvent {
18032    /// Debug message for when a notification fails to send.
18033    pub message: std::string::String,
18034
18035    /// The name of the `Target`.
18036    pub target: std::string::String,
18037
18038    /// Type of this notification, e.g. for a Pub/Sub failure.
18039    pub r#type: crate::model::Type,
18040
18041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18042}
18043
18044impl TargetNotificationEvent {
18045    pub fn new() -> Self {
18046        std::default::Default::default()
18047    }
18048
18049    /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
18050    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18051        self.message = v.into();
18052        self
18053    }
18054
18055    /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
18056    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18057        self.target = v.into();
18058        self
18059    }
18060
18061    /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
18062    pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
18063        self.r#type = v.into();
18064        self
18065    }
18066}
18067
18068impl wkt::message::Message for TargetNotificationEvent {
18069    fn typename() -> &'static str {
18070        "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
18071    }
18072}
18073
18074/// The support state of a specific Skaffold version.
18075///
18076/// # Working with unknown values
18077///
18078/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18079/// additional enum variants at any time. Adding new variants is not considered
18080/// a breaking change. Applications should write their code in anticipation of:
18081///
18082/// - New values appearing in future releases of the client library, **and**
18083/// - New values received dynamically, without application changes.
18084///
18085/// Please consult the [Working with enums] section in the user guide for some
18086/// guidelines.
18087///
18088/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18089#[derive(Clone, Debug, PartialEq)]
18090#[non_exhaustive]
18091pub enum SkaffoldSupportState {
18092    /// Default value. This value is unused.
18093    Unspecified,
18094    /// This Skaffold version is currently supported.
18095    Supported,
18096    /// This Skaffold version is in maintenance mode.
18097    MaintenanceMode,
18098    /// This Skaffold version is no longer supported.
18099    Unsupported,
18100    /// If set, the enum was initialized with an unknown value.
18101    ///
18102    /// Applications can examine the value using [SkaffoldSupportState::value] or
18103    /// [SkaffoldSupportState::name].
18104    UnknownValue(skaffold_support_state::UnknownValue),
18105}
18106
18107#[doc(hidden)]
18108pub mod skaffold_support_state {
18109    #[allow(unused_imports)]
18110    use super::*;
18111    #[derive(Clone, Debug, PartialEq)]
18112    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18113}
18114
18115impl SkaffoldSupportState {
18116    /// Gets the enum value.
18117    ///
18118    /// Returns `None` if the enum contains an unknown value deserialized from
18119    /// the string representation of enums.
18120    pub fn value(&self) -> std::option::Option<i32> {
18121        match self {
18122            Self::Unspecified => std::option::Option::Some(0),
18123            Self::Supported => std::option::Option::Some(1),
18124            Self::MaintenanceMode => std::option::Option::Some(2),
18125            Self::Unsupported => std::option::Option::Some(3),
18126            Self::UnknownValue(u) => u.0.value(),
18127        }
18128    }
18129
18130    /// Gets the enum value as a string.
18131    ///
18132    /// Returns `None` if the enum contains an unknown value deserialized from
18133    /// the integer representation of enums.
18134    pub fn name(&self) -> std::option::Option<&str> {
18135        match self {
18136            Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
18137            Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
18138            Self::MaintenanceMode => {
18139                std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
18140            }
18141            Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
18142            Self::UnknownValue(u) => u.0.name(),
18143        }
18144    }
18145}
18146
18147impl std::default::Default for SkaffoldSupportState {
18148    fn default() -> Self {
18149        use std::convert::From;
18150        Self::from(0)
18151    }
18152}
18153
18154impl std::fmt::Display for SkaffoldSupportState {
18155    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18156        wkt::internal::display_enum(f, self.name(), self.value())
18157    }
18158}
18159
18160impl std::convert::From<i32> for SkaffoldSupportState {
18161    fn from(value: i32) -> Self {
18162        match value {
18163            0 => Self::Unspecified,
18164            1 => Self::Supported,
18165            2 => Self::MaintenanceMode,
18166            3 => Self::Unsupported,
18167            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
18168                wkt::internal::UnknownEnumValue::Integer(value),
18169            )),
18170        }
18171    }
18172}
18173
18174impl std::convert::From<&str> for SkaffoldSupportState {
18175    fn from(value: &str) -> Self {
18176        use std::string::ToString;
18177        match value {
18178            "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
18179            "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
18180            "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
18181            "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
18182            _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
18183                wkt::internal::UnknownEnumValue::String(value.to_string()),
18184            )),
18185        }
18186    }
18187}
18188
18189impl serde::ser::Serialize for SkaffoldSupportState {
18190    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18191    where
18192        S: serde::Serializer,
18193    {
18194        match self {
18195            Self::Unspecified => serializer.serialize_i32(0),
18196            Self::Supported => serializer.serialize_i32(1),
18197            Self::MaintenanceMode => serializer.serialize_i32(2),
18198            Self::Unsupported => serializer.serialize_i32(3),
18199            Self::UnknownValue(u) => u.0.serialize(serializer),
18200        }
18201    }
18202}
18203
18204impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
18205    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18206    where
18207        D: serde::Deserializer<'de>,
18208    {
18209        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
18210            ".google.cloud.deploy.v1.SkaffoldSupportState",
18211        ))
18212    }
18213}
18214
18215/// The pattern of how wait time is increased.
18216///
18217/// # Working with unknown values
18218///
18219/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18220/// additional enum variants at any time. Adding new variants is not considered
18221/// a breaking change. Applications should write their code in anticipation of:
18222///
18223/// - New values appearing in future releases of the client library, **and**
18224/// - New values received dynamically, without application changes.
18225///
18226/// Please consult the [Working with enums] section in the user guide for some
18227/// guidelines.
18228///
18229/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18230#[derive(Clone, Debug, PartialEq)]
18231#[non_exhaustive]
18232pub enum BackoffMode {
18233    /// No WaitMode is specified.
18234    Unspecified,
18235    /// Increases the wait time linearly.
18236    Linear,
18237    /// Increases the wait time exponentially.
18238    Exponential,
18239    /// If set, the enum was initialized with an unknown value.
18240    ///
18241    /// Applications can examine the value using [BackoffMode::value] or
18242    /// [BackoffMode::name].
18243    UnknownValue(backoff_mode::UnknownValue),
18244}
18245
18246#[doc(hidden)]
18247pub mod backoff_mode {
18248    #[allow(unused_imports)]
18249    use super::*;
18250    #[derive(Clone, Debug, PartialEq)]
18251    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18252}
18253
18254impl BackoffMode {
18255    /// Gets the enum value.
18256    ///
18257    /// Returns `None` if the enum contains an unknown value deserialized from
18258    /// the string representation of enums.
18259    pub fn value(&self) -> std::option::Option<i32> {
18260        match self {
18261            Self::Unspecified => std::option::Option::Some(0),
18262            Self::Linear => std::option::Option::Some(1),
18263            Self::Exponential => std::option::Option::Some(2),
18264            Self::UnknownValue(u) => u.0.value(),
18265        }
18266    }
18267
18268    /// Gets the enum value as a string.
18269    ///
18270    /// Returns `None` if the enum contains an unknown value deserialized from
18271    /// the integer representation of enums.
18272    pub fn name(&self) -> std::option::Option<&str> {
18273        match self {
18274            Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
18275            Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
18276            Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
18277            Self::UnknownValue(u) => u.0.name(),
18278        }
18279    }
18280}
18281
18282impl std::default::Default for BackoffMode {
18283    fn default() -> Self {
18284        use std::convert::From;
18285        Self::from(0)
18286    }
18287}
18288
18289impl std::fmt::Display for BackoffMode {
18290    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18291        wkt::internal::display_enum(f, self.name(), self.value())
18292    }
18293}
18294
18295impl std::convert::From<i32> for BackoffMode {
18296    fn from(value: i32) -> Self {
18297        match value {
18298            0 => Self::Unspecified,
18299            1 => Self::Linear,
18300            2 => Self::Exponential,
18301            _ => Self::UnknownValue(backoff_mode::UnknownValue(
18302                wkt::internal::UnknownEnumValue::Integer(value),
18303            )),
18304        }
18305    }
18306}
18307
18308impl std::convert::From<&str> for BackoffMode {
18309    fn from(value: &str) -> Self {
18310        use std::string::ToString;
18311        match value {
18312            "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
18313            "BACKOFF_MODE_LINEAR" => Self::Linear,
18314            "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
18315            _ => Self::UnknownValue(backoff_mode::UnknownValue(
18316                wkt::internal::UnknownEnumValue::String(value.to_string()),
18317            )),
18318        }
18319    }
18320}
18321
18322impl serde::ser::Serialize for BackoffMode {
18323    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18324    where
18325        S: serde::Serializer,
18326    {
18327        match self {
18328            Self::Unspecified => serializer.serialize_i32(0),
18329            Self::Linear => serializer.serialize_i32(1),
18330            Self::Exponential => serializer.serialize_i32(2),
18331            Self::UnknownValue(u) => u.0.serialize(serializer),
18332        }
18333    }
18334}
18335
18336impl<'de> serde::de::Deserialize<'de> for BackoffMode {
18337    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18338    where
18339        D: serde::Deserializer<'de>,
18340    {
18341        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
18342            ".google.cloud.deploy.v1.BackoffMode",
18343        ))
18344    }
18345}
18346
18347/// Valid state of a repair attempt.
18348///
18349/// # Working with unknown values
18350///
18351/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18352/// additional enum variants at any time. Adding new variants is not considered
18353/// a breaking change. Applications should write their code in anticipation of:
18354///
18355/// - New values appearing in future releases of the client library, **and**
18356/// - New values received dynamically, without application changes.
18357///
18358/// Please consult the [Working with enums] section in the user guide for some
18359/// guidelines.
18360///
18361/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18362#[derive(Clone, Debug, PartialEq)]
18363#[non_exhaustive]
18364pub enum RepairState {
18365    /// The `repair` has an unspecified state.
18366    Unspecified,
18367    /// The `repair` action has succeeded.
18368    Succeeded,
18369    /// The `repair` action was cancelled.
18370    Cancelled,
18371    /// The `repair` action has failed.
18372    Failed,
18373    /// The `repair` action is in progress.
18374    InProgress,
18375    /// The `repair` action is pending.
18376    Pending,
18377    /// The `repair` action was aborted.
18378    Aborted,
18379    /// If set, the enum was initialized with an unknown value.
18380    ///
18381    /// Applications can examine the value using [RepairState::value] or
18382    /// [RepairState::name].
18383    UnknownValue(repair_state::UnknownValue),
18384}
18385
18386#[doc(hidden)]
18387pub mod repair_state {
18388    #[allow(unused_imports)]
18389    use super::*;
18390    #[derive(Clone, Debug, PartialEq)]
18391    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18392}
18393
18394impl RepairState {
18395    /// Gets the enum value.
18396    ///
18397    /// Returns `None` if the enum contains an unknown value deserialized from
18398    /// the string representation of enums.
18399    pub fn value(&self) -> std::option::Option<i32> {
18400        match self {
18401            Self::Unspecified => std::option::Option::Some(0),
18402            Self::Succeeded => std::option::Option::Some(1),
18403            Self::Cancelled => std::option::Option::Some(2),
18404            Self::Failed => std::option::Option::Some(3),
18405            Self::InProgress => std::option::Option::Some(4),
18406            Self::Pending => std::option::Option::Some(5),
18407            Self::Aborted => std::option::Option::Some(7),
18408            Self::UnknownValue(u) => u.0.value(),
18409        }
18410    }
18411
18412    /// Gets the enum value as a string.
18413    ///
18414    /// Returns `None` if the enum contains an unknown value deserialized from
18415    /// the integer representation of enums.
18416    pub fn name(&self) -> std::option::Option<&str> {
18417        match self {
18418            Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
18419            Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
18420            Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
18421            Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
18422            Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
18423            Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
18424            Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
18425            Self::UnknownValue(u) => u.0.name(),
18426        }
18427    }
18428}
18429
18430impl std::default::Default for RepairState {
18431    fn default() -> Self {
18432        use std::convert::From;
18433        Self::from(0)
18434    }
18435}
18436
18437impl std::fmt::Display for RepairState {
18438    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18439        wkt::internal::display_enum(f, self.name(), self.value())
18440    }
18441}
18442
18443impl std::convert::From<i32> for RepairState {
18444    fn from(value: i32) -> Self {
18445        match value {
18446            0 => Self::Unspecified,
18447            1 => Self::Succeeded,
18448            2 => Self::Cancelled,
18449            3 => Self::Failed,
18450            4 => Self::InProgress,
18451            5 => Self::Pending,
18452            7 => Self::Aborted,
18453            _ => Self::UnknownValue(repair_state::UnknownValue(
18454                wkt::internal::UnknownEnumValue::Integer(value),
18455            )),
18456        }
18457    }
18458}
18459
18460impl std::convert::From<&str> for RepairState {
18461    fn from(value: &str) -> Self {
18462        use std::string::ToString;
18463        match value {
18464            "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
18465            "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
18466            "REPAIR_STATE_CANCELLED" => Self::Cancelled,
18467            "REPAIR_STATE_FAILED" => Self::Failed,
18468            "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
18469            "REPAIR_STATE_PENDING" => Self::Pending,
18470            "REPAIR_STATE_ABORTED" => Self::Aborted,
18471            _ => Self::UnknownValue(repair_state::UnknownValue(
18472                wkt::internal::UnknownEnumValue::String(value.to_string()),
18473            )),
18474        }
18475    }
18476}
18477
18478impl serde::ser::Serialize for RepairState {
18479    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18480    where
18481        S: serde::Serializer,
18482    {
18483        match self {
18484            Self::Unspecified => serializer.serialize_i32(0),
18485            Self::Succeeded => serializer.serialize_i32(1),
18486            Self::Cancelled => serializer.serialize_i32(2),
18487            Self::Failed => serializer.serialize_i32(3),
18488            Self::InProgress => serializer.serialize_i32(4),
18489            Self::Pending => serializer.serialize_i32(5),
18490            Self::Aborted => serializer.serialize_i32(7),
18491            Self::UnknownValue(u) => u.0.serialize(serializer),
18492        }
18493    }
18494}
18495
18496impl<'de> serde::de::Deserialize<'de> for RepairState {
18497    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18498    where
18499        D: serde::Deserializer<'de>,
18500    {
18501        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
18502            ".google.cloud.deploy.v1.RepairState",
18503        ))
18504    }
18505}
18506
18507/// Type indicates the type of the log entry and can be used as a filter.
18508///
18509/// # Working with unknown values
18510///
18511/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18512/// additional enum variants at any time. Adding new variants is not considered
18513/// a breaking change. Applications should write their code in anticipation of:
18514///
18515/// - New values appearing in future releases of the client library, **and**
18516/// - New values received dynamically, without application changes.
18517///
18518/// Please consult the [Working with enums] section in the user guide for some
18519/// guidelines.
18520///
18521/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18522#[derive(Clone, Debug, PartialEq)]
18523#[non_exhaustive]
18524pub enum Type {
18525    /// Type is unspecified.
18526    Unspecified,
18527    /// A Pub/Sub notification failed to be sent.
18528    PubsubNotificationFailure,
18529    /// Resource state changed.
18530    ResourceStateChange,
18531    /// A process aborted.
18532    ProcessAborted,
18533    /// Restriction check failed.
18534    RestrictionViolated,
18535    /// Resource deleted.
18536    ResourceDeleted,
18537    /// Rollout updated.
18538    RolloutUpdate,
18539    /// Deploy Policy evaluation.
18540    DeployPolicyEvaluation,
18541    /// Deprecated: This field is never used. Use release_render log type instead.
18542    #[deprecated]
18543    RenderStatuesChange,
18544    /// If set, the enum was initialized with an unknown value.
18545    ///
18546    /// Applications can examine the value using [Type::value] or
18547    /// [Type::name].
18548    UnknownValue(r#type::UnknownValue),
18549}
18550
18551#[doc(hidden)]
18552pub mod r#type {
18553    #[allow(unused_imports)]
18554    use super::*;
18555    #[derive(Clone, Debug, PartialEq)]
18556    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18557}
18558
18559impl Type {
18560    /// Gets the enum value.
18561    ///
18562    /// Returns `None` if the enum contains an unknown value deserialized from
18563    /// the string representation of enums.
18564    pub fn value(&self) -> std::option::Option<i32> {
18565        match self {
18566            Self::Unspecified => std::option::Option::Some(0),
18567            Self::PubsubNotificationFailure => std::option::Option::Some(1),
18568            Self::ResourceStateChange => std::option::Option::Some(3),
18569            Self::ProcessAborted => std::option::Option::Some(4),
18570            Self::RestrictionViolated => std::option::Option::Some(5),
18571            Self::ResourceDeleted => std::option::Option::Some(6),
18572            Self::RolloutUpdate => std::option::Option::Some(7),
18573            Self::DeployPolicyEvaluation => std::option::Option::Some(8),
18574            Self::RenderStatuesChange => std::option::Option::Some(2),
18575            Self::UnknownValue(u) => u.0.value(),
18576        }
18577    }
18578
18579    /// Gets the enum value as a string.
18580    ///
18581    /// Returns `None` if the enum contains an unknown value deserialized from
18582    /// the integer representation of enums.
18583    pub fn name(&self) -> std::option::Option<&str> {
18584        match self {
18585            Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
18586            Self::PubsubNotificationFailure => {
18587                std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
18588            }
18589            Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
18590            Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
18591            Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
18592            Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
18593            Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
18594            Self::DeployPolicyEvaluation => {
18595                std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
18596            }
18597            Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
18598            Self::UnknownValue(u) => u.0.name(),
18599        }
18600    }
18601}
18602
18603impl std::default::Default for Type {
18604    fn default() -> Self {
18605        use std::convert::From;
18606        Self::from(0)
18607    }
18608}
18609
18610impl std::fmt::Display for Type {
18611    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18612        wkt::internal::display_enum(f, self.name(), self.value())
18613    }
18614}
18615
18616impl std::convert::From<i32> for Type {
18617    fn from(value: i32) -> Self {
18618        match value {
18619            0 => Self::Unspecified,
18620            1 => Self::PubsubNotificationFailure,
18621            2 => Self::RenderStatuesChange,
18622            3 => Self::ResourceStateChange,
18623            4 => Self::ProcessAborted,
18624            5 => Self::RestrictionViolated,
18625            6 => Self::ResourceDeleted,
18626            7 => Self::RolloutUpdate,
18627            8 => Self::DeployPolicyEvaluation,
18628            _ => Self::UnknownValue(r#type::UnknownValue(
18629                wkt::internal::UnknownEnumValue::Integer(value),
18630            )),
18631        }
18632    }
18633}
18634
18635impl std::convert::From<&str> for Type {
18636    fn from(value: &str) -> Self {
18637        use std::string::ToString;
18638        match value {
18639            "TYPE_UNSPECIFIED" => Self::Unspecified,
18640            "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
18641            "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
18642            "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
18643            "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
18644            "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
18645            "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
18646            "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
18647            "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
18648            _ => Self::UnknownValue(r#type::UnknownValue(
18649                wkt::internal::UnknownEnumValue::String(value.to_string()),
18650            )),
18651        }
18652    }
18653}
18654
18655impl serde::ser::Serialize for Type {
18656    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18657    where
18658        S: serde::Serializer,
18659    {
18660        match self {
18661            Self::Unspecified => serializer.serialize_i32(0),
18662            Self::PubsubNotificationFailure => serializer.serialize_i32(1),
18663            Self::ResourceStateChange => serializer.serialize_i32(3),
18664            Self::ProcessAborted => serializer.serialize_i32(4),
18665            Self::RestrictionViolated => serializer.serialize_i32(5),
18666            Self::ResourceDeleted => serializer.serialize_i32(6),
18667            Self::RolloutUpdate => serializer.serialize_i32(7),
18668            Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
18669            Self::RenderStatuesChange => serializer.serialize_i32(2),
18670            Self::UnknownValue(u) => u.0.serialize(serializer),
18671        }
18672    }
18673}
18674
18675impl<'de> serde::de::Deserialize<'de> for Type {
18676    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18677    where
18678        D: serde::Deserializer<'de>,
18679    {
18680        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
18681            ".google.cloud.deploy.v1.Type",
18682        ))
18683    }
18684}