google_cloud_deploy_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_type;
29extern crate lazy_static;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Payload proto for "clouddeploy.googleapis.com/automation"
42/// Platform Log event that describes the Automation related events.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct AutomationEvent {
46 /// Debug message for when there is an update on the AutomationRun.
47 /// Provides further details about the resource creation or state change.
48 pub message: std::string::String,
49
50 /// The name of the `AutomationRun`.
51 pub automation: std::string::String,
52
53 /// Unique identifier of the `DeliveryPipeline`.
54 pub pipeline_uid: std::string::String,
55
56 /// Type of this notification, e.g. for a Pub/Sub failure.
57 pub r#type: crate::model::Type,
58
59 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl AutomationEvent {
63 pub fn new() -> Self {
64 std::default::Default::default()
65 }
66
67 /// Sets the value of [message][crate::model::AutomationEvent::message].
68 ///
69 /// # Example
70 /// ```ignore,no_run
71 /// # use google_cloud_deploy_v1::model::AutomationEvent;
72 /// let x = AutomationEvent::new().set_message("example");
73 /// ```
74 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75 self.message = v.into();
76 self
77 }
78
79 /// Sets the value of [automation][crate::model::AutomationEvent::automation].
80 ///
81 /// # Example
82 /// ```ignore,no_run
83 /// # use google_cloud_deploy_v1::model::AutomationEvent;
84 /// let x = AutomationEvent::new().set_automation("example");
85 /// ```
86 pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
87 self.automation = v.into();
88 self
89 }
90
91 /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
92 ///
93 /// # Example
94 /// ```ignore,no_run
95 /// # use google_cloud_deploy_v1::model::AutomationEvent;
96 /// let x = AutomationEvent::new().set_pipeline_uid("example");
97 /// ```
98 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99 self.pipeline_uid = v.into();
100 self
101 }
102
103 /// Sets the value of [r#type][crate::model::AutomationEvent::type].
104 ///
105 /// # Example
106 /// ```ignore,no_run
107 /// # use google_cloud_deploy_v1::model::AutomationEvent;
108 /// use google_cloud_deploy_v1::model::Type;
109 /// let x0 = AutomationEvent::new().set_type(Type::PubsubNotificationFailure);
110 /// let x1 = AutomationEvent::new().set_type(Type::ResourceStateChange);
111 /// let x2 = AutomationEvent::new().set_type(Type::ProcessAborted);
112 /// ```
113 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
114 self.r#type = v.into();
115 self
116 }
117}
118
119impl wkt::message::Message for AutomationEvent {
120 fn typename() -> &'static str {
121 "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
122 }
123}
124
125/// Payload proto for "clouddeploy.googleapis.com/automation_run"
126/// Platform Log event that describes the AutomationRun related events.
127#[derive(Clone, Default, PartialEq)]
128#[non_exhaustive]
129pub struct AutomationRunEvent {
130 /// Debug message for when there is an update on the AutomationRun.
131 /// Provides further details about the resource creation or state change.
132 pub message: std::string::String,
133
134 /// The name of the `AutomationRun`.
135 pub automation_run: std::string::String,
136
137 /// Unique identifier of the `DeliveryPipeline`.
138 pub pipeline_uid: std::string::String,
139
140 /// Identifier of the `Automation`.
141 pub automation_id: std::string::String,
142
143 /// Identifier of the `Automation` rule.
144 pub rule_id: std::string::String,
145
146 /// ID of the `Target` to which the `AutomationRun` is created.
147 pub destination_target_id: std::string::String,
148
149 /// Type of this notification, e.g. for a Pub/Sub failure.
150 pub r#type: crate::model::Type,
151
152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
153}
154
155impl AutomationRunEvent {
156 pub fn new() -> Self {
157 std::default::Default::default()
158 }
159
160 /// Sets the value of [message][crate::model::AutomationRunEvent::message].
161 ///
162 /// # Example
163 /// ```ignore,no_run
164 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
165 /// let x = AutomationRunEvent::new().set_message("example");
166 /// ```
167 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
168 self.message = v.into();
169 self
170 }
171
172 /// Sets the value of [automation_run][crate::model::AutomationRunEvent::automation_run].
173 ///
174 /// # Example
175 /// ```ignore,no_run
176 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
177 /// let x = AutomationRunEvent::new().set_automation_run("example");
178 /// ```
179 pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
180 self.automation_run = v.into();
181 self
182 }
183
184 /// Sets the value of [pipeline_uid][crate::model::AutomationRunEvent::pipeline_uid].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
189 /// let x = AutomationRunEvent::new().set_pipeline_uid("example");
190 /// ```
191 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
192 self.pipeline_uid = v.into();
193 self
194 }
195
196 /// Sets the value of [automation_id][crate::model::AutomationRunEvent::automation_id].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
201 /// let x = AutomationRunEvent::new().set_automation_id("example");
202 /// ```
203 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
204 self.automation_id = v.into();
205 self
206 }
207
208 /// Sets the value of [rule_id][crate::model::AutomationRunEvent::rule_id].
209 ///
210 /// # Example
211 /// ```ignore,no_run
212 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
213 /// let x = AutomationRunEvent::new().set_rule_id("example");
214 /// ```
215 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
216 self.rule_id = v.into();
217 self
218 }
219
220 /// Sets the value of [destination_target_id][crate::model::AutomationRunEvent::destination_target_id].
221 ///
222 /// # Example
223 /// ```ignore,no_run
224 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
225 /// let x = AutomationRunEvent::new().set_destination_target_id("example");
226 /// ```
227 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
228 mut self,
229 v: T,
230 ) -> Self {
231 self.destination_target_id = v.into();
232 self
233 }
234
235 /// Sets the value of [r#type][crate::model::AutomationRunEvent::type].
236 ///
237 /// # Example
238 /// ```ignore,no_run
239 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
240 /// use google_cloud_deploy_v1::model::Type;
241 /// let x0 = AutomationRunEvent::new().set_type(Type::PubsubNotificationFailure);
242 /// let x1 = AutomationRunEvent::new().set_type(Type::ResourceStateChange);
243 /// let x2 = AutomationRunEvent::new().set_type(Type::ProcessAborted);
244 /// ```
245 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
246 self.r#type = v.into();
247 self
248 }
249}
250
251impl wkt::message::Message for AutomationRunEvent {
252 fn typename() -> &'static str {
253 "type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
254 }
255}
256
257/// A `DeliveryPipeline` resource in the Cloud Deploy API.
258///
259/// A `DeliveryPipeline` defines a pipeline through which a Skaffold
260/// configuration can progress.
261#[derive(Clone, Default, PartialEq)]
262#[non_exhaustive]
263pub struct DeliveryPipeline {
264 /// Identifier. Name of the `DeliveryPipeline`. Format is
265 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`.
266 /// The `deliveryPipeline` component must match
267 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
268 pub name: std::string::String,
269
270 /// Output only. Unique identifier of the `DeliveryPipeline`.
271 pub uid: std::string::String,
272
273 /// Optional. Description of the `DeliveryPipeline`. Max length is 255
274 /// characters.
275 pub description: std::string::String,
276
277 /// Optional. User annotations. These attributes can only be set and used by
278 /// the user, and not by Cloud Deploy.
279 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
280
281 /// Labels are attributes that can be set and used by both the
282 /// user and by Cloud Deploy. Labels must meet the following constraints:
283 ///
284 /// * Keys and values can contain only lowercase letters, numeric characters,
285 /// underscores, and dashes.
286 /// * All characters must use UTF-8 encoding, and international characters are
287 /// allowed.
288 /// * Keys must start with a lowercase letter or international character.
289 /// * Each resource is limited to a maximum of 64 labels.
290 ///
291 /// Both keys and values are additionally constrained to be <= 128 bytes.
292 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
293
294 /// Output only. Time at which the pipeline was created.
295 pub create_time: std::option::Option<wkt::Timestamp>,
296
297 /// Output only. Most recent time at which the pipeline was updated.
298 pub update_time: std::option::Option<wkt::Timestamp>,
299
300 /// Output only. Information around the state of the Delivery Pipeline.
301 pub condition: std::option::Option<crate::model::PipelineCondition>,
302
303 /// This checksum is computed by the server based on the value of other
304 /// fields, and may be sent on update and delete requests to ensure the
305 /// client has an up-to-date value before proceeding.
306 pub etag: std::string::String,
307
308 /// Optional. When suspended, no new releases or rollouts can be created,
309 /// but in-progress ones will complete.
310 pub suspended: bool,
311
312 /// The ordering configuration of the `DeliveryPipeline`.
313 pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
314
315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
316}
317
318impl DeliveryPipeline {
319 pub fn new() -> Self {
320 std::default::Default::default()
321 }
322
323 /// Sets the value of [name][crate::model::DeliveryPipeline::name].
324 ///
325 /// # Example
326 /// ```ignore,no_run
327 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
328 /// let x = DeliveryPipeline::new().set_name("example");
329 /// ```
330 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
331 self.name = v.into();
332 self
333 }
334
335 /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
336 ///
337 /// # Example
338 /// ```ignore,no_run
339 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
340 /// let x = DeliveryPipeline::new().set_uid("example");
341 /// ```
342 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
343 self.uid = v.into();
344 self
345 }
346
347 /// Sets the value of [description][crate::model::DeliveryPipeline::description].
348 ///
349 /// # Example
350 /// ```ignore,no_run
351 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
352 /// let x = DeliveryPipeline::new().set_description("example");
353 /// ```
354 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
355 self.description = v.into();
356 self
357 }
358
359 /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
360 ///
361 /// # Example
362 /// ```ignore,no_run
363 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
364 /// let x = DeliveryPipeline::new().set_annotations([
365 /// ("key0", "abc"),
366 /// ("key1", "xyz"),
367 /// ]);
368 /// ```
369 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
370 where
371 T: std::iter::IntoIterator<Item = (K, V)>,
372 K: std::convert::Into<std::string::String>,
373 V: std::convert::Into<std::string::String>,
374 {
375 use std::iter::Iterator;
376 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
377 self
378 }
379
380 /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
381 ///
382 /// # Example
383 /// ```ignore,no_run
384 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
385 /// let x = DeliveryPipeline::new().set_labels([
386 /// ("key0", "abc"),
387 /// ("key1", "xyz"),
388 /// ]);
389 /// ```
390 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
391 where
392 T: std::iter::IntoIterator<Item = (K, V)>,
393 K: std::convert::Into<std::string::String>,
394 V: std::convert::Into<std::string::String>,
395 {
396 use std::iter::Iterator;
397 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
398 self
399 }
400
401 /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
402 ///
403 /// # Example
404 /// ```ignore,no_run
405 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
406 /// use wkt::Timestamp;
407 /// let x = DeliveryPipeline::new().set_create_time(Timestamp::default()/* use setters */);
408 /// ```
409 pub fn set_create_time<T>(mut self, v: T) -> Self
410 where
411 T: std::convert::Into<wkt::Timestamp>,
412 {
413 self.create_time = std::option::Option::Some(v.into());
414 self
415 }
416
417 /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
418 ///
419 /// # Example
420 /// ```ignore,no_run
421 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
422 /// use wkt::Timestamp;
423 /// let x = DeliveryPipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
424 /// let x = DeliveryPipeline::new().set_or_clear_create_time(None::<Timestamp>);
425 /// ```
426 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
427 where
428 T: std::convert::Into<wkt::Timestamp>,
429 {
430 self.create_time = v.map(|x| x.into());
431 self
432 }
433
434 /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
435 ///
436 /// # Example
437 /// ```ignore,no_run
438 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
439 /// use wkt::Timestamp;
440 /// let x = DeliveryPipeline::new().set_update_time(Timestamp::default()/* use setters */);
441 /// ```
442 pub fn set_update_time<T>(mut self, v: T) -> Self
443 where
444 T: std::convert::Into<wkt::Timestamp>,
445 {
446 self.update_time = std::option::Option::Some(v.into());
447 self
448 }
449
450 /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
451 ///
452 /// # Example
453 /// ```ignore,no_run
454 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
455 /// use wkt::Timestamp;
456 /// let x = DeliveryPipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
457 /// let x = DeliveryPipeline::new().set_or_clear_update_time(None::<Timestamp>);
458 /// ```
459 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
460 where
461 T: std::convert::Into<wkt::Timestamp>,
462 {
463 self.update_time = v.map(|x| x.into());
464 self
465 }
466
467 /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
468 ///
469 /// # Example
470 /// ```ignore,no_run
471 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
472 /// use google_cloud_deploy_v1::model::PipelineCondition;
473 /// let x = DeliveryPipeline::new().set_condition(PipelineCondition::default()/* use setters */);
474 /// ```
475 pub fn set_condition<T>(mut self, v: T) -> Self
476 where
477 T: std::convert::Into<crate::model::PipelineCondition>,
478 {
479 self.condition = std::option::Option::Some(v.into());
480 self
481 }
482
483 /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
484 ///
485 /// # Example
486 /// ```ignore,no_run
487 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
488 /// use google_cloud_deploy_v1::model::PipelineCondition;
489 /// let x = DeliveryPipeline::new().set_or_clear_condition(Some(PipelineCondition::default()/* use setters */));
490 /// let x = DeliveryPipeline::new().set_or_clear_condition(None::<PipelineCondition>);
491 /// ```
492 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
493 where
494 T: std::convert::Into<crate::model::PipelineCondition>,
495 {
496 self.condition = v.map(|x| x.into());
497 self
498 }
499
500 /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
501 ///
502 /// # Example
503 /// ```ignore,no_run
504 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
505 /// let x = DeliveryPipeline::new().set_etag("example");
506 /// ```
507 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
508 self.etag = v.into();
509 self
510 }
511
512 /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
513 ///
514 /// # Example
515 /// ```ignore,no_run
516 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
517 /// let x = DeliveryPipeline::new().set_suspended(true);
518 /// ```
519 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
520 self.suspended = v.into();
521 self
522 }
523
524 /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
525 ///
526 /// Note that all the setters affecting `pipeline` are mutually
527 /// exclusive.
528 ///
529 /// # Example
530 /// ```ignore,no_run
531 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
532 /// use google_cloud_deploy_v1::model::SerialPipeline;
533 /// let x = DeliveryPipeline::new().set_pipeline(Some(
534 /// google_cloud_deploy_v1::model::delivery_pipeline::Pipeline::SerialPipeline(SerialPipeline::default().into())));
535 /// ```
536 pub fn set_pipeline<
537 T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
538 >(
539 mut self,
540 v: T,
541 ) -> Self {
542 self.pipeline = v.into();
543 self
544 }
545
546 /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
547 /// if it holds a `SerialPipeline`, `None` if the field is not set or
548 /// holds a different branch.
549 pub fn serial_pipeline(
550 &self,
551 ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
552 #[allow(unreachable_patterns)]
553 self.pipeline.as_ref().and_then(|v| match v {
554 crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
555 std::option::Option::Some(v)
556 }
557 _ => std::option::Option::None,
558 })
559 }
560
561 /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
562 /// to hold a `SerialPipeline`.
563 ///
564 /// Note that all the setters affecting `pipeline` are
565 /// mutually exclusive.
566 ///
567 /// # Example
568 /// ```ignore,no_run
569 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
570 /// use google_cloud_deploy_v1::model::SerialPipeline;
571 /// let x = DeliveryPipeline::new().set_serial_pipeline(SerialPipeline::default()/* use setters */);
572 /// assert!(x.serial_pipeline().is_some());
573 /// ```
574 pub fn set_serial_pipeline<
575 T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
576 >(
577 mut self,
578 v: T,
579 ) -> Self {
580 self.pipeline = std::option::Option::Some(
581 crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
582 );
583 self
584 }
585}
586
587impl wkt::message::Message for DeliveryPipeline {
588 fn typename() -> &'static str {
589 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
590 }
591}
592
593/// Defines additional types related to [DeliveryPipeline].
594pub mod delivery_pipeline {
595 #[allow(unused_imports)]
596 use super::*;
597
598 /// The ordering configuration of the `DeliveryPipeline`.
599 #[derive(Clone, Debug, PartialEq)]
600 #[non_exhaustive]
601 pub enum Pipeline {
602 /// Optional. SerialPipeline defines a sequential set of stages for a
603 /// `DeliveryPipeline`.
604 SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
605 }
606}
607
608/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
609#[derive(Clone, Default, PartialEq)]
610#[non_exhaustive]
611pub struct SerialPipeline {
612 /// Optional. Each stage specifies configuration for a `Target`. The ordering
613 /// of this list defines the promotion flow.
614 pub stages: std::vec::Vec<crate::model::Stage>,
615
616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
617}
618
619impl SerialPipeline {
620 pub fn new() -> Self {
621 std::default::Default::default()
622 }
623
624 /// Sets the value of [stages][crate::model::SerialPipeline::stages].
625 ///
626 /// # Example
627 /// ```ignore,no_run
628 /// # use google_cloud_deploy_v1::model::SerialPipeline;
629 /// use google_cloud_deploy_v1::model::Stage;
630 /// let x = SerialPipeline::new()
631 /// .set_stages([
632 /// Stage::default()/* use setters */,
633 /// Stage::default()/* use (different) setters */,
634 /// ]);
635 /// ```
636 pub fn set_stages<T, V>(mut self, v: T) -> Self
637 where
638 T: std::iter::IntoIterator<Item = V>,
639 V: std::convert::Into<crate::model::Stage>,
640 {
641 use std::iter::Iterator;
642 self.stages = v.into_iter().map(|i| i.into()).collect();
643 self
644 }
645}
646
647impl wkt::message::Message for SerialPipeline {
648 fn typename() -> &'static str {
649 "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
650 }
651}
652
653/// Stage specifies a location to which to deploy.
654#[derive(Clone, Default, PartialEq)]
655#[non_exhaustive]
656pub struct Stage {
657 /// Optional. The target_id to which this stage points. This field refers
658 /// exclusively to the last segment of a target name. For example, this field
659 /// would just be `my-target` (rather than
660 /// `projects/project/locations/location/targets/my-target`). The location of
661 /// the `Target` is inferred to be the same as the location of the
662 /// `DeliveryPipeline` that contains this `Stage`.
663 pub target_id: std::string::String,
664
665 /// Optional. Skaffold profiles to use when rendering the manifest for this
666 /// stage's `Target`.
667 pub profiles: std::vec::Vec<std::string::String>,
668
669 /// Optional. The strategy to use for a `Rollout` to this stage.
670 pub strategy: std::option::Option<crate::model::Strategy>,
671
672 /// Optional. The deploy parameters to use for the target in this stage.
673 pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
674
675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
676}
677
678impl Stage {
679 pub fn new() -> Self {
680 std::default::Default::default()
681 }
682
683 /// Sets the value of [target_id][crate::model::Stage::target_id].
684 ///
685 /// # Example
686 /// ```ignore,no_run
687 /// # use google_cloud_deploy_v1::model::Stage;
688 /// let x = Stage::new().set_target_id("example");
689 /// ```
690 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
691 self.target_id = v.into();
692 self
693 }
694
695 /// Sets the value of [profiles][crate::model::Stage::profiles].
696 ///
697 /// # Example
698 /// ```ignore,no_run
699 /// # use google_cloud_deploy_v1::model::Stage;
700 /// let x = Stage::new().set_profiles(["a", "b", "c"]);
701 /// ```
702 pub fn set_profiles<T, V>(mut self, v: T) -> Self
703 where
704 T: std::iter::IntoIterator<Item = V>,
705 V: std::convert::Into<std::string::String>,
706 {
707 use std::iter::Iterator;
708 self.profiles = v.into_iter().map(|i| i.into()).collect();
709 self
710 }
711
712 /// Sets the value of [strategy][crate::model::Stage::strategy].
713 ///
714 /// # Example
715 /// ```ignore,no_run
716 /// # use google_cloud_deploy_v1::model::Stage;
717 /// use google_cloud_deploy_v1::model::Strategy;
718 /// let x = Stage::new().set_strategy(Strategy::default()/* use setters */);
719 /// ```
720 pub fn set_strategy<T>(mut self, v: T) -> Self
721 where
722 T: std::convert::Into<crate::model::Strategy>,
723 {
724 self.strategy = std::option::Option::Some(v.into());
725 self
726 }
727
728 /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
729 ///
730 /// # Example
731 /// ```ignore,no_run
732 /// # use google_cloud_deploy_v1::model::Stage;
733 /// use google_cloud_deploy_v1::model::Strategy;
734 /// let x = Stage::new().set_or_clear_strategy(Some(Strategy::default()/* use setters */));
735 /// let x = Stage::new().set_or_clear_strategy(None::<Strategy>);
736 /// ```
737 pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
738 where
739 T: std::convert::Into<crate::model::Strategy>,
740 {
741 self.strategy = v.map(|x| x.into());
742 self
743 }
744
745 /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
746 ///
747 /// # Example
748 /// ```ignore,no_run
749 /// # use google_cloud_deploy_v1::model::Stage;
750 /// use google_cloud_deploy_v1::model::DeployParameters;
751 /// let x = Stage::new()
752 /// .set_deploy_parameters([
753 /// DeployParameters::default()/* use setters */,
754 /// DeployParameters::default()/* use (different) setters */,
755 /// ]);
756 /// ```
757 pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
758 where
759 T: std::iter::IntoIterator<Item = V>,
760 V: std::convert::Into<crate::model::DeployParameters>,
761 {
762 use std::iter::Iterator;
763 self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
764 self
765 }
766}
767
768impl wkt::message::Message for Stage {
769 fn typename() -> &'static str {
770 "type.googleapis.com/google.cloud.deploy.v1.Stage"
771 }
772}
773
774/// DeployParameters contains deploy parameters information.
775#[derive(Clone, Default, PartialEq)]
776#[non_exhaustive]
777pub struct DeployParameters {
778 /// Required. Values are deploy parameters in key-value pairs.
779 pub values: std::collections::HashMap<std::string::String, std::string::String>,
780
781 /// Optional. Deploy parameters are applied to targets with match labels.
782 /// If unspecified, deploy parameters are applied to all targets (including
783 /// child targets of a multi-target).
784 pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
785
786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
787}
788
789impl DeployParameters {
790 pub fn new() -> Self {
791 std::default::Default::default()
792 }
793
794 /// Sets the value of [values][crate::model::DeployParameters::values].
795 ///
796 /// # Example
797 /// ```ignore,no_run
798 /// # use google_cloud_deploy_v1::model::DeployParameters;
799 /// let x = DeployParameters::new().set_values([
800 /// ("key0", "abc"),
801 /// ("key1", "xyz"),
802 /// ]);
803 /// ```
804 pub fn set_values<T, K, V>(mut self, v: T) -> Self
805 where
806 T: std::iter::IntoIterator<Item = (K, V)>,
807 K: std::convert::Into<std::string::String>,
808 V: std::convert::Into<std::string::String>,
809 {
810 use std::iter::Iterator;
811 self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
812 self
813 }
814
815 /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
816 ///
817 /// # Example
818 /// ```ignore,no_run
819 /// # use google_cloud_deploy_v1::model::DeployParameters;
820 /// let x = DeployParameters::new().set_match_target_labels([
821 /// ("key0", "abc"),
822 /// ("key1", "xyz"),
823 /// ]);
824 /// ```
825 pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
826 where
827 T: std::iter::IntoIterator<Item = (K, V)>,
828 K: std::convert::Into<std::string::String>,
829 V: std::convert::Into<std::string::String>,
830 {
831 use std::iter::Iterator;
832 self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
833 self
834 }
835}
836
837impl wkt::message::Message for DeployParameters {
838 fn typename() -> &'static str {
839 "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
840 }
841}
842
843/// Strategy contains deployment strategy information.
844#[derive(Clone, Default, PartialEq)]
845#[non_exhaustive]
846pub struct Strategy {
847 /// Deployment strategy details.
848 pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
849
850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
851}
852
853impl Strategy {
854 pub fn new() -> Self {
855 std::default::Default::default()
856 }
857
858 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
859 ///
860 /// Note that all the setters affecting `deployment_strategy` are mutually
861 /// exclusive.
862 ///
863 /// # Example
864 /// ```ignore,no_run
865 /// # use google_cloud_deploy_v1::model::Strategy;
866 /// use google_cloud_deploy_v1::model::Standard;
867 /// let x = Strategy::new().set_deployment_strategy(Some(
868 /// google_cloud_deploy_v1::model::strategy::DeploymentStrategy::Standard(Standard::default().into())));
869 /// ```
870 pub fn set_deployment_strategy<
871 T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
872 >(
873 mut self,
874 v: T,
875 ) -> Self {
876 self.deployment_strategy = v.into();
877 self
878 }
879
880 /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
881 /// if it holds a `Standard`, `None` if the field is not set or
882 /// holds a different branch.
883 pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
884 #[allow(unreachable_patterns)]
885 self.deployment_strategy.as_ref().and_then(|v| match v {
886 crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
887 _ => std::option::Option::None,
888 })
889 }
890
891 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
892 /// to hold a `Standard`.
893 ///
894 /// Note that all the setters affecting `deployment_strategy` are
895 /// mutually exclusive.
896 ///
897 /// # Example
898 /// ```ignore,no_run
899 /// # use google_cloud_deploy_v1::model::Strategy;
900 /// use google_cloud_deploy_v1::model::Standard;
901 /// let x = Strategy::new().set_standard(Standard::default()/* use setters */);
902 /// assert!(x.standard().is_some());
903 /// assert!(x.canary().is_none());
904 /// ```
905 pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
906 mut self,
907 v: T,
908 ) -> Self {
909 self.deployment_strategy = std::option::Option::Some(
910 crate::model::strategy::DeploymentStrategy::Standard(v.into()),
911 );
912 self
913 }
914
915 /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
916 /// if it holds a `Canary`, `None` if the field is not set or
917 /// holds a different branch.
918 pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
919 #[allow(unreachable_patterns)]
920 self.deployment_strategy.as_ref().and_then(|v| match v {
921 crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
922 _ => std::option::Option::None,
923 })
924 }
925
926 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
927 /// to hold a `Canary`.
928 ///
929 /// Note that all the setters affecting `deployment_strategy` are
930 /// mutually exclusive.
931 ///
932 /// # Example
933 /// ```ignore,no_run
934 /// # use google_cloud_deploy_v1::model::Strategy;
935 /// use google_cloud_deploy_v1::model::Canary;
936 /// let x = Strategy::new().set_canary(Canary::default()/* use setters */);
937 /// assert!(x.canary().is_some());
938 /// assert!(x.standard().is_none());
939 /// ```
940 pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
941 mut self,
942 v: T,
943 ) -> Self {
944 self.deployment_strategy =
945 std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
946 self
947 }
948}
949
950impl wkt::message::Message for Strategy {
951 fn typename() -> &'static str {
952 "type.googleapis.com/google.cloud.deploy.v1.Strategy"
953 }
954}
955
956/// Defines additional types related to [Strategy].
957pub mod strategy {
958 #[allow(unused_imports)]
959 use super::*;
960
961 /// Deployment strategy details.
962 #[derive(Clone, Debug, PartialEq)]
963 #[non_exhaustive]
964 pub enum DeploymentStrategy {
965 /// Optional. Standard deployment strategy executes a single deploy and
966 /// allows verifying the deployment.
967 Standard(std::boxed::Box<crate::model::Standard>),
968 /// Optional. Canary deployment strategy provides progressive percentage
969 /// based deployments to a Target.
970 Canary(std::boxed::Box<crate::model::Canary>),
971 }
972}
973
974/// Predeploy contains the predeploy job configuration information.
975#[derive(Clone, Default, PartialEq)]
976#[non_exhaustive]
977pub struct Predeploy {
978 /// Optional. A sequence of Skaffold custom actions to invoke during execution
979 /// of the predeploy job.
980 pub actions: std::vec::Vec<std::string::String>,
981
982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
983}
984
985impl Predeploy {
986 pub fn new() -> Self {
987 std::default::Default::default()
988 }
989
990 /// Sets the value of [actions][crate::model::Predeploy::actions].
991 ///
992 /// # Example
993 /// ```ignore,no_run
994 /// # use google_cloud_deploy_v1::model::Predeploy;
995 /// let x = Predeploy::new().set_actions(["a", "b", "c"]);
996 /// ```
997 pub fn set_actions<T, V>(mut self, v: T) -> Self
998 where
999 T: std::iter::IntoIterator<Item = V>,
1000 V: std::convert::Into<std::string::String>,
1001 {
1002 use std::iter::Iterator;
1003 self.actions = v.into_iter().map(|i| i.into()).collect();
1004 self
1005 }
1006}
1007
1008impl wkt::message::Message for Predeploy {
1009 fn typename() -> &'static str {
1010 "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
1011 }
1012}
1013
1014/// Postdeploy contains the postdeploy job configuration information.
1015#[derive(Clone, Default, PartialEq)]
1016#[non_exhaustive]
1017pub struct Postdeploy {
1018 /// Optional. A sequence of Skaffold custom actions to invoke during execution
1019 /// of the postdeploy job.
1020 pub actions: std::vec::Vec<std::string::String>,
1021
1022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1023}
1024
1025impl Postdeploy {
1026 pub fn new() -> Self {
1027 std::default::Default::default()
1028 }
1029
1030 /// Sets the value of [actions][crate::model::Postdeploy::actions].
1031 ///
1032 /// # Example
1033 /// ```ignore,no_run
1034 /// # use google_cloud_deploy_v1::model::Postdeploy;
1035 /// let x = Postdeploy::new().set_actions(["a", "b", "c"]);
1036 /// ```
1037 pub fn set_actions<T, V>(mut self, v: T) -> Self
1038 where
1039 T: std::iter::IntoIterator<Item = V>,
1040 V: std::convert::Into<std::string::String>,
1041 {
1042 use std::iter::Iterator;
1043 self.actions = v.into_iter().map(|i| i.into()).collect();
1044 self
1045 }
1046}
1047
1048impl wkt::message::Message for Postdeploy {
1049 fn typename() -> &'static str {
1050 "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
1051 }
1052}
1053
1054/// Standard represents the standard deployment strategy.
1055#[derive(Clone, Default, PartialEq)]
1056#[non_exhaustive]
1057pub struct Standard {
1058 /// Optional. Whether to verify a deployment via `skaffold verify`.
1059 pub verify: bool,
1060
1061 /// Optional. Configuration for the predeploy job. If this is not configured,
1062 /// the predeploy job will not be present.
1063 pub predeploy: std::option::Option<crate::model::Predeploy>,
1064
1065 /// Optional. Configuration for the postdeploy job. If this is not configured,
1066 /// the postdeploy job will not be present.
1067 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1068
1069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1070}
1071
1072impl Standard {
1073 pub fn new() -> Self {
1074 std::default::Default::default()
1075 }
1076
1077 /// Sets the value of [verify][crate::model::Standard::verify].
1078 ///
1079 /// # Example
1080 /// ```ignore,no_run
1081 /// # use google_cloud_deploy_v1::model::Standard;
1082 /// let x = Standard::new().set_verify(true);
1083 /// ```
1084 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1085 self.verify = v.into();
1086 self
1087 }
1088
1089 /// Sets the value of [predeploy][crate::model::Standard::predeploy].
1090 ///
1091 /// # Example
1092 /// ```ignore,no_run
1093 /// # use google_cloud_deploy_v1::model::Standard;
1094 /// use google_cloud_deploy_v1::model::Predeploy;
1095 /// let x = Standard::new().set_predeploy(Predeploy::default()/* use setters */);
1096 /// ```
1097 pub fn set_predeploy<T>(mut self, v: T) -> Self
1098 where
1099 T: std::convert::Into<crate::model::Predeploy>,
1100 {
1101 self.predeploy = std::option::Option::Some(v.into());
1102 self
1103 }
1104
1105 /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
1106 ///
1107 /// # Example
1108 /// ```ignore,no_run
1109 /// # use google_cloud_deploy_v1::model::Standard;
1110 /// use google_cloud_deploy_v1::model::Predeploy;
1111 /// let x = Standard::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1112 /// let x = Standard::new().set_or_clear_predeploy(None::<Predeploy>);
1113 /// ```
1114 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1115 where
1116 T: std::convert::Into<crate::model::Predeploy>,
1117 {
1118 self.predeploy = v.map(|x| x.into());
1119 self
1120 }
1121
1122 /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
1123 ///
1124 /// # Example
1125 /// ```ignore,no_run
1126 /// # use google_cloud_deploy_v1::model::Standard;
1127 /// use google_cloud_deploy_v1::model::Postdeploy;
1128 /// let x = Standard::new().set_postdeploy(Postdeploy::default()/* use setters */);
1129 /// ```
1130 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1131 where
1132 T: std::convert::Into<crate::model::Postdeploy>,
1133 {
1134 self.postdeploy = std::option::Option::Some(v.into());
1135 self
1136 }
1137
1138 /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
1139 ///
1140 /// # Example
1141 /// ```ignore,no_run
1142 /// # use google_cloud_deploy_v1::model::Standard;
1143 /// use google_cloud_deploy_v1::model::Postdeploy;
1144 /// let x = Standard::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1145 /// let x = Standard::new().set_or_clear_postdeploy(None::<Postdeploy>);
1146 /// ```
1147 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1148 where
1149 T: std::convert::Into<crate::model::Postdeploy>,
1150 {
1151 self.postdeploy = v.map(|x| x.into());
1152 self
1153 }
1154}
1155
1156impl wkt::message::Message for Standard {
1157 fn typename() -> &'static str {
1158 "type.googleapis.com/google.cloud.deploy.v1.Standard"
1159 }
1160}
1161
1162/// Canary represents the canary deployment strategy.
1163#[derive(Clone, Default, PartialEq)]
1164#[non_exhaustive]
1165pub struct Canary {
1166 /// Optional. Runtime specific configurations for the deployment strategy. The
1167 /// runtime configuration is used to determine how Cloud Deploy will split
1168 /// traffic to enable a progressive deployment.
1169 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1170
1171 /// The mode to use for the canary deployment strategy.
1172 pub mode: std::option::Option<crate::model::canary::Mode>,
1173
1174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1175}
1176
1177impl Canary {
1178 pub fn new() -> Self {
1179 std::default::Default::default()
1180 }
1181
1182 /// Sets the value of [runtime_config][crate::model::Canary::runtime_config].
1183 ///
1184 /// # Example
1185 /// ```ignore,no_run
1186 /// # use google_cloud_deploy_v1::model::Canary;
1187 /// use google_cloud_deploy_v1::model::RuntimeConfig;
1188 /// let x = Canary::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
1189 /// ```
1190 pub fn set_runtime_config<T>(mut self, v: T) -> Self
1191 where
1192 T: std::convert::Into<crate::model::RuntimeConfig>,
1193 {
1194 self.runtime_config = std::option::Option::Some(v.into());
1195 self
1196 }
1197
1198 /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
1199 ///
1200 /// # Example
1201 /// ```ignore,no_run
1202 /// # use google_cloud_deploy_v1::model::Canary;
1203 /// use google_cloud_deploy_v1::model::RuntimeConfig;
1204 /// let x = Canary::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
1205 /// let x = Canary::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
1206 /// ```
1207 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1208 where
1209 T: std::convert::Into<crate::model::RuntimeConfig>,
1210 {
1211 self.runtime_config = v.map(|x| x.into());
1212 self
1213 }
1214
1215 /// Sets the value of [mode][crate::model::Canary::mode].
1216 ///
1217 /// Note that all the setters affecting `mode` are mutually
1218 /// exclusive.
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_deploy_v1::model::Canary;
1223 /// use google_cloud_deploy_v1::model::CanaryDeployment;
1224 /// let x = Canary::new().set_mode(Some(
1225 /// google_cloud_deploy_v1::model::canary::Mode::CanaryDeployment(CanaryDeployment::default().into())));
1226 /// ```
1227 pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
1228 mut self,
1229 v: T,
1230 ) -> Self {
1231 self.mode = v.into();
1232 self
1233 }
1234
1235 /// The value of [mode][crate::model::Canary::mode]
1236 /// if it holds a `CanaryDeployment`, `None` if the field is not set or
1237 /// holds a different branch.
1238 pub fn canary_deployment(
1239 &self,
1240 ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
1241 #[allow(unreachable_patterns)]
1242 self.mode.as_ref().and_then(|v| match v {
1243 crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
1244 _ => std::option::Option::None,
1245 })
1246 }
1247
1248 /// Sets the value of [mode][crate::model::Canary::mode]
1249 /// to hold a `CanaryDeployment`.
1250 ///
1251 /// Note that all the setters affecting `mode` are
1252 /// mutually exclusive.
1253 ///
1254 /// # Example
1255 /// ```ignore,no_run
1256 /// # use google_cloud_deploy_v1::model::Canary;
1257 /// use google_cloud_deploy_v1::model::CanaryDeployment;
1258 /// let x = Canary::new().set_canary_deployment(CanaryDeployment::default()/* use setters */);
1259 /// assert!(x.canary_deployment().is_some());
1260 /// assert!(x.custom_canary_deployment().is_none());
1261 /// ```
1262 pub fn set_canary_deployment<
1263 T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
1264 >(
1265 mut self,
1266 v: T,
1267 ) -> Self {
1268 self.mode =
1269 std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
1270 self
1271 }
1272
1273 /// The value of [mode][crate::model::Canary::mode]
1274 /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
1275 /// holds a different branch.
1276 pub fn custom_canary_deployment(
1277 &self,
1278 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
1279 #[allow(unreachable_patterns)]
1280 self.mode.as_ref().and_then(|v| match v {
1281 crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
1282 _ => std::option::Option::None,
1283 })
1284 }
1285
1286 /// Sets the value of [mode][crate::model::Canary::mode]
1287 /// to hold a `CustomCanaryDeployment`.
1288 ///
1289 /// Note that all the setters affecting `mode` are
1290 /// mutually exclusive.
1291 ///
1292 /// # Example
1293 /// ```ignore,no_run
1294 /// # use google_cloud_deploy_v1::model::Canary;
1295 /// use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1296 /// let x = Canary::new().set_custom_canary_deployment(CustomCanaryDeployment::default()/* use setters */);
1297 /// assert!(x.custom_canary_deployment().is_some());
1298 /// assert!(x.canary_deployment().is_none());
1299 /// ```
1300 pub fn set_custom_canary_deployment<
1301 T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
1302 >(
1303 mut self,
1304 v: T,
1305 ) -> Self {
1306 self.mode =
1307 std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
1308 self
1309 }
1310}
1311
1312impl wkt::message::Message for Canary {
1313 fn typename() -> &'static str {
1314 "type.googleapis.com/google.cloud.deploy.v1.Canary"
1315 }
1316}
1317
1318/// Defines additional types related to [Canary].
1319pub mod canary {
1320 #[allow(unused_imports)]
1321 use super::*;
1322
1323 /// The mode to use for the canary deployment strategy.
1324 #[derive(Clone, Debug, PartialEq)]
1325 #[non_exhaustive]
1326 pub enum Mode {
1327 /// Optional. Configures the progressive based deployment for a Target.
1328 CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
1329 /// Optional. Configures the progressive based deployment for a Target, but
1330 /// allows customizing at the phase level where a phase represents each of
1331 /// the percentage deployments.
1332 CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
1333 }
1334}
1335
1336/// CanaryDeployment represents the canary deployment configuration
1337#[derive(Clone, Default, PartialEq)]
1338#[non_exhaustive]
1339pub struct CanaryDeployment {
1340 /// Required. The percentage based deployments that will occur as a part of a
1341 /// `Rollout`. List is expected in ascending order and each integer n is
1342 /// 0 <= n < 100.
1343 /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
1344 /// n is 0 <= n <= 100.
1345 pub percentages: std::vec::Vec<i32>,
1346
1347 /// Optional. Whether to run verify tests after each percentage deployment via
1348 /// `skaffold verify`.
1349 pub verify: bool,
1350
1351 /// Optional. Configuration for the predeploy job of the first phase. If this
1352 /// is not configured, there will be no predeploy job for this phase.
1353 pub predeploy: std::option::Option<crate::model::Predeploy>,
1354
1355 /// Optional. Configuration for the postdeploy job of the last phase. If this
1356 /// is not configured, there will be no postdeploy job for this phase.
1357 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1358
1359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1360}
1361
1362impl CanaryDeployment {
1363 pub fn new() -> Self {
1364 std::default::Default::default()
1365 }
1366
1367 /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1368 ///
1369 /// # Example
1370 /// ```ignore,no_run
1371 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1372 /// let x = CanaryDeployment::new().set_percentages([1, 2, 3]);
1373 /// ```
1374 pub fn set_percentages<T, V>(mut self, v: T) -> Self
1375 where
1376 T: std::iter::IntoIterator<Item = V>,
1377 V: std::convert::Into<i32>,
1378 {
1379 use std::iter::Iterator;
1380 self.percentages = v.into_iter().map(|i| i.into()).collect();
1381 self
1382 }
1383
1384 /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1385 ///
1386 /// # Example
1387 /// ```ignore,no_run
1388 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1389 /// let x = CanaryDeployment::new().set_verify(true);
1390 /// ```
1391 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1392 self.verify = v.into();
1393 self
1394 }
1395
1396 /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1397 ///
1398 /// # Example
1399 /// ```ignore,no_run
1400 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1401 /// use google_cloud_deploy_v1::model::Predeploy;
1402 /// let x = CanaryDeployment::new().set_predeploy(Predeploy::default()/* use setters */);
1403 /// ```
1404 pub fn set_predeploy<T>(mut self, v: T) -> Self
1405 where
1406 T: std::convert::Into<crate::model::Predeploy>,
1407 {
1408 self.predeploy = std::option::Option::Some(v.into());
1409 self
1410 }
1411
1412 /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1413 ///
1414 /// # Example
1415 /// ```ignore,no_run
1416 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1417 /// use google_cloud_deploy_v1::model::Predeploy;
1418 /// let x = CanaryDeployment::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1419 /// let x = CanaryDeployment::new().set_or_clear_predeploy(None::<Predeploy>);
1420 /// ```
1421 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1422 where
1423 T: std::convert::Into<crate::model::Predeploy>,
1424 {
1425 self.predeploy = v.map(|x| x.into());
1426 self
1427 }
1428
1429 /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1430 ///
1431 /// # Example
1432 /// ```ignore,no_run
1433 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1434 /// use google_cloud_deploy_v1::model::Postdeploy;
1435 /// let x = CanaryDeployment::new().set_postdeploy(Postdeploy::default()/* use setters */);
1436 /// ```
1437 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1438 where
1439 T: std::convert::Into<crate::model::Postdeploy>,
1440 {
1441 self.postdeploy = std::option::Option::Some(v.into());
1442 self
1443 }
1444
1445 /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1446 ///
1447 /// # Example
1448 /// ```ignore,no_run
1449 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1450 /// use google_cloud_deploy_v1::model::Postdeploy;
1451 /// let x = CanaryDeployment::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1452 /// let x = CanaryDeployment::new().set_or_clear_postdeploy(None::<Postdeploy>);
1453 /// ```
1454 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1455 where
1456 T: std::convert::Into<crate::model::Postdeploy>,
1457 {
1458 self.postdeploy = v.map(|x| x.into());
1459 self
1460 }
1461}
1462
1463impl wkt::message::Message for CanaryDeployment {
1464 fn typename() -> &'static str {
1465 "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1466 }
1467}
1468
1469/// CustomCanaryDeployment represents the custom canary deployment
1470/// configuration.
1471#[derive(Clone, Default, PartialEq)]
1472#[non_exhaustive]
1473pub struct CustomCanaryDeployment {
1474 /// Required. Configuration for each phase in the canary deployment in the
1475 /// order executed.
1476 pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1477
1478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1479}
1480
1481impl CustomCanaryDeployment {
1482 pub fn new() -> Self {
1483 std::default::Default::default()
1484 }
1485
1486 /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1487 ///
1488 /// # Example
1489 /// ```ignore,no_run
1490 /// # use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1491 /// use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1492 /// let x = CustomCanaryDeployment::new()
1493 /// .set_phase_configs([
1494 /// PhaseConfig::default()/* use setters */,
1495 /// PhaseConfig::default()/* use (different) setters */,
1496 /// ]);
1497 /// ```
1498 pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1499 where
1500 T: std::iter::IntoIterator<Item = V>,
1501 V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1502 {
1503 use std::iter::Iterator;
1504 self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1505 self
1506 }
1507}
1508
1509impl wkt::message::Message for CustomCanaryDeployment {
1510 fn typename() -> &'static str {
1511 "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1512 }
1513}
1514
1515/// Defines additional types related to [CustomCanaryDeployment].
1516pub mod custom_canary_deployment {
1517 #[allow(unused_imports)]
1518 use super::*;
1519
1520 /// PhaseConfig represents the configuration for a phase in the custom
1521 /// canary deployment.
1522 #[derive(Clone, Default, PartialEq)]
1523 #[non_exhaustive]
1524 pub struct PhaseConfig {
1525 /// Required. The ID to assign to the `Rollout` phase.
1526 /// This value must consist of lower-case letters, numbers, and hyphens,
1527 /// start with a letter and end with a letter or a number, and have a max
1528 /// length of 63 characters. In other words, it must match the following
1529 /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1530 pub phase_id: std::string::String,
1531
1532 /// Required. Percentage deployment for the phase.
1533 pub percentage: i32,
1534
1535 /// Optional. Skaffold profiles to use when rendering the manifest for this
1536 /// phase. These are in addition to the profiles list specified in the
1537 /// `DeliveryPipeline` stage.
1538 pub profiles: std::vec::Vec<std::string::String>,
1539
1540 /// Optional. Whether to run verify tests after the deployment via `skaffold
1541 /// verify`.
1542 pub verify: bool,
1543
1544 /// Optional. Configuration for the predeploy job of this phase. If this is
1545 /// not configured, there will be no predeploy job for this phase.
1546 pub predeploy: std::option::Option<crate::model::Predeploy>,
1547
1548 /// Optional. Configuration for the postdeploy job of this phase. If this is
1549 /// not configured, there will be no postdeploy job for this phase.
1550 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1551
1552 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1553 }
1554
1555 impl PhaseConfig {
1556 pub fn new() -> Self {
1557 std::default::Default::default()
1558 }
1559
1560 /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1561 ///
1562 /// # Example
1563 /// ```ignore,no_run
1564 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1565 /// let x = PhaseConfig::new().set_phase_id("example");
1566 /// ```
1567 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.phase_id = v.into();
1569 self
1570 }
1571
1572 /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1573 ///
1574 /// # Example
1575 /// ```ignore,no_run
1576 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1577 /// let x = PhaseConfig::new().set_percentage(42);
1578 /// ```
1579 pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1580 self.percentage = v.into();
1581 self
1582 }
1583
1584 /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1585 ///
1586 /// # Example
1587 /// ```ignore,no_run
1588 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1589 /// let x = PhaseConfig::new().set_profiles(["a", "b", "c"]);
1590 /// ```
1591 pub fn set_profiles<T, V>(mut self, v: T) -> Self
1592 where
1593 T: std::iter::IntoIterator<Item = V>,
1594 V: std::convert::Into<std::string::String>,
1595 {
1596 use std::iter::Iterator;
1597 self.profiles = v.into_iter().map(|i| i.into()).collect();
1598 self
1599 }
1600
1601 /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1602 ///
1603 /// # Example
1604 /// ```ignore,no_run
1605 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1606 /// let x = PhaseConfig::new().set_verify(true);
1607 /// ```
1608 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1609 self.verify = v.into();
1610 self
1611 }
1612
1613 /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1614 ///
1615 /// # Example
1616 /// ```ignore,no_run
1617 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1618 /// use google_cloud_deploy_v1::model::Predeploy;
1619 /// let x = PhaseConfig::new().set_predeploy(Predeploy::default()/* use setters */);
1620 /// ```
1621 pub fn set_predeploy<T>(mut self, v: T) -> Self
1622 where
1623 T: std::convert::Into<crate::model::Predeploy>,
1624 {
1625 self.predeploy = std::option::Option::Some(v.into());
1626 self
1627 }
1628
1629 /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1630 ///
1631 /// # Example
1632 /// ```ignore,no_run
1633 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1634 /// use google_cloud_deploy_v1::model::Predeploy;
1635 /// let x = PhaseConfig::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1636 /// let x = PhaseConfig::new().set_or_clear_predeploy(None::<Predeploy>);
1637 /// ```
1638 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1639 where
1640 T: std::convert::Into<crate::model::Predeploy>,
1641 {
1642 self.predeploy = v.map(|x| x.into());
1643 self
1644 }
1645
1646 /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1647 ///
1648 /// # Example
1649 /// ```ignore,no_run
1650 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1651 /// use google_cloud_deploy_v1::model::Postdeploy;
1652 /// let x = PhaseConfig::new().set_postdeploy(Postdeploy::default()/* use setters */);
1653 /// ```
1654 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1655 where
1656 T: std::convert::Into<crate::model::Postdeploy>,
1657 {
1658 self.postdeploy = std::option::Option::Some(v.into());
1659 self
1660 }
1661
1662 /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1663 ///
1664 /// # Example
1665 /// ```ignore,no_run
1666 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1667 /// use google_cloud_deploy_v1::model::Postdeploy;
1668 /// let x = PhaseConfig::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1669 /// let x = PhaseConfig::new().set_or_clear_postdeploy(None::<Postdeploy>);
1670 /// ```
1671 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1672 where
1673 T: std::convert::Into<crate::model::Postdeploy>,
1674 {
1675 self.postdeploy = v.map(|x| x.into());
1676 self
1677 }
1678 }
1679
1680 impl wkt::message::Message for PhaseConfig {
1681 fn typename() -> &'static str {
1682 "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1683 }
1684 }
1685}
1686
1687/// KubernetesConfig contains the Kubernetes runtime configuration.
1688#[derive(Clone, Default, PartialEq)]
1689#[non_exhaustive]
1690pub struct KubernetesConfig {
1691 /// The service definition configuration.
1692 pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1693
1694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1695}
1696
1697impl KubernetesConfig {
1698 pub fn new() -> Self {
1699 std::default::Default::default()
1700 }
1701
1702 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1703 ///
1704 /// Note that all the setters affecting `service_definition` are mutually
1705 /// exclusive.
1706 ///
1707 /// # Example
1708 /// ```ignore,no_run
1709 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1710 /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1711 /// let x = KubernetesConfig::new().set_service_definition(Some(
1712 /// google_cloud_deploy_v1::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(GatewayServiceMesh::default().into())));
1713 /// ```
1714 pub fn set_service_definition<
1715 T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1716 >(
1717 mut self,
1718 v: T,
1719 ) -> Self {
1720 self.service_definition = v.into();
1721 self
1722 }
1723
1724 /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1725 /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1726 /// holds a different branch.
1727 pub fn gateway_service_mesh(
1728 &self,
1729 ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1730 {
1731 #[allow(unreachable_patterns)]
1732 self.service_definition.as_ref().and_then(|v| match v {
1733 crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1734 std::option::Option::Some(v)
1735 }
1736 _ => std::option::Option::None,
1737 })
1738 }
1739
1740 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1741 /// to hold a `GatewayServiceMesh`.
1742 ///
1743 /// Note that all the setters affecting `service_definition` are
1744 /// mutually exclusive.
1745 ///
1746 /// # Example
1747 /// ```ignore,no_run
1748 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1749 /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1750 /// let x = KubernetesConfig::new().set_gateway_service_mesh(GatewayServiceMesh::default()/* use setters */);
1751 /// assert!(x.gateway_service_mesh().is_some());
1752 /// assert!(x.service_networking().is_none());
1753 /// ```
1754 pub fn set_gateway_service_mesh<
1755 T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1756 >(
1757 mut self,
1758 v: T,
1759 ) -> Self {
1760 self.service_definition = std::option::Option::Some(
1761 crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1762 );
1763 self
1764 }
1765
1766 /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1767 /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1768 /// holds a different branch.
1769 pub fn service_networking(
1770 &self,
1771 ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1772 {
1773 #[allow(unreachable_patterns)]
1774 self.service_definition.as_ref().and_then(|v| match v {
1775 crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1776 std::option::Option::Some(v)
1777 }
1778 _ => std::option::Option::None,
1779 })
1780 }
1781
1782 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1783 /// to hold a `ServiceNetworking`.
1784 ///
1785 /// Note that all the setters affecting `service_definition` are
1786 /// mutually exclusive.
1787 ///
1788 /// # Example
1789 /// ```ignore,no_run
1790 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1791 /// use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
1792 /// let x = KubernetesConfig::new().set_service_networking(ServiceNetworking::default()/* use setters */);
1793 /// assert!(x.service_networking().is_some());
1794 /// assert!(x.gateway_service_mesh().is_none());
1795 /// ```
1796 pub fn set_service_networking<
1797 T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1798 >(
1799 mut self,
1800 v: T,
1801 ) -> Self {
1802 self.service_definition = std::option::Option::Some(
1803 crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1804 );
1805 self
1806 }
1807}
1808
1809impl wkt::message::Message for KubernetesConfig {
1810 fn typename() -> &'static str {
1811 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1812 }
1813}
1814
1815/// Defines additional types related to [KubernetesConfig].
1816pub mod kubernetes_config {
1817 #[allow(unused_imports)]
1818 use super::*;
1819
1820 /// Information about the Kubernetes Gateway API service mesh configuration.
1821 #[derive(Clone, Default, PartialEq)]
1822 #[non_exhaustive]
1823 pub struct GatewayServiceMesh {
1824 /// Required. Name of the Gateway API HTTPRoute.
1825 pub http_route: std::string::String,
1826
1827 /// Required. Name of the Kubernetes Service.
1828 pub service: std::string::String,
1829
1830 /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1831 /// the specified HTTPRoute and Service.
1832 pub deployment: std::string::String,
1833
1834 /// Optional. The time to wait for route updates to propagate. The maximum
1835 /// configurable time is 3 hours, in seconds format. If unspecified, there is
1836 /// no wait time.
1837 pub route_update_wait_time: std::option::Option<wkt::Duration>,
1838
1839 /// Optional. The amount of time to migrate traffic back from the canary
1840 /// Service to the original Service during the stable phase deployment. If
1841 /// specified, must be between 15s and 3600s. If unspecified, there is no
1842 /// cutback time.
1843 pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1844
1845 /// Optional. The label to use when selecting Pods for the Deployment and
1846 /// Service resources. This label must already be present in both resources.
1847 pub pod_selector_label: std::string::String,
1848
1849 /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1850 /// to be deployed to additional clusters. This option is available for
1851 /// multi-cluster service mesh set ups that require the route to exist in the
1852 /// clusters that call the service. If unspecified, the HTTPRoute will only
1853 /// be deployed to the Target cluster.
1854 pub route_destinations: std::option::Option<
1855 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1856 >,
1857
1858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1859 }
1860
1861 impl GatewayServiceMesh {
1862 pub fn new() -> Self {
1863 std::default::Default::default()
1864 }
1865
1866 /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1867 ///
1868 /// # Example
1869 /// ```ignore,no_run
1870 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1871 /// let x = GatewayServiceMesh::new().set_http_route("example");
1872 /// ```
1873 pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1874 self.http_route = v.into();
1875 self
1876 }
1877
1878 /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1879 ///
1880 /// # Example
1881 /// ```ignore,no_run
1882 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1883 /// let x = GatewayServiceMesh::new().set_service("example");
1884 /// ```
1885 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1886 self.service = v.into();
1887 self
1888 }
1889
1890 /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1891 ///
1892 /// # Example
1893 /// ```ignore,no_run
1894 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1895 /// let x = GatewayServiceMesh::new().set_deployment("example");
1896 /// ```
1897 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1898 self.deployment = v.into();
1899 self
1900 }
1901
1902 /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1903 ///
1904 /// # Example
1905 /// ```ignore,no_run
1906 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1907 /// use wkt::Duration;
1908 /// let x = GatewayServiceMesh::new().set_route_update_wait_time(Duration::default()/* use setters */);
1909 /// ```
1910 pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1911 where
1912 T: std::convert::Into<wkt::Duration>,
1913 {
1914 self.route_update_wait_time = std::option::Option::Some(v.into());
1915 self
1916 }
1917
1918 /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1919 ///
1920 /// # Example
1921 /// ```ignore,no_run
1922 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1923 /// use wkt::Duration;
1924 /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(Some(Duration::default()/* use setters */));
1925 /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(None::<Duration>);
1926 /// ```
1927 pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1928 where
1929 T: std::convert::Into<wkt::Duration>,
1930 {
1931 self.route_update_wait_time = v.map(|x| x.into());
1932 self
1933 }
1934
1935 /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1936 ///
1937 /// # Example
1938 /// ```ignore,no_run
1939 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1940 /// use wkt::Duration;
1941 /// let x = GatewayServiceMesh::new().set_stable_cutback_duration(Duration::default()/* use setters */);
1942 /// ```
1943 pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1944 where
1945 T: std::convert::Into<wkt::Duration>,
1946 {
1947 self.stable_cutback_duration = std::option::Option::Some(v.into());
1948 self
1949 }
1950
1951 /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1952 ///
1953 /// # Example
1954 /// ```ignore,no_run
1955 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1956 /// use wkt::Duration;
1957 /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(Some(Duration::default()/* use setters */));
1958 /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(None::<Duration>);
1959 /// ```
1960 pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1961 where
1962 T: std::convert::Into<wkt::Duration>,
1963 {
1964 self.stable_cutback_duration = v.map(|x| x.into());
1965 self
1966 }
1967
1968 /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1969 ///
1970 /// # Example
1971 /// ```ignore,no_run
1972 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1973 /// let x = GatewayServiceMesh::new().set_pod_selector_label("example");
1974 /// ```
1975 pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1976 mut self,
1977 v: T,
1978 ) -> Self {
1979 self.pod_selector_label = v.into();
1980 self
1981 }
1982
1983 /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
1984 ///
1985 /// # Example
1986 /// ```ignore,no_run
1987 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1988 /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
1989 /// let x = GatewayServiceMesh::new().set_route_destinations(RouteDestinations::default()/* use setters */);
1990 /// ```
1991 pub fn set_route_destinations<T>(mut self, v: T) -> Self
1992 where
1993 T: std::convert::Into<
1994 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1995 >,
1996 {
1997 self.route_destinations = std::option::Option::Some(v.into());
1998 self
1999 }
2000
2001 /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2002 ///
2003 /// # Example
2004 /// ```ignore,no_run
2005 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2006 /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2007 /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(Some(RouteDestinations::default()/* use setters */));
2008 /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(None::<RouteDestinations>);
2009 /// ```
2010 pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
2011 where
2012 T: std::convert::Into<
2013 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2014 >,
2015 {
2016 self.route_destinations = v.map(|x| x.into());
2017 self
2018 }
2019 }
2020
2021 impl wkt::message::Message for GatewayServiceMesh {
2022 fn typename() -> &'static str {
2023 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
2024 }
2025 }
2026
2027 /// Defines additional types related to [GatewayServiceMesh].
2028 pub mod gateway_service_mesh {
2029 #[allow(unused_imports)]
2030 use super::*;
2031
2032 /// Information about route destinations for the Gateway API service mesh.
2033 #[derive(Clone, Default, PartialEq)]
2034 #[non_exhaustive]
2035 pub struct RouteDestinations {
2036 /// Required. The clusters where the Gateway API HTTPRoute resource will be
2037 /// deployed to. Valid entries include the associated entities IDs
2038 /// configured in the Target resource and "@self" to include the Target
2039 /// cluster.
2040 pub destination_ids: std::vec::Vec<std::string::String>,
2041
2042 /// Optional. Whether to propagate the Kubernetes Service to the route
2043 /// destination clusters. The Service will always be deployed to the Target
2044 /// cluster even if the HTTPRoute is not. This option may be used to
2045 /// facilitate successful DNS lookup in the route destination clusters. Can
2046 /// only be set to true if destinations are specified.
2047 pub propagate_service: bool,
2048
2049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2050 }
2051
2052 impl RouteDestinations {
2053 pub fn new() -> Self {
2054 std::default::Default::default()
2055 }
2056
2057 /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
2058 ///
2059 /// # Example
2060 /// ```ignore,no_run
2061 /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2062 /// let x = RouteDestinations::new().set_destination_ids(["a", "b", "c"]);
2063 /// ```
2064 pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
2065 where
2066 T: std::iter::IntoIterator<Item = V>,
2067 V: std::convert::Into<std::string::String>,
2068 {
2069 use std::iter::Iterator;
2070 self.destination_ids = v.into_iter().map(|i| i.into()).collect();
2071 self
2072 }
2073
2074 /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
2075 ///
2076 /// # Example
2077 /// ```ignore,no_run
2078 /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2079 /// let x = RouteDestinations::new().set_propagate_service(true);
2080 /// ```
2081 pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2082 self.propagate_service = v.into();
2083 self
2084 }
2085 }
2086
2087 impl wkt::message::Message for RouteDestinations {
2088 fn typename() -> &'static str {
2089 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
2090 }
2091 }
2092 }
2093
2094 /// Information about the Kubernetes Service networking configuration.
2095 #[derive(Clone, Default, PartialEq)]
2096 #[non_exhaustive]
2097 pub struct ServiceNetworking {
2098 /// Required. Name of the Kubernetes Service.
2099 pub service: std::string::String,
2100
2101 /// Required. Name of the Kubernetes Deployment whose traffic is managed by
2102 /// the specified Service.
2103 pub deployment: std::string::String,
2104
2105 /// Optional. Whether to disable Pod overprovisioning. If Pod
2106 /// overprovisioning is disabled then Cloud Deploy will limit the number of
2107 /// total Pods used for the deployment strategy to the number of Pods the
2108 /// Deployment has on the cluster.
2109 pub disable_pod_overprovisioning: bool,
2110
2111 /// Optional. The label to use when selecting Pods for the Deployment
2112 /// resource. This label must already be present in the Deployment.
2113 pub pod_selector_label: std::string::String,
2114
2115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2116 }
2117
2118 impl ServiceNetworking {
2119 pub fn new() -> Self {
2120 std::default::Default::default()
2121 }
2122
2123 /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
2124 ///
2125 /// # Example
2126 /// ```ignore,no_run
2127 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2128 /// let x = ServiceNetworking::new().set_service("example");
2129 /// ```
2130 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2131 self.service = v.into();
2132 self
2133 }
2134
2135 /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
2136 ///
2137 /// # Example
2138 /// ```ignore,no_run
2139 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2140 /// let x = ServiceNetworking::new().set_deployment("example");
2141 /// ```
2142 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2143 self.deployment = v.into();
2144 self
2145 }
2146
2147 /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
2148 ///
2149 /// # Example
2150 /// ```ignore,no_run
2151 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2152 /// let x = ServiceNetworking::new().set_disable_pod_overprovisioning(true);
2153 /// ```
2154 pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
2155 mut self,
2156 v: T,
2157 ) -> Self {
2158 self.disable_pod_overprovisioning = v.into();
2159 self
2160 }
2161
2162 /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
2163 ///
2164 /// # Example
2165 /// ```ignore,no_run
2166 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2167 /// let x = ServiceNetworking::new().set_pod_selector_label("example");
2168 /// ```
2169 pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
2170 mut self,
2171 v: T,
2172 ) -> Self {
2173 self.pod_selector_label = v.into();
2174 self
2175 }
2176 }
2177
2178 impl wkt::message::Message for ServiceNetworking {
2179 fn typename() -> &'static str {
2180 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
2181 }
2182 }
2183
2184 /// The service definition configuration.
2185 #[derive(Clone, Debug, PartialEq)]
2186 #[non_exhaustive]
2187 pub enum ServiceDefinition {
2188 /// Optional. Kubernetes Gateway API service mesh configuration.
2189 GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
2190 /// Optional. Kubernetes Service networking configuration.
2191 ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
2192 }
2193}
2194
2195/// CloudRunConfig contains the Cloud Run runtime configuration.
2196#[derive(Clone, Default, PartialEq)]
2197#[non_exhaustive]
2198pub struct CloudRunConfig {
2199 /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
2200 /// Run Service on the user's behalf to facilitate traffic splitting. This is
2201 /// required to be true for CanaryDeployments, but optional for
2202 /// CustomCanaryDeployments.
2203 pub automatic_traffic_control: bool,
2204
2205 /// Optional. A list of tags that are added to the canary revision while the
2206 /// canary phase is in progress.
2207 pub canary_revision_tags: std::vec::Vec<std::string::String>,
2208
2209 /// Optional. A list of tags that are added to the prior revision while the
2210 /// canary phase is in progress.
2211 pub prior_revision_tags: std::vec::Vec<std::string::String>,
2212
2213 /// Optional. A list of tags that are added to the final stable revision when
2214 /// the stable phase is applied.
2215 pub stable_revision_tags: std::vec::Vec<std::string::String>,
2216
2217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2218}
2219
2220impl CloudRunConfig {
2221 pub fn new() -> Self {
2222 std::default::Default::default()
2223 }
2224
2225 /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
2226 ///
2227 /// # Example
2228 /// ```ignore,no_run
2229 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2230 /// let x = CloudRunConfig::new().set_automatic_traffic_control(true);
2231 /// ```
2232 pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2233 self.automatic_traffic_control = v.into();
2234 self
2235 }
2236
2237 /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
2238 ///
2239 /// # Example
2240 /// ```ignore,no_run
2241 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2242 /// let x = CloudRunConfig::new().set_canary_revision_tags(["a", "b", "c"]);
2243 /// ```
2244 pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
2245 where
2246 T: std::iter::IntoIterator<Item = V>,
2247 V: std::convert::Into<std::string::String>,
2248 {
2249 use std::iter::Iterator;
2250 self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
2251 self
2252 }
2253
2254 /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
2255 ///
2256 /// # Example
2257 /// ```ignore,no_run
2258 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2259 /// let x = CloudRunConfig::new().set_prior_revision_tags(["a", "b", "c"]);
2260 /// ```
2261 pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
2262 where
2263 T: std::iter::IntoIterator<Item = V>,
2264 V: std::convert::Into<std::string::String>,
2265 {
2266 use std::iter::Iterator;
2267 self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
2268 self
2269 }
2270
2271 /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
2272 ///
2273 /// # Example
2274 /// ```ignore,no_run
2275 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2276 /// let x = CloudRunConfig::new().set_stable_revision_tags(["a", "b", "c"]);
2277 /// ```
2278 pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
2279 where
2280 T: std::iter::IntoIterator<Item = V>,
2281 V: std::convert::Into<std::string::String>,
2282 {
2283 use std::iter::Iterator;
2284 self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
2285 self
2286 }
2287}
2288
2289impl wkt::message::Message for CloudRunConfig {
2290 fn typename() -> &'static str {
2291 "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
2292 }
2293}
2294
2295/// RuntimeConfig contains the runtime specific configurations for a deployment
2296/// strategy.
2297#[derive(Clone, Default, PartialEq)]
2298#[non_exhaustive]
2299pub struct RuntimeConfig {
2300 /// The runtime configuration details.
2301 pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
2302
2303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2304}
2305
2306impl RuntimeConfig {
2307 pub fn new() -> Self {
2308 std::default::Default::default()
2309 }
2310
2311 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
2312 ///
2313 /// Note that all the setters affecting `runtime_config` are mutually
2314 /// exclusive.
2315 ///
2316 /// # Example
2317 /// ```ignore,no_run
2318 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2319 /// use google_cloud_deploy_v1::model::KubernetesConfig;
2320 /// let x = RuntimeConfig::new().set_runtime_config(Some(
2321 /// google_cloud_deploy_v1::model::runtime_config::RuntimeConfig::Kubernetes(KubernetesConfig::default().into())));
2322 /// ```
2323 pub fn set_runtime_config<
2324 T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
2325 >(
2326 mut self,
2327 v: T,
2328 ) -> Self {
2329 self.runtime_config = v.into();
2330 self
2331 }
2332
2333 /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2334 /// if it holds a `Kubernetes`, `None` if the field is not set or
2335 /// holds a different branch.
2336 pub fn kubernetes(
2337 &self,
2338 ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
2339 #[allow(unreachable_patterns)]
2340 self.runtime_config.as_ref().and_then(|v| match v {
2341 crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
2342 std::option::Option::Some(v)
2343 }
2344 _ => std::option::Option::None,
2345 })
2346 }
2347
2348 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2349 /// to hold a `Kubernetes`.
2350 ///
2351 /// Note that all the setters affecting `runtime_config` are
2352 /// mutually exclusive.
2353 ///
2354 /// # Example
2355 /// ```ignore,no_run
2356 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2357 /// use google_cloud_deploy_v1::model::KubernetesConfig;
2358 /// let x = RuntimeConfig::new().set_kubernetes(KubernetesConfig::default()/* use setters */);
2359 /// assert!(x.kubernetes().is_some());
2360 /// assert!(x.cloud_run().is_none());
2361 /// ```
2362 pub fn set_kubernetes<
2363 T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
2364 >(
2365 mut self,
2366 v: T,
2367 ) -> Self {
2368 self.runtime_config = std::option::Option::Some(
2369 crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
2370 );
2371 self
2372 }
2373
2374 /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2375 /// if it holds a `CloudRun`, `None` if the field is not set or
2376 /// holds a different branch.
2377 pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
2378 #[allow(unreachable_patterns)]
2379 self.runtime_config.as_ref().and_then(|v| match v {
2380 crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
2381 std::option::Option::Some(v)
2382 }
2383 _ => std::option::Option::None,
2384 })
2385 }
2386
2387 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2388 /// to hold a `CloudRun`.
2389 ///
2390 /// Note that all the setters affecting `runtime_config` are
2391 /// mutually exclusive.
2392 ///
2393 /// # Example
2394 /// ```ignore,no_run
2395 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2396 /// use google_cloud_deploy_v1::model::CloudRunConfig;
2397 /// let x = RuntimeConfig::new().set_cloud_run(CloudRunConfig::default()/* use setters */);
2398 /// assert!(x.cloud_run().is_some());
2399 /// assert!(x.kubernetes().is_none());
2400 /// ```
2401 pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
2402 mut self,
2403 v: T,
2404 ) -> Self {
2405 self.runtime_config = std::option::Option::Some(
2406 crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
2407 );
2408 self
2409 }
2410}
2411
2412impl wkt::message::Message for RuntimeConfig {
2413 fn typename() -> &'static str {
2414 "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
2415 }
2416}
2417
2418/// Defines additional types related to [RuntimeConfig].
2419pub mod runtime_config {
2420 #[allow(unused_imports)]
2421 use super::*;
2422
2423 /// The runtime configuration details.
2424 #[derive(Clone, Debug, PartialEq)]
2425 #[non_exhaustive]
2426 pub enum RuntimeConfig {
2427 /// Optional. Kubernetes runtime configuration.
2428 Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
2429 /// Optional. Cloud Run runtime configuration.
2430 CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
2431 }
2432}
2433
2434/// PipelineReadyCondition contains information around the status of the
2435/// Pipeline.
2436#[derive(Clone, Default, PartialEq)]
2437#[non_exhaustive]
2438pub struct PipelineReadyCondition {
2439 /// True if the Pipeline is in a valid state. Otherwise at least one condition
2440 /// in `PipelineCondition` is in an invalid state. Iterate over those
2441 /// conditions and see which condition(s) has status = false to find out what
2442 /// is wrong with the Pipeline.
2443 pub status: bool,
2444
2445 /// Last time the condition was updated.
2446 pub update_time: std::option::Option<wkt::Timestamp>,
2447
2448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2449}
2450
2451impl PipelineReadyCondition {
2452 pub fn new() -> Self {
2453 std::default::Default::default()
2454 }
2455
2456 /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
2457 ///
2458 /// # Example
2459 /// ```ignore,no_run
2460 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2461 /// let x = PipelineReadyCondition::new().set_status(true);
2462 /// ```
2463 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2464 self.status = v.into();
2465 self
2466 }
2467
2468 /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2469 ///
2470 /// # Example
2471 /// ```ignore,no_run
2472 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2473 /// use wkt::Timestamp;
2474 /// let x = PipelineReadyCondition::new().set_update_time(Timestamp::default()/* use setters */);
2475 /// ```
2476 pub fn set_update_time<T>(mut self, v: T) -> Self
2477 where
2478 T: std::convert::Into<wkt::Timestamp>,
2479 {
2480 self.update_time = std::option::Option::Some(v.into());
2481 self
2482 }
2483
2484 /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2485 ///
2486 /// # Example
2487 /// ```ignore,no_run
2488 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2489 /// use wkt::Timestamp;
2490 /// let x = PipelineReadyCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2491 /// let x = PipelineReadyCondition::new().set_or_clear_update_time(None::<Timestamp>);
2492 /// ```
2493 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2494 where
2495 T: std::convert::Into<wkt::Timestamp>,
2496 {
2497 self.update_time = v.map(|x| x.into());
2498 self
2499 }
2500}
2501
2502impl wkt::message::Message for PipelineReadyCondition {
2503 fn typename() -> &'static str {
2504 "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
2505 }
2506}
2507
2508/// `TargetsPresentCondition` contains information on any Targets referenced in
2509/// the Delivery Pipeline that do not actually exist.
2510#[derive(Clone, Default, PartialEq)]
2511#[non_exhaustive]
2512pub struct TargetsPresentCondition {
2513 /// True if there aren't any missing Targets.
2514 pub status: bool,
2515
2516 /// The list of Target names that do not exist. For example,
2517 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
2518 pub missing_targets: std::vec::Vec<std::string::String>,
2519
2520 /// Last time the condition was updated.
2521 pub update_time: std::option::Option<wkt::Timestamp>,
2522
2523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2524}
2525
2526impl TargetsPresentCondition {
2527 pub fn new() -> Self {
2528 std::default::Default::default()
2529 }
2530
2531 /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
2532 ///
2533 /// # Example
2534 /// ```ignore,no_run
2535 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2536 /// let x = TargetsPresentCondition::new().set_status(true);
2537 /// ```
2538 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2539 self.status = v.into();
2540 self
2541 }
2542
2543 /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
2544 ///
2545 /// # Example
2546 /// ```ignore,no_run
2547 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2548 /// let x = TargetsPresentCondition::new().set_missing_targets(["a", "b", "c"]);
2549 /// ```
2550 pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
2551 where
2552 T: std::iter::IntoIterator<Item = V>,
2553 V: std::convert::Into<std::string::String>,
2554 {
2555 use std::iter::Iterator;
2556 self.missing_targets = v.into_iter().map(|i| i.into()).collect();
2557 self
2558 }
2559
2560 /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2561 ///
2562 /// # Example
2563 /// ```ignore,no_run
2564 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2565 /// use wkt::Timestamp;
2566 /// let x = TargetsPresentCondition::new().set_update_time(Timestamp::default()/* use setters */);
2567 /// ```
2568 pub fn set_update_time<T>(mut self, v: T) -> Self
2569 where
2570 T: std::convert::Into<wkt::Timestamp>,
2571 {
2572 self.update_time = std::option::Option::Some(v.into());
2573 self
2574 }
2575
2576 /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2577 ///
2578 /// # Example
2579 /// ```ignore,no_run
2580 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2581 /// use wkt::Timestamp;
2582 /// let x = TargetsPresentCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2583 /// let x = TargetsPresentCondition::new().set_or_clear_update_time(None::<Timestamp>);
2584 /// ```
2585 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2586 where
2587 T: std::convert::Into<wkt::Timestamp>,
2588 {
2589 self.update_time = v.map(|x| x.into());
2590 self
2591 }
2592}
2593
2594impl wkt::message::Message for TargetsPresentCondition {
2595 fn typename() -> &'static str {
2596 "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
2597 }
2598}
2599
2600/// TargetsTypeCondition contains information on whether the Targets defined in
2601/// the Delivery Pipeline are of the same type.
2602#[derive(Clone, Default, PartialEq)]
2603#[non_exhaustive]
2604pub struct TargetsTypeCondition {
2605 /// True if the targets are all a comparable type. For example this is true if
2606 /// all targets are GKE clusters. This is false if some targets are Cloud Run
2607 /// targets and others are GKE clusters.
2608 pub status: bool,
2609
2610 /// Human readable error message.
2611 pub error_details: std::string::String,
2612
2613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2614}
2615
2616impl TargetsTypeCondition {
2617 pub fn new() -> Self {
2618 std::default::Default::default()
2619 }
2620
2621 /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
2622 ///
2623 /// # Example
2624 /// ```ignore,no_run
2625 /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2626 /// let x = TargetsTypeCondition::new().set_status(true);
2627 /// ```
2628 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2629 self.status = v.into();
2630 self
2631 }
2632
2633 /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
2634 ///
2635 /// # Example
2636 /// ```ignore,no_run
2637 /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2638 /// let x = TargetsTypeCondition::new().set_error_details("example");
2639 /// ```
2640 pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2641 self.error_details = v.into();
2642 self
2643 }
2644}
2645
2646impl wkt::message::Message for TargetsTypeCondition {
2647 fn typename() -> &'static str {
2648 "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
2649 }
2650}
2651
2652/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
2653#[derive(Clone, Default, PartialEq)]
2654#[non_exhaustive]
2655pub struct PipelineCondition {
2656 /// Details around the Pipeline's overall status.
2657 pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
2658
2659 /// Details around targets enumerated in the pipeline.
2660 pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
2661
2662 /// Details on the whether the targets enumerated in the pipeline are of the
2663 /// same type.
2664 pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
2665
2666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2667}
2668
2669impl PipelineCondition {
2670 pub fn new() -> Self {
2671 std::default::Default::default()
2672 }
2673
2674 /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2675 ///
2676 /// # Example
2677 /// ```ignore,no_run
2678 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2679 /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2680 /// let x = PipelineCondition::new().set_pipeline_ready_condition(PipelineReadyCondition::default()/* use setters */);
2681 /// ```
2682 pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
2683 where
2684 T: std::convert::Into<crate::model::PipelineReadyCondition>,
2685 {
2686 self.pipeline_ready_condition = std::option::Option::Some(v.into());
2687 self
2688 }
2689
2690 /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2691 ///
2692 /// # Example
2693 /// ```ignore,no_run
2694 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2695 /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2696 /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(Some(PipelineReadyCondition::default()/* use setters */));
2697 /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(None::<PipelineReadyCondition>);
2698 /// ```
2699 pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
2700 where
2701 T: std::convert::Into<crate::model::PipelineReadyCondition>,
2702 {
2703 self.pipeline_ready_condition = v.map(|x| x.into());
2704 self
2705 }
2706
2707 /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2708 ///
2709 /// # Example
2710 /// ```ignore,no_run
2711 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2712 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2713 /// let x = PipelineCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
2714 /// ```
2715 pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
2716 where
2717 T: std::convert::Into<crate::model::TargetsPresentCondition>,
2718 {
2719 self.targets_present_condition = std::option::Option::Some(v.into());
2720 self
2721 }
2722
2723 /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2724 ///
2725 /// # Example
2726 /// ```ignore,no_run
2727 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2728 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2729 /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
2730 /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
2731 /// ```
2732 pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
2733 where
2734 T: std::convert::Into<crate::model::TargetsPresentCondition>,
2735 {
2736 self.targets_present_condition = v.map(|x| x.into());
2737 self
2738 }
2739
2740 /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2741 ///
2742 /// # Example
2743 /// ```ignore,no_run
2744 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2745 /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2746 /// let x = PipelineCondition::new().set_targets_type_condition(TargetsTypeCondition::default()/* use setters */);
2747 /// ```
2748 pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2749 where
2750 T: std::convert::Into<crate::model::TargetsTypeCondition>,
2751 {
2752 self.targets_type_condition = std::option::Option::Some(v.into());
2753 self
2754 }
2755
2756 /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2757 ///
2758 /// # Example
2759 /// ```ignore,no_run
2760 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2761 /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2762 /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(Some(TargetsTypeCondition::default()/* use setters */));
2763 /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(None::<TargetsTypeCondition>);
2764 /// ```
2765 pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2766 where
2767 T: std::convert::Into<crate::model::TargetsTypeCondition>,
2768 {
2769 self.targets_type_condition = v.map(|x| x.into());
2770 self
2771 }
2772}
2773
2774impl wkt::message::Message for PipelineCondition {
2775 fn typename() -> &'static str {
2776 "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2777 }
2778}
2779
2780/// The request object for `ListDeliveryPipelines`.
2781#[derive(Clone, Default, PartialEq)]
2782#[non_exhaustive]
2783pub struct ListDeliveryPipelinesRequest {
2784 /// Required. The parent, which owns this collection of pipelines. Format must
2785 /// be `projects/{project_id}/locations/{location_name}`.
2786 pub parent: std::string::String,
2787
2788 /// The maximum number of pipelines to return. The service may return
2789 /// fewer than this value. If unspecified, at most 50 pipelines will
2790 /// be returned. The maximum value is 1000; values above 1000 will be set
2791 /// to 1000.
2792 pub page_size: i32,
2793
2794 /// A page token, received from a previous `ListDeliveryPipelines` call.
2795 /// Provide this to retrieve the subsequent page.
2796 ///
2797 /// When paginating, all other provided parameters match
2798 /// the call that provided the page token.
2799 pub page_token: std::string::String,
2800
2801 /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2802 /// details.
2803 pub filter: std::string::String,
2804
2805 /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2806 pub order_by: std::string::String,
2807
2808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2809}
2810
2811impl ListDeliveryPipelinesRequest {
2812 pub fn new() -> Self {
2813 std::default::Default::default()
2814 }
2815
2816 /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2817 ///
2818 /// # Example
2819 /// ```ignore,no_run
2820 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2821 /// let x = ListDeliveryPipelinesRequest::new().set_parent("example");
2822 /// ```
2823 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2824 self.parent = v.into();
2825 self
2826 }
2827
2828 /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2829 ///
2830 /// # Example
2831 /// ```ignore,no_run
2832 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2833 /// let x = ListDeliveryPipelinesRequest::new().set_page_size(42);
2834 /// ```
2835 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2836 self.page_size = v.into();
2837 self
2838 }
2839
2840 /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2841 ///
2842 /// # Example
2843 /// ```ignore,no_run
2844 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2845 /// let x = ListDeliveryPipelinesRequest::new().set_page_token("example");
2846 /// ```
2847 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2848 self.page_token = v.into();
2849 self
2850 }
2851
2852 /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2857 /// let x = ListDeliveryPipelinesRequest::new().set_filter("example");
2858 /// ```
2859 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2860 self.filter = v.into();
2861 self
2862 }
2863
2864 /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2865 ///
2866 /// # Example
2867 /// ```ignore,no_run
2868 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2869 /// let x = ListDeliveryPipelinesRequest::new().set_order_by("example");
2870 /// ```
2871 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2872 self.order_by = v.into();
2873 self
2874 }
2875}
2876
2877impl wkt::message::Message for ListDeliveryPipelinesRequest {
2878 fn typename() -> &'static str {
2879 "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2880 }
2881}
2882
2883/// The response object from `ListDeliveryPipelines`.
2884#[derive(Clone, Default, PartialEq)]
2885#[non_exhaustive]
2886pub struct ListDeliveryPipelinesResponse {
2887 /// The `DeliveryPipeline` objects.
2888 pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2889
2890 /// A token, which can be sent as `page_token` to retrieve the next page.
2891 /// If this field is omitted, there are no subsequent pages.
2892 pub next_page_token: std::string::String,
2893
2894 /// Locations that could not be reached.
2895 pub unreachable: std::vec::Vec<std::string::String>,
2896
2897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2898}
2899
2900impl ListDeliveryPipelinesResponse {
2901 pub fn new() -> Self {
2902 std::default::Default::default()
2903 }
2904
2905 /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2906 ///
2907 /// # Example
2908 /// ```ignore,no_run
2909 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2910 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
2911 /// let x = ListDeliveryPipelinesResponse::new()
2912 /// .set_delivery_pipelines([
2913 /// DeliveryPipeline::default()/* use setters */,
2914 /// DeliveryPipeline::default()/* use (different) setters */,
2915 /// ]);
2916 /// ```
2917 pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2918 where
2919 T: std::iter::IntoIterator<Item = V>,
2920 V: std::convert::Into<crate::model::DeliveryPipeline>,
2921 {
2922 use std::iter::Iterator;
2923 self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2924 self
2925 }
2926
2927 /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2928 ///
2929 /// # Example
2930 /// ```ignore,no_run
2931 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2932 /// let x = ListDeliveryPipelinesResponse::new().set_next_page_token("example");
2933 /// ```
2934 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2935 self.next_page_token = v.into();
2936 self
2937 }
2938
2939 /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2940 ///
2941 /// # Example
2942 /// ```ignore,no_run
2943 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2944 /// let x = ListDeliveryPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
2945 /// ```
2946 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2947 where
2948 T: std::iter::IntoIterator<Item = V>,
2949 V: std::convert::Into<std::string::String>,
2950 {
2951 use std::iter::Iterator;
2952 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2953 self
2954 }
2955}
2956
2957impl wkt::message::Message for ListDeliveryPipelinesResponse {
2958 fn typename() -> &'static str {
2959 "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2960 }
2961}
2962
2963#[doc(hidden)]
2964impl google_cloud_gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2965 type PageItem = crate::model::DeliveryPipeline;
2966
2967 fn items(self) -> std::vec::Vec<Self::PageItem> {
2968 self.delivery_pipelines
2969 }
2970
2971 fn next_page_token(&self) -> std::string::String {
2972 use std::clone::Clone;
2973 self.next_page_token.clone()
2974 }
2975}
2976
2977/// The request object for `GetDeliveryPipeline`
2978#[derive(Clone, Default, PartialEq)]
2979#[non_exhaustive]
2980pub struct GetDeliveryPipelineRequest {
2981 /// Required. Name of the `DeliveryPipeline`. Format must be
2982 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
2983 pub name: std::string::String,
2984
2985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2986}
2987
2988impl GetDeliveryPipelineRequest {
2989 pub fn new() -> Self {
2990 std::default::Default::default()
2991 }
2992
2993 /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
2994 ///
2995 /// # Example
2996 /// ```ignore,no_run
2997 /// # use google_cloud_deploy_v1::model::GetDeliveryPipelineRequest;
2998 /// let x = GetDeliveryPipelineRequest::new().set_name("example");
2999 /// ```
3000 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3001 self.name = v.into();
3002 self
3003 }
3004}
3005
3006impl wkt::message::Message for GetDeliveryPipelineRequest {
3007 fn typename() -> &'static str {
3008 "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
3009 }
3010}
3011
3012/// The request object for `CreateDeliveryPipeline`.
3013#[derive(Clone, Default, PartialEq)]
3014#[non_exhaustive]
3015pub struct CreateDeliveryPipelineRequest {
3016 /// Required. The parent collection in which the `DeliveryPipeline` must be
3017 /// created. The format is `projects/{project_id}/locations/{location_name}`.
3018 pub parent: std::string::String,
3019
3020 /// Required. ID of the `DeliveryPipeline`.
3021 pub delivery_pipeline_id: std::string::String,
3022
3023 /// Required. The `DeliveryPipeline` to create.
3024 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3025
3026 /// Optional. A request ID to identify requests. Specify a unique request ID
3027 /// so that if you must retry your request, the server knows to ignore the
3028 /// request if it has already been completed. The server guarantees that for
3029 /// at least 60 minutes after the first request.
3030 ///
3031 /// For example, consider a situation where you make an initial request and the
3032 /// request times out. If you make the request again with the same request ID,
3033 /// the server can check if original operation with the same request ID was
3034 /// received, and if so, will ignore the second request. This prevents clients
3035 /// from accidentally creating duplicate commitments.
3036 ///
3037 /// The request ID must be a valid UUID with the exception that zero UUID is
3038 /// not supported (00000000-0000-0000-0000-000000000000).
3039 pub request_id: std::string::String,
3040
3041 /// Optional. If set to true, the request is validated and the user is provided
3042 /// with an expected result, but no actual change is made.
3043 pub validate_only: bool,
3044
3045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3046}
3047
3048impl CreateDeliveryPipelineRequest {
3049 pub fn new() -> Self {
3050 std::default::Default::default()
3051 }
3052
3053 /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
3054 ///
3055 /// # Example
3056 /// ```ignore,no_run
3057 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3058 /// let x = CreateDeliveryPipelineRequest::new().set_parent("example");
3059 /// ```
3060 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3061 self.parent = v.into();
3062 self
3063 }
3064
3065 /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
3066 ///
3067 /// # Example
3068 /// ```ignore,no_run
3069 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3070 /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline_id("example");
3071 /// ```
3072 pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
3073 mut self,
3074 v: T,
3075 ) -> Self {
3076 self.delivery_pipeline_id = v.into();
3077 self
3078 }
3079
3080 /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3081 ///
3082 /// # Example
3083 /// ```ignore,no_run
3084 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3085 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3086 /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3087 /// ```
3088 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3089 where
3090 T: std::convert::Into<crate::model::DeliveryPipeline>,
3091 {
3092 self.delivery_pipeline = std::option::Option::Some(v.into());
3093 self
3094 }
3095
3096 /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3097 ///
3098 /// # Example
3099 /// ```ignore,no_run
3100 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3101 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3102 /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3103 /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3104 /// ```
3105 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3106 where
3107 T: std::convert::Into<crate::model::DeliveryPipeline>,
3108 {
3109 self.delivery_pipeline = v.map(|x| x.into());
3110 self
3111 }
3112
3113 /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
3114 ///
3115 /// # Example
3116 /// ```ignore,no_run
3117 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3118 /// let x = CreateDeliveryPipelineRequest::new().set_request_id("example");
3119 /// ```
3120 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3121 self.request_id = v.into();
3122 self
3123 }
3124
3125 /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
3126 ///
3127 /// # Example
3128 /// ```ignore,no_run
3129 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3130 /// let x = CreateDeliveryPipelineRequest::new().set_validate_only(true);
3131 /// ```
3132 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3133 self.validate_only = v.into();
3134 self
3135 }
3136}
3137
3138impl wkt::message::Message for CreateDeliveryPipelineRequest {
3139 fn typename() -> &'static str {
3140 "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
3141 }
3142}
3143
3144/// The request object for `UpdateDeliveryPipeline`.
3145#[derive(Clone, Default, PartialEq)]
3146#[non_exhaustive]
3147pub struct UpdateDeliveryPipelineRequest {
3148 /// Required. Field mask is used to specify the fields to be overwritten by the
3149 /// update in the `DeliveryPipeline` resource. The fields specified in the
3150 /// update_mask are relative to the resource, not the full request. A field
3151 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
3152 /// then all fields are overwritten.
3153 pub update_mask: std::option::Option<wkt::FieldMask>,
3154
3155 /// Required. The `DeliveryPipeline` to update.
3156 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3157
3158 /// Optional. A request ID to identify requests. Specify a unique request ID
3159 /// so that if you must retry your request, the server knows to ignore the
3160 /// request if it has already been completed. The server guarantees that for
3161 /// at least 60 minutes after the first request.
3162 ///
3163 /// For example, consider a situation where you make an initial request and the
3164 /// request times out. If you make the request again with the same request ID,
3165 /// the server can check if original operation with the same request ID was
3166 /// received, and if so, will ignore the second request. This prevents clients
3167 /// from accidentally creating duplicate commitments.
3168 ///
3169 /// The request ID must be a valid UUID with the exception that zero UUID is
3170 /// not supported (00000000-0000-0000-0000-000000000000).
3171 pub request_id: std::string::String,
3172
3173 /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
3174 /// will result in the creation of a new `DeliveryPipeline`.
3175 pub allow_missing: bool,
3176
3177 /// Optional. If set to true, the request is validated and the user is provided
3178 /// with an expected result, but no actual change is made.
3179 pub validate_only: bool,
3180
3181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3182}
3183
3184impl UpdateDeliveryPipelineRequest {
3185 pub fn new() -> Self {
3186 std::default::Default::default()
3187 }
3188
3189 /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3190 ///
3191 /// # Example
3192 /// ```ignore,no_run
3193 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3194 /// use wkt::FieldMask;
3195 /// let x = UpdateDeliveryPipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3196 /// ```
3197 pub fn set_update_mask<T>(mut self, v: T) -> Self
3198 where
3199 T: std::convert::Into<wkt::FieldMask>,
3200 {
3201 self.update_mask = std::option::Option::Some(v.into());
3202 self
3203 }
3204
3205 /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3206 ///
3207 /// # Example
3208 /// ```ignore,no_run
3209 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3210 /// use wkt::FieldMask;
3211 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3212 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3213 /// ```
3214 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3215 where
3216 T: std::convert::Into<wkt::FieldMask>,
3217 {
3218 self.update_mask = v.map(|x| x.into());
3219 self
3220 }
3221
3222 /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3223 ///
3224 /// # Example
3225 /// ```ignore,no_run
3226 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3227 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3228 /// let x = UpdateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3229 /// ```
3230 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3231 where
3232 T: std::convert::Into<crate::model::DeliveryPipeline>,
3233 {
3234 self.delivery_pipeline = std::option::Option::Some(v.into());
3235 self
3236 }
3237
3238 /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3239 ///
3240 /// # Example
3241 /// ```ignore,no_run
3242 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3243 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3244 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3245 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3246 /// ```
3247 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3248 where
3249 T: std::convert::Into<crate::model::DeliveryPipeline>,
3250 {
3251 self.delivery_pipeline = v.map(|x| x.into());
3252 self
3253 }
3254
3255 /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
3256 ///
3257 /// # Example
3258 /// ```ignore,no_run
3259 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3260 /// let x = UpdateDeliveryPipelineRequest::new().set_request_id("example");
3261 /// ```
3262 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3263 self.request_id = v.into();
3264 self
3265 }
3266
3267 /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
3268 ///
3269 /// # Example
3270 /// ```ignore,no_run
3271 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3272 /// let x = UpdateDeliveryPipelineRequest::new().set_allow_missing(true);
3273 /// ```
3274 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3275 self.allow_missing = v.into();
3276 self
3277 }
3278
3279 /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
3280 ///
3281 /// # Example
3282 /// ```ignore,no_run
3283 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3284 /// let x = UpdateDeliveryPipelineRequest::new().set_validate_only(true);
3285 /// ```
3286 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3287 self.validate_only = v.into();
3288 self
3289 }
3290}
3291
3292impl wkt::message::Message for UpdateDeliveryPipelineRequest {
3293 fn typename() -> &'static str {
3294 "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
3295 }
3296}
3297
3298/// The request object for `DeleteDeliveryPipeline`.
3299#[derive(Clone, Default, PartialEq)]
3300#[non_exhaustive]
3301pub struct DeleteDeliveryPipelineRequest {
3302 /// Required. The name of the `DeliveryPipeline` to delete. The format is
3303 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3304 pub name: std::string::String,
3305
3306 /// Optional. A request ID to identify requests. Specify a unique request ID
3307 /// so that if you must retry your request, the server knows to ignore the
3308 /// request if it has already been completed. The server guarantees that for
3309 /// at least 60 minutes after the first request.
3310 ///
3311 /// For example, consider a situation where you make an initial request and the
3312 /// request times out. If you make the request again with the same request ID,
3313 /// the server can check if original operation with the same request ID was
3314 /// received, and if so, will ignore the second request. This prevents clients
3315 /// from accidentally creating duplicate commitments.
3316 ///
3317 /// The request ID must be a valid UUID with the exception that zero UUID is
3318 /// not supported (00000000-0000-0000-0000-000000000000).
3319 pub request_id: std::string::String,
3320
3321 /// Optional. If set to true, then deleting an already deleted or non-existing
3322 /// `DeliveryPipeline` will succeed.
3323 pub allow_missing: bool,
3324
3325 /// Optional. If set, validate the request and preview the review, but do not
3326 /// actually post it.
3327 pub validate_only: bool,
3328
3329 /// Optional. If set to true, all child resources under this pipeline will also
3330 /// be deleted. Otherwise, the request will only work if the pipeline has no
3331 /// child resources.
3332 pub force: bool,
3333
3334 /// Optional. This checksum is computed by the server based on the value of
3335 /// other fields, and may be sent on update and delete requests to ensure the
3336 /// client has an up-to-date value before proceeding.
3337 pub etag: std::string::String,
3338
3339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3340}
3341
3342impl DeleteDeliveryPipelineRequest {
3343 pub fn new() -> Self {
3344 std::default::Default::default()
3345 }
3346
3347 /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
3348 ///
3349 /// # Example
3350 /// ```ignore,no_run
3351 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3352 /// let x = DeleteDeliveryPipelineRequest::new().set_name("example");
3353 /// ```
3354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3355 self.name = v.into();
3356 self
3357 }
3358
3359 /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
3360 ///
3361 /// # Example
3362 /// ```ignore,no_run
3363 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3364 /// let x = DeleteDeliveryPipelineRequest::new().set_request_id("example");
3365 /// ```
3366 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3367 self.request_id = v.into();
3368 self
3369 }
3370
3371 /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
3372 ///
3373 /// # Example
3374 /// ```ignore,no_run
3375 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3376 /// let x = DeleteDeliveryPipelineRequest::new().set_allow_missing(true);
3377 /// ```
3378 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3379 self.allow_missing = v.into();
3380 self
3381 }
3382
3383 /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
3384 ///
3385 /// # Example
3386 /// ```ignore,no_run
3387 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3388 /// let x = DeleteDeliveryPipelineRequest::new().set_validate_only(true);
3389 /// ```
3390 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3391 self.validate_only = v.into();
3392 self
3393 }
3394
3395 /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
3396 ///
3397 /// # Example
3398 /// ```ignore,no_run
3399 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3400 /// let x = DeleteDeliveryPipelineRequest::new().set_force(true);
3401 /// ```
3402 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3403 self.force = v.into();
3404 self
3405 }
3406
3407 /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
3408 ///
3409 /// # Example
3410 /// ```ignore,no_run
3411 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3412 /// let x = DeleteDeliveryPipelineRequest::new().set_etag("example");
3413 /// ```
3414 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415 self.etag = v.into();
3416 self
3417 }
3418}
3419
3420impl wkt::message::Message for DeleteDeliveryPipelineRequest {
3421 fn typename() -> &'static str {
3422 "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
3423 }
3424}
3425
3426/// Configs for the Rollback rollout.
3427#[derive(Clone, Default, PartialEq)]
3428#[non_exhaustive]
3429pub struct RollbackTargetConfig {
3430 /// Optional. The rollback `Rollout` to create.
3431 pub rollout: std::option::Option<crate::model::Rollout>,
3432
3433 /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
3434 /// `Rollout` will start in the stable phase.
3435 pub starting_phase_id: std::string::String,
3436
3437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3438}
3439
3440impl RollbackTargetConfig {
3441 pub fn new() -> Self {
3442 std::default::Default::default()
3443 }
3444
3445 /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3446 ///
3447 /// # Example
3448 /// ```ignore,no_run
3449 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3450 /// use google_cloud_deploy_v1::model::Rollout;
3451 /// let x = RollbackTargetConfig::new().set_rollout(Rollout::default()/* use setters */);
3452 /// ```
3453 pub fn set_rollout<T>(mut self, v: T) -> Self
3454 where
3455 T: std::convert::Into<crate::model::Rollout>,
3456 {
3457 self.rollout = std::option::Option::Some(v.into());
3458 self
3459 }
3460
3461 /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3462 ///
3463 /// # Example
3464 /// ```ignore,no_run
3465 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3466 /// use google_cloud_deploy_v1::model::Rollout;
3467 /// let x = RollbackTargetConfig::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
3468 /// let x = RollbackTargetConfig::new().set_or_clear_rollout(None::<Rollout>);
3469 /// ```
3470 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3471 where
3472 T: std::convert::Into<crate::model::Rollout>,
3473 {
3474 self.rollout = v.map(|x| x.into());
3475 self
3476 }
3477
3478 /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
3479 ///
3480 /// # Example
3481 /// ```ignore,no_run
3482 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3483 /// let x = RollbackTargetConfig::new().set_starting_phase_id("example");
3484 /// ```
3485 pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
3486 mut self,
3487 v: T,
3488 ) -> Self {
3489 self.starting_phase_id = v.into();
3490 self
3491 }
3492}
3493
3494impl wkt::message::Message for RollbackTargetConfig {
3495 fn typename() -> &'static str {
3496 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
3497 }
3498}
3499
3500/// The request object for `RollbackTarget`.
3501#[derive(Clone, Default, PartialEq)]
3502#[non_exhaustive]
3503pub struct RollbackTargetRequest {
3504 /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
3505 /// created. The format is
3506 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3507 pub name: std::string::String,
3508
3509 /// Required. ID of the `Target` that is being rolled back.
3510 pub target_id: std::string::String,
3511
3512 /// Required. ID of the rollback `Rollout` to create.
3513 pub rollout_id: std::string::String,
3514
3515 /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
3516 /// previous successful `Rollout` to the specified target will be used to
3517 /// determine the `Release`.
3518 pub release_id: std::string::String,
3519
3520 /// Optional. If provided, this must be the latest `Rollout` that is on the
3521 /// `Target`.
3522 pub rollout_to_roll_back: std::string::String,
3523
3524 /// Optional. Configs for the rollback `Rollout`.
3525 pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3526
3527 /// Optional. If set to true, the request is validated and the user is provided
3528 /// with a `RollbackTargetResponse`.
3529 pub validate_only: bool,
3530
3531 /// Optional. Deploy policies to override. Format is
3532 /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
3533 pub override_deploy_policy: std::vec::Vec<std::string::String>,
3534
3535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3536}
3537
3538impl RollbackTargetRequest {
3539 pub fn new() -> Self {
3540 std::default::Default::default()
3541 }
3542
3543 /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
3544 ///
3545 /// # Example
3546 /// ```ignore,no_run
3547 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3548 /// let x = RollbackTargetRequest::new().set_name("example");
3549 /// ```
3550 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3551 self.name = v.into();
3552 self
3553 }
3554
3555 /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
3556 ///
3557 /// # Example
3558 /// ```ignore,no_run
3559 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3560 /// let x = RollbackTargetRequest::new().set_target_id("example");
3561 /// ```
3562 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3563 self.target_id = v.into();
3564 self
3565 }
3566
3567 /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
3568 ///
3569 /// # Example
3570 /// ```ignore,no_run
3571 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3572 /// let x = RollbackTargetRequest::new().set_rollout_id("example");
3573 /// ```
3574 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3575 self.rollout_id = v.into();
3576 self
3577 }
3578
3579 /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
3580 ///
3581 /// # Example
3582 /// ```ignore,no_run
3583 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3584 /// let x = RollbackTargetRequest::new().set_release_id("example");
3585 /// ```
3586 pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3587 self.release_id = v.into();
3588 self
3589 }
3590
3591 /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
3592 ///
3593 /// # Example
3594 /// ```ignore,no_run
3595 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3596 /// let x = RollbackTargetRequest::new().set_rollout_to_roll_back("example");
3597 /// ```
3598 pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
3599 mut self,
3600 v: T,
3601 ) -> Self {
3602 self.rollout_to_roll_back = v.into();
3603 self
3604 }
3605
3606 /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3607 ///
3608 /// # Example
3609 /// ```ignore,no_run
3610 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3611 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3612 /// let x = RollbackTargetRequest::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3613 /// ```
3614 pub fn set_rollback_config<T>(mut self, v: T) -> Self
3615 where
3616 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3617 {
3618 self.rollback_config = std::option::Option::Some(v.into());
3619 self
3620 }
3621
3622 /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3623 ///
3624 /// # Example
3625 /// ```ignore,no_run
3626 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3627 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3628 /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3629 /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3630 /// ```
3631 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3632 where
3633 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3634 {
3635 self.rollback_config = v.map(|x| x.into());
3636 self
3637 }
3638
3639 /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
3640 ///
3641 /// # Example
3642 /// ```ignore,no_run
3643 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3644 /// let x = RollbackTargetRequest::new().set_validate_only(true);
3645 /// ```
3646 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3647 self.validate_only = v.into();
3648 self
3649 }
3650
3651 /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
3652 ///
3653 /// # Example
3654 /// ```ignore,no_run
3655 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3656 /// let x = RollbackTargetRequest::new().set_override_deploy_policy(["a", "b", "c"]);
3657 /// ```
3658 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3659 where
3660 T: std::iter::IntoIterator<Item = V>,
3661 V: std::convert::Into<std::string::String>,
3662 {
3663 use std::iter::Iterator;
3664 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3665 self
3666 }
3667}
3668
3669impl wkt::message::Message for RollbackTargetRequest {
3670 fn typename() -> &'static str {
3671 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
3672 }
3673}
3674
3675/// The response object from `RollbackTarget`.
3676#[derive(Clone, Default, PartialEq)]
3677#[non_exhaustive]
3678pub struct RollbackTargetResponse {
3679 /// The config of the rollback `Rollout` created or will be created.
3680 pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3681
3682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3683}
3684
3685impl RollbackTargetResponse {
3686 pub fn new() -> Self {
3687 std::default::Default::default()
3688 }
3689
3690 /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3691 ///
3692 /// # Example
3693 /// ```ignore,no_run
3694 /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3695 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3696 /// let x = RollbackTargetResponse::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3697 /// ```
3698 pub fn set_rollback_config<T>(mut self, v: T) -> Self
3699 where
3700 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3701 {
3702 self.rollback_config = std::option::Option::Some(v.into());
3703 self
3704 }
3705
3706 /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3707 ///
3708 /// # Example
3709 /// ```ignore,no_run
3710 /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3711 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3712 /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3713 /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3714 /// ```
3715 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3716 where
3717 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3718 {
3719 self.rollback_config = v.map(|x| x.into());
3720 self
3721 }
3722}
3723
3724impl wkt::message::Message for RollbackTargetResponse {
3725 fn typename() -> &'static str {
3726 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
3727 }
3728}
3729
3730/// A `Target` resource in the Cloud Deploy API.
3731///
3732/// A `Target` defines a location to which a Skaffold configuration
3733/// can be deployed.
3734#[derive(Clone, Default, PartialEq)]
3735#[non_exhaustive]
3736pub struct Target {
3737 /// Identifier. Name of the `Target`. Format is
3738 /// `projects/{project}/locations/{location}/targets/{target}`.
3739 /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
3740 pub name: std::string::String,
3741
3742 /// Output only. Resource id of the `Target`.
3743 pub target_id: std::string::String,
3744
3745 /// Output only. Unique identifier of the `Target`.
3746 pub uid: std::string::String,
3747
3748 /// Optional. Description of the `Target`. Max length is 255 characters.
3749 pub description: std::string::String,
3750
3751 /// Optional. User annotations. These attributes can only be set and used by
3752 /// the user, and not by Cloud Deploy. See
3753 /// <https://google.aip.dev/128#annotations> for more details such as format and
3754 /// size limitations.
3755 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3756
3757 /// Optional. Labels are attributes that can be set and used by both the
3758 /// user and by Cloud Deploy. Labels must meet the following constraints:
3759 ///
3760 /// * Keys and values can contain only lowercase letters, numeric characters,
3761 /// underscores, and dashes.
3762 /// * All characters must use UTF-8 encoding, and international characters are
3763 /// allowed.
3764 /// * Keys must start with a lowercase letter or international character.
3765 /// * Each resource is limited to a maximum of 64 labels.
3766 ///
3767 /// Both keys and values are additionally constrained to be <= 128 bytes.
3768 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3769
3770 /// Optional. Whether or not the `Target` requires approval.
3771 pub require_approval: bool,
3772
3773 /// Output only. Time at which the `Target` was created.
3774 pub create_time: std::option::Option<wkt::Timestamp>,
3775
3776 /// Output only. Most recent time at which the `Target` was updated.
3777 pub update_time: std::option::Option<wkt::Timestamp>,
3778
3779 /// Optional. Map of entity IDs to their associated entities. Associated
3780 /// entities allows specifying places other than the deployment target for
3781 /// specific features. For example, the Gateway API canary can be configured to
3782 /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
3783 /// using associated entities. An entity ID must consist of lower-case letters,
3784 /// numbers, and hyphens, start with a letter and end with a letter or a
3785 /// number, and have a max length of 63 characters. In other words, it must
3786 /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3787 pub associated_entities:
3788 std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
3789
3790 /// Optional. This checksum is computed by the server based on the value of
3791 /// other fields, and may be sent on update and delete requests to ensure the
3792 /// client has an up-to-date value before proceeding.
3793 pub etag: std::string::String,
3794
3795 /// Optional. Configurations for all execution that relates to this `Target`.
3796 /// Each `ExecutionEnvironmentUsage` value may only be used in a single
3797 /// configuration; using the same value multiple times is an error.
3798 /// When one or more configurations are specified, they must include the
3799 /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
3800 /// When no configurations are specified, execution will use the default
3801 /// specified in `DefaultPool`.
3802 pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
3803
3804 /// Optional. The deploy parameters to use for this target.
3805 pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
3806
3807 /// Destination to which the Skaffold configuration is applied during a
3808 /// rollout.
3809 pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
3810
3811 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3812}
3813
3814impl Target {
3815 pub fn new() -> Self {
3816 std::default::Default::default()
3817 }
3818
3819 /// Sets the value of [name][crate::model::Target::name].
3820 ///
3821 /// # Example
3822 /// ```ignore,no_run
3823 /// # use google_cloud_deploy_v1::model::Target;
3824 /// let x = Target::new().set_name("example");
3825 /// ```
3826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3827 self.name = v.into();
3828 self
3829 }
3830
3831 /// Sets the value of [target_id][crate::model::Target::target_id].
3832 ///
3833 /// # Example
3834 /// ```ignore,no_run
3835 /// # use google_cloud_deploy_v1::model::Target;
3836 /// let x = Target::new().set_target_id("example");
3837 /// ```
3838 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3839 self.target_id = v.into();
3840 self
3841 }
3842
3843 /// Sets the value of [uid][crate::model::Target::uid].
3844 ///
3845 /// # Example
3846 /// ```ignore,no_run
3847 /// # use google_cloud_deploy_v1::model::Target;
3848 /// let x = Target::new().set_uid("example");
3849 /// ```
3850 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3851 self.uid = v.into();
3852 self
3853 }
3854
3855 /// Sets the value of [description][crate::model::Target::description].
3856 ///
3857 /// # Example
3858 /// ```ignore,no_run
3859 /// # use google_cloud_deploy_v1::model::Target;
3860 /// let x = Target::new().set_description("example");
3861 /// ```
3862 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3863 self.description = v.into();
3864 self
3865 }
3866
3867 /// Sets the value of [annotations][crate::model::Target::annotations].
3868 ///
3869 /// # Example
3870 /// ```ignore,no_run
3871 /// # use google_cloud_deploy_v1::model::Target;
3872 /// let x = Target::new().set_annotations([
3873 /// ("key0", "abc"),
3874 /// ("key1", "xyz"),
3875 /// ]);
3876 /// ```
3877 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3878 where
3879 T: std::iter::IntoIterator<Item = (K, V)>,
3880 K: std::convert::Into<std::string::String>,
3881 V: std::convert::Into<std::string::String>,
3882 {
3883 use std::iter::Iterator;
3884 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3885 self
3886 }
3887
3888 /// Sets the value of [labels][crate::model::Target::labels].
3889 ///
3890 /// # Example
3891 /// ```ignore,no_run
3892 /// # use google_cloud_deploy_v1::model::Target;
3893 /// let x = Target::new().set_labels([
3894 /// ("key0", "abc"),
3895 /// ("key1", "xyz"),
3896 /// ]);
3897 /// ```
3898 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3899 where
3900 T: std::iter::IntoIterator<Item = (K, V)>,
3901 K: std::convert::Into<std::string::String>,
3902 V: std::convert::Into<std::string::String>,
3903 {
3904 use std::iter::Iterator;
3905 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3906 self
3907 }
3908
3909 /// Sets the value of [require_approval][crate::model::Target::require_approval].
3910 ///
3911 /// # Example
3912 /// ```ignore,no_run
3913 /// # use google_cloud_deploy_v1::model::Target;
3914 /// let x = Target::new().set_require_approval(true);
3915 /// ```
3916 pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3917 self.require_approval = v.into();
3918 self
3919 }
3920
3921 /// Sets the value of [create_time][crate::model::Target::create_time].
3922 ///
3923 /// # Example
3924 /// ```ignore,no_run
3925 /// # use google_cloud_deploy_v1::model::Target;
3926 /// use wkt::Timestamp;
3927 /// let x = Target::new().set_create_time(Timestamp::default()/* use setters */);
3928 /// ```
3929 pub fn set_create_time<T>(mut self, v: T) -> Self
3930 where
3931 T: std::convert::Into<wkt::Timestamp>,
3932 {
3933 self.create_time = std::option::Option::Some(v.into());
3934 self
3935 }
3936
3937 /// Sets or clears the value of [create_time][crate::model::Target::create_time].
3938 ///
3939 /// # Example
3940 /// ```ignore,no_run
3941 /// # use google_cloud_deploy_v1::model::Target;
3942 /// use wkt::Timestamp;
3943 /// let x = Target::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3944 /// let x = Target::new().set_or_clear_create_time(None::<Timestamp>);
3945 /// ```
3946 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3947 where
3948 T: std::convert::Into<wkt::Timestamp>,
3949 {
3950 self.create_time = v.map(|x| x.into());
3951 self
3952 }
3953
3954 /// Sets the value of [update_time][crate::model::Target::update_time].
3955 ///
3956 /// # Example
3957 /// ```ignore,no_run
3958 /// # use google_cloud_deploy_v1::model::Target;
3959 /// use wkt::Timestamp;
3960 /// let x = Target::new().set_update_time(Timestamp::default()/* use setters */);
3961 /// ```
3962 pub fn set_update_time<T>(mut self, v: T) -> Self
3963 where
3964 T: std::convert::Into<wkt::Timestamp>,
3965 {
3966 self.update_time = std::option::Option::Some(v.into());
3967 self
3968 }
3969
3970 /// Sets or clears the value of [update_time][crate::model::Target::update_time].
3971 ///
3972 /// # Example
3973 /// ```ignore,no_run
3974 /// # use google_cloud_deploy_v1::model::Target;
3975 /// use wkt::Timestamp;
3976 /// let x = Target::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3977 /// let x = Target::new().set_or_clear_update_time(None::<Timestamp>);
3978 /// ```
3979 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3980 where
3981 T: std::convert::Into<wkt::Timestamp>,
3982 {
3983 self.update_time = v.map(|x| x.into());
3984 self
3985 }
3986
3987 /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
3988 ///
3989 /// # Example
3990 /// ```ignore,no_run
3991 /// # use google_cloud_deploy_v1::model::Target;
3992 /// use google_cloud_deploy_v1::model::AssociatedEntities;
3993 /// let x = Target::new().set_associated_entities([
3994 /// ("key0", AssociatedEntities::default()/* use setters */),
3995 /// ("key1", AssociatedEntities::default()/* use (different) setters */),
3996 /// ]);
3997 /// ```
3998 pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
3999 where
4000 T: std::iter::IntoIterator<Item = (K, V)>,
4001 K: std::convert::Into<std::string::String>,
4002 V: std::convert::Into<crate::model::AssociatedEntities>,
4003 {
4004 use std::iter::Iterator;
4005 self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4006 self
4007 }
4008
4009 /// Sets the value of [etag][crate::model::Target::etag].
4010 ///
4011 /// # Example
4012 /// ```ignore,no_run
4013 /// # use google_cloud_deploy_v1::model::Target;
4014 /// let x = Target::new().set_etag("example");
4015 /// ```
4016 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4017 self.etag = v.into();
4018 self
4019 }
4020
4021 /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
4022 ///
4023 /// # Example
4024 /// ```ignore,no_run
4025 /// # use google_cloud_deploy_v1::model::Target;
4026 /// use google_cloud_deploy_v1::model::ExecutionConfig;
4027 /// let x = Target::new()
4028 /// .set_execution_configs([
4029 /// ExecutionConfig::default()/* use setters */,
4030 /// ExecutionConfig::default()/* use (different) setters */,
4031 /// ]);
4032 /// ```
4033 pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
4034 where
4035 T: std::iter::IntoIterator<Item = V>,
4036 V: std::convert::Into<crate::model::ExecutionConfig>,
4037 {
4038 use std::iter::Iterator;
4039 self.execution_configs = v.into_iter().map(|i| i.into()).collect();
4040 self
4041 }
4042
4043 /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
4044 ///
4045 /// # Example
4046 /// ```ignore,no_run
4047 /// # use google_cloud_deploy_v1::model::Target;
4048 /// let x = Target::new().set_deploy_parameters([
4049 /// ("key0", "abc"),
4050 /// ("key1", "xyz"),
4051 /// ]);
4052 /// ```
4053 pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
4054 where
4055 T: std::iter::IntoIterator<Item = (K, V)>,
4056 K: std::convert::Into<std::string::String>,
4057 V: std::convert::Into<std::string::String>,
4058 {
4059 use std::iter::Iterator;
4060 self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4061 self
4062 }
4063
4064 /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
4065 ///
4066 /// Note that all the setters affecting `deployment_target` are mutually
4067 /// exclusive.
4068 ///
4069 /// # Example
4070 /// ```ignore,no_run
4071 /// # use google_cloud_deploy_v1::model::Target;
4072 /// use google_cloud_deploy_v1::model::GkeCluster;
4073 /// let x = Target::new().set_deployment_target(Some(
4074 /// google_cloud_deploy_v1::model::target::DeploymentTarget::Gke(GkeCluster::default().into())));
4075 /// ```
4076 pub fn set_deployment_target<
4077 T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
4078 >(
4079 mut self,
4080 v: T,
4081 ) -> Self {
4082 self.deployment_target = v.into();
4083 self
4084 }
4085
4086 /// The value of [deployment_target][crate::model::Target::deployment_target]
4087 /// if it holds a `Gke`, `None` if the field is not set or
4088 /// holds a different branch.
4089 pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
4090 #[allow(unreachable_patterns)]
4091 self.deployment_target.as_ref().and_then(|v| match v {
4092 crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
4093 _ => std::option::Option::None,
4094 })
4095 }
4096
4097 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4098 /// to hold a `Gke`.
4099 ///
4100 /// Note that all the setters affecting `deployment_target` are
4101 /// mutually exclusive.
4102 ///
4103 /// # Example
4104 /// ```ignore,no_run
4105 /// # use google_cloud_deploy_v1::model::Target;
4106 /// use google_cloud_deploy_v1::model::GkeCluster;
4107 /// let x = Target::new().set_gke(GkeCluster::default()/* use setters */);
4108 /// assert!(x.gke().is_some());
4109 /// assert!(x.anthos_cluster().is_none());
4110 /// assert!(x.run().is_none());
4111 /// assert!(x.multi_target().is_none());
4112 /// assert!(x.custom_target().is_none());
4113 /// ```
4114 pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
4115 mut self,
4116 v: T,
4117 ) -> Self {
4118 self.deployment_target =
4119 std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
4120 self
4121 }
4122
4123 /// The value of [deployment_target][crate::model::Target::deployment_target]
4124 /// if it holds a `AnthosCluster`, `None` if the field is not set or
4125 /// holds a different branch.
4126 pub fn anthos_cluster(
4127 &self,
4128 ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
4129 #[allow(unreachable_patterns)]
4130 self.deployment_target.as_ref().and_then(|v| match v {
4131 crate::model::target::DeploymentTarget::AnthosCluster(v) => {
4132 std::option::Option::Some(v)
4133 }
4134 _ => std::option::Option::None,
4135 })
4136 }
4137
4138 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4139 /// to hold a `AnthosCluster`.
4140 ///
4141 /// Note that all the setters affecting `deployment_target` are
4142 /// mutually exclusive.
4143 ///
4144 /// # Example
4145 /// ```ignore,no_run
4146 /// # use google_cloud_deploy_v1::model::Target;
4147 /// use google_cloud_deploy_v1::model::AnthosCluster;
4148 /// let x = Target::new().set_anthos_cluster(AnthosCluster::default()/* use setters */);
4149 /// assert!(x.anthos_cluster().is_some());
4150 /// assert!(x.gke().is_none());
4151 /// assert!(x.run().is_none());
4152 /// assert!(x.multi_target().is_none());
4153 /// assert!(x.custom_target().is_none());
4154 /// ```
4155 pub fn set_anthos_cluster<
4156 T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
4157 >(
4158 mut self,
4159 v: T,
4160 ) -> Self {
4161 self.deployment_target = std::option::Option::Some(
4162 crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
4163 );
4164 self
4165 }
4166
4167 /// The value of [deployment_target][crate::model::Target::deployment_target]
4168 /// if it holds a `Run`, `None` if the field is not set or
4169 /// holds a different branch.
4170 pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
4171 #[allow(unreachable_patterns)]
4172 self.deployment_target.as_ref().and_then(|v| match v {
4173 crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
4174 _ => std::option::Option::None,
4175 })
4176 }
4177
4178 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4179 /// to hold a `Run`.
4180 ///
4181 /// Note that all the setters affecting `deployment_target` are
4182 /// mutually exclusive.
4183 ///
4184 /// # Example
4185 /// ```ignore,no_run
4186 /// # use google_cloud_deploy_v1::model::Target;
4187 /// use google_cloud_deploy_v1::model::CloudRunLocation;
4188 /// let x = Target::new().set_run(CloudRunLocation::default()/* use setters */);
4189 /// assert!(x.run().is_some());
4190 /// assert!(x.gke().is_none());
4191 /// assert!(x.anthos_cluster().is_none());
4192 /// assert!(x.multi_target().is_none());
4193 /// assert!(x.custom_target().is_none());
4194 /// ```
4195 pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
4196 mut self,
4197 v: T,
4198 ) -> Self {
4199 self.deployment_target =
4200 std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
4201 self
4202 }
4203
4204 /// The value of [deployment_target][crate::model::Target::deployment_target]
4205 /// if it holds a `MultiTarget`, `None` if the field is not set or
4206 /// holds a different branch.
4207 pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
4208 #[allow(unreachable_patterns)]
4209 self.deployment_target.as_ref().and_then(|v| match v {
4210 crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
4211 _ => std::option::Option::None,
4212 })
4213 }
4214
4215 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4216 /// to hold a `MultiTarget`.
4217 ///
4218 /// Note that all the setters affecting `deployment_target` are
4219 /// mutually exclusive.
4220 ///
4221 /// # Example
4222 /// ```ignore,no_run
4223 /// # use google_cloud_deploy_v1::model::Target;
4224 /// use google_cloud_deploy_v1::model::MultiTarget;
4225 /// let x = Target::new().set_multi_target(MultiTarget::default()/* use setters */);
4226 /// assert!(x.multi_target().is_some());
4227 /// assert!(x.gke().is_none());
4228 /// assert!(x.anthos_cluster().is_none());
4229 /// assert!(x.run().is_none());
4230 /// assert!(x.custom_target().is_none());
4231 /// ```
4232 pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
4233 mut self,
4234 v: T,
4235 ) -> Self {
4236 self.deployment_target = std::option::Option::Some(
4237 crate::model::target::DeploymentTarget::MultiTarget(v.into()),
4238 );
4239 self
4240 }
4241
4242 /// The value of [deployment_target][crate::model::Target::deployment_target]
4243 /// if it holds a `CustomTarget`, `None` if the field is not set or
4244 /// holds a different branch.
4245 pub fn custom_target(
4246 &self,
4247 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
4248 #[allow(unreachable_patterns)]
4249 self.deployment_target.as_ref().and_then(|v| match v {
4250 crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
4251 _ => std::option::Option::None,
4252 })
4253 }
4254
4255 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4256 /// to hold a `CustomTarget`.
4257 ///
4258 /// Note that all the setters affecting `deployment_target` are
4259 /// mutually exclusive.
4260 ///
4261 /// # Example
4262 /// ```ignore,no_run
4263 /// # use google_cloud_deploy_v1::model::Target;
4264 /// use google_cloud_deploy_v1::model::CustomTarget;
4265 /// let x = Target::new().set_custom_target(CustomTarget::default()/* use setters */);
4266 /// assert!(x.custom_target().is_some());
4267 /// assert!(x.gke().is_none());
4268 /// assert!(x.anthos_cluster().is_none());
4269 /// assert!(x.run().is_none());
4270 /// assert!(x.multi_target().is_none());
4271 /// ```
4272 pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
4273 mut self,
4274 v: T,
4275 ) -> Self {
4276 self.deployment_target = std::option::Option::Some(
4277 crate::model::target::DeploymentTarget::CustomTarget(v.into()),
4278 );
4279 self
4280 }
4281}
4282
4283impl wkt::message::Message for Target {
4284 fn typename() -> &'static str {
4285 "type.googleapis.com/google.cloud.deploy.v1.Target"
4286 }
4287}
4288
4289/// Defines additional types related to [Target].
4290pub mod target {
4291 #[allow(unused_imports)]
4292 use super::*;
4293
4294 /// Destination to which the Skaffold configuration is applied during a
4295 /// rollout.
4296 #[derive(Clone, Debug, PartialEq)]
4297 #[non_exhaustive]
4298 pub enum DeploymentTarget {
4299 /// Optional. Information specifying a GKE Cluster.
4300 Gke(std::boxed::Box<crate::model::GkeCluster>),
4301 /// Optional. Information specifying an Anthos Cluster.
4302 AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
4303 /// Optional. Information specifying a Cloud Run deployment target.
4304 Run(std::boxed::Box<crate::model::CloudRunLocation>),
4305 /// Optional. Information specifying a multiTarget.
4306 MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
4307 /// Optional. Information specifying a Custom Target.
4308 CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
4309 }
4310}
4311
4312/// Configuration of the environment to use when calling Skaffold.
4313#[derive(Clone, Default, PartialEq)]
4314#[non_exhaustive]
4315pub struct ExecutionConfig {
4316 /// Required. Usages when this configuration should be applied.
4317 pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
4318
4319 /// Optional. The resource name of the `WorkerPool`, with the format
4320 /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
4321 /// If this optional field is unspecified, the default Cloud Build pool will be
4322 /// used.
4323 pub worker_pool: std::string::String,
4324
4325 /// Optional. Google service account to use for execution. If unspecified,
4326 /// the project execution service account
4327 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
4328 pub service_account: std::string::String,
4329
4330 /// Optional. Cloud Storage location in which to store execution outputs. This
4331 /// can either be a bucket ("gs://my-bucket") or a path within a bucket
4332 /// ("gs://my-bucket/my-dir").
4333 /// If unspecified, a default bucket located in the same region will be used.
4334 pub artifact_storage: std::string::String,
4335
4336 /// Optional. Execution timeout for a Cloud Build Execution. This must be
4337 /// between 10m and 24h in seconds format. If unspecified, a default timeout of
4338 /// 1h is used.
4339 pub execution_timeout: std::option::Option<wkt::Duration>,
4340
4341 /// Optional. If true, additional logging will be enabled when running builds
4342 /// in this execution environment.
4343 pub verbose: bool,
4344
4345 /// Details of the environment.
4346 pub execution_environment:
4347 std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4348
4349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4350}
4351
4352impl ExecutionConfig {
4353 pub fn new() -> Self {
4354 std::default::Default::default()
4355 }
4356
4357 /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
4358 ///
4359 /// # Example
4360 /// ```ignore,no_run
4361 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4362 /// use google_cloud_deploy_v1::model::execution_config::ExecutionEnvironmentUsage;
4363 /// let x = ExecutionConfig::new().set_usages([
4364 /// ExecutionEnvironmentUsage::Render,
4365 /// ExecutionEnvironmentUsage::Deploy,
4366 /// ExecutionEnvironmentUsage::Verify,
4367 /// ]);
4368 /// ```
4369 pub fn set_usages<T, V>(mut self, v: T) -> Self
4370 where
4371 T: std::iter::IntoIterator<Item = V>,
4372 V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
4373 {
4374 use std::iter::Iterator;
4375 self.usages = v.into_iter().map(|i| i.into()).collect();
4376 self
4377 }
4378
4379 /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
4380 ///
4381 /// # Example
4382 /// ```ignore,no_run
4383 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4384 /// let x = ExecutionConfig::new().set_worker_pool("example");
4385 /// ```
4386 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4387 self.worker_pool = v.into();
4388 self
4389 }
4390
4391 /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
4392 ///
4393 /// # Example
4394 /// ```ignore,no_run
4395 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4396 /// let x = ExecutionConfig::new().set_service_account("example");
4397 /// ```
4398 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.service_account = v.into();
4400 self
4401 }
4402
4403 /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
4404 ///
4405 /// # Example
4406 /// ```ignore,no_run
4407 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4408 /// let x = ExecutionConfig::new().set_artifact_storage("example");
4409 /// ```
4410 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4411 mut self,
4412 v: T,
4413 ) -> Self {
4414 self.artifact_storage = v.into();
4415 self
4416 }
4417
4418 /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4419 ///
4420 /// # Example
4421 /// ```ignore,no_run
4422 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4423 /// use wkt::Duration;
4424 /// let x = ExecutionConfig::new().set_execution_timeout(Duration::default()/* use setters */);
4425 /// ```
4426 pub fn set_execution_timeout<T>(mut self, v: T) -> Self
4427 where
4428 T: std::convert::Into<wkt::Duration>,
4429 {
4430 self.execution_timeout = std::option::Option::Some(v.into());
4431 self
4432 }
4433
4434 /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4435 ///
4436 /// # Example
4437 /// ```ignore,no_run
4438 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4439 /// use wkt::Duration;
4440 /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(Some(Duration::default()/* use setters */));
4441 /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(None::<Duration>);
4442 /// ```
4443 pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4444 where
4445 T: std::convert::Into<wkt::Duration>,
4446 {
4447 self.execution_timeout = v.map(|x| x.into());
4448 self
4449 }
4450
4451 /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
4452 ///
4453 /// # Example
4454 /// ```ignore,no_run
4455 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4456 /// let x = ExecutionConfig::new().set_verbose(true);
4457 /// ```
4458 pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4459 self.verbose = v.into();
4460 self
4461 }
4462
4463 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
4464 ///
4465 /// Note that all the setters affecting `execution_environment` are mutually
4466 /// exclusive.
4467 ///
4468 /// # Example
4469 /// ```ignore,no_run
4470 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4471 /// use google_cloud_deploy_v1::model::DefaultPool;
4472 /// let x = ExecutionConfig::new().set_execution_environment(Some(
4473 /// google_cloud_deploy_v1::model::execution_config::ExecutionEnvironment::DefaultPool(DefaultPool::default().into())));
4474 /// ```
4475 pub fn set_execution_environment<
4476 T: std::convert::Into<
4477 std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4478 >,
4479 >(
4480 mut self,
4481 v: T,
4482 ) -> Self {
4483 self.execution_environment = v.into();
4484 self
4485 }
4486
4487 /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4488 /// if it holds a `DefaultPool`, `None` if the field is not set or
4489 /// holds a different branch.
4490 pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
4491 #[allow(unreachable_patterns)]
4492 self.execution_environment.as_ref().and_then(|v| match v {
4493 crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
4494 std::option::Option::Some(v)
4495 }
4496 _ => std::option::Option::None,
4497 })
4498 }
4499
4500 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4501 /// to hold a `DefaultPool`.
4502 ///
4503 /// Note that all the setters affecting `execution_environment` are
4504 /// mutually exclusive.
4505 ///
4506 /// # Example
4507 /// ```ignore,no_run
4508 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4509 /// use google_cloud_deploy_v1::model::DefaultPool;
4510 /// let x = ExecutionConfig::new().set_default_pool(DefaultPool::default()/* use setters */);
4511 /// assert!(x.default_pool().is_some());
4512 /// assert!(x.private_pool().is_none());
4513 /// ```
4514 pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
4515 mut self,
4516 v: T,
4517 ) -> Self {
4518 self.execution_environment = std::option::Option::Some(
4519 crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
4520 );
4521 self
4522 }
4523
4524 /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4525 /// if it holds a `PrivatePool`, `None` if the field is not set or
4526 /// holds a different branch.
4527 pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
4528 #[allow(unreachable_patterns)]
4529 self.execution_environment.as_ref().and_then(|v| match v {
4530 crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
4531 std::option::Option::Some(v)
4532 }
4533 _ => std::option::Option::None,
4534 })
4535 }
4536
4537 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4538 /// to hold a `PrivatePool`.
4539 ///
4540 /// Note that all the setters affecting `execution_environment` are
4541 /// mutually exclusive.
4542 ///
4543 /// # Example
4544 /// ```ignore,no_run
4545 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4546 /// use google_cloud_deploy_v1::model::PrivatePool;
4547 /// let x = ExecutionConfig::new().set_private_pool(PrivatePool::default()/* use setters */);
4548 /// assert!(x.private_pool().is_some());
4549 /// assert!(x.default_pool().is_none());
4550 /// ```
4551 pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
4552 mut self,
4553 v: T,
4554 ) -> Self {
4555 self.execution_environment = std::option::Option::Some(
4556 crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
4557 );
4558 self
4559 }
4560}
4561
4562impl wkt::message::Message for ExecutionConfig {
4563 fn typename() -> &'static str {
4564 "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
4565 }
4566}
4567
4568/// Defines additional types related to [ExecutionConfig].
4569pub mod execution_config {
4570 #[allow(unused_imports)]
4571 use super::*;
4572
4573 /// Possible usages of this configuration.
4574 ///
4575 /// # Working with unknown values
4576 ///
4577 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4578 /// additional enum variants at any time. Adding new variants is not considered
4579 /// a breaking change. Applications should write their code in anticipation of:
4580 ///
4581 /// - New values appearing in future releases of the client library, **and**
4582 /// - New values received dynamically, without application changes.
4583 ///
4584 /// Please consult the [Working with enums] section in the user guide for some
4585 /// guidelines.
4586 ///
4587 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4588 #[derive(Clone, Debug, PartialEq)]
4589 #[non_exhaustive]
4590 pub enum ExecutionEnvironmentUsage {
4591 /// Default value. This value is unused.
4592 Unspecified,
4593 /// Use for rendering.
4594 Render,
4595 /// Use for deploying and deployment hooks.
4596 Deploy,
4597 /// Use for deployment verification.
4598 Verify,
4599 /// Use for predeploy job execution.
4600 Predeploy,
4601 /// Use for postdeploy job execution.
4602 Postdeploy,
4603 /// If set, the enum was initialized with an unknown value.
4604 ///
4605 /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
4606 /// [ExecutionEnvironmentUsage::name].
4607 UnknownValue(execution_environment_usage::UnknownValue),
4608 }
4609
4610 #[doc(hidden)]
4611 pub mod execution_environment_usage {
4612 #[allow(unused_imports)]
4613 use super::*;
4614 #[derive(Clone, Debug, PartialEq)]
4615 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4616 }
4617
4618 impl ExecutionEnvironmentUsage {
4619 /// Gets the enum value.
4620 ///
4621 /// Returns `None` if the enum contains an unknown value deserialized from
4622 /// the string representation of enums.
4623 pub fn value(&self) -> std::option::Option<i32> {
4624 match self {
4625 Self::Unspecified => std::option::Option::Some(0),
4626 Self::Render => std::option::Option::Some(1),
4627 Self::Deploy => std::option::Option::Some(2),
4628 Self::Verify => std::option::Option::Some(3),
4629 Self::Predeploy => std::option::Option::Some(4),
4630 Self::Postdeploy => std::option::Option::Some(5),
4631 Self::UnknownValue(u) => u.0.value(),
4632 }
4633 }
4634
4635 /// Gets the enum value as a string.
4636 ///
4637 /// Returns `None` if the enum contains an unknown value deserialized from
4638 /// the integer representation of enums.
4639 pub fn name(&self) -> std::option::Option<&str> {
4640 match self {
4641 Self::Unspecified => {
4642 std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
4643 }
4644 Self::Render => std::option::Option::Some("RENDER"),
4645 Self::Deploy => std::option::Option::Some("DEPLOY"),
4646 Self::Verify => std::option::Option::Some("VERIFY"),
4647 Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
4648 Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
4649 Self::UnknownValue(u) => u.0.name(),
4650 }
4651 }
4652 }
4653
4654 impl std::default::Default for ExecutionEnvironmentUsage {
4655 fn default() -> Self {
4656 use std::convert::From;
4657 Self::from(0)
4658 }
4659 }
4660
4661 impl std::fmt::Display for ExecutionEnvironmentUsage {
4662 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4663 wkt::internal::display_enum(f, self.name(), self.value())
4664 }
4665 }
4666
4667 impl std::convert::From<i32> for ExecutionEnvironmentUsage {
4668 fn from(value: i32) -> Self {
4669 match value {
4670 0 => Self::Unspecified,
4671 1 => Self::Render,
4672 2 => Self::Deploy,
4673 3 => Self::Verify,
4674 4 => Self::Predeploy,
4675 5 => Self::Postdeploy,
4676 _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4677 wkt::internal::UnknownEnumValue::Integer(value),
4678 )),
4679 }
4680 }
4681 }
4682
4683 impl std::convert::From<&str> for ExecutionEnvironmentUsage {
4684 fn from(value: &str) -> Self {
4685 use std::string::ToString;
4686 match value {
4687 "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
4688 "RENDER" => Self::Render,
4689 "DEPLOY" => Self::Deploy,
4690 "VERIFY" => Self::Verify,
4691 "PREDEPLOY" => Self::Predeploy,
4692 "POSTDEPLOY" => Self::Postdeploy,
4693 _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4694 wkt::internal::UnknownEnumValue::String(value.to_string()),
4695 )),
4696 }
4697 }
4698 }
4699
4700 impl serde::ser::Serialize for ExecutionEnvironmentUsage {
4701 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4702 where
4703 S: serde::Serializer,
4704 {
4705 match self {
4706 Self::Unspecified => serializer.serialize_i32(0),
4707 Self::Render => serializer.serialize_i32(1),
4708 Self::Deploy => serializer.serialize_i32(2),
4709 Self::Verify => serializer.serialize_i32(3),
4710 Self::Predeploy => serializer.serialize_i32(4),
4711 Self::Postdeploy => serializer.serialize_i32(5),
4712 Self::UnknownValue(u) => u.0.serialize(serializer),
4713 }
4714 }
4715 }
4716
4717 impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
4718 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4719 where
4720 D: serde::Deserializer<'de>,
4721 {
4722 deserializer.deserialize_any(
4723 wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
4724 ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
4725 ),
4726 )
4727 }
4728 }
4729
4730 /// Details of the environment.
4731 #[derive(Clone, Debug, PartialEq)]
4732 #[non_exhaustive]
4733 pub enum ExecutionEnvironment {
4734 /// Optional. Use default Cloud Build pool.
4735 DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
4736 /// Optional. Use private Cloud Build pool.
4737 PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
4738 }
4739}
4740
4741/// Execution using the default Cloud Build pool.
4742#[derive(Clone, Default, PartialEq)]
4743#[non_exhaustive]
4744pub struct DefaultPool {
4745 /// Optional. Google service account to use for execution. If unspecified,
4746 /// the project execution service account
4747 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4748 pub service_account: std::string::String,
4749
4750 /// Optional. Cloud Storage location where execution outputs should be stored.
4751 /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4752 /// ("gs://my-bucket/my-dir").
4753 /// If unspecified, a default bucket located in the same region will be used.
4754 pub artifact_storage: std::string::String,
4755
4756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4757}
4758
4759impl DefaultPool {
4760 pub fn new() -> Self {
4761 std::default::Default::default()
4762 }
4763
4764 /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
4765 ///
4766 /// # Example
4767 /// ```ignore,no_run
4768 /// # use google_cloud_deploy_v1::model::DefaultPool;
4769 /// let x = DefaultPool::new().set_service_account("example");
4770 /// ```
4771 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4772 self.service_account = v.into();
4773 self
4774 }
4775
4776 /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
4777 ///
4778 /// # Example
4779 /// ```ignore,no_run
4780 /// # use google_cloud_deploy_v1::model::DefaultPool;
4781 /// let x = DefaultPool::new().set_artifact_storage("example");
4782 /// ```
4783 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4784 mut self,
4785 v: T,
4786 ) -> Self {
4787 self.artifact_storage = v.into();
4788 self
4789 }
4790}
4791
4792impl wkt::message::Message for DefaultPool {
4793 fn typename() -> &'static str {
4794 "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
4795 }
4796}
4797
4798/// Execution using a private Cloud Build pool.
4799#[derive(Clone, Default, PartialEq)]
4800#[non_exhaustive]
4801pub struct PrivatePool {
4802 /// Required. Resource name of the Cloud Build worker pool to use. The format
4803 /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
4804 pub worker_pool: std::string::String,
4805
4806 /// Optional. Google service account to use for execution. If unspecified,
4807 /// the project execution service account
4808 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4809 pub service_account: std::string::String,
4810
4811 /// Optional. Cloud Storage location where execution outputs should be stored.
4812 /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4813 /// ("gs://my-bucket/my-dir").
4814 /// If unspecified, a default bucket located in the same region will be used.
4815 pub artifact_storage: std::string::String,
4816
4817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4818}
4819
4820impl PrivatePool {
4821 pub fn new() -> Self {
4822 std::default::Default::default()
4823 }
4824
4825 /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
4826 ///
4827 /// # Example
4828 /// ```ignore,no_run
4829 /// # use google_cloud_deploy_v1::model::PrivatePool;
4830 /// let x = PrivatePool::new().set_worker_pool("example");
4831 /// ```
4832 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4833 self.worker_pool = v.into();
4834 self
4835 }
4836
4837 /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
4838 ///
4839 /// # Example
4840 /// ```ignore,no_run
4841 /// # use google_cloud_deploy_v1::model::PrivatePool;
4842 /// let x = PrivatePool::new().set_service_account("example");
4843 /// ```
4844 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4845 self.service_account = v.into();
4846 self
4847 }
4848
4849 /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
4850 ///
4851 /// # Example
4852 /// ```ignore,no_run
4853 /// # use google_cloud_deploy_v1::model::PrivatePool;
4854 /// let x = PrivatePool::new().set_artifact_storage("example");
4855 /// ```
4856 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4857 mut self,
4858 v: T,
4859 ) -> Self {
4860 self.artifact_storage = v.into();
4861 self
4862 }
4863}
4864
4865impl wkt::message::Message for PrivatePool {
4866 fn typename() -> &'static str {
4867 "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
4868 }
4869}
4870
4871/// Information specifying a GKE Cluster.
4872#[derive(Clone, Default, PartialEq)]
4873#[non_exhaustive]
4874pub struct GkeCluster {
4875 /// Optional. Information specifying a GKE Cluster. Format is
4876 /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
4877 pub cluster: std::string::String,
4878
4879 /// Optional. If true, `cluster` is accessed using the private IP address of
4880 /// the control plane endpoint. Otherwise, the default IP address of the
4881 /// control plane endpoint is used. The default IP address is the private IP
4882 /// address for clusters with private control-plane endpoints and the public IP
4883 /// address otherwise.
4884 ///
4885 /// Only specify this option when `cluster` is a [private GKE
4886 /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
4887 /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
4888 pub internal_ip: bool,
4889
4890 /// Optional. If set, used to configure a
4891 /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
4892 /// to the Kubernetes server.
4893 pub proxy_url: std::string::String,
4894
4895 /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
4896 /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
4897 pub dns_endpoint: bool,
4898
4899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4900}
4901
4902impl GkeCluster {
4903 pub fn new() -> Self {
4904 std::default::Default::default()
4905 }
4906
4907 /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
4908 ///
4909 /// # Example
4910 /// ```ignore,no_run
4911 /// # use google_cloud_deploy_v1::model::GkeCluster;
4912 /// let x = GkeCluster::new().set_cluster("example");
4913 /// ```
4914 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4915 self.cluster = v.into();
4916 self
4917 }
4918
4919 /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
4920 ///
4921 /// # Example
4922 /// ```ignore,no_run
4923 /// # use google_cloud_deploy_v1::model::GkeCluster;
4924 /// let x = GkeCluster::new().set_internal_ip(true);
4925 /// ```
4926 pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4927 self.internal_ip = v.into();
4928 self
4929 }
4930
4931 /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
4932 ///
4933 /// # Example
4934 /// ```ignore,no_run
4935 /// # use google_cloud_deploy_v1::model::GkeCluster;
4936 /// let x = GkeCluster::new().set_proxy_url("example");
4937 /// ```
4938 pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4939 self.proxy_url = v.into();
4940 self
4941 }
4942
4943 /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
4944 ///
4945 /// # Example
4946 /// ```ignore,no_run
4947 /// # use google_cloud_deploy_v1::model::GkeCluster;
4948 /// let x = GkeCluster::new().set_dns_endpoint(true);
4949 /// ```
4950 pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4951 self.dns_endpoint = v.into();
4952 self
4953 }
4954}
4955
4956impl wkt::message::Message for GkeCluster {
4957 fn typename() -> &'static str {
4958 "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
4959 }
4960}
4961
4962/// Information specifying an Anthos Cluster.
4963#[derive(Clone, Default, PartialEq)]
4964#[non_exhaustive]
4965pub struct AnthosCluster {
4966 /// Optional. Membership of the GKE Hub-registered cluster to which to apply
4967 /// the Skaffold configuration. Format is
4968 /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
4969 pub membership: std::string::String,
4970
4971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4972}
4973
4974impl AnthosCluster {
4975 pub fn new() -> Self {
4976 std::default::Default::default()
4977 }
4978
4979 /// Sets the value of [membership][crate::model::AnthosCluster::membership].
4980 ///
4981 /// # Example
4982 /// ```ignore,no_run
4983 /// # use google_cloud_deploy_v1::model::AnthosCluster;
4984 /// let x = AnthosCluster::new().set_membership("example");
4985 /// ```
4986 pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4987 self.membership = v.into();
4988 self
4989 }
4990}
4991
4992impl wkt::message::Message for AnthosCluster {
4993 fn typename() -> &'static str {
4994 "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
4995 }
4996}
4997
4998/// Information specifying where to deploy a Cloud Run Service.
4999#[derive(Clone, Default, PartialEq)]
5000#[non_exhaustive]
5001pub struct CloudRunLocation {
5002 /// Required. The location for the Cloud Run Service. Format must be
5003 /// `projects/{project}/locations/{location}`.
5004 pub location: std::string::String,
5005
5006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5007}
5008
5009impl CloudRunLocation {
5010 pub fn new() -> Self {
5011 std::default::Default::default()
5012 }
5013
5014 /// Sets the value of [location][crate::model::CloudRunLocation::location].
5015 ///
5016 /// # Example
5017 /// ```ignore,no_run
5018 /// # use google_cloud_deploy_v1::model::CloudRunLocation;
5019 /// let x = CloudRunLocation::new().set_location("example");
5020 /// ```
5021 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5022 self.location = v.into();
5023 self
5024 }
5025}
5026
5027impl wkt::message::Message for CloudRunLocation {
5028 fn typename() -> &'static str {
5029 "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
5030 }
5031}
5032
5033/// Information specifying a multiTarget.
5034#[derive(Clone, Default, PartialEq)]
5035#[non_exhaustive]
5036pub struct MultiTarget {
5037 /// Required. The target_ids of this multiTarget.
5038 pub target_ids: std::vec::Vec<std::string::String>,
5039
5040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5041}
5042
5043impl MultiTarget {
5044 pub fn new() -> Self {
5045 std::default::Default::default()
5046 }
5047
5048 /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
5049 ///
5050 /// # Example
5051 /// ```ignore,no_run
5052 /// # use google_cloud_deploy_v1::model::MultiTarget;
5053 /// let x = MultiTarget::new().set_target_ids(["a", "b", "c"]);
5054 /// ```
5055 pub fn set_target_ids<T, V>(mut self, v: T) -> Self
5056 where
5057 T: std::iter::IntoIterator<Item = V>,
5058 V: std::convert::Into<std::string::String>,
5059 {
5060 use std::iter::Iterator;
5061 self.target_ids = v.into_iter().map(|i| i.into()).collect();
5062 self
5063 }
5064}
5065
5066impl wkt::message::Message for MultiTarget {
5067 fn typename() -> &'static str {
5068 "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
5069 }
5070}
5071
5072/// Information specifying a Custom Target.
5073#[derive(Clone, Default, PartialEq)]
5074#[non_exhaustive]
5075pub struct CustomTarget {
5076 /// Required. The name of the CustomTargetType. Format must be
5077 /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
5078 pub custom_target_type: std::string::String,
5079
5080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5081}
5082
5083impl CustomTarget {
5084 pub fn new() -> Self {
5085 std::default::Default::default()
5086 }
5087
5088 /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
5089 ///
5090 /// # Example
5091 /// ```ignore,no_run
5092 /// # use google_cloud_deploy_v1::model::CustomTarget;
5093 /// let x = CustomTarget::new().set_custom_target_type("example");
5094 /// ```
5095 pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
5096 mut self,
5097 v: T,
5098 ) -> Self {
5099 self.custom_target_type = v.into();
5100 self
5101 }
5102}
5103
5104impl wkt::message::Message for CustomTarget {
5105 fn typename() -> &'static str {
5106 "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
5107 }
5108}
5109
5110/// Information about entities associated with a `Target`.
5111#[derive(Clone, Default, PartialEq)]
5112#[non_exhaustive]
5113pub struct AssociatedEntities {
5114 /// Optional. Information specifying GKE clusters as associated entities.
5115 pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
5116
5117 /// Optional. Information specifying Anthos clusters as associated entities.
5118 pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
5119
5120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5121}
5122
5123impl AssociatedEntities {
5124 pub fn new() -> Self {
5125 std::default::Default::default()
5126 }
5127
5128 /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
5129 ///
5130 /// # Example
5131 /// ```ignore,no_run
5132 /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5133 /// use google_cloud_deploy_v1::model::GkeCluster;
5134 /// let x = AssociatedEntities::new()
5135 /// .set_gke_clusters([
5136 /// GkeCluster::default()/* use setters */,
5137 /// GkeCluster::default()/* use (different) setters */,
5138 /// ]);
5139 /// ```
5140 pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
5141 where
5142 T: std::iter::IntoIterator<Item = V>,
5143 V: std::convert::Into<crate::model::GkeCluster>,
5144 {
5145 use std::iter::Iterator;
5146 self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
5147 self
5148 }
5149
5150 /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
5151 ///
5152 /// # Example
5153 /// ```ignore,no_run
5154 /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5155 /// use google_cloud_deploy_v1::model::AnthosCluster;
5156 /// let x = AssociatedEntities::new()
5157 /// .set_anthos_clusters([
5158 /// AnthosCluster::default()/* use setters */,
5159 /// AnthosCluster::default()/* use (different) setters */,
5160 /// ]);
5161 /// ```
5162 pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
5163 where
5164 T: std::iter::IntoIterator<Item = V>,
5165 V: std::convert::Into<crate::model::AnthosCluster>,
5166 {
5167 use std::iter::Iterator;
5168 self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
5169 self
5170 }
5171}
5172
5173impl wkt::message::Message for AssociatedEntities {
5174 fn typename() -> &'static str {
5175 "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
5176 }
5177}
5178
5179/// The request object for `ListTargets`.
5180#[derive(Clone, Default, PartialEq)]
5181#[non_exhaustive]
5182pub struct ListTargetsRequest {
5183 /// Required. The parent, which owns this collection of targets. Format must be
5184 /// `projects/{project_id}/locations/{location_name}`.
5185 pub parent: std::string::String,
5186
5187 /// Optional. The maximum number of `Target` objects to return. The service may
5188 /// return fewer than this value. If unspecified, at most 50 `Target` objects
5189 /// will be returned. The maximum value is 1000; values above 1000 will be set
5190 /// to 1000.
5191 pub page_size: i32,
5192
5193 /// Optional. A page token, received from a previous `ListTargets` call.
5194 /// Provide this to retrieve the subsequent page.
5195 ///
5196 /// When paginating, all other provided parameters match
5197 /// the call that provided the page token.
5198 pub page_token: std::string::String,
5199
5200 /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
5201 /// more details.
5202 pub filter: std::string::String,
5203
5204 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
5205 /// more details.
5206 pub order_by: std::string::String,
5207
5208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5209}
5210
5211impl ListTargetsRequest {
5212 pub fn new() -> Self {
5213 std::default::Default::default()
5214 }
5215
5216 /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
5217 ///
5218 /// # Example
5219 /// ```ignore,no_run
5220 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5221 /// let x = ListTargetsRequest::new().set_parent("example");
5222 /// ```
5223 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5224 self.parent = v.into();
5225 self
5226 }
5227
5228 /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
5229 ///
5230 /// # Example
5231 /// ```ignore,no_run
5232 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5233 /// let x = ListTargetsRequest::new().set_page_size(42);
5234 /// ```
5235 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5236 self.page_size = v.into();
5237 self
5238 }
5239
5240 /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
5241 ///
5242 /// # Example
5243 /// ```ignore,no_run
5244 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5245 /// let x = ListTargetsRequest::new().set_page_token("example");
5246 /// ```
5247 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5248 self.page_token = v.into();
5249 self
5250 }
5251
5252 /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
5253 ///
5254 /// # Example
5255 /// ```ignore,no_run
5256 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5257 /// let x = ListTargetsRequest::new().set_filter("example");
5258 /// ```
5259 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5260 self.filter = v.into();
5261 self
5262 }
5263
5264 /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
5265 ///
5266 /// # Example
5267 /// ```ignore,no_run
5268 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5269 /// let x = ListTargetsRequest::new().set_order_by("example");
5270 /// ```
5271 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5272 self.order_by = v.into();
5273 self
5274 }
5275}
5276
5277impl wkt::message::Message for ListTargetsRequest {
5278 fn typename() -> &'static str {
5279 "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
5280 }
5281}
5282
5283/// The response object from `ListTargets`.
5284#[derive(Clone, Default, PartialEq)]
5285#[non_exhaustive]
5286pub struct ListTargetsResponse {
5287 /// The `Target` objects.
5288 pub targets: std::vec::Vec<crate::model::Target>,
5289
5290 /// A token, which can be sent as `page_token` to retrieve the next page.
5291 /// If this field is omitted, there are no subsequent pages.
5292 pub next_page_token: std::string::String,
5293
5294 /// Locations that could not be reached.
5295 pub unreachable: std::vec::Vec<std::string::String>,
5296
5297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5298}
5299
5300impl ListTargetsResponse {
5301 pub fn new() -> Self {
5302 std::default::Default::default()
5303 }
5304
5305 /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
5306 ///
5307 /// # Example
5308 /// ```ignore,no_run
5309 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5310 /// use google_cloud_deploy_v1::model::Target;
5311 /// let x = ListTargetsResponse::new()
5312 /// .set_targets([
5313 /// Target::default()/* use setters */,
5314 /// Target::default()/* use (different) setters */,
5315 /// ]);
5316 /// ```
5317 pub fn set_targets<T, V>(mut self, v: T) -> Self
5318 where
5319 T: std::iter::IntoIterator<Item = V>,
5320 V: std::convert::Into<crate::model::Target>,
5321 {
5322 use std::iter::Iterator;
5323 self.targets = v.into_iter().map(|i| i.into()).collect();
5324 self
5325 }
5326
5327 /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
5328 ///
5329 /// # Example
5330 /// ```ignore,no_run
5331 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5332 /// let x = ListTargetsResponse::new().set_next_page_token("example");
5333 /// ```
5334 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5335 self.next_page_token = v.into();
5336 self
5337 }
5338
5339 /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
5340 ///
5341 /// # Example
5342 /// ```ignore,no_run
5343 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5344 /// let x = ListTargetsResponse::new().set_unreachable(["a", "b", "c"]);
5345 /// ```
5346 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5347 where
5348 T: std::iter::IntoIterator<Item = V>,
5349 V: std::convert::Into<std::string::String>,
5350 {
5351 use std::iter::Iterator;
5352 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5353 self
5354 }
5355}
5356
5357impl wkt::message::Message for ListTargetsResponse {
5358 fn typename() -> &'static str {
5359 "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
5360 }
5361}
5362
5363#[doc(hidden)]
5364impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetsResponse {
5365 type PageItem = crate::model::Target;
5366
5367 fn items(self) -> std::vec::Vec<Self::PageItem> {
5368 self.targets
5369 }
5370
5371 fn next_page_token(&self) -> std::string::String {
5372 use std::clone::Clone;
5373 self.next_page_token.clone()
5374 }
5375}
5376
5377/// The request object for `GetTarget`.
5378#[derive(Clone, Default, PartialEq)]
5379#[non_exhaustive]
5380pub struct GetTargetRequest {
5381 /// Required. Name of the `Target`. Format must be
5382 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5383 pub name: std::string::String,
5384
5385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5386}
5387
5388impl GetTargetRequest {
5389 pub fn new() -> Self {
5390 std::default::Default::default()
5391 }
5392
5393 /// Sets the value of [name][crate::model::GetTargetRequest::name].
5394 ///
5395 /// # Example
5396 /// ```ignore,no_run
5397 /// # use google_cloud_deploy_v1::model::GetTargetRequest;
5398 /// let x = GetTargetRequest::new().set_name("example");
5399 /// ```
5400 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5401 self.name = v.into();
5402 self
5403 }
5404}
5405
5406impl wkt::message::Message for GetTargetRequest {
5407 fn typename() -> &'static str {
5408 "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
5409 }
5410}
5411
5412/// The request object for `CreateTarget`.
5413#[derive(Clone, Default, PartialEq)]
5414#[non_exhaustive]
5415pub struct CreateTargetRequest {
5416 /// Required. The parent collection in which the `Target` must be created.
5417 /// The format is
5418 /// `projects/{project_id}/locations/{location_name}`.
5419 pub parent: std::string::String,
5420
5421 /// Required. ID of the `Target`.
5422 pub target_id: std::string::String,
5423
5424 /// Required. The `Target` to create.
5425 pub target: std::option::Option<crate::model::Target>,
5426
5427 /// Optional. A request ID to identify requests. Specify a unique request ID
5428 /// so that if you must retry your request, the server knows to ignore the
5429 /// request if it has already been completed. The server guarantees that for
5430 /// at least 60 minutes after the first request.
5431 ///
5432 /// For example, consider a situation where you make an initial request and the
5433 /// request times out. If you make the request again with the same request ID,
5434 /// the server can check if original operation with the same request ID was
5435 /// received, and if so, will ignore the second request. This prevents clients
5436 /// from accidentally creating duplicate commitments.
5437 ///
5438 /// The request ID must be a valid UUID with the exception that zero UUID is
5439 /// not supported (00000000-0000-0000-0000-000000000000).
5440 pub request_id: std::string::String,
5441
5442 /// Optional. If set to true, the request is validated and the user is provided
5443 /// with an expected result, but no actual change is made.
5444 pub validate_only: bool,
5445
5446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5447}
5448
5449impl CreateTargetRequest {
5450 pub fn new() -> Self {
5451 std::default::Default::default()
5452 }
5453
5454 /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
5455 ///
5456 /// # Example
5457 /// ```ignore,no_run
5458 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5459 /// let x = CreateTargetRequest::new().set_parent("example");
5460 /// ```
5461 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5462 self.parent = v.into();
5463 self
5464 }
5465
5466 /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
5467 ///
5468 /// # Example
5469 /// ```ignore,no_run
5470 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5471 /// let x = CreateTargetRequest::new().set_target_id("example");
5472 /// ```
5473 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5474 self.target_id = v.into();
5475 self
5476 }
5477
5478 /// Sets the value of [target][crate::model::CreateTargetRequest::target].
5479 ///
5480 /// # Example
5481 /// ```ignore,no_run
5482 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5483 /// use google_cloud_deploy_v1::model::Target;
5484 /// let x = CreateTargetRequest::new().set_target(Target::default()/* use setters */);
5485 /// ```
5486 pub fn set_target<T>(mut self, v: T) -> Self
5487 where
5488 T: std::convert::Into<crate::model::Target>,
5489 {
5490 self.target = std::option::Option::Some(v.into());
5491 self
5492 }
5493
5494 /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
5495 ///
5496 /// # Example
5497 /// ```ignore,no_run
5498 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5499 /// use google_cloud_deploy_v1::model::Target;
5500 /// let x = CreateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5501 /// let x = CreateTargetRequest::new().set_or_clear_target(None::<Target>);
5502 /// ```
5503 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5504 where
5505 T: std::convert::Into<crate::model::Target>,
5506 {
5507 self.target = v.map(|x| x.into());
5508 self
5509 }
5510
5511 /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
5512 ///
5513 /// # Example
5514 /// ```ignore,no_run
5515 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5516 /// let x = CreateTargetRequest::new().set_request_id("example");
5517 /// ```
5518 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5519 self.request_id = v.into();
5520 self
5521 }
5522
5523 /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
5524 ///
5525 /// # Example
5526 /// ```ignore,no_run
5527 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5528 /// let x = CreateTargetRequest::new().set_validate_only(true);
5529 /// ```
5530 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5531 self.validate_only = v.into();
5532 self
5533 }
5534}
5535
5536impl wkt::message::Message for CreateTargetRequest {
5537 fn typename() -> &'static str {
5538 "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
5539 }
5540}
5541
5542/// The request object for `UpdateTarget`.
5543#[derive(Clone, Default, PartialEq)]
5544#[non_exhaustive]
5545pub struct UpdateTargetRequest {
5546 /// Required. Field mask is used to specify the fields to be overwritten by the
5547 /// update in the `Target` resource. The fields specified in the update_mask
5548 /// are relative to the resource, not the full request. A field will be
5549 /// overwritten if it's in the mask. If the user doesn't provide a mask then
5550 /// all fields are overwritten.
5551 pub update_mask: std::option::Option<wkt::FieldMask>,
5552
5553 /// Required. The `Target` to update.
5554 pub target: std::option::Option<crate::model::Target>,
5555
5556 /// Optional. A request ID to identify requests. Specify a unique request ID
5557 /// so that if you must retry your request, the server knows to ignore the
5558 /// request if it has already been completed. The server guarantees that for
5559 /// at least 60 minutes after the first request.
5560 ///
5561 /// For example, consider a situation where you make an initial request and the
5562 /// request times out. If you make the request again with the same request ID,
5563 /// the server can check if original operation with the same request ID was
5564 /// received, and if so, will ignore the second request. This prevents clients
5565 /// from accidentally creating duplicate commitments.
5566 ///
5567 /// The request ID must be a valid UUID with the exception that zero UUID is
5568 /// not supported (00000000-0000-0000-0000-000000000000).
5569 pub request_id: std::string::String,
5570
5571 /// Optional. If set to true, updating a `Target` that does not exist will
5572 /// result in the creation of a new `Target`.
5573 pub allow_missing: bool,
5574
5575 /// Optional. If set to true, the request is validated and the user is provided
5576 /// with an expected result, but no actual change is made.
5577 pub validate_only: bool,
5578
5579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5580}
5581
5582impl UpdateTargetRequest {
5583 pub fn new() -> Self {
5584 std::default::Default::default()
5585 }
5586
5587 /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5588 ///
5589 /// # Example
5590 /// ```ignore,no_run
5591 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5592 /// use wkt::FieldMask;
5593 /// let x = UpdateTargetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5594 /// ```
5595 pub fn set_update_mask<T>(mut self, v: T) -> Self
5596 where
5597 T: std::convert::Into<wkt::FieldMask>,
5598 {
5599 self.update_mask = std::option::Option::Some(v.into());
5600 self
5601 }
5602
5603 /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5604 ///
5605 /// # Example
5606 /// ```ignore,no_run
5607 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5608 /// use wkt::FieldMask;
5609 /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5610 /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5611 /// ```
5612 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5613 where
5614 T: std::convert::Into<wkt::FieldMask>,
5615 {
5616 self.update_mask = v.map(|x| x.into());
5617 self
5618 }
5619
5620 /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
5621 ///
5622 /// # Example
5623 /// ```ignore,no_run
5624 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5625 /// use google_cloud_deploy_v1::model::Target;
5626 /// let x = UpdateTargetRequest::new().set_target(Target::default()/* use setters */);
5627 /// ```
5628 pub fn set_target<T>(mut self, v: T) -> Self
5629 where
5630 T: std::convert::Into<crate::model::Target>,
5631 {
5632 self.target = std::option::Option::Some(v.into());
5633 self
5634 }
5635
5636 /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
5637 ///
5638 /// # Example
5639 /// ```ignore,no_run
5640 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5641 /// use google_cloud_deploy_v1::model::Target;
5642 /// let x = UpdateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5643 /// let x = UpdateTargetRequest::new().set_or_clear_target(None::<Target>);
5644 /// ```
5645 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5646 where
5647 T: std::convert::Into<crate::model::Target>,
5648 {
5649 self.target = v.map(|x| x.into());
5650 self
5651 }
5652
5653 /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
5654 ///
5655 /// # Example
5656 /// ```ignore,no_run
5657 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5658 /// let x = UpdateTargetRequest::new().set_request_id("example");
5659 /// ```
5660 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5661 self.request_id = v.into();
5662 self
5663 }
5664
5665 /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
5666 ///
5667 /// # Example
5668 /// ```ignore,no_run
5669 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5670 /// let x = UpdateTargetRequest::new().set_allow_missing(true);
5671 /// ```
5672 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5673 self.allow_missing = v.into();
5674 self
5675 }
5676
5677 /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
5678 ///
5679 /// # Example
5680 /// ```ignore,no_run
5681 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5682 /// let x = UpdateTargetRequest::new().set_validate_only(true);
5683 /// ```
5684 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5685 self.validate_only = v.into();
5686 self
5687 }
5688}
5689
5690impl wkt::message::Message for UpdateTargetRequest {
5691 fn typename() -> &'static str {
5692 "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
5693 }
5694}
5695
5696/// The request object for `DeleteTarget`.
5697#[derive(Clone, Default, PartialEq)]
5698#[non_exhaustive]
5699pub struct DeleteTargetRequest {
5700 /// Required. The name of the `Target` to delete. The format is
5701 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5702 pub name: std::string::String,
5703
5704 /// Optional. A request ID to identify requests. Specify a unique request ID
5705 /// so that if you must retry your request, the server knows to ignore the
5706 /// request if it has already been completed. The server guarantees that for
5707 /// at least 60 minutes after the first request.
5708 ///
5709 /// For example, consider a situation where you make an initial request and the
5710 /// request times out. If you make the request again with the same request ID,
5711 /// the server can check if original operation with the same request ID was
5712 /// received, and if so, will ignore the second request. This prevents clients
5713 /// from accidentally creating duplicate commitments.
5714 ///
5715 /// The request ID must be a valid UUID with the exception that zero UUID is
5716 /// not supported (00000000-0000-0000-0000-000000000000).
5717 pub request_id: std::string::String,
5718
5719 /// Optional. If set to true, then deleting an already deleted or non-existing
5720 /// `Target` will succeed.
5721 pub allow_missing: bool,
5722
5723 /// Optional. If set, validate the request and preview the review, but do not
5724 /// actually post it.
5725 pub validate_only: bool,
5726
5727 /// Optional. This checksum is computed by the server based on the value of
5728 /// other fields, and may be sent on update and delete requests to ensure the
5729 /// client has an up-to-date value before proceeding.
5730 pub etag: std::string::String,
5731
5732 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5733}
5734
5735impl DeleteTargetRequest {
5736 pub fn new() -> Self {
5737 std::default::Default::default()
5738 }
5739
5740 /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5745 /// let x = DeleteTargetRequest::new().set_name("example");
5746 /// ```
5747 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5748 self.name = v.into();
5749 self
5750 }
5751
5752 /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
5753 ///
5754 /// # Example
5755 /// ```ignore,no_run
5756 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5757 /// let x = DeleteTargetRequest::new().set_request_id("example");
5758 /// ```
5759 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5760 self.request_id = v.into();
5761 self
5762 }
5763
5764 /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
5765 ///
5766 /// # Example
5767 /// ```ignore,no_run
5768 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5769 /// let x = DeleteTargetRequest::new().set_allow_missing(true);
5770 /// ```
5771 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5772 self.allow_missing = v.into();
5773 self
5774 }
5775
5776 /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
5777 ///
5778 /// # Example
5779 /// ```ignore,no_run
5780 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5781 /// let x = DeleteTargetRequest::new().set_validate_only(true);
5782 /// ```
5783 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5784 self.validate_only = v.into();
5785 self
5786 }
5787
5788 /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
5789 ///
5790 /// # Example
5791 /// ```ignore,no_run
5792 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5793 /// let x = DeleteTargetRequest::new().set_etag("example");
5794 /// ```
5795 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5796 self.etag = v.into();
5797 self
5798 }
5799}
5800
5801impl wkt::message::Message for DeleteTargetRequest {
5802 fn typename() -> &'static str {
5803 "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
5804 }
5805}
5806
5807/// A `CustomTargetType` resource in the Cloud Deploy API.
5808///
5809/// A `CustomTargetType` defines a type of custom target that can be referenced
5810/// in a `Target` in order to facilitate deploying to other systems besides the
5811/// supported runtimes.
5812#[derive(Clone, Default, PartialEq)]
5813#[non_exhaustive]
5814pub struct CustomTargetType {
5815 /// Identifier. Name of the `CustomTargetType`. Format is
5816 /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
5817 /// The `customTargetType` component must match
5818 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5819 pub name: std::string::String,
5820
5821 /// Output only. Resource id of the `CustomTargetType`.
5822 pub custom_target_type_id: std::string::String,
5823
5824 /// Output only. Unique identifier of the `CustomTargetType`.
5825 pub uid: std::string::String,
5826
5827 /// Optional. Description of the `CustomTargetType`. Max length is 255
5828 /// characters.
5829 pub description: std::string::String,
5830
5831 /// Optional. User annotations. These attributes can only be set and used by
5832 /// the user, and not by Cloud Deploy. See
5833 /// <https://google.aip.dev/128#annotations> for more details such as format and
5834 /// size limitations.
5835 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5836
5837 /// Optional. Labels are attributes that can be set and used by both the
5838 /// user and by Cloud Deploy. Labels must meet the following constraints:
5839 ///
5840 /// * Keys and values can contain only lowercase letters, numeric characters,
5841 /// underscores, and dashes.
5842 /// * All characters must use UTF-8 encoding, and international characters are
5843 /// allowed.
5844 /// * Keys must start with a lowercase letter or international character.
5845 /// * Each resource is limited to a maximum of 64 labels.
5846 ///
5847 /// Both keys and values are additionally constrained to be <= 128 bytes.
5848 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5849
5850 /// Output only. Time at which the `CustomTargetType` was created.
5851 pub create_time: std::option::Option<wkt::Timestamp>,
5852
5853 /// Output only. Most recent time at which the `CustomTargetType` was updated.
5854 pub update_time: std::option::Option<wkt::Timestamp>,
5855
5856 /// Optional. This checksum is computed by the server based on the value of
5857 /// other fields, and may be sent on update and delete requests to ensure the
5858 /// client has an up-to-date value before proceeding.
5859 pub etag: std::string::String,
5860
5861 /// Defines the `CustomTargetType` renderer and deployer.
5862 pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
5863
5864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5865}
5866
5867impl CustomTargetType {
5868 pub fn new() -> Self {
5869 std::default::Default::default()
5870 }
5871
5872 /// Sets the value of [name][crate::model::CustomTargetType::name].
5873 ///
5874 /// # Example
5875 /// ```ignore,no_run
5876 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5877 /// let x = CustomTargetType::new().set_name("example");
5878 /// ```
5879 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5880 self.name = v.into();
5881 self
5882 }
5883
5884 /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
5885 ///
5886 /// # Example
5887 /// ```ignore,no_run
5888 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5889 /// let x = CustomTargetType::new().set_custom_target_type_id("example");
5890 /// ```
5891 pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5892 mut self,
5893 v: T,
5894 ) -> Self {
5895 self.custom_target_type_id = v.into();
5896 self
5897 }
5898
5899 /// Sets the value of [uid][crate::model::CustomTargetType::uid].
5900 ///
5901 /// # Example
5902 /// ```ignore,no_run
5903 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5904 /// let x = CustomTargetType::new().set_uid("example");
5905 /// ```
5906 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5907 self.uid = v.into();
5908 self
5909 }
5910
5911 /// Sets the value of [description][crate::model::CustomTargetType::description].
5912 ///
5913 /// # Example
5914 /// ```ignore,no_run
5915 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5916 /// let x = CustomTargetType::new().set_description("example");
5917 /// ```
5918 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5919 self.description = v.into();
5920 self
5921 }
5922
5923 /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
5924 ///
5925 /// # Example
5926 /// ```ignore,no_run
5927 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5928 /// let x = CustomTargetType::new().set_annotations([
5929 /// ("key0", "abc"),
5930 /// ("key1", "xyz"),
5931 /// ]);
5932 /// ```
5933 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5934 where
5935 T: std::iter::IntoIterator<Item = (K, V)>,
5936 K: std::convert::Into<std::string::String>,
5937 V: std::convert::Into<std::string::String>,
5938 {
5939 use std::iter::Iterator;
5940 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5941 self
5942 }
5943
5944 /// Sets the value of [labels][crate::model::CustomTargetType::labels].
5945 ///
5946 /// # Example
5947 /// ```ignore,no_run
5948 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5949 /// let x = CustomTargetType::new().set_labels([
5950 /// ("key0", "abc"),
5951 /// ("key1", "xyz"),
5952 /// ]);
5953 /// ```
5954 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5955 where
5956 T: std::iter::IntoIterator<Item = (K, V)>,
5957 K: std::convert::Into<std::string::String>,
5958 V: std::convert::Into<std::string::String>,
5959 {
5960 use std::iter::Iterator;
5961 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5962 self
5963 }
5964
5965 /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
5966 ///
5967 /// # Example
5968 /// ```ignore,no_run
5969 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5970 /// use wkt::Timestamp;
5971 /// let x = CustomTargetType::new().set_create_time(Timestamp::default()/* use setters */);
5972 /// ```
5973 pub fn set_create_time<T>(mut self, v: T) -> Self
5974 where
5975 T: std::convert::Into<wkt::Timestamp>,
5976 {
5977 self.create_time = std::option::Option::Some(v.into());
5978 self
5979 }
5980
5981 /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
5982 ///
5983 /// # Example
5984 /// ```ignore,no_run
5985 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5986 /// use wkt::Timestamp;
5987 /// let x = CustomTargetType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5988 /// let x = CustomTargetType::new().set_or_clear_create_time(None::<Timestamp>);
5989 /// ```
5990 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5991 where
5992 T: std::convert::Into<wkt::Timestamp>,
5993 {
5994 self.create_time = v.map(|x| x.into());
5995 self
5996 }
5997
5998 /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
5999 ///
6000 /// # Example
6001 /// ```ignore,no_run
6002 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6003 /// use wkt::Timestamp;
6004 /// let x = CustomTargetType::new().set_update_time(Timestamp::default()/* use setters */);
6005 /// ```
6006 pub fn set_update_time<T>(mut self, v: T) -> Self
6007 where
6008 T: std::convert::Into<wkt::Timestamp>,
6009 {
6010 self.update_time = std::option::Option::Some(v.into());
6011 self
6012 }
6013
6014 /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
6015 ///
6016 /// # Example
6017 /// ```ignore,no_run
6018 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6019 /// use wkt::Timestamp;
6020 /// let x = CustomTargetType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6021 /// let x = CustomTargetType::new().set_or_clear_update_time(None::<Timestamp>);
6022 /// ```
6023 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6024 where
6025 T: std::convert::Into<wkt::Timestamp>,
6026 {
6027 self.update_time = v.map(|x| x.into());
6028 self
6029 }
6030
6031 /// Sets the value of [etag][crate::model::CustomTargetType::etag].
6032 ///
6033 /// # Example
6034 /// ```ignore,no_run
6035 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6036 /// let x = CustomTargetType::new().set_etag("example");
6037 /// ```
6038 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6039 self.etag = v.into();
6040 self
6041 }
6042
6043 /// Sets the value of [definition][crate::model::CustomTargetType::definition].
6044 ///
6045 /// Note that all the setters affecting `definition` are mutually
6046 /// exclusive.
6047 ///
6048 /// # Example
6049 /// ```ignore,no_run
6050 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6051 /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6052 /// let x = CustomTargetType::new().set_definition(Some(
6053 /// google_cloud_deploy_v1::model::custom_target_type::Definition::CustomActions(CustomTargetSkaffoldActions::default().into())));
6054 /// ```
6055 pub fn set_definition<
6056 T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
6057 >(
6058 mut self,
6059 v: T,
6060 ) -> Self {
6061 self.definition = v.into();
6062 self
6063 }
6064
6065 /// The value of [definition][crate::model::CustomTargetType::definition]
6066 /// if it holds a `CustomActions`, `None` if the field is not set or
6067 /// holds a different branch.
6068 pub fn custom_actions(
6069 &self,
6070 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
6071 #[allow(unreachable_patterns)]
6072 self.definition.as_ref().and_then(|v| match v {
6073 crate::model::custom_target_type::Definition::CustomActions(v) => {
6074 std::option::Option::Some(v)
6075 }
6076 _ => std::option::Option::None,
6077 })
6078 }
6079
6080 /// Sets the value of [definition][crate::model::CustomTargetType::definition]
6081 /// to hold a `CustomActions`.
6082 ///
6083 /// Note that all the setters affecting `definition` are
6084 /// mutually exclusive.
6085 ///
6086 /// # Example
6087 /// ```ignore,no_run
6088 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6089 /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6090 /// let x = CustomTargetType::new().set_custom_actions(CustomTargetSkaffoldActions::default()/* use setters */);
6091 /// assert!(x.custom_actions().is_some());
6092 /// ```
6093 pub fn set_custom_actions<
6094 T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
6095 >(
6096 mut self,
6097 v: T,
6098 ) -> Self {
6099 self.definition = std::option::Option::Some(
6100 crate::model::custom_target_type::Definition::CustomActions(v.into()),
6101 );
6102 self
6103 }
6104}
6105
6106impl wkt::message::Message for CustomTargetType {
6107 fn typename() -> &'static str {
6108 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
6109 }
6110}
6111
6112/// Defines additional types related to [CustomTargetType].
6113pub mod custom_target_type {
6114 #[allow(unused_imports)]
6115 use super::*;
6116
6117 /// Defines the `CustomTargetType` renderer and deployer.
6118 #[derive(Clone, Debug, PartialEq)]
6119 #[non_exhaustive]
6120 pub enum Definition {
6121 /// Optional. Configures render and deploy for the `CustomTargetType` using
6122 /// Skaffold custom actions.
6123 CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
6124 }
6125}
6126
6127/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
6128/// using Skaffold custom actions.
6129#[derive(Clone, Default, PartialEq)]
6130#[non_exhaustive]
6131pub struct CustomTargetSkaffoldActions {
6132 /// Optional. The Skaffold custom action responsible for render operations. If
6133 /// not provided then Cloud Deploy will perform the render operations via
6134 /// `skaffold render`.
6135 pub render_action: std::string::String,
6136
6137 /// Required. The Skaffold custom action responsible for deploy operations.
6138 pub deploy_action: std::string::String,
6139
6140 /// Optional. List of Skaffold modules Cloud Deploy will include in the
6141 /// Skaffold Config as required before performing diagnose.
6142 pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
6143
6144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6145}
6146
6147impl CustomTargetSkaffoldActions {
6148 pub fn new() -> Self {
6149 std::default::Default::default()
6150 }
6151
6152 /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
6153 ///
6154 /// # Example
6155 /// ```ignore,no_run
6156 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6157 /// let x = CustomTargetSkaffoldActions::new().set_render_action("example");
6158 /// ```
6159 pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6160 self.render_action = v.into();
6161 self
6162 }
6163
6164 /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
6165 ///
6166 /// # Example
6167 /// ```ignore,no_run
6168 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6169 /// let x = CustomTargetSkaffoldActions::new().set_deploy_action("example");
6170 /// ```
6171 pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6172 self.deploy_action = v.into();
6173 self
6174 }
6175
6176 /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
6177 ///
6178 /// # Example
6179 /// ```ignore,no_run
6180 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6181 /// use google_cloud_deploy_v1::model::SkaffoldModules;
6182 /// let x = CustomTargetSkaffoldActions::new()
6183 /// .set_include_skaffold_modules([
6184 /// SkaffoldModules::default()/* use setters */,
6185 /// SkaffoldModules::default()/* use (different) setters */,
6186 /// ]);
6187 /// ```
6188 pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
6189 where
6190 T: std::iter::IntoIterator<Item = V>,
6191 V: std::convert::Into<crate::model::SkaffoldModules>,
6192 {
6193 use std::iter::Iterator;
6194 self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
6195 self
6196 }
6197}
6198
6199impl wkt::message::Message for CustomTargetSkaffoldActions {
6200 fn typename() -> &'static str {
6201 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
6202 }
6203}
6204
6205/// Skaffold Config modules and their remote source.
6206#[derive(Clone, Default, PartialEq)]
6207#[non_exhaustive]
6208pub struct SkaffoldModules {
6209 /// Optional. The Skaffold Config modules to use from the specified source.
6210 pub configs: std::vec::Vec<std::string::String>,
6211
6212 /// The source that contains the Skaffold Config modules.
6213 pub source: std::option::Option<crate::model::skaffold_modules::Source>,
6214
6215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6216}
6217
6218impl SkaffoldModules {
6219 pub fn new() -> Self {
6220 std::default::Default::default()
6221 }
6222
6223 /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
6224 ///
6225 /// # Example
6226 /// ```ignore,no_run
6227 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6228 /// let x = SkaffoldModules::new().set_configs(["a", "b", "c"]);
6229 /// ```
6230 pub fn set_configs<T, V>(mut self, v: T) -> Self
6231 where
6232 T: std::iter::IntoIterator<Item = V>,
6233 V: std::convert::Into<std::string::String>,
6234 {
6235 use std::iter::Iterator;
6236 self.configs = v.into_iter().map(|i| i.into()).collect();
6237 self
6238 }
6239
6240 /// Sets the value of [source][crate::model::SkaffoldModules::source].
6241 ///
6242 /// Note that all the setters affecting `source` are mutually
6243 /// exclusive.
6244 ///
6245 /// # Example
6246 /// ```ignore,no_run
6247 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6248 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6249 /// let x = SkaffoldModules::new().set_source(Some(
6250 /// google_cloud_deploy_v1::model::skaffold_modules::Source::Git(SkaffoldGitSource::default().into())));
6251 /// ```
6252 pub fn set_source<
6253 T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
6254 >(
6255 mut self,
6256 v: T,
6257 ) -> Self {
6258 self.source = v.into();
6259 self
6260 }
6261
6262 /// The value of [source][crate::model::SkaffoldModules::source]
6263 /// if it holds a `Git`, `None` if the field is not set or
6264 /// holds a different branch.
6265 pub fn git(
6266 &self,
6267 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
6268 {
6269 #[allow(unreachable_patterns)]
6270 self.source.as_ref().and_then(|v| match v {
6271 crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
6272 _ => std::option::Option::None,
6273 })
6274 }
6275
6276 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6277 /// to hold a `Git`.
6278 ///
6279 /// Note that all the setters affecting `source` are
6280 /// mutually exclusive.
6281 ///
6282 /// # Example
6283 /// ```ignore,no_run
6284 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6285 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6286 /// let x = SkaffoldModules::new().set_git(SkaffoldGitSource::default()/* use setters */);
6287 /// assert!(x.git().is_some());
6288 /// assert!(x.google_cloud_storage().is_none());
6289 /// assert!(x.google_cloud_build_repo().is_none());
6290 /// ```
6291 pub fn set_git<
6292 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
6293 >(
6294 mut self,
6295 v: T,
6296 ) -> Self {
6297 self.source =
6298 std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
6299 self
6300 }
6301
6302 /// The value of [source][crate::model::SkaffoldModules::source]
6303 /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
6304 /// holds a different branch.
6305 pub fn google_cloud_storage(
6306 &self,
6307 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
6308 {
6309 #[allow(unreachable_patterns)]
6310 self.source.as_ref().and_then(|v| match v {
6311 crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
6312 std::option::Option::Some(v)
6313 }
6314 _ => std::option::Option::None,
6315 })
6316 }
6317
6318 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6319 /// to hold a `GoogleCloudStorage`.
6320 ///
6321 /// Note that all the setters affecting `source` are
6322 /// mutually exclusive.
6323 ///
6324 /// # Example
6325 /// ```ignore,no_run
6326 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6327 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6328 /// let x = SkaffoldModules::new().set_google_cloud_storage(SkaffoldGCSSource::default()/* use setters */);
6329 /// assert!(x.google_cloud_storage().is_some());
6330 /// assert!(x.git().is_none());
6331 /// assert!(x.google_cloud_build_repo().is_none());
6332 /// ```
6333 pub fn set_google_cloud_storage<
6334 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
6335 >(
6336 mut self,
6337 v: T,
6338 ) -> Self {
6339 self.source = std::option::Option::Some(
6340 crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
6341 );
6342 self
6343 }
6344
6345 /// The value of [source][crate::model::SkaffoldModules::source]
6346 /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
6347 /// holds a different branch.
6348 pub fn google_cloud_build_repo(
6349 &self,
6350 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
6351 {
6352 #[allow(unreachable_patterns)]
6353 self.source.as_ref().and_then(|v| match v {
6354 crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
6355 std::option::Option::Some(v)
6356 }
6357 _ => std::option::Option::None,
6358 })
6359 }
6360
6361 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6362 /// to hold a `GoogleCloudBuildRepo`.
6363 ///
6364 /// Note that all the setters affecting `source` are
6365 /// mutually exclusive.
6366 ///
6367 /// # Example
6368 /// ```ignore,no_run
6369 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6370 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6371 /// let x = SkaffoldModules::new().set_google_cloud_build_repo(SkaffoldGCBRepoSource::default()/* use setters */);
6372 /// assert!(x.google_cloud_build_repo().is_some());
6373 /// assert!(x.git().is_none());
6374 /// assert!(x.google_cloud_storage().is_none());
6375 /// ```
6376 pub fn set_google_cloud_build_repo<
6377 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
6378 >(
6379 mut self,
6380 v: T,
6381 ) -> Self {
6382 self.source = std::option::Option::Some(
6383 crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
6384 );
6385 self
6386 }
6387}
6388
6389impl wkt::message::Message for SkaffoldModules {
6390 fn typename() -> &'static str {
6391 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
6392 }
6393}
6394
6395/// Defines additional types related to [SkaffoldModules].
6396pub mod skaffold_modules {
6397 #[allow(unused_imports)]
6398 use super::*;
6399
6400 /// Git repository containing Skaffold Config modules.
6401 #[derive(Clone, Default, PartialEq)]
6402 #[non_exhaustive]
6403 pub struct SkaffoldGitSource {
6404 /// Required. Git repository the package should be cloned from.
6405 pub repo: std::string::String,
6406
6407 /// Optional. Relative path from the repository root to the Skaffold file.
6408 pub path: std::string::String,
6409
6410 /// Optional. Git branch or tag to use when cloning the repository.
6411 pub r#ref: std::string::String,
6412
6413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6414 }
6415
6416 impl SkaffoldGitSource {
6417 pub fn new() -> Self {
6418 std::default::Default::default()
6419 }
6420
6421 /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
6422 ///
6423 /// # Example
6424 /// ```ignore,no_run
6425 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6426 /// let x = SkaffoldGitSource::new().set_repo("example");
6427 /// ```
6428 pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6429 self.repo = v.into();
6430 self
6431 }
6432
6433 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
6434 ///
6435 /// # Example
6436 /// ```ignore,no_run
6437 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6438 /// let x = SkaffoldGitSource::new().set_path("example");
6439 /// ```
6440 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6441 self.path = v.into();
6442 self
6443 }
6444
6445 /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
6446 ///
6447 /// # Example
6448 /// ```ignore,no_run
6449 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6450 /// let x = SkaffoldGitSource::new().set_ref("example");
6451 /// ```
6452 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6453 self.r#ref = v.into();
6454 self
6455 }
6456 }
6457
6458 impl wkt::message::Message for SkaffoldGitSource {
6459 fn typename() -> &'static str {
6460 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
6461 }
6462 }
6463
6464 /// Cloud Storage bucket containing Skaffold Config modules.
6465 #[derive(Clone, Default, PartialEq)]
6466 #[non_exhaustive]
6467 pub struct SkaffoldGCSSource {
6468 /// Required. Cloud Storage source paths to copy recursively. For example,
6469 /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
6470 /// all files within the "dir/configs" directory in the bucket "my-bucket".
6471 pub source: std::string::String,
6472
6473 /// Optional. Relative path from the source to the Skaffold file.
6474 pub path: std::string::String,
6475
6476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6477 }
6478
6479 impl SkaffoldGCSSource {
6480 pub fn new() -> Self {
6481 std::default::Default::default()
6482 }
6483
6484 /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
6485 ///
6486 /// # Example
6487 /// ```ignore,no_run
6488 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6489 /// let x = SkaffoldGCSSource::new().set_source("example");
6490 /// ```
6491 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6492 self.source = v.into();
6493 self
6494 }
6495
6496 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
6497 ///
6498 /// # Example
6499 /// ```ignore,no_run
6500 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6501 /// let x = SkaffoldGCSSource::new().set_path("example");
6502 /// ```
6503 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6504 self.path = v.into();
6505 self
6506 }
6507 }
6508
6509 impl wkt::message::Message for SkaffoldGCSSource {
6510 fn typename() -> &'static str {
6511 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
6512 }
6513 }
6514
6515 /// Cloud Build V2 Repository containing Skaffold Configs.
6516 #[derive(Clone, Default, PartialEq)]
6517 #[non_exhaustive]
6518 pub struct SkaffoldGCBRepoSource {
6519 /// Required. Name of the Cloud Build V2 Repository.
6520 /// Format is
6521 /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
6522 pub repository: std::string::String,
6523
6524 /// Optional. Relative path from the repository root to the Skaffold Config
6525 /// file.
6526 pub path: std::string::String,
6527
6528 /// Optional. Branch or tag to use when cloning the repository.
6529 pub r#ref: std::string::String,
6530
6531 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6532 }
6533
6534 impl SkaffoldGCBRepoSource {
6535 pub fn new() -> Self {
6536 std::default::Default::default()
6537 }
6538
6539 /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
6540 ///
6541 /// # Example
6542 /// ```ignore,no_run
6543 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6544 /// let x = SkaffoldGCBRepoSource::new().set_repository("example");
6545 /// ```
6546 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6547 self.repository = v.into();
6548 self
6549 }
6550
6551 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
6552 ///
6553 /// # Example
6554 /// ```ignore,no_run
6555 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6556 /// let x = SkaffoldGCBRepoSource::new().set_path("example");
6557 /// ```
6558 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6559 self.path = v.into();
6560 self
6561 }
6562
6563 /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
6564 ///
6565 /// # Example
6566 /// ```ignore,no_run
6567 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6568 /// let x = SkaffoldGCBRepoSource::new().set_ref("example");
6569 /// ```
6570 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6571 self.r#ref = v.into();
6572 self
6573 }
6574 }
6575
6576 impl wkt::message::Message for SkaffoldGCBRepoSource {
6577 fn typename() -> &'static str {
6578 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
6579 }
6580 }
6581
6582 /// The source that contains the Skaffold Config modules.
6583 #[derive(Clone, Debug, PartialEq)]
6584 #[non_exhaustive]
6585 pub enum Source {
6586 /// Optional. Remote git repository containing the Skaffold Config modules.
6587 Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
6588 /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
6589 GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
6590 /// Optional. Cloud Build V2 repository containing the Skaffold Config
6591 /// modules.
6592 GoogleCloudBuildRepo(
6593 std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
6594 ),
6595 }
6596}
6597
6598/// The request object for `ListCustomTargetTypes`.
6599#[derive(Clone, Default, PartialEq)]
6600#[non_exhaustive]
6601pub struct ListCustomTargetTypesRequest {
6602 /// Required. The parent that owns this collection of custom target types.
6603 /// Format must be `projects/{project_id}/locations/{location_name}`.
6604 pub parent: std::string::String,
6605
6606 /// Optional. The maximum number of `CustomTargetType` objects to return. The
6607 /// service may return fewer than this value. If unspecified, at most 50
6608 /// `CustomTargetType` objects will be returned. The maximum value is 1000;
6609 /// values above 1000 will be set to 1000.
6610 pub page_size: i32,
6611
6612 /// Optional. A page token, received from a previous `ListCustomTargetTypes`
6613 /// call. Provide this to retrieve the subsequent page.
6614 ///
6615 /// When paginating, all other provided parameters match
6616 /// the call that provided the page token.
6617 pub page_token: std::string::String,
6618
6619 /// Optional. Filter custom target types to be returned. See
6620 /// <https://google.aip.dev/160> for more details.
6621 pub filter: std::string::String,
6622
6623 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
6624 /// more details.
6625 pub order_by: std::string::String,
6626
6627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6628}
6629
6630impl ListCustomTargetTypesRequest {
6631 pub fn new() -> Self {
6632 std::default::Default::default()
6633 }
6634
6635 /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
6636 ///
6637 /// # Example
6638 /// ```ignore,no_run
6639 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6640 /// let x = ListCustomTargetTypesRequest::new().set_parent("example");
6641 /// ```
6642 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643 self.parent = v.into();
6644 self
6645 }
6646
6647 /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
6648 ///
6649 /// # Example
6650 /// ```ignore,no_run
6651 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6652 /// let x = ListCustomTargetTypesRequest::new().set_page_size(42);
6653 /// ```
6654 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6655 self.page_size = v.into();
6656 self
6657 }
6658
6659 /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
6660 ///
6661 /// # Example
6662 /// ```ignore,no_run
6663 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6664 /// let x = ListCustomTargetTypesRequest::new().set_page_token("example");
6665 /// ```
6666 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6667 self.page_token = v.into();
6668 self
6669 }
6670
6671 /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
6672 ///
6673 /// # Example
6674 /// ```ignore,no_run
6675 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6676 /// let x = ListCustomTargetTypesRequest::new().set_filter("example");
6677 /// ```
6678 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6679 self.filter = v.into();
6680 self
6681 }
6682
6683 /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
6684 ///
6685 /// # Example
6686 /// ```ignore,no_run
6687 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6688 /// let x = ListCustomTargetTypesRequest::new().set_order_by("example");
6689 /// ```
6690 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6691 self.order_by = v.into();
6692 self
6693 }
6694}
6695
6696impl wkt::message::Message for ListCustomTargetTypesRequest {
6697 fn typename() -> &'static str {
6698 "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
6699 }
6700}
6701
6702/// The response object from `ListCustomTargetTypes.`
6703#[derive(Clone, Default, PartialEq)]
6704#[non_exhaustive]
6705pub struct ListCustomTargetTypesResponse {
6706 /// The `CustomTargetType` objects.
6707 pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
6708
6709 /// A token, which can be sent as `page_token` to retrieve the next page.
6710 /// If this field is omitted, there are no subsequent pages.
6711 pub next_page_token: std::string::String,
6712
6713 /// Locations that could not be reached.
6714 pub unreachable: std::vec::Vec<std::string::String>,
6715
6716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6717}
6718
6719impl ListCustomTargetTypesResponse {
6720 pub fn new() -> Self {
6721 std::default::Default::default()
6722 }
6723
6724 /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
6725 ///
6726 /// # Example
6727 /// ```ignore,no_run
6728 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6729 /// use google_cloud_deploy_v1::model::CustomTargetType;
6730 /// let x = ListCustomTargetTypesResponse::new()
6731 /// .set_custom_target_types([
6732 /// CustomTargetType::default()/* use setters */,
6733 /// CustomTargetType::default()/* use (different) setters */,
6734 /// ]);
6735 /// ```
6736 pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
6737 where
6738 T: std::iter::IntoIterator<Item = V>,
6739 V: std::convert::Into<crate::model::CustomTargetType>,
6740 {
6741 use std::iter::Iterator;
6742 self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
6743 self
6744 }
6745
6746 /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
6747 ///
6748 /// # Example
6749 /// ```ignore,no_run
6750 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6751 /// let x = ListCustomTargetTypesResponse::new().set_next_page_token("example");
6752 /// ```
6753 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6754 self.next_page_token = v.into();
6755 self
6756 }
6757
6758 /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
6759 ///
6760 /// # Example
6761 /// ```ignore,no_run
6762 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6763 /// let x = ListCustomTargetTypesResponse::new().set_unreachable(["a", "b", "c"]);
6764 /// ```
6765 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6766 where
6767 T: std::iter::IntoIterator<Item = V>,
6768 V: std::convert::Into<std::string::String>,
6769 {
6770 use std::iter::Iterator;
6771 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6772 self
6773 }
6774}
6775
6776impl wkt::message::Message for ListCustomTargetTypesResponse {
6777 fn typename() -> &'static str {
6778 "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
6779 }
6780}
6781
6782#[doc(hidden)]
6783impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
6784 type PageItem = crate::model::CustomTargetType;
6785
6786 fn items(self) -> std::vec::Vec<Self::PageItem> {
6787 self.custom_target_types
6788 }
6789
6790 fn next_page_token(&self) -> std::string::String {
6791 use std::clone::Clone;
6792 self.next_page_token.clone()
6793 }
6794}
6795
6796/// The request object for `GetCustomTargetType`.
6797#[derive(Clone, Default, PartialEq)]
6798#[non_exhaustive]
6799pub struct GetCustomTargetTypeRequest {
6800 /// Required. Name of the `CustomTargetType`. Format must be
6801 /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
6802 pub name: std::string::String,
6803
6804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6805}
6806
6807impl GetCustomTargetTypeRequest {
6808 pub fn new() -> Self {
6809 std::default::Default::default()
6810 }
6811
6812 /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
6813 ///
6814 /// # Example
6815 /// ```ignore,no_run
6816 /// # use google_cloud_deploy_v1::model::GetCustomTargetTypeRequest;
6817 /// let x = GetCustomTargetTypeRequest::new().set_name("example");
6818 /// ```
6819 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6820 self.name = v.into();
6821 self
6822 }
6823}
6824
6825impl wkt::message::Message for GetCustomTargetTypeRequest {
6826 fn typename() -> &'static str {
6827 "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
6828 }
6829}
6830
6831/// The request object for `CreateCustomTargetType`.
6832#[derive(Clone, Default, PartialEq)]
6833#[non_exhaustive]
6834pub struct CreateCustomTargetTypeRequest {
6835 /// Required. The parent collection in which the `CustomTargetType` must be
6836 /// created. The format is `projects/{project_id}/locations/{location_name}`.
6837 pub parent: std::string::String,
6838
6839 /// Required. ID of the `CustomTargetType`.
6840 pub custom_target_type_id: std::string::String,
6841
6842 /// Required. The `CustomTargetType` to create.
6843 pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6844
6845 /// Optional. A request ID to identify requests. Specify a unique request ID
6846 /// so that if you must retry your request, the server knows to ignore the
6847 /// request if it has already been completed. The server guarantees that for
6848 /// at least 60 minutes after the first request.
6849 ///
6850 /// For example, consider a situation where you make an initial request and the
6851 /// request times out. If you make the request again with the same request ID,
6852 /// the server can check if original operation with the same request ID was
6853 /// received, and if so, will ignore the second request. This prevents clients
6854 /// from accidentally creating duplicate commitments.
6855 ///
6856 /// The request ID must be a valid UUID with the exception that zero UUID is
6857 /// not supported (00000000-0000-0000-0000-000000000000).
6858 pub request_id: std::string::String,
6859
6860 /// Optional. If set to true, the request is validated and the user is provided
6861 /// with an expected result, but no actual change is made.
6862 pub validate_only: bool,
6863
6864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6865}
6866
6867impl CreateCustomTargetTypeRequest {
6868 pub fn new() -> Self {
6869 std::default::Default::default()
6870 }
6871
6872 /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
6873 ///
6874 /// # Example
6875 /// ```ignore,no_run
6876 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6877 /// let x = CreateCustomTargetTypeRequest::new().set_parent("example");
6878 /// ```
6879 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6880 self.parent = v.into();
6881 self
6882 }
6883
6884 /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
6885 ///
6886 /// # Example
6887 /// ```ignore,no_run
6888 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6889 /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type_id("example");
6890 /// ```
6891 pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
6892 mut self,
6893 v: T,
6894 ) -> Self {
6895 self.custom_target_type_id = v.into();
6896 self
6897 }
6898
6899 /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6900 ///
6901 /// # Example
6902 /// ```ignore,no_run
6903 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6904 /// use google_cloud_deploy_v1::model::CustomTargetType;
6905 /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
6906 /// ```
6907 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
6908 where
6909 T: std::convert::Into<crate::model::CustomTargetType>,
6910 {
6911 self.custom_target_type = std::option::Option::Some(v.into());
6912 self
6913 }
6914
6915 /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6916 ///
6917 /// # Example
6918 /// ```ignore,no_run
6919 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6920 /// use google_cloud_deploy_v1::model::CustomTargetType;
6921 /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
6922 /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
6923 /// ```
6924 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
6925 where
6926 T: std::convert::Into<crate::model::CustomTargetType>,
6927 {
6928 self.custom_target_type = v.map(|x| x.into());
6929 self
6930 }
6931
6932 /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
6933 ///
6934 /// # Example
6935 /// ```ignore,no_run
6936 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6937 /// let x = CreateCustomTargetTypeRequest::new().set_request_id("example");
6938 /// ```
6939 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6940 self.request_id = v.into();
6941 self
6942 }
6943
6944 /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
6945 ///
6946 /// # Example
6947 /// ```ignore,no_run
6948 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6949 /// let x = CreateCustomTargetTypeRequest::new().set_validate_only(true);
6950 /// ```
6951 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6952 self.validate_only = v.into();
6953 self
6954 }
6955}
6956
6957impl wkt::message::Message for CreateCustomTargetTypeRequest {
6958 fn typename() -> &'static str {
6959 "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
6960 }
6961}
6962
6963/// The request object for `UpdateCustomTargetType`.
6964#[derive(Clone, Default, PartialEq)]
6965#[non_exhaustive]
6966pub struct UpdateCustomTargetTypeRequest {
6967 /// Required. Field mask is used to specify the fields to be overwritten by the
6968 /// update in the `CustomTargetType` resource. The fields specified in the
6969 /// update_mask are relative to the resource, not the full request. A field
6970 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
6971 /// then all fields are overwritten.
6972 pub update_mask: std::option::Option<wkt::FieldMask>,
6973
6974 /// Required. The `CustomTargetType` to update.
6975 pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6976
6977 /// Optional. A request ID to identify requests. Specify a unique request ID
6978 /// so that if you must retry your request, the server knows to ignore the
6979 /// request if it has already been completed. The server guarantees that for
6980 /// at least 60 minutes after the first request.
6981 ///
6982 /// For example, consider a situation where you make an initial request and the
6983 /// request times out. If you make the request again with the same request ID,
6984 /// the server can check if original operation with the same request ID was
6985 /// received, and if so, will ignore the second request. This prevents clients
6986 /// from accidentally creating duplicate commitments.
6987 ///
6988 /// The request ID must be a valid UUID with the exception that zero UUID is
6989 /// not supported (00000000-0000-0000-0000-000000000000).
6990 pub request_id: std::string::String,
6991
6992 /// Optional. If set to true, updating a `CustomTargetType` that does not exist
6993 /// will result in the creation of a new `CustomTargetType`.
6994 pub allow_missing: bool,
6995
6996 /// Optional. If set to true, the request is validated and the user is provided
6997 /// with an expected result, but no actual change is made.
6998 pub validate_only: bool,
6999
7000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7001}
7002
7003impl UpdateCustomTargetTypeRequest {
7004 pub fn new() -> Self {
7005 std::default::Default::default()
7006 }
7007
7008 /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7009 ///
7010 /// # Example
7011 /// ```ignore,no_run
7012 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7013 /// use wkt::FieldMask;
7014 /// let x = UpdateCustomTargetTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7015 /// ```
7016 pub fn set_update_mask<T>(mut self, v: T) -> Self
7017 where
7018 T: std::convert::Into<wkt::FieldMask>,
7019 {
7020 self.update_mask = std::option::Option::Some(v.into());
7021 self
7022 }
7023
7024 /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7025 ///
7026 /// # Example
7027 /// ```ignore,no_run
7028 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7029 /// use wkt::FieldMask;
7030 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7031 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7032 /// ```
7033 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7034 where
7035 T: std::convert::Into<wkt::FieldMask>,
7036 {
7037 self.update_mask = v.map(|x| x.into());
7038 self
7039 }
7040
7041 /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7042 ///
7043 /// # Example
7044 /// ```ignore,no_run
7045 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7046 /// use google_cloud_deploy_v1::model::CustomTargetType;
7047 /// let x = UpdateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7048 /// ```
7049 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7050 where
7051 T: std::convert::Into<crate::model::CustomTargetType>,
7052 {
7053 self.custom_target_type = std::option::Option::Some(v.into());
7054 self
7055 }
7056
7057 /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7058 ///
7059 /// # Example
7060 /// ```ignore,no_run
7061 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7062 /// use google_cloud_deploy_v1::model::CustomTargetType;
7063 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7064 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7065 /// ```
7066 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7067 where
7068 T: std::convert::Into<crate::model::CustomTargetType>,
7069 {
7070 self.custom_target_type = v.map(|x| x.into());
7071 self
7072 }
7073
7074 /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
7075 ///
7076 /// # Example
7077 /// ```ignore,no_run
7078 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7079 /// let x = UpdateCustomTargetTypeRequest::new().set_request_id("example");
7080 /// ```
7081 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7082 self.request_id = v.into();
7083 self
7084 }
7085
7086 /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7091 /// let x = UpdateCustomTargetTypeRequest::new().set_allow_missing(true);
7092 /// ```
7093 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7094 self.allow_missing = v.into();
7095 self
7096 }
7097
7098 /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
7099 ///
7100 /// # Example
7101 /// ```ignore,no_run
7102 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7103 /// let x = UpdateCustomTargetTypeRequest::new().set_validate_only(true);
7104 /// ```
7105 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7106 self.validate_only = v.into();
7107 self
7108 }
7109}
7110
7111impl wkt::message::Message for UpdateCustomTargetTypeRequest {
7112 fn typename() -> &'static str {
7113 "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
7114 }
7115}
7116
7117/// The request object for `DeleteCustomTargetType`.
7118#[derive(Clone, Default, PartialEq)]
7119#[non_exhaustive]
7120pub struct DeleteCustomTargetTypeRequest {
7121 /// Required. The name of the `CustomTargetType` to delete. Format must be
7122 /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
7123 pub name: std::string::String,
7124
7125 /// Optional. A request ID to identify requests. Specify a unique request ID
7126 /// so that if you must retry your request, the server knows to ignore the
7127 /// request if it has already been completed. The server guarantees that for
7128 /// at least 60 minutes after the first request.
7129 ///
7130 /// For example, consider a situation where you make an initial request and the
7131 /// request times out. If you make the request again with the same request ID,
7132 /// the server can check if original operation with the same request ID was
7133 /// received, and if so, will ignore the second request. This prevents clients
7134 /// from accidentally creating duplicate commitments.
7135 ///
7136 /// The request ID must be a valid UUID with the exception that zero UUID is
7137 /// not supported (00000000-0000-0000-0000-000000000000).
7138 pub request_id: std::string::String,
7139
7140 /// Optional. If set to true, then deleting an already deleted or non-existing
7141 /// `CustomTargetType` will succeed.
7142 pub allow_missing: bool,
7143
7144 /// Optional. If set to true, the request is validated but no actual change is
7145 /// made.
7146 pub validate_only: bool,
7147
7148 /// Optional. This checksum is computed by the server based on the value of
7149 /// other fields, and may be sent on update and delete requests to ensure the
7150 /// client has an up-to-date value before proceeding.
7151 pub etag: std::string::String,
7152
7153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7154}
7155
7156impl DeleteCustomTargetTypeRequest {
7157 pub fn new() -> Self {
7158 std::default::Default::default()
7159 }
7160
7161 /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
7162 ///
7163 /// # Example
7164 /// ```ignore,no_run
7165 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7166 /// let x = DeleteCustomTargetTypeRequest::new().set_name("example");
7167 /// ```
7168 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7169 self.name = v.into();
7170 self
7171 }
7172
7173 /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
7174 ///
7175 /// # Example
7176 /// ```ignore,no_run
7177 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7178 /// let x = DeleteCustomTargetTypeRequest::new().set_request_id("example");
7179 /// ```
7180 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7181 self.request_id = v.into();
7182 self
7183 }
7184
7185 /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7190 /// let x = DeleteCustomTargetTypeRequest::new().set_allow_missing(true);
7191 /// ```
7192 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7193 self.allow_missing = v.into();
7194 self
7195 }
7196
7197 /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
7198 ///
7199 /// # Example
7200 /// ```ignore,no_run
7201 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7202 /// let x = DeleteCustomTargetTypeRequest::new().set_validate_only(true);
7203 /// ```
7204 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7205 self.validate_only = v.into();
7206 self
7207 }
7208
7209 /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
7210 ///
7211 /// # Example
7212 /// ```ignore,no_run
7213 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7214 /// let x = DeleteCustomTargetTypeRequest::new().set_etag("example");
7215 /// ```
7216 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7217 self.etag = v.into();
7218 self
7219 }
7220}
7221
7222impl wkt::message::Message for DeleteCustomTargetTypeRequest {
7223 fn typename() -> &'static str {
7224 "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
7225 }
7226}
7227
7228/// A `DeployPolicy` resource in the Cloud Deploy API.
7229///
7230/// A `DeployPolicy` inhibits manual or automation-driven actions within a
7231/// Delivery Pipeline or Target.
7232#[derive(Clone, Default, PartialEq)]
7233#[non_exhaustive]
7234pub struct DeployPolicy {
7235 /// Output only. Name of the `DeployPolicy`. Format is
7236 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
7237 /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
7238 pub name: std::string::String,
7239
7240 /// Output only. Unique identifier of the `DeployPolicy`.
7241 pub uid: std::string::String,
7242
7243 /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
7244 pub description: std::string::String,
7245
7246 /// Optional. User annotations. These attributes can only be set and used by
7247 /// the user, and not by Cloud Deploy. Annotations must meet the following
7248 /// constraints:
7249 ///
7250 /// * Annotations are key/value pairs.
7251 /// * Valid annotation keys have two segments: an optional prefix and name,
7252 /// separated by a slash (`/`).
7253 /// * The name segment is required and must be 63 characters or less,
7254 /// beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
7255 /// dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
7256 /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
7257 /// a series of DNS labels separated by dots(`.`), not longer than 253
7258 /// characters in total, followed by a slash (`/`).
7259 ///
7260 /// See
7261 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
7262 /// for more details.
7263 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7264
7265 /// Labels are attributes that can be set and used by both the
7266 /// user and by Cloud Deploy. Labels must meet the following constraints:
7267 ///
7268 /// * Keys and values can contain only lowercase letters, numeric characters,
7269 /// underscores, and dashes.
7270 /// * All characters must use UTF-8 encoding, and international characters are
7271 /// allowed.
7272 /// * Keys must start with a lowercase letter or international character.
7273 /// * Each resource is limited to a maximum of 64 labels.
7274 ///
7275 /// Both keys and values are additionally constrained to be <= 128 bytes.
7276 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7277
7278 /// Output only. Time at which the deploy policy was created.
7279 pub create_time: std::option::Option<wkt::Timestamp>,
7280
7281 /// Output only. Most recent time at which the deploy policy was updated.
7282 pub update_time: std::option::Option<wkt::Timestamp>,
7283
7284 /// Optional. When suspended, the policy will not prevent actions from
7285 /// occurring, even if the action violates the policy.
7286 pub suspended: bool,
7287
7288 /// Required. Selected resources to which the policy will be applied. At least
7289 /// one selector is required. If one selector matches the resource the policy
7290 /// applies. For example, if there are two selectors and the action being
7291 /// attempted matches one of them, the policy will apply to that action.
7292 pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
7293
7294 /// Required. Rules to apply. At least one rule must be present.
7295 pub rules: std::vec::Vec<crate::model::PolicyRule>,
7296
7297 /// The weak etag of the `DeployPolicy` resource.
7298 /// This checksum is computed by the server based on the value of other
7299 /// fields, and may be sent on update and delete requests to ensure the
7300 /// client has an up-to-date value before proceeding.
7301 pub etag: std::string::String,
7302
7303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7304}
7305
7306impl DeployPolicy {
7307 pub fn new() -> Self {
7308 std::default::Default::default()
7309 }
7310
7311 /// Sets the value of [name][crate::model::DeployPolicy::name].
7312 ///
7313 /// # Example
7314 /// ```ignore,no_run
7315 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7316 /// let x = DeployPolicy::new().set_name("example");
7317 /// ```
7318 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7319 self.name = v.into();
7320 self
7321 }
7322
7323 /// Sets the value of [uid][crate::model::DeployPolicy::uid].
7324 ///
7325 /// # Example
7326 /// ```ignore,no_run
7327 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7328 /// let x = DeployPolicy::new().set_uid("example");
7329 /// ```
7330 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7331 self.uid = v.into();
7332 self
7333 }
7334
7335 /// Sets the value of [description][crate::model::DeployPolicy::description].
7336 ///
7337 /// # Example
7338 /// ```ignore,no_run
7339 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7340 /// let x = DeployPolicy::new().set_description("example");
7341 /// ```
7342 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7343 self.description = v.into();
7344 self
7345 }
7346
7347 /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
7348 ///
7349 /// # Example
7350 /// ```ignore,no_run
7351 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7352 /// let x = DeployPolicy::new().set_annotations([
7353 /// ("key0", "abc"),
7354 /// ("key1", "xyz"),
7355 /// ]);
7356 /// ```
7357 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7358 where
7359 T: std::iter::IntoIterator<Item = (K, V)>,
7360 K: std::convert::Into<std::string::String>,
7361 V: std::convert::Into<std::string::String>,
7362 {
7363 use std::iter::Iterator;
7364 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7365 self
7366 }
7367
7368 /// Sets the value of [labels][crate::model::DeployPolicy::labels].
7369 ///
7370 /// # Example
7371 /// ```ignore,no_run
7372 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7373 /// let x = DeployPolicy::new().set_labels([
7374 /// ("key0", "abc"),
7375 /// ("key1", "xyz"),
7376 /// ]);
7377 /// ```
7378 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7379 where
7380 T: std::iter::IntoIterator<Item = (K, V)>,
7381 K: std::convert::Into<std::string::String>,
7382 V: std::convert::Into<std::string::String>,
7383 {
7384 use std::iter::Iterator;
7385 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7386 self
7387 }
7388
7389 /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
7390 ///
7391 /// # Example
7392 /// ```ignore,no_run
7393 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7394 /// use wkt::Timestamp;
7395 /// let x = DeployPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7396 /// ```
7397 pub fn set_create_time<T>(mut self, v: T) -> Self
7398 where
7399 T: std::convert::Into<wkt::Timestamp>,
7400 {
7401 self.create_time = std::option::Option::Some(v.into());
7402 self
7403 }
7404
7405 /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
7406 ///
7407 /// # Example
7408 /// ```ignore,no_run
7409 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7410 /// use wkt::Timestamp;
7411 /// let x = DeployPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7412 /// let x = DeployPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7413 /// ```
7414 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7415 where
7416 T: std::convert::Into<wkt::Timestamp>,
7417 {
7418 self.create_time = v.map(|x| x.into());
7419 self
7420 }
7421
7422 /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
7423 ///
7424 /// # Example
7425 /// ```ignore,no_run
7426 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7427 /// use wkt::Timestamp;
7428 /// let x = DeployPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7429 /// ```
7430 pub fn set_update_time<T>(mut self, v: T) -> Self
7431 where
7432 T: std::convert::Into<wkt::Timestamp>,
7433 {
7434 self.update_time = std::option::Option::Some(v.into());
7435 self
7436 }
7437
7438 /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
7439 ///
7440 /// # Example
7441 /// ```ignore,no_run
7442 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7443 /// use wkt::Timestamp;
7444 /// let x = DeployPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7445 /// let x = DeployPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7446 /// ```
7447 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7448 where
7449 T: std::convert::Into<wkt::Timestamp>,
7450 {
7451 self.update_time = v.map(|x| x.into());
7452 self
7453 }
7454
7455 /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
7456 ///
7457 /// # Example
7458 /// ```ignore,no_run
7459 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7460 /// let x = DeployPolicy::new().set_suspended(true);
7461 /// ```
7462 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7463 self.suspended = v.into();
7464 self
7465 }
7466
7467 /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
7468 ///
7469 /// # Example
7470 /// ```ignore,no_run
7471 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7472 /// use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7473 /// let x = DeployPolicy::new()
7474 /// .set_selectors([
7475 /// DeployPolicyResourceSelector::default()/* use setters */,
7476 /// DeployPolicyResourceSelector::default()/* use (different) setters */,
7477 /// ]);
7478 /// ```
7479 pub fn set_selectors<T, V>(mut self, v: T) -> Self
7480 where
7481 T: std::iter::IntoIterator<Item = V>,
7482 V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
7483 {
7484 use std::iter::Iterator;
7485 self.selectors = v.into_iter().map(|i| i.into()).collect();
7486 self
7487 }
7488
7489 /// Sets the value of [rules][crate::model::DeployPolicy::rules].
7490 ///
7491 /// # Example
7492 /// ```ignore,no_run
7493 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7494 /// use google_cloud_deploy_v1::model::PolicyRule;
7495 /// let x = DeployPolicy::new()
7496 /// .set_rules([
7497 /// PolicyRule::default()/* use setters */,
7498 /// PolicyRule::default()/* use (different) setters */,
7499 /// ]);
7500 /// ```
7501 pub fn set_rules<T, V>(mut self, v: T) -> Self
7502 where
7503 T: std::iter::IntoIterator<Item = V>,
7504 V: std::convert::Into<crate::model::PolicyRule>,
7505 {
7506 use std::iter::Iterator;
7507 self.rules = v.into_iter().map(|i| i.into()).collect();
7508 self
7509 }
7510
7511 /// Sets the value of [etag][crate::model::DeployPolicy::etag].
7512 ///
7513 /// # Example
7514 /// ```ignore,no_run
7515 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7516 /// let x = DeployPolicy::new().set_etag("example");
7517 /// ```
7518 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7519 self.etag = v.into();
7520 self
7521 }
7522}
7523
7524impl wkt::message::Message for DeployPolicy {
7525 fn typename() -> &'static str {
7526 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
7527 }
7528}
7529
7530/// Defines additional types related to [DeployPolicy].
7531pub mod deploy_policy {
7532 #[allow(unused_imports)]
7533 use super::*;
7534
7535 /// What invoked the action. Filters enforcing the policy depending on what
7536 /// invoked the action.
7537 ///
7538 /// # Working with unknown values
7539 ///
7540 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7541 /// additional enum variants at any time. Adding new variants is not considered
7542 /// a breaking change. Applications should write their code in anticipation of:
7543 ///
7544 /// - New values appearing in future releases of the client library, **and**
7545 /// - New values received dynamically, without application changes.
7546 ///
7547 /// Please consult the [Working with enums] section in the user guide for some
7548 /// guidelines.
7549 ///
7550 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7551 #[derive(Clone, Debug, PartialEq)]
7552 #[non_exhaustive]
7553 pub enum Invoker {
7554 /// Unspecified.
7555 Unspecified,
7556 /// The action is user-driven. For example, creating a rollout manually via a
7557 /// gcloud create command.
7558 User,
7559 /// Automated action by Cloud Deploy.
7560 DeployAutomation,
7561 /// If set, the enum was initialized with an unknown value.
7562 ///
7563 /// Applications can examine the value using [Invoker::value] or
7564 /// [Invoker::name].
7565 UnknownValue(invoker::UnknownValue),
7566 }
7567
7568 #[doc(hidden)]
7569 pub mod invoker {
7570 #[allow(unused_imports)]
7571 use super::*;
7572 #[derive(Clone, Debug, PartialEq)]
7573 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7574 }
7575
7576 impl Invoker {
7577 /// Gets the enum value.
7578 ///
7579 /// Returns `None` if the enum contains an unknown value deserialized from
7580 /// the string representation of enums.
7581 pub fn value(&self) -> std::option::Option<i32> {
7582 match self {
7583 Self::Unspecified => std::option::Option::Some(0),
7584 Self::User => std::option::Option::Some(1),
7585 Self::DeployAutomation => std::option::Option::Some(2),
7586 Self::UnknownValue(u) => u.0.value(),
7587 }
7588 }
7589
7590 /// Gets the enum value as a string.
7591 ///
7592 /// Returns `None` if the enum contains an unknown value deserialized from
7593 /// the integer representation of enums.
7594 pub fn name(&self) -> std::option::Option<&str> {
7595 match self {
7596 Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
7597 Self::User => std::option::Option::Some("USER"),
7598 Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
7599 Self::UnknownValue(u) => u.0.name(),
7600 }
7601 }
7602 }
7603
7604 impl std::default::Default for Invoker {
7605 fn default() -> Self {
7606 use std::convert::From;
7607 Self::from(0)
7608 }
7609 }
7610
7611 impl std::fmt::Display for Invoker {
7612 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7613 wkt::internal::display_enum(f, self.name(), self.value())
7614 }
7615 }
7616
7617 impl std::convert::From<i32> for Invoker {
7618 fn from(value: i32) -> Self {
7619 match value {
7620 0 => Self::Unspecified,
7621 1 => Self::User,
7622 2 => Self::DeployAutomation,
7623 _ => Self::UnknownValue(invoker::UnknownValue(
7624 wkt::internal::UnknownEnumValue::Integer(value),
7625 )),
7626 }
7627 }
7628 }
7629
7630 impl std::convert::From<&str> for Invoker {
7631 fn from(value: &str) -> Self {
7632 use std::string::ToString;
7633 match value {
7634 "INVOKER_UNSPECIFIED" => Self::Unspecified,
7635 "USER" => Self::User,
7636 "DEPLOY_AUTOMATION" => Self::DeployAutomation,
7637 _ => Self::UnknownValue(invoker::UnknownValue(
7638 wkt::internal::UnknownEnumValue::String(value.to_string()),
7639 )),
7640 }
7641 }
7642 }
7643
7644 impl serde::ser::Serialize for Invoker {
7645 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7646 where
7647 S: serde::Serializer,
7648 {
7649 match self {
7650 Self::Unspecified => serializer.serialize_i32(0),
7651 Self::User => serializer.serialize_i32(1),
7652 Self::DeployAutomation => serializer.serialize_i32(2),
7653 Self::UnknownValue(u) => u.0.serialize(serializer),
7654 }
7655 }
7656 }
7657
7658 impl<'de> serde::de::Deserialize<'de> for Invoker {
7659 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7660 where
7661 D: serde::Deserializer<'de>,
7662 {
7663 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
7664 ".google.cloud.deploy.v1.DeployPolicy.Invoker",
7665 ))
7666 }
7667 }
7668}
7669
7670/// Contains information on the resources to select for a deploy policy.
7671/// Attributes provided must all match the resource in order for policy
7672/// restrictions to apply. For example, if delivery pipelines attributes given
7673/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
7674/// match both that id and have that label in order to be subject to the policy.
7675#[derive(Clone, Default, PartialEq)]
7676#[non_exhaustive]
7677pub struct DeployPolicyResourceSelector {
7678 /// Optional. Contains attributes about a delivery pipeline.
7679 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
7680
7681 /// Optional. Contains attributes about a target.
7682 pub target: std::option::Option<crate::model::TargetAttribute>,
7683
7684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7685}
7686
7687impl DeployPolicyResourceSelector {
7688 pub fn new() -> Self {
7689 std::default::Default::default()
7690 }
7691
7692 /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7693 ///
7694 /// # Example
7695 /// ```ignore,no_run
7696 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7697 /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7698 /// let x = DeployPolicyResourceSelector::new().set_delivery_pipeline(DeliveryPipelineAttribute::default()/* use setters */);
7699 /// ```
7700 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
7701 where
7702 T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7703 {
7704 self.delivery_pipeline = std::option::Option::Some(v.into());
7705 self
7706 }
7707
7708 /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7709 ///
7710 /// # Example
7711 /// ```ignore,no_run
7712 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7713 /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7714 /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(Some(DeliveryPipelineAttribute::default()/* use setters */));
7715 /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(None::<DeliveryPipelineAttribute>);
7716 /// ```
7717 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
7718 where
7719 T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7720 {
7721 self.delivery_pipeline = v.map(|x| x.into());
7722 self
7723 }
7724
7725 /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
7726 ///
7727 /// # Example
7728 /// ```ignore,no_run
7729 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7730 /// use google_cloud_deploy_v1::model::TargetAttribute;
7731 /// let x = DeployPolicyResourceSelector::new().set_target(TargetAttribute::default()/* use setters */);
7732 /// ```
7733 pub fn set_target<T>(mut self, v: T) -> Self
7734 where
7735 T: std::convert::Into<crate::model::TargetAttribute>,
7736 {
7737 self.target = std::option::Option::Some(v.into());
7738 self
7739 }
7740
7741 /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
7742 ///
7743 /// # Example
7744 /// ```ignore,no_run
7745 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7746 /// use google_cloud_deploy_v1::model::TargetAttribute;
7747 /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(Some(TargetAttribute::default()/* use setters */));
7748 /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(None::<TargetAttribute>);
7749 /// ```
7750 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7751 where
7752 T: std::convert::Into<crate::model::TargetAttribute>,
7753 {
7754 self.target = v.map(|x| x.into());
7755 self
7756 }
7757}
7758
7759impl wkt::message::Message for DeployPolicyResourceSelector {
7760 fn typename() -> &'static str {
7761 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
7762 }
7763}
7764
7765/// Contains criteria for selecting DeliveryPipelines.
7766#[derive(Clone, Default, PartialEq)]
7767#[non_exhaustive]
7768pub struct DeliveryPipelineAttribute {
7769 /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
7770 /// one of the following:
7771 ///
7772 /// * The last segment of a pipeline name
7773 /// * "*", all delivery pipelines in a location
7774 pub id: std::string::String,
7775
7776 /// DeliveryPipeline labels.
7777 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7778
7779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7780}
7781
7782impl DeliveryPipelineAttribute {
7783 pub fn new() -> Self {
7784 std::default::Default::default()
7785 }
7786
7787 /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
7788 ///
7789 /// # Example
7790 /// ```ignore,no_run
7791 /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7792 /// let x = DeliveryPipelineAttribute::new().set_id("example");
7793 /// ```
7794 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7795 self.id = v.into();
7796 self
7797 }
7798
7799 /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
7800 ///
7801 /// # Example
7802 /// ```ignore,no_run
7803 /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7804 /// let x = DeliveryPipelineAttribute::new().set_labels([
7805 /// ("key0", "abc"),
7806 /// ("key1", "xyz"),
7807 /// ]);
7808 /// ```
7809 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7810 where
7811 T: std::iter::IntoIterator<Item = (K, V)>,
7812 K: std::convert::Into<std::string::String>,
7813 V: std::convert::Into<std::string::String>,
7814 {
7815 use std::iter::Iterator;
7816 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7817 self
7818 }
7819}
7820
7821impl wkt::message::Message for DeliveryPipelineAttribute {
7822 fn typename() -> &'static str {
7823 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
7824 }
7825}
7826
7827/// Contains criteria for selecting Targets. This could be used to select targets
7828/// for a Deploy Policy or for an Automation.
7829#[derive(Clone, Default, PartialEq)]
7830#[non_exhaustive]
7831pub struct TargetAttribute {
7832 /// Optional. ID of the `Target`. The value of this field could be one of the
7833 /// following:
7834 ///
7835 /// * The last segment of a target name
7836 /// * "*", all targets in a location
7837 pub id: std::string::String,
7838
7839 /// Target labels.
7840 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7841
7842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7843}
7844
7845impl TargetAttribute {
7846 pub fn new() -> Self {
7847 std::default::Default::default()
7848 }
7849
7850 /// Sets the value of [id][crate::model::TargetAttribute::id].
7851 ///
7852 /// # Example
7853 /// ```ignore,no_run
7854 /// # use google_cloud_deploy_v1::model::TargetAttribute;
7855 /// let x = TargetAttribute::new().set_id("example");
7856 /// ```
7857 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7858 self.id = v.into();
7859 self
7860 }
7861
7862 /// Sets the value of [labels][crate::model::TargetAttribute::labels].
7863 ///
7864 /// # Example
7865 /// ```ignore,no_run
7866 /// # use google_cloud_deploy_v1::model::TargetAttribute;
7867 /// let x = TargetAttribute::new().set_labels([
7868 /// ("key0", "abc"),
7869 /// ("key1", "xyz"),
7870 /// ]);
7871 /// ```
7872 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7873 where
7874 T: std::iter::IntoIterator<Item = (K, V)>,
7875 K: std::convert::Into<std::string::String>,
7876 V: std::convert::Into<std::string::String>,
7877 {
7878 use std::iter::Iterator;
7879 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7880 self
7881 }
7882}
7883
7884impl wkt::message::Message for TargetAttribute {
7885 fn typename() -> &'static str {
7886 "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
7887 }
7888}
7889
7890/// Deploy Policy rule.
7891#[derive(Clone, Default, PartialEq)]
7892#[non_exhaustive]
7893pub struct PolicyRule {
7894 pub rule: std::option::Option<crate::model::policy_rule::Rule>,
7895
7896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7897}
7898
7899impl PolicyRule {
7900 pub fn new() -> Self {
7901 std::default::Default::default()
7902 }
7903
7904 /// Sets the value of [rule][crate::model::PolicyRule::rule].
7905 ///
7906 /// Note that all the setters affecting `rule` are mutually
7907 /// exclusive.
7908 ///
7909 /// # Example
7910 /// ```ignore,no_run
7911 /// # use google_cloud_deploy_v1::model::PolicyRule;
7912 /// use google_cloud_deploy_v1::model::RolloutRestriction;
7913 /// let x = PolicyRule::new().set_rule(Some(
7914 /// google_cloud_deploy_v1::model::policy_rule::Rule::RolloutRestriction(RolloutRestriction::default().into())));
7915 /// ```
7916 pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
7917 mut self,
7918 v: T,
7919 ) -> Self {
7920 self.rule = v.into();
7921 self
7922 }
7923
7924 /// The value of [rule][crate::model::PolicyRule::rule]
7925 /// if it holds a `RolloutRestriction`, `None` if the field is not set or
7926 /// holds a different branch.
7927 pub fn rollout_restriction(
7928 &self,
7929 ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
7930 #[allow(unreachable_patterns)]
7931 self.rule.as_ref().and_then(|v| match v {
7932 crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
7933 _ => std::option::Option::None,
7934 })
7935 }
7936
7937 /// Sets the value of [rule][crate::model::PolicyRule::rule]
7938 /// to hold a `RolloutRestriction`.
7939 ///
7940 /// Note that all the setters affecting `rule` are
7941 /// mutually exclusive.
7942 ///
7943 /// # Example
7944 /// ```ignore,no_run
7945 /// # use google_cloud_deploy_v1::model::PolicyRule;
7946 /// use google_cloud_deploy_v1::model::RolloutRestriction;
7947 /// let x = PolicyRule::new().set_rollout_restriction(RolloutRestriction::default()/* use setters */);
7948 /// assert!(x.rollout_restriction().is_some());
7949 /// ```
7950 pub fn set_rollout_restriction<
7951 T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
7952 >(
7953 mut self,
7954 v: T,
7955 ) -> Self {
7956 self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
7957 v.into(),
7958 ));
7959 self
7960 }
7961}
7962
7963impl wkt::message::Message for PolicyRule {
7964 fn typename() -> &'static str {
7965 "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
7966 }
7967}
7968
7969/// Defines additional types related to [PolicyRule].
7970pub mod policy_rule {
7971 #[allow(unused_imports)]
7972 use super::*;
7973
7974 #[derive(Clone, Debug, PartialEq)]
7975 #[non_exhaustive]
7976 pub enum Rule {
7977 /// Optional. Rollout restrictions.
7978 RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
7979 }
7980}
7981
7982/// Rollout restrictions.
7983#[derive(Clone, Default, PartialEq)]
7984#[non_exhaustive]
7985pub struct RolloutRestriction {
7986 /// Required. Restriction rule ID. Required and must be unique within a
7987 /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
7988 pub id: std::string::String,
7989
7990 /// Optional. What invoked the action. If left empty, all invoker types will be
7991 /// restricted.
7992 pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
7993
7994 /// Optional. Rollout actions to be restricted as part of the policy. If left
7995 /// empty, all actions will be restricted.
7996 pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
7997
7998 /// Required. Time window within which actions are restricted.
7999 pub time_windows: std::option::Option<crate::model::TimeWindows>,
8000
8001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8002}
8003
8004impl RolloutRestriction {
8005 pub fn new() -> Self {
8006 std::default::Default::default()
8007 }
8008
8009 /// Sets the value of [id][crate::model::RolloutRestriction::id].
8010 ///
8011 /// # Example
8012 /// ```ignore,no_run
8013 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8014 /// let x = RolloutRestriction::new().set_id("example");
8015 /// ```
8016 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8017 self.id = v.into();
8018 self
8019 }
8020
8021 /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
8022 ///
8023 /// # Example
8024 /// ```ignore,no_run
8025 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8026 /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
8027 /// let x = RolloutRestriction::new().set_invokers([
8028 /// Invoker::User,
8029 /// Invoker::DeployAutomation,
8030 /// ]);
8031 /// ```
8032 pub fn set_invokers<T, V>(mut self, v: T) -> Self
8033 where
8034 T: std::iter::IntoIterator<Item = V>,
8035 V: std::convert::Into<crate::model::deploy_policy::Invoker>,
8036 {
8037 use std::iter::Iterator;
8038 self.invokers = v.into_iter().map(|i| i.into()).collect();
8039 self
8040 }
8041
8042 /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
8043 ///
8044 /// # Example
8045 /// ```ignore,no_run
8046 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8047 /// use google_cloud_deploy_v1::model::rollout_restriction::RolloutActions;
8048 /// let x = RolloutRestriction::new().set_actions([
8049 /// RolloutActions::Advance,
8050 /// RolloutActions::Approve,
8051 /// RolloutActions::Cancel,
8052 /// ]);
8053 /// ```
8054 pub fn set_actions<T, V>(mut self, v: T) -> Self
8055 where
8056 T: std::iter::IntoIterator<Item = V>,
8057 V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
8058 {
8059 use std::iter::Iterator;
8060 self.actions = v.into_iter().map(|i| i.into()).collect();
8061 self
8062 }
8063
8064 /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8065 ///
8066 /// # Example
8067 /// ```ignore,no_run
8068 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8069 /// use google_cloud_deploy_v1::model::TimeWindows;
8070 /// let x = RolloutRestriction::new().set_time_windows(TimeWindows::default()/* use setters */);
8071 /// ```
8072 pub fn set_time_windows<T>(mut self, v: T) -> Self
8073 where
8074 T: std::convert::Into<crate::model::TimeWindows>,
8075 {
8076 self.time_windows = std::option::Option::Some(v.into());
8077 self
8078 }
8079
8080 /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8081 ///
8082 /// # Example
8083 /// ```ignore,no_run
8084 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8085 /// use google_cloud_deploy_v1::model::TimeWindows;
8086 /// let x = RolloutRestriction::new().set_or_clear_time_windows(Some(TimeWindows::default()/* use setters */));
8087 /// let x = RolloutRestriction::new().set_or_clear_time_windows(None::<TimeWindows>);
8088 /// ```
8089 pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
8090 where
8091 T: std::convert::Into<crate::model::TimeWindows>,
8092 {
8093 self.time_windows = v.map(|x| x.into());
8094 self
8095 }
8096}
8097
8098impl wkt::message::Message for RolloutRestriction {
8099 fn typename() -> &'static str {
8100 "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
8101 }
8102}
8103
8104/// Defines additional types related to [RolloutRestriction].
8105pub mod rollout_restriction {
8106 #[allow(unused_imports)]
8107 use super::*;
8108
8109 /// Rollout actions to be restricted as part of the policy.
8110 ///
8111 /// # Working with unknown values
8112 ///
8113 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8114 /// additional enum variants at any time. Adding new variants is not considered
8115 /// a breaking change. Applications should write their code in anticipation of:
8116 ///
8117 /// - New values appearing in future releases of the client library, **and**
8118 /// - New values received dynamically, without application changes.
8119 ///
8120 /// Please consult the [Working with enums] section in the user guide for some
8121 /// guidelines.
8122 ///
8123 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8124 #[derive(Clone, Debug, PartialEq)]
8125 #[non_exhaustive]
8126 pub enum RolloutActions {
8127 /// Unspecified.
8128 Unspecified,
8129 /// Advance the rollout to the next phase.
8130 Advance,
8131 /// Approve the rollout.
8132 Approve,
8133 /// Cancel the rollout.
8134 Cancel,
8135 /// Create a rollout.
8136 Create,
8137 /// Ignore a job result on the rollout.
8138 IgnoreJob,
8139 /// Retry a job for a rollout.
8140 RetryJob,
8141 /// Rollback a rollout.
8142 Rollback,
8143 /// Terminate a jobrun.
8144 TerminateJobrun,
8145 /// If set, the enum was initialized with an unknown value.
8146 ///
8147 /// Applications can examine the value using [RolloutActions::value] or
8148 /// [RolloutActions::name].
8149 UnknownValue(rollout_actions::UnknownValue),
8150 }
8151
8152 #[doc(hidden)]
8153 pub mod rollout_actions {
8154 #[allow(unused_imports)]
8155 use super::*;
8156 #[derive(Clone, Debug, PartialEq)]
8157 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8158 }
8159
8160 impl RolloutActions {
8161 /// Gets the enum value.
8162 ///
8163 /// Returns `None` if the enum contains an unknown value deserialized from
8164 /// the string representation of enums.
8165 pub fn value(&self) -> std::option::Option<i32> {
8166 match self {
8167 Self::Unspecified => std::option::Option::Some(0),
8168 Self::Advance => std::option::Option::Some(1),
8169 Self::Approve => std::option::Option::Some(2),
8170 Self::Cancel => std::option::Option::Some(3),
8171 Self::Create => std::option::Option::Some(4),
8172 Self::IgnoreJob => std::option::Option::Some(5),
8173 Self::RetryJob => std::option::Option::Some(6),
8174 Self::Rollback => std::option::Option::Some(7),
8175 Self::TerminateJobrun => std::option::Option::Some(8),
8176 Self::UnknownValue(u) => u.0.value(),
8177 }
8178 }
8179
8180 /// Gets the enum value as a string.
8181 ///
8182 /// Returns `None` if the enum contains an unknown value deserialized from
8183 /// the integer representation of enums.
8184 pub fn name(&self) -> std::option::Option<&str> {
8185 match self {
8186 Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
8187 Self::Advance => std::option::Option::Some("ADVANCE"),
8188 Self::Approve => std::option::Option::Some("APPROVE"),
8189 Self::Cancel => std::option::Option::Some("CANCEL"),
8190 Self::Create => std::option::Option::Some("CREATE"),
8191 Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
8192 Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
8193 Self::Rollback => std::option::Option::Some("ROLLBACK"),
8194 Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
8195 Self::UnknownValue(u) => u.0.name(),
8196 }
8197 }
8198 }
8199
8200 impl std::default::Default for RolloutActions {
8201 fn default() -> Self {
8202 use std::convert::From;
8203 Self::from(0)
8204 }
8205 }
8206
8207 impl std::fmt::Display for RolloutActions {
8208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8209 wkt::internal::display_enum(f, self.name(), self.value())
8210 }
8211 }
8212
8213 impl std::convert::From<i32> for RolloutActions {
8214 fn from(value: i32) -> Self {
8215 match value {
8216 0 => Self::Unspecified,
8217 1 => Self::Advance,
8218 2 => Self::Approve,
8219 3 => Self::Cancel,
8220 4 => Self::Create,
8221 5 => Self::IgnoreJob,
8222 6 => Self::RetryJob,
8223 7 => Self::Rollback,
8224 8 => Self::TerminateJobrun,
8225 _ => Self::UnknownValue(rollout_actions::UnknownValue(
8226 wkt::internal::UnknownEnumValue::Integer(value),
8227 )),
8228 }
8229 }
8230 }
8231
8232 impl std::convert::From<&str> for RolloutActions {
8233 fn from(value: &str) -> Self {
8234 use std::string::ToString;
8235 match value {
8236 "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
8237 "ADVANCE" => Self::Advance,
8238 "APPROVE" => Self::Approve,
8239 "CANCEL" => Self::Cancel,
8240 "CREATE" => Self::Create,
8241 "IGNORE_JOB" => Self::IgnoreJob,
8242 "RETRY_JOB" => Self::RetryJob,
8243 "ROLLBACK" => Self::Rollback,
8244 "TERMINATE_JOBRUN" => Self::TerminateJobrun,
8245 _ => Self::UnknownValue(rollout_actions::UnknownValue(
8246 wkt::internal::UnknownEnumValue::String(value.to_string()),
8247 )),
8248 }
8249 }
8250 }
8251
8252 impl serde::ser::Serialize for RolloutActions {
8253 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8254 where
8255 S: serde::Serializer,
8256 {
8257 match self {
8258 Self::Unspecified => serializer.serialize_i32(0),
8259 Self::Advance => serializer.serialize_i32(1),
8260 Self::Approve => serializer.serialize_i32(2),
8261 Self::Cancel => serializer.serialize_i32(3),
8262 Self::Create => serializer.serialize_i32(4),
8263 Self::IgnoreJob => serializer.serialize_i32(5),
8264 Self::RetryJob => serializer.serialize_i32(6),
8265 Self::Rollback => serializer.serialize_i32(7),
8266 Self::TerminateJobrun => serializer.serialize_i32(8),
8267 Self::UnknownValue(u) => u.0.serialize(serializer),
8268 }
8269 }
8270 }
8271
8272 impl<'de> serde::de::Deserialize<'de> for RolloutActions {
8273 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8274 where
8275 D: serde::Deserializer<'de>,
8276 {
8277 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
8278 ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
8279 ))
8280 }
8281 }
8282}
8283
8284/// Time windows within which actions are restricted. See the
8285/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
8286/// for more information on how to configure dates/times.
8287#[derive(Clone, Default, PartialEq)]
8288#[non_exhaustive]
8289pub struct TimeWindows {
8290 /// Required. The time zone in IANA format [IANA Time Zone
8291 /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
8292 pub time_zone: std::string::String,
8293
8294 /// Optional. One-time windows within which actions are restricted.
8295 pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
8296
8297 /// Optional. Recurring weekly windows within which actions are restricted.
8298 pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
8299
8300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8301}
8302
8303impl TimeWindows {
8304 pub fn new() -> Self {
8305 std::default::Default::default()
8306 }
8307
8308 /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
8309 ///
8310 /// # Example
8311 /// ```ignore,no_run
8312 /// # use google_cloud_deploy_v1::model::TimeWindows;
8313 /// let x = TimeWindows::new().set_time_zone("example");
8314 /// ```
8315 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8316 self.time_zone = v.into();
8317 self
8318 }
8319
8320 /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
8321 ///
8322 /// # Example
8323 /// ```ignore,no_run
8324 /// # use google_cloud_deploy_v1::model::TimeWindows;
8325 /// use google_cloud_deploy_v1::model::OneTimeWindow;
8326 /// let x = TimeWindows::new()
8327 /// .set_one_time_windows([
8328 /// OneTimeWindow::default()/* use setters */,
8329 /// OneTimeWindow::default()/* use (different) setters */,
8330 /// ]);
8331 /// ```
8332 pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
8333 where
8334 T: std::iter::IntoIterator<Item = V>,
8335 V: std::convert::Into<crate::model::OneTimeWindow>,
8336 {
8337 use std::iter::Iterator;
8338 self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
8339 self
8340 }
8341
8342 /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
8343 ///
8344 /// # Example
8345 /// ```ignore,no_run
8346 /// # use google_cloud_deploy_v1::model::TimeWindows;
8347 /// use google_cloud_deploy_v1::model::WeeklyWindow;
8348 /// let x = TimeWindows::new()
8349 /// .set_weekly_windows([
8350 /// WeeklyWindow::default()/* use setters */,
8351 /// WeeklyWindow::default()/* use (different) setters */,
8352 /// ]);
8353 /// ```
8354 pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
8355 where
8356 T: std::iter::IntoIterator<Item = V>,
8357 V: std::convert::Into<crate::model::WeeklyWindow>,
8358 {
8359 use std::iter::Iterator;
8360 self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
8361 self
8362 }
8363}
8364
8365impl wkt::message::Message for TimeWindows {
8366 fn typename() -> &'static str {
8367 "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
8368 }
8369}
8370
8371/// One-time window within which actions are restricted. For example, blocking
8372/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
8373#[derive(Clone, Default, PartialEq)]
8374#[non_exhaustive]
8375pub struct OneTimeWindow {
8376 /// Required. Start date.
8377 pub start_date: std::option::Option<google_cloud_type::model::Date>,
8378
8379 /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
8380 pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8381
8382 /// Required. End date.
8383 pub end_date: std::option::Option<google_cloud_type::model::Date>,
8384
8385 /// Required. End time (exclusive). You may use 24:00 for the end of the day.
8386 pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8387
8388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8389}
8390
8391impl OneTimeWindow {
8392 pub fn new() -> Self {
8393 std::default::Default::default()
8394 }
8395
8396 /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
8397 ///
8398 /// # Example
8399 /// ```ignore,no_run
8400 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8401 /// use google_cloud_type::model::Date;
8402 /// let x = OneTimeWindow::new().set_start_date(Date::default()/* use setters */);
8403 /// ```
8404 pub fn set_start_date<T>(mut self, v: T) -> Self
8405 where
8406 T: std::convert::Into<google_cloud_type::model::Date>,
8407 {
8408 self.start_date = std::option::Option::Some(v.into());
8409 self
8410 }
8411
8412 /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
8413 ///
8414 /// # Example
8415 /// ```ignore,no_run
8416 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8417 /// use google_cloud_type::model::Date;
8418 /// let x = OneTimeWindow::new().set_or_clear_start_date(Some(Date::default()/* use setters */));
8419 /// let x = OneTimeWindow::new().set_or_clear_start_date(None::<Date>);
8420 /// ```
8421 pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
8422 where
8423 T: std::convert::Into<google_cloud_type::model::Date>,
8424 {
8425 self.start_date = v.map(|x| x.into());
8426 self
8427 }
8428
8429 /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
8430 ///
8431 /// # Example
8432 /// ```ignore,no_run
8433 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8434 /// use google_cloud_type::model::TimeOfDay;
8435 /// let x = OneTimeWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8436 /// ```
8437 pub fn set_start_time<T>(mut self, v: T) -> Self
8438 where
8439 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8440 {
8441 self.start_time = std::option::Option::Some(v.into());
8442 self
8443 }
8444
8445 /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
8446 ///
8447 /// # Example
8448 /// ```ignore,no_run
8449 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8450 /// use google_cloud_type::model::TimeOfDay;
8451 /// let x = OneTimeWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8452 /// let x = OneTimeWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8453 /// ```
8454 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8455 where
8456 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8457 {
8458 self.start_time = v.map(|x| x.into());
8459 self
8460 }
8461
8462 /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
8463 ///
8464 /// # Example
8465 /// ```ignore,no_run
8466 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8467 /// use google_cloud_type::model::Date;
8468 /// let x = OneTimeWindow::new().set_end_date(Date::default()/* use setters */);
8469 /// ```
8470 pub fn set_end_date<T>(mut self, v: T) -> Self
8471 where
8472 T: std::convert::Into<google_cloud_type::model::Date>,
8473 {
8474 self.end_date = std::option::Option::Some(v.into());
8475 self
8476 }
8477
8478 /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
8479 ///
8480 /// # Example
8481 /// ```ignore,no_run
8482 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8483 /// use google_cloud_type::model::Date;
8484 /// let x = OneTimeWindow::new().set_or_clear_end_date(Some(Date::default()/* use setters */));
8485 /// let x = OneTimeWindow::new().set_or_clear_end_date(None::<Date>);
8486 /// ```
8487 pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
8488 where
8489 T: std::convert::Into<google_cloud_type::model::Date>,
8490 {
8491 self.end_date = v.map(|x| x.into());
8492 self
8493 }
8494
8495 /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
8496 ///
8497 /// # Example
8498 /// ```ignore,no_run
8499 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8500 /// use google_cloud_type::model::TimeOfDay;
8501 /// let x = OneTimeWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8502 /// ```
8503 pub fn set_end_time<T>(mut self, v: T) -> Self
8504 where
8505 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8506 {
8507 self.end_time = std::option::Option::Some(v.into());
8508 self
8509 }
8510
8511 /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
8512 ///
8513 /// # Example
8514 /// ```ignore,no_run
8515 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8516 /// use google_cloud_type::model::TimeOfDay;
8517 /// let x = OneTimeWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8518 /// let x = OneTimeWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8519 /// ```
8520 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8521 where
8522 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8523 {
8524 self.end_time = v.map(|x| x.into());
8525 self
8526 }
8527}
8528
8529impl wkt::message::Message for OneTimeWindow {
8530 fn typename() -> &'static str {
8531 "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
8532 }
8533}
8534
8535/// Weekly windows. For example, blocking actions every Saturday and Sunday.
8536/// Another example would be blocking actions every weekday from 5pm to midnight.
8537#[derive(Clone, Default, PartialEq)]
8538#[non_exhaustive]
8539pub struct WeeklyWindow {
8540 /// Optional. Days of week. If left empty, all days of the week will be
8541 /// included.
8542 pub days_of_week: std::vec::Vec<google_cloud_type::model::DayOfWeek>,
8543
8544 /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
8545 /// If you specify start_time you must also specify end_time. If left empty,
8546 /// this will block for the entire day for the days specified in days_of_week.
8547 pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8548
8549 /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
8550 /// specify end_time you must also specify start_time. If left empty, this will
8551 /// block for the entire day for the days specified in days_of_week.
8552 pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8553
8554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8555}
8556
8557impl WeeklyWindow {
8558 pub fn new() -> Self {
8559 std::default::Default::default()
8560 }
8561
8562 /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
8563 ///
8564 /// # Example
8565 /// ```ignore,no_run
8566 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8567 /// use google_cloud_type::model::DayOfWeek;
8568 /// let x = WeeklyWindow::new().set_days_of_week([
8569 /// DayOfWeek::Monday,
8570 /// DayOfWeek::Tuesday,
8571 /// DayOfWeek::Wednesday,
8572 /// ]);
8573 /// ```
8574 pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
8575 where
8576 T: std::iter::IntoIterator<Item = V>,
8577 V: std::convert::Into<google_cloud_type::model::DayOfWeek>,
8578 {
8579 use std::iter::Iterator;
8580 self.days_of_week = v.into_iter().map(|i| i.into()).collect();
8581 self
8582 }
8583
8584 /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
8585 ///
8586 /// # Example
8587 /// ```ignore,no_run
8588 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8589 /// use google_cloud_type::model::TimeOfDay;
8590 /// let x = WeeklyWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8591 /// ```
8592 pub fn set_start_time<T>(mut self, v: T) -> Self
8593 where
8594 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8595 {
8596 self.start_time = std::option::Option::Some(v.into());
8597 self
8598 }
8599
8600 /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
8601 ///
8602 /// # Example
8603 /// ```ignore,no_run
8604 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8605 /// use google_cloud_type::model::TimeOfDay;
8606 /// let x = WeeklyWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8607 /// let x = WeeklyWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8608 /// ```
8609 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8610 where
8611 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8612 {
8613 self.start_time = v.map(|x| x.into());
8614 self
8615 }
8616
8617 /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
8618 ///
8619 /// # Example
8620 /// ```ignore,no_run
8621 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8622 /// use google_cloud_type::model::TimeOfDay;
8623 /// let x = WeeklyWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8624 /// ```
8625 pub fn set_end_time<T>(mut self, v: T) -> Self
8626 where
8627 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8628 {
8629 self.end_time = std::option::Option::Some(v.into());
8630 self
8631 }
8632
8633 /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
8634 ///
8635 /// # Example
8636 /// ```ignore,no_run
8637 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8638 /// use google_cloud_type::model::TimeOfDay;
8639 /// let x = WeeklyWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8640 /// let x = WeeklyWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8641 /// ```
8642 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8643 where
8644 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8645 {
8646 self.end_time = v.map(|x| x.into());
8647 self
8648 }
8649}
8650
8651impl wkt::message::Message for WeeklyWindow {
8652 fn typename() -> &'static str {
8653 "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
8654 }
8655}
8656
8657/// Returned from an action if one or more policies were
8658/// violated, and therefore the action was prevented. Contains information about
8659/// what policies were violated and why.
8660#[derive(Clone, Default, PartialEq)]
8661#[non_exhaustive]
8662pub struct PolicyViolation {
8663 /// Policy violation details.
8664 pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
8665
8666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8667}
8668
8669impl PolicyViolation {
8670 pub fn new() -> Self {
8671 std::default::Default::default()
8672 }
8673
8674 /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
8675 ///
8676 /// # Example
8677 /// ```ignore,no_run
8678 /// # use google_cloud_deploy_v1::model::PolicyViolation;
8679 /// use google_cloud_deploy_v1::model::PolicyViolationDetails;
8680 /// let x = PolicyViolation::new()
8681 /// .set_policy_violation_details([
8682 /// PolicyViolationDetails::default()/* use setters */,
8683 /// PolicyViolationDetails::default()/* use (different) setters */,
8684 /// ]);
8685 /// ```
8686 pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
8687 where
8688 T: std::iter::IntoIterator<Item = V>,
8689 V: std::convert::Into<crate::model::PolicyViolationDetails>,
8690 {
8691 use std::iter::Iterator;
8692 self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
8693 self
8694 }
8695}
8696
8697impl wkt::message::Message for PolicyViolation {
8698 fn typename() -> &'static str {
8699 "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
8700 }
8701}
8702
8703/// Policy violation details.
8704#[derive(Clone, Default, PartialEq)]
8705#[non_exhaustive]
8706pub struct PolicyViolationDetails {
8707 /// Name of the policy that was violated.
8708 /// Policy resource will be in the format of
8709 /// `projects/{project}/locations/{location}/policies/{policy}`.
8710 pub policy: std::string::String,
8711
8712 /// Id of the rule that triggered the policy violation.
8713 pub rule_id: std::string::String,
8714
8715 /// User readable message about why the request violated a policy. This is not
8716 /// intended for machine parsing.
8717 pub failure_message: std::string::String,
8718
8719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8720}
8721
8722impl PolicyViolationDetails {
8723 pub fn new() -> Self {
8724 std::default::Default::default()
8725 }
8726
8727 /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
8728 ///
8729 /// # Example
8730 /// ```ignore,no_run
8731 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8732 /// let x = PolicyViolationDetails::new().set_policy("example");
8733 /// ```
8734 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8735 self.policy = v.into();
8736 self
8737 }
8738
8739 /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
8740 ///
8741 /// # Example
8742 /// ```ignore,no_run
8743 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8744 /// let x = PolicyViolationDetails::new().set_rule_id("example");
8745 /// ```
8746 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8747 self.rule_id = v.into();
8748 self
8749 }
8750
8751 /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
8752 ///
8753 /// # Example
8754 /// ```ignore,no_run
8755 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8756 /// let x = PolicyViolationDetails::new().set_failure_message("example");
8757 /// ```
8758 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8759 self.failure_message = v.into();
8760 self
8761 }
8762}
8763
8764impl wkt::message::Message for PolicyViolationDetails {
8765 fn typename() -> &'static str {
8766 "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
8767 }
8768}
8769
8770/// A `Release` resource in the Cloud Deploy API.
8771///
8772/// A `Release` defines a specific Skaffold configuration instance
8773/// that can be deployed.
8774#[derive(Clone, Default, PartialEq)]
8775#[non_exhaustive]
8776pub struct Release {
8777 /// Identifier. Name of the `Release`. Format is
8778 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
8779 /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8780 pub name: std::string::String,
8781
8782 /// Output only. Unique identifier of the `Release`.
8783 pub uid: std::string::String,
8784
8785 /// Optional. Description of the `Release`. Max length is 255 characters.
8786 pub description: std::string::String,
8787
8788 /// Optional. User annotations. These attributes can only be set and used by
8789 /// the user, and not by Cloud Deploy. See
8790 /// <https://google.aip.dev/128#annotations> for more details such as format and
8791 /// size limitations.
8792 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8793
8794 /// Labels are attributes that can be set and used by both the
8795 /// user and by Cloud Deploy. Labels must meet the following constraints:
8796 ///
8797 /// * Keys and values can contain only lowercase letters, numeric characters,
8798 /// underscores, and dashes.
8799 /// * All characters must use UTF-8 encoding, and international characters are
8800 /// allowed.
8801 /// * Keys must start with a lowercase letter or international character.
8802 /// * Each resource is limited to a maximum of 64 labels.
8803 ///
8804 /// Both keys and values are additionally constrained to be <= 128 bytes.
8805 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8806
8807 /// Output only. Indicates whether this is an abandoned release.
8808 pub abandoned: bool,
8809
8810 /// Output only. Time at which the `Release` was created.
8811 pub create_time: std::option::Option<wkt::Timestamp>,
8812
8813 /// Output only. Time at which the render began.
8814 pub render_start_time: std::option::Option<wkt::Timestamp>,
8815
8816 /// Output only. Time at which the render completed.
8817 pub render_end_time: std::option::Option<wkt::Timestamp>,
8818
8819 /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
8820 /// configuration.
8821 pub skaffold_config_uri: std::string::String,
8822
8823 /// Optional. Filepath of the Skaffold config inside of the config URI.
8824 pub skaffold_config_path: std::string::String,
8825
8826 /// Optional. List of artifacts to pass through to Skaffold command.
8827 pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
8828
8829 /// Output only. Snapshot of the parent pipeline taken at release creation
8830 /// time.
8831 pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
8832
8833 /// Output only. Snapshot of the targets taken at release creation time.
8834 pub target_snapshots: std::vec::Vec<crate::model::Target>,
8835
8836 /// Output only. Snapshot of the custom target types referenced by the targets
8837 /// taken at release creation time.
8838 pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
8839
8840 /// Output only. Current state of the render operation.
8841 pub render_state: crate::model::release::RenderState,
8842
8843 /// This checksum is computed by the server based on the value of other
8844 /// fields, and may be sent on update and delete requests to ensure the
8845 /// client has an up-to-date value before proceeding.
8846 pub etag: std::string::String,
8847
8848 /// Optional. The Skaffold version to use when operating on this release, such
8849 /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
8850 /// set of versions.
8851 ///
8852 /// If unset, the most recent supported Skaffold version will be used.
8853 pub skaffold_version: std::string::String,
8854
8855 /// Output only. Map from target ID to the target artifacts created
8856 /// during the render operation.
8857 pub target_artifacts:
8858 std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
8859
8860 /// Output only. Map from target ID to details of the render operation for that
8861 /// target.
8862 pub target_renders:
8863 std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
8864
8865 /// Output only. Information around the state of the Release.
8866 pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
8867
8868 /// Optional. The deploy parameters to use for all targets in this release.
8869 pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
8870
8871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8872}
8873
8874impl Release {
8875 pub fn new() -> Self {
8876 std::default::Default::default()
8877 }
8878
8879 /// Sets the value of [name][crate::model::Release::name].
8880 ///
8881 /// # Example
8882 /// ```ignore,no_run
8883 /// # use google_cloud_deploy_v1::model::Release;
8884 /// let x = Release::new().set_name("example");
8885 /// ```
8886 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8887 self.name = v.into();
8888 self
8889 }
8890
8891 /// Sets the value of [uid][crate::model::Release::uid].
8892 ///
8893 /// # Example
8894 /// ```ignore,no_run
8895 /// # use google_cloud_deploy_v1::model::Release;
8896 /// let x = Release::new().set_uid("example");
8897 /// ```
8898 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8899 self.uid = v.into();
8900 self
8901 }
8902
8903 /// Sets the value of [description][crate::model::Release::description].
8904 ///
8905 /// # Example
8906 /// ```ignore,no_run
8907 /// # use google_cloud_deploy_v1::model::Release;
8908 /// let x = Release::new().set_description("example");
8909 /// ```
8910 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8911 self.description = v.into();
8912 self
8913 }
8914
8915 /// Sets the value of [annotations][crate::model::Release::annotations].
8916 ///
8917 /// # Example
8918 /// ```ignore,no_run
8919 /// # use google_cloud_deploy_v1::model::Release;
8920 /// let x = Release::new().set_annotations([
8921 /// ("key0", "abc"),
8922 /// ("key1", "xyz"),
8923 /// ]);
8924 /// ```
8925 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
8926 where
8927 T: std::iter::IntoIterator<Item = (K, V)>,
8928 K: std::convert::Into<std::string::String>,
8929 V: std::convert::Into<std::string::String>,
8930 {
8931 use std::iter::Iterator;
8932 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8933 self
8934 }
8935
8936 /// Sets the value of [labels][crate::model::Release::labels].
8937 ///
8938 /// # Example
8939 /// ```ignore,no_run
8940 /// # use google_cloud_deploy_v1::model::Release;
8941 /// let x = Release::new().set_labels([
8942 /// ("key0", "abc"),
8943 /// ("key1", "xyz"),
8944 /// ]);
8945 /// ```
8946 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8947 where
8948 T: std::iter::IntoIterator<Item = (K, V)>,
8949 K: std::convert::Into<std::string::String>,
8950 V: std::convert::Into<std::string::String>,
8951 {
8952 use std::iter::Iterator;
8953 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8954 self
8955 }
8956
8957 /// Sets the value of [abandoned][crate::model::Release::abandoned].
8958 ///
8959 /// # Example
8960 /// ```ignore,no_run
8961 /// # use google_cloud_deploy_v1::model::Release;
8962 /// let x = Release::new().set_abandoned(true);
8963 /// ```
8964 pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8965 self.abandoned = v.into();
8966 self
8967 }
8968
8969 /// Sets the value of [create_time][crate::model::Release::create_time].
8970 ///
8971 /// # Example
8972 /// ```ignore,no_run
8973 /// # use google_cloud_deploy_v1::model::Release;
8974 /// use wkt::Timestamp;
8975 /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
8976 /// ```
8977 pub fn set_create_time<T>(mut self, v: T) -> Self
8978 where
8979 T: std::convert::Into<wkt::Timestamp>,
8980 {
8981 self.create_time = std::option::Option::Some(v.into());
8982 self
8983 }
8984
8985 /// Sets or clears the value of [create_time][crate::model::Release::create_time].
8986 ///
8987 /// # Example
8988 /// ```ignore,no_run
8989 /// # use google_cloud_deploy_v1::model::Release;
8990 /// use wkt::Timestamp;
8991 /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8992 /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
8993 /// ```
8994 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8995 where
8996 T: std::convert::Into<wkt::Timestamp>,
8997 {
8998 self.create_time = v.map(|x| x.into());
8999 self
9000 }
9001
9002 /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
9003 ///
9004 /// # Example
9005 /// ```ignore,no_run
9006 /// # use google_cloud_deploy_v1::model::Release;
9007 /// use wkt::Timestamp;
9008 /// let x = Release::new().set_render_start_time(Timestamp::default()/* use setters */);
9009 /// ```
9010 pub fn set_render_start_time<T>(mut self, v: T) -> Self
9011 where
9012 T: std::convert::Into<wkt::Timestamp>,
9013 {
9014 self.render_start_time = std::option::Option::Some(v.into());
9015 self
9016 }
9017
9018 /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
9019 ///
9020 /// # Example
9021 /// ```ignore,no_run
9022 /// # use google_cloud_deploy_v1::model::Release;
9023 /// use wkt::Timestamp;
9024 /// let x = Release::new().set_or_clear_render_start_time(Some(Timestamp::default()/* use setters */));
9025 /// let x = Release::new().set_or_clear_render_start_time(None::<Timestamp>);
9026 /// ```
9027 pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9028 where
9029 T: std::convert::Into<wkt::Timestamp>,
9030 {
9031 self.render_start_time = v.map(|x| x.into());
9032 self
9033 }
9034
9035 /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
9036 ///
9037 /// # Example
9038 /// ```ignore,no_run
9039 /// # use google_cloud_deploy_v1::model::Release;
9040 /// use wkt::Timestamp;
9041 /// let x = Release::new().set_render_end_time(Timestamp::default()/* use setters */);
9042 /// ```
9043 pub fn set_render_end_time<T>(mut self, v: T) -> Self
9044 where
9045 T: std::convert::Into<wkt::Timestamp>,
9046 {
9047 self.render_end_time = std::option::Option::Some(v.into());
9048 self
9049 }
9050
9051 /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
9052 ///
9053 /// # Example
9054 /// ```ignore,no_run
9055 /// # use google_cloud_deploy_v1::model::Release;
9056 /// use wkt::Timestamp;
9057 /// let x = Release::new().set_or_clear_render_end_time(Some(Timestamp::default()/* use setters */));
9058 /// let x = Release::new().set_or_clear_render_end_time(None::<Timestamp>);
9059 /// ```
9060 pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9061 where
9062 T: std::convert::Into<wkt::Timestamp>,
9063 {
9064 self.render_end_time = v.map(|x| x.into());
9065 self
9066 }
9067
9068 /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
9069 ///
9070 /// # Example
9071 /// ```ignore,no_run
9072 /// # use google_cloud_deploy_v1::model::Release;
9073 /// let x = Release::new().set_skaffold_config_uri("example");
9074 /// ```
9075 pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
9076 mut self,
9077 v: T,
9078 ) -> Self {
9079 self.skaffold_config_uri = v.into();
9080 self
9081 }
9082
9083 /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
9084 ///
9085 /// # Example
9086 /// ```ignore,no_run
9087 /// # use google_cloud_deploy_v1::model::Release;
9088 /// let x = Release::new().set_skaffold_config_path("example");
9089 /// ```
9090 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
9091 mut self,
9092 v: T,
9093 ) -> Self {
9094 self.skaffold_config_path = v.into();
9095 self
9096 }
9097
9098 /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
9099 ///
9100 /// # Example
9101 /// ```ignore,no_run
9102 /// # use google_cloud_deploy_v1::model::Release;
9103 /// use google_cloud_deploy_v1::model::BuildArtifact;
9104 /// let x = Release::new()
9105 /// .set_build_artifacts([
9106 /// BuildArtifact::default()/* use setters */,
9107 /// BuildArtifact::default()/* use (different) setters */,
9108 /// ]);
9109 /// ```
9110 pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
9111 where
9112 T: std::iter::IntoIterator<Item = V>,
9113 V: std::convert::Into<crate::model::BuildArtifact>,
9114 {
9115 use std::iter::Iterator;
9116 self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
9117 self
9118 }
9119
9120 /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9121 ///
9122 /// # Example
9123 /// ```ignore,no_run
9124 /// # use google_cloud_deploy_v1::model::Release;
9125 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9126 /// let x = Release::new().set_delivery_pipeline_snapshot(DeliveryPipeline::default()/* use setters */);
9127 /// ```
9128 pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
9129 where
9130 T: std::convert::Into<crate::model::DeliveryPipeline>,
9131 {
9132 self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
9133 self
9134 }
9135
9136 /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9137 ///
9138 /// # Example
9139 /// ```ignore,no_run
9140 /// # use google_cloud_deploy_v1::model::Release;
9141 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9142 /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(Some(DeliveryPipeline::default()/* use setters */));
9143 /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(None::<DeliveryPipeline>);
9144 /// ```
9145 pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9146 where
9147 T: std::convert::Into<crate::model::DeliveryPipeline>,
9148 {
9149 self.delivery_pipeline_snapshot = v.map(|x| x.into());
9150 self
9151 }
9152
9153 /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
9154 ///
9155 /// # Example
9156 /// ```ignore,no_run
9157 /// # use google_cloud_deploy_v1::model::Release;
9158 /// use google_cloud_deploy_v1::model::Target;
9159 /// let x = Release::new()
9160 /// .set_target_snapshots([
9161 /// Target::default()/* use setters */,
9162 /// Target::default()/* use (different) setters */,
9163 /// ]);
9164 /// ```
9165 pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
9166 where
9167 T: std::iter::IntoIterator<Item = V>,
9168 V: std::convert::Into<crate::model::Target>,
9169 {
9170 use std::iter::Iterator;
9171 self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
9172 self
9173 }
9174
9175 /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
9176 ///
9177 /// # Example
9178 /// ```ignore,no_run
9179 /// # use google_cloud_deploy_v1::model::Release;
9180 /// use google_cloud_deploy_v1::model::CustomTargetType;
9181 /// let x = Release::new()
9182 /// .set_custom_target_type_snapshots([
9183 /// CustomTargetType::default()/* use setters */,
9184 /// CustomTargetType::default()/* use (different) setters */,
9185 /// ]);
9186 /// ```
9187 pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
9188 where
9189 T: std::iter::IntoIterator<Item = V>,
9190 V: std::convert::Into<crate::model::CustomTargetType>,
9191 {
9192 use std::iter::Iterator;
9193 self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
9194 self
9195 }
9196
9197 /// Sets the value of [render_state][crate::model::Release::render_state].
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_deploy_v1::model::Release;
9202 /// use google_cloud_deploy_v1::model::release::RenderState;
9203 /// let x0 = Release::new().set_render_state(RenderState::Succeeded);
9204 /// let x1 = Release::new().set_render_state(RenderState::Failed);
9205 /// let x2 = Release::new().set_render_state(RenderState::InProgress);
9206 /// ```
9207 pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
9208 mut self,
9209 v: T,
9210 ) -> Self {
9211 self.render_state = v.into();
9212 self
9213 }
9214
9215 /// Sets the value of [etag][crate::model::Release::etag].
9216 ///
9217 /// # Example
9218 /// ```ignore,no_run
9219 /// # use google_cloud_deploy_v1::model::Release;
9220 /// let x = Release::new().set_etag("example");
9221 /// ```
9222 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9223 self.etag = v.into();
9224 self
9225 }
9226
9227 /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
9228 ///
9229 /// # Example
9230 /// ```ignore,no_run
9231 /// # use google_cloud_deploy_v1::model::Release;
9232 /// let x = Release::new().set_skaffold_version("example");
9233 /// ```
9234 pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
9235 mut self,
9236 v: T,
9237 ) -> Self {
9238 self.skaffold_version = v.into();
9239 self
9240 }
9241
9242 /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
9243 ///
9244 /// # Example
9245 /// ```ignore,no_run
9246 /// # use google_cloud_deploy_v1::model::Release;
9247 /// use google_cloud_deploy_v1::model::TargetArtifact;
9248 /// let x = Release::new().set_target_artifacts([
9249 /// ("key0", TargetArtifact::default()/* use setters */),
9250 /// ("key1", TargetArtifact::default()/* use (different) setters */),
9251 /// ]);
9252 /// ```
9253 pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
9254 where
9255 T: std::iter::IntoIterator<Item = (K, V)>,
9256 K: std::convert::Into<std::string::String>,
9257 V: std::convert::Into<crate::model::TargetArtifact>,
9258 {
9259 use std::iter::Iterator;
9260 self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9261 self
9262 }
9263
9264 /// Sets the value of [target_renders][crate::model::Release::target_renders].
9265 ///
9266 /// # Example
9267 /// ```ignore,no_run
9268 /// # use google_cloud_deploy_v1::model::Release;
9269 /// use google_cloud_deploy_v1::model::release::TargetRender;
9270 /// let x = Release::new().set_target_renders([
9271 /// ("key0", TargetRender::default()/* use setters */),
9272 /// ("key1", TargetRender::default()/* use (different) setters */),
9273 /// ]);
9274 /// ```
9275 pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
9276 where
9277 T: std::iter::IntoIterator<Item = (K, V)>,
9278 K: std::convert::Into<std::string::String>,
9279 V: std::convert::Into<crate::model::release::TargetRender>,
9280 {
9281 use std::iter::Iterator;
9282 self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9283 self
9284 }
9285
9286 /// Sets the value of [condition][crate::model::Release::condition].
9287 ///
9288 /// # Example
9289 /// ```ignore,no_run
9290 /// # use google_cloud_deploy_v1::model::Release;
9291 /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9292 /// let x = Release::new().set_condition(ReleaseCondition::default()/* use setters */);
9293 /// ```
9294 pub fn set_condition<T>(mut self, v: T) -> Self
9295 where
9296 T: std::convert::Into<crate::model::release::ReleaseCondition>,
9297 {
9298 self.condition = std::option::Option::Some(v.into());
9299 self
9300 }
9301
9302 /// Sets or clears the value of [condition][crate::model::Release::condition].
9303 ///
9304 /// # Example
9305 /// ```ignore,no_run
9306 /// # use google_cloud_deploy_v1::model::Release;
9307 /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9308 /// let x = Release::new().set_or_clear_condition(Some(ReleaseCondition::default()/* use setters */));
9309 /// let x = Release::new().set_or_clear_condition(None::<ReleaseCondition>);
9310 /// ```
9311 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
9312 where
9313 T: std::convert::Into<crate::model::release::ReleaseCondition>,
9314 {
9315 self.condition = v.map(|x| x.into());
9316 self
9317 }
9318
9319 /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
9320 ///
9321 /// # Example
9322 /// ```ignore,no_run
9323 /// # use google_cloud_deploy_v1::model::Release;
9324 /// let x = Release::new().set_deploy_parameters([
9325 /// ("key0", "abc"),
9326 /// ("key1", "xyz"),
9327 /// ]);
9328 /// ```
9329 pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
9330 where
9331 T: std::iter::IntoIterator<Item = (K, V)>,
9332 K: std::convert::Into<std::string::String>,
9333 V: std::convert::Into<std::string::String>,
9334 {
9335 use std::iter::Iterator;
9336 self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9337 self
9338 }
9339}
9340
9341impl wkt::message::Message for Release {
9342 fn typename() -> &'static str {
9343 "type.googleapis.com/google.cloud.deploy.v1.Release"
9344 }
9345}
9346
9347/// Defines additional types related to [Release].
9348pub mod release {
9349 #[allow(unused_imports)]
9350 use super::*;
9351
9352 /// Details of rendering for a single target.
9353 #[derive(Clone, Default, PartialEq)]
9354 #[non_exhaustive]
9355 pub struct TargetRender {
9356 /// Output only. The resource name of the Cloud Build `Build` object that is
9357 /// used to render the manifest for this target. Format is
9358 /// `projects/{project}/locations/{location}/builds/{build}`.
9359 pub rendering_build: std::string::String,
9360
9361 /// Output only. Current state of the render operation for this Target.
9362 pub rendering_state: crate::model::release::target_render::TargetRenderState,
9363
9364 /// Output only. Metadata related to the `Release` render for this Target.
9365 pub metadata: std::option::Option<crate::model::RenderMetadata>,
9366
9367 /// Output only. Reason this render failed. This will always be unspecified
9368 /// while the render in progress.
9369 pub failure_cause: crate::model::release::target_render::FailureCause,
9370
9371 /// Output only. Additional information about the render failure, if
9372 /// available.
9373 pub failure_message: std::string::String,
9374
9375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9376 }
9377
9378 impl TargetRender {
9379 pub fn new() -> Self {
9380 std::default::Default::default()
9381 }
9382
9383 /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
9384 ///
9385 /// # Example
9386 /// ```ignore,no_run
9387 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9388 /// let x = TargetRender::new().set_rendering_build("example");
9389 /// ```
9390 pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
9391 mut self,
9392 v: T,
9393 ) -> Self {
9394 self.rendering_build = v.into();
9395 self
9396 }
9397
9398 /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
9399 ///
9400 /// # Example
9401 /// ```ignore,no_run
9402 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9403 /// use google_cloud_deploy_v1::model::release::target_render::TargetRenderState;
9404 /// let x0 = TargetRender::new().set_rendering_state(TargetRenderState::Succeeded);
9405 /// let x1 = TargetRender::new().set_rendering_state(TargetRenderState::Failed);
9406 /// let x2 = TargetRender::new().set_rendering_state(TargetRenderState::InProgress);
9407 /// ```
9408 pub fn set_rendering_state<
9409 T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
9410 >(
9411 mut self,
9412 v: T,
9413 ) -> Self {
9414 self.rendering_state = v.into();
9415 self
9416 }
9417
9418 /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
9419 ///
9420 /// # Example
9421 /// ```ignore,no_run
9422 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9423 /// use google_cloud_deploy_v1::model::RenderMetadata;
9424 /// let x = TargetRender::new().set_metadata(RenderMetadata::default()/* use setters */);
9425 /// ```
9426 pub fn set_metadata<T>(mut self, v: T) -> Self
9427 where
9428 T: std::convert::Into<crate::model::RenderMetadata>,
9429 {
9430 self.metadata = std::option::Option::Some(v.into());
9431 self
9432 }
9433
9434 /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
9435 ///
9436 /// # Example
9437 /// ```ignore,no_run
9438 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9439 /// use google_cloud_deploy_v1::model::RenderMetadata;
9440 /// let x = TargetRender::new().set_or_clear_metadata(Some(RenderMetadata::default()/* use setters */));
9441 /// let x = TargetRender::new().set_or_clear_metadata(None::<RenderMetadata>);
9442 /// ```
9443 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9444 where
9445 T: std::convert::Into<crate::model::RenderMetadata>,
9446 {
9447 self.metadata = v.map(|x| x.into());
9448 self
9449 }
9450
9451 /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
9452 ///
9453 /// # Example
9454 /// ```ignore,no_run
9455 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9456 /// use google_cloud_deploy_v1::model::release::target_render::FailureCause;
9457 /// let x0 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
9458 /// let x1 = TargetRender::new().set_failure_cause(FailureCause::ExecutionFailed);
9459 /// let x2 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildRequestFailed);
9460 /// ```
9461 pub fn set_failure_cause<
9462 T: std::convert::Into<crate::model::release::target_render::FailureCause>,
9463 >(
9464 mut self,
9465 v: T,
9466 ) -> Self {
9467 self.failure_cause = v.into();
9468 self
9469 }
9470
9471 /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
9472 ///
9473 /// # Example
9474 /// ```ignore,no_run
9475 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9476 /// let x = TargetRender::new().set_failure_message("example");
9477 /// ```
9478 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
9479 mut self,
9480 v: T,
9481 ) -> Self {
9482 self.failure_message = v.into();
9483 self
9484 }
9485 }
9486
9487 impl wkt::message::Message for TargetRender {
9488 fn typename() -> &'static str {
9489 "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
9490 }
9491 }
9492
9493 /// Defines additional types related to [TargetRender].
9494 pub mod target_render {
9495 #[allow(unused_imports)]
9496 use super::*;
9497
9498 /// Valid states of the render operation.
9499 ///
9500 /// # Working with unknown values
9501 ///
9502 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9503 /// additional enum variants at any time. Adding new variants is not considered
9504 /// a breaking change. Applications should write their code in anticipation of:
9505 ///
9506 /// - New values appearing in future releases of the client library, **and**
9507 /// - New values received dynamically, without application changes.
9508 ///
9509 /// Please consult the [Working with enums] section in the user guide for some
9510 /// guidelines.
9511 ///
9512 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9513 #[derive(Clone, Debug, PartialEq)]
9514 #[non_exhaustive]
9515 pub enum TargetRenderState {
9516 /// The render operation state is unspecified.
9517 Unspecified,
9518 /// The render operation has completed successfully.
9519 Succeeded,
9520 /// The render operation has failed.
9521 Failed,
9522 /// The render operation is in progress.
9523 InProgress,
9524 /// If set, the enum was initialized with an unknown value.
9525 ///
9526 /// Applications can examine the value using [TargetRenderState::value] or
9527 /// [TargetRenderState::name].
9528 UnknownValue(target_render_state::UnknownValue),
9529 }
9530
9531 #[doc(hidden)]
9532 pub mod target_render_state {
9533 #[allow(unused_imports)]
9534 use super::*;
9535 #[derive(Clone, Debug, PartialEq)]
9536 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9537 }
9538
9539 impl TargetRenderState {
9540 /// Gets the enum value.
9541 ///
9542 /// Returns `None` if the enum contains an unknown value deserialized from
9543 /// the string representation of enums.
9544 pub fn value(&self) -> std::option::Option<i32> {
9545 match self {
9546 Self::Unspecified => std::option::Option::Some(0),
9547 Self::Succeeded => std::option::Option::Some(1),
9548 Self::Failed => std::option::Option::Some(2),
9549 Self::InProgress => std::option::Option::Some(3),
9550 Self::UnknownValue(u) => u.0.value(),
9551 }
9552 }
9553
9554 /// Gets the enum value as a string.
9555 ///
9556 /// Returns `None` if the enum contains an unknown value deserialized from
9557 /// the integer representation of enums.
9558 pub fn name(&self) -> std::option::Option<&str> {
9559 match self {
9560 Self::Unspecified => {
9561 std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
9562 }
9563 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9564 Self::Failed => std::option::Option::Some("FAILED"),
9565 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9566 Self::UnknownValue(u) => u.0.name(),
9567 }
9568 }
9569 }
9570
9571 impl std::default::Default for TargetRenderState {
9572 fn default() -> Self {
9573 use std::convert::From;
9574 Self::from(0)
9575 }
9576 }
9577
9578 impl std::fmt::Display for TargetRenderState {
9579 fn fmt(
9580 &self,
9581 f: &mut std::fmt::Formatter<'_>,
9582 ) -> std::result::Result<(), std::fmt::Error> {
9583 wkt::internal::display_enum(f, self.name(), self.value())
9584 }
9585 }
9586
9587 impl std::convert::From<i32> for TargetRenderState {
9588 fn from(value: i32) -> Self {
9589 match value {
9590 0 => Self::Unspecified,
9591 1 => Self::Succeeded,
9592 2 => Self::Failed,
9593 3 => Self::InProgress,
9594 _ => Self::UnknownValue(target_render_state::UnknownValue(
9595 wkt::internal::UnknownEnumValue::Integer(value),
9596 )),
9597 }
9598 }
9599 }
9600
9601 impl std::convert::From<&str> for TargetRenderState {
9602 fn from(value: &str) -> Self {
9603 use std::string::ToString;
9604 match value {
9605 "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
9606 "SUCCEEDED" => Self::Succeeded,
9607 "FAILED" => Self::Failed,
9608 "IN_PROGRESS" => Self::InProgress,
9609 _ => Self::UnknownValue(target_render_state::UnknownValue(
9610 wkt::internal::UnknownEnumValue::String(value.to_string()),
9611 )),
9612 }
9613 }
9614 }
9615
9616 impl serde::ser::Serialize for TargetRenderState {
9617 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9618 where
9619 S: serde::Serializer,
9620 {
9621 match self {
9622 Self::Unspecified => serializer.serialize_i32(0),
9623 Self::Succeeded => serializer.serialize_i32(1),
9624 Self::Failed => serializer.serialize_i32(2),
9625 Self::InProgress => serializer.serialize_i32(3),
9626 Self::UnknownValue(u) => u.0.serialize(serializer),
9627 }
9628 }
9629 }
9630
9631 impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
9632 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9633 where
9634 D: serde::Deserializer<'de>,
9635 {
9636 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
9637 ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
9638 ))
9639 }
9640 }
9641
9642 /// Well-known rendering failures.
9643 ///
9644 /// # Working with unknown values
9645 ///
9646 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9647 /// additional enum variants at any time. Adding new variants is not considered
9648 /// a breaking change. Applications should write their code in anticipation of:
9649 ///
9650 /// - New values appearing in future releases of the client library, **and**
9651 /// - New values received dynamically, without application changes.
9652 ///
9653 /// Please consult the [Working with enums] section in the user guide for some
9654 /// guidelines.
9655 ///
9656 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9657 #[derive(Clone, Debug, PartialEq)]
9658 #[non_exhaustive]
9659 pub enum FailureCause {
9660 /// No reason for failure is specified.
9661 Unspecified,
9662 /// Cloud Build is not available, either because it is not enabled or
9663 /// because Cloud Deploy has insufficient permissions. See [required
9664 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9665 CloudBuildUnavailable,
9666 /// The render operation did not complete successfully; check Cloud Build
9667 /// logs.
9668 ExecutionFailed,
9669 /// Cloud Build failed to fulfill Cloud Deploy's request. See
9670 /// failure_message for additional details.
9671 CloudBuildRequestFailed,
9672 /// The render operation did not complete successfully because the
9673 /// verification stanza required for verify was not found on the Skaffold
9674 /// configuration.
9675 VerificationConfigNotFound,
9676 /// The render operation did not complete successfully because the custom
9677 /// action(s) required for Rollout jobs were not found in the Skaffold
9678 /// configuration. See failure_message for additional details.
9679 CustomActionNotFound,
9680 /// Release failed during rendering because the release configuration is
9681 /// not supported with the specified deployment strategy.
9682 DeploymentStrategyNotSupported,
9683 /// The render operation had a feature configured that is not supported.
9684 RenderFeatureNotSupported,
9685 /// If set, the enum was initialized with an unknown value.
9686 ///
9687 /// Applications can examine the value using [FailureCause::value] or
9688 /// [FailureCause::name].
9689 UnknownValue(failure_cause::UnknownValue),
9690 }
9691
9692 #[doc(hidden)]
9693 pub mod failure_cause {
9694 #[allow(unused_imports)]
9695 use super::*;
9696 #[derive(Clone, Debug, PartialEq)]
9697 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9698 }
9699
9700 impl FailureCause {
9701 /// Gets the enum value.
9702 ///
9703 /// Returns `None` if the enum contains an unknown value deserialized from
9704 /// the string representation of enums.
9705 pub fn value(&self) -> std::option::Option<i32> {
9706 match self {
9707 Self::Unspecified => std::option::Option::Some(0),
9708 Self::CloudBuildUnavailable => std::option::Option::Some(1),
9709 Self::ExecutionFailed => std::option::Option::Some(2),
9710 Self::CloudBuildRequestFailed => std::option::Option::Some(3),
9711 Self::VerificationConfigNotFound => std::option::Option::Some(4),
9712 Self::CustomActionNotFound => std::option::Option::Some(5),
9713 Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
9714 Self::RenderFeatureNotSupported => std::option::Option::Some(7),
9715 Self::UnknownValue(u) => u.0.value(),
9716 }
9717 }
9718
9719 /// Gets the enum value as a string.
9720 ///
9721 /// Returns `None` if the enum contains an unknown value deserialized from
9722 /// the integer representation of enums.
9723 pub fn name(&self) -> std::option::Option<&str> {
9724 match self {
9725 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9726 Self::CloudBuildUnavailable => {
9727 std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
9728 }
9729 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9730 Self::CloudBuildRequestFailed => {
9731 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9732 }
9733 Self::VerificationConfigNotFound => {
9734 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9735 }
9736 Self::CustomActionNotFound => {
9737 std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
9738 }
9739 Self::DeploymentStrategyNotSupported => {
9740 std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
9741 }
9742 Self::RenderFeatureNotSupported => {
9743 std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
9744 }
9745 Self::UnknownValue(u) => u.0.name(),
9746 }
9747 }
9748 }
9749
9750 impl std::default::Default for FailureCause {
9751 fn default() -> Self {
9752 use std::convert::From;
9753 Self::from(0)
9754 }
9755 }
9756
9757 impl std::fmt::Display for FailureCause {
9758 fn fmt(
9759 &self,
9760 f: &mut std::fmt::Formatter<'_>,
9761 ) -> std::result::Result<(), std::fmt::Error> {
9762 wkt::internal::display_enum(f, self.name(), self.value())
9763 }
9764 }
9765
9766 impl std::convert::From<i32> for FailureCause {
9767 fn from(value: i32) -> Self {
9768 match value {
9769 0 => Self::Unspecified,
9770 1 => Self::CloudBuildUnavailable,
9771 2 => Self::ExecutionFailed,
9772 3 => Self::CloudBuildRequestFailed,
9773 4 => Self::VerificationConfigNotFound,
9774 5 => Self::CustomActionNotFound,
9775 6 => Self::DeploymentStrategyNotSupported,
9776 7 => Self::RenderFeatureNotSupported,
9777 _ => Self::UnknownValue(failure_cause::UnknownValue(
9778 wkt::internal::UnknownEnumValue::Integer(value),
9779 )),
9780 }
9781 }
9782 }
9783
9784 impl std::convert::From<&str> for FailureCause {
9785 fn from(value: &str) -> Self {
9786 use std::string::ToString;
9787 match value {
9788 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9789 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9790 "EXECUTION_FAILED" => Self::ExecutionFailed,
9791 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9792 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9793 "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
9794 "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
9795 "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
9796 _ => Self::UnknownValue(failure_cause::UnknownValue(
9797 wkt::internal::UnknownEnumValue::String(value.to_string()),
9798 )),
9799 }
9800 }
9801 }
9802
9803 impl serde::ser::Serialize for FailureCause {
9804 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9805 where
9806 S: serde::Serializer,
9807 {
9808 match self {
9809 Self::Unspecified => serializer.serialize_i32(0),
9810 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9811 Self::ExecutionFailed => serializer.serialize_i32(2),
9812 Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
9813 Self::VerificationConfigNotFound => serializer.serialize_i32(4),
9814 Self::CustomActionNotFound => serializer.serialize_i32(5),
9815 Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
9816 Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
9817 Self::UnknownValue(u) => u.0.serialize(serializer),
9818 }
9819 }
9820 }
9821
9822 impl<'de> serde::de::Deserialize<'de> for FailureCause {
9823 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9824 where
9825 D: serde::Deserializer<'de>,
9826 {
9827 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9828 ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
9829 ))
9830 }
9831 }
9832 }
9833
9834 /// ReleaseReadyCondition contains information around the status of the
9835 /// Release. If a release is not ready, you cannot create a rollout with the
9836 /// release.
9837 #[derive(Clone, Default, PartialEq)]
9838 #[non_exhaustive]
9839 pub struct ReleaseReadyCondition {
9840 /// True if the Release is in a valid state. Otherwise at least one condition
9841 /// in `ReleaseCondition` is in an invalid state. Iterate over those
9842 /// conditions and see which condition(s) has status = false to find out what
9843 /// is wrong with the Release.
9844 pub status: bool,
9845
9846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9847 }
9848
9849 impl ReleaseReadyCondition {
9850 pub fn new() -> Self {
9851 std::default::Default::default()
9852 }
9853
9854 /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
9855 ///
9856 /// # Example
9857 /// ```ignore,no_run
9858 /// # use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
9859 /// let x = ReleaseReadyCondition::new().set_status(true);
9860 /// ```
9861 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9862 self.status = v.into();
9863 self
9864 }
9865 }
9866
9867 impl wkt::message::Message for ReleaseReadyCondition {
9868 fn typename() -> &'static str {
9869 "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
9870 }
9871 }
9872
9873 /// SkaffoldSupportedCondition contains information about when support for the
9874 /// release's version of Skaffold ends.
9875 #[derive(Clone, Default, PartialEq)]
9876 #[non_exhaustive]
9877 pub struct SkaffoldSupportedCondition {
9878 /// True if the version of Skaffold used by this release is supported.
9879 pub status: bool,
9880
9881 /// The Skaffold support state for this release's version of Skaffold.
9882 pub skaffold_support_state: crate::model::SkaffoldSupportState,
9883
9884 /// The time at which this release's version of Skaffold will enter
9885 /// maintenance mode.
9886 pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
9887
9888 /// The time at which this release's version of Skaffold will no longer be
9889 /// supported.
9890 pub support_expiration_time: std::option::Option<wkt::Timestamp>,
9891
9892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9893 }
9894
9895 impl SkaffoldSupportedCondition {
9896 pub fn new() -> Self {
9897 std::default::Default::default()
9898 }
9899
9900 /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
9901 ///
9902 /// # Example
9903 /// ```ignore,no_run
9904 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9905 /// let x = SkaffoldSupportedCondition::new().set_status(true);
9906 /// ```
9907 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9908 self.status = v.into();
9909 self
9910 }
9911
9912 /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
9913 ///
9914 /// # Example
9915 /// ```ignore,no_run
9916 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9917 /// use google_cloud_deploy_v1::model::SkaffoldSupportState;
9918 /// let x0 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Supported);
9919 /// let x1 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::MaintenanceMode);
9920 /// let x2 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Unsupported);
9921 /// ```
9922 pub fn set_skaffold_support_state<
9923 T: std::convert::Into<crate::model::SkaffoldSupportState>,
9924 >(
9925 mut self,
9926 v: T,
9927 ) -> Self {
9928 self.skaffold_support_state = v.into();
9929 self
9930 }
9931
9932 /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
9933 ///
9934 /// # Example
9935 /// ```ignore,no_run
9936 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9937 /// use wkt::Timestamp;
9938 /// let x = SkaffoldSupportedCondition::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
9939 /// ```
9940 pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
9941 where
9942 T: std::convert::Into<wkt::Timestamp>,
9943 {
9944 self.maintenance_mode_time = std::option::Option::Some(v.into());
9945 self
9946 }
9947
9948 /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
9949 ///
9950 /// # Example
9951 /// ```ignore,no_run
9952 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9953 /// use wkt::Timestamp;
9954 /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
9955 /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
9956 /// ```
9957 pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
9958 where
9959 T: std::convert::Into<wkt::Timestamp>,
9960 {
9961 self.maintenance_mode_time = v.map(|x| x.into());
9962 self
9963 }
9964
9965 /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
9966 ///
9967 /// # Example
9968 /// ```ignore,no_run
9969 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9970 /// use wkt::Timestamp;
9971 /// let x = SkaffoldSupportedCondition::new().set_support_expiration_time(Timestamp::default()/* use setters */);
9972 /// ```
9973 pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
9974 where
9975 T: std::convert::Into<wkt::Timestamp>,
9976 {
9977 self.support_expiration_time = std::option::Option::Some(v.into());
9978 self
9979 }
9980
9981 /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
9982 ///
9983 /// # Example
9984 /// ```ignore,no_run
9985 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9986 /// use wkt::Timestamp;
9987 /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
9988 /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(None::<Timestamp>);
9989 /// ```
9990 pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
9991 where
9992 T: std::convert::Into<wkt::Timestamp>,
9993 {
9994 self.support_expiration_time = v.map(|x| x.into());
9995 self
9996 }
9997 }
9998
9999 impl wkt::message::Message for SkaffoldSupportedCondition {
10000 fn typename() -> &'static str {
10001 "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
10002 }
10003 }
10004
10005 /// ReleaseCondition contains all conditions relevant to a Release.
10006 #[derive(Clone, Default, PartialEq)]
10007 #[non_exhaustive]
10008 pub struct ReleaseCondition {
10009 /// Details around the Releases's overall status.
10010 pub release_ready_condition:
10011 std::option::Option<crate::model::release::ReleaseReadyCondition>,
10012
10013 /// Details around the support state of the release's Skaffold
10014 /// version.
10015 pub skaffold_supported_condition:
10016 std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
10017
10018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10019 }
10020
10021 impl ReleaseCondition {
10022 pub fn new() -> Self {
10023 std::default::Default::default()
10024 }
10025
10026 /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10027 ///
10028 /// # Example
10029 /// ```ignore,no_run
10030 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10031 /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10032 /// let x = ReleaseCondition::new().set_release_ready_condition(ReleaseReadyCondition::default()/* use setters */);
10033 /// ```
10034 pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
10035 where
10036 T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10037 {
10038 self.release_ready_condition = std::option::Option::Some(v.into());
10039 self
10040 }
10041
10042 /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10043 ///
10044 /// # Example
10045 /// ```ignore,no_run
10046 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10047 /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10048 /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(Some(ReleaseReadyCondition::default()/* use setters */));
10049 /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(None::<ReleaseReadyCondition>);
10050 /// ```
10051 pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
10052 where
10053 T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10054 {
10055 self.release_ready_condition = v.map(|x| x.into());
10056 self
10057 }
10058
10059 /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10060 ///
10061 /// # Example
10062 /// ```ignore,no_run
10063 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10064 /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10065 /// let x = ReleaseCondition::new().set_skaffold_supported_condition(SkaffoldSupportedCondition::default()/* use setters */);
10066 /// ```
10067 pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
10068 where
10069 T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10070 {
10071 self.skaffold_supported_condition = std::option::Option::Some(v.into());
10072 self
10073 }
10074
10075 /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10076 ///
10077 /// # Example
10078 /// ```ignore,no_run
10079 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10080 /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10081 /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(Some(SkaffoldSupportedCondition::default()/* use setters */));
10082 /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(None::<SkaffoldSupportedCondition>);
10083 /// ```
10084 pub fn set_or_clear_skaffold_supported_condition<T>(
10085 mut self,
10086 v: std::option::Option<T>,
10087 ) -> Self
10088 where
10089 T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10090 {
10091 self.skaffold_supported_condition = v.map(|x| x.into());
10092 self
10093 }
10094 }
10095
10096 impl wkt::message::Message for ReleaseCondition {
10097 fn typename() -> &'static str {
10098 "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
10099 }
10100 }
10101
10102 /// Valid states of the render operation.
10103 ///
10104 /// # Working with unknown values
10105 ///
10106 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10107 /// additional enum variants at any time. Adding new variants is not considered
10108 /// a breaking change. Applications should write their code in anticipation of:
10109 ///
10110 /// - New values appearing in future releases of the client library, **and**
10111 /// - New values received dynamically, without application changes.
10112 ///
10113 /// Please consult the [Working with enums] section in the user guide for some
10114 /// guidelines.
10115 ///
10116 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10117 #[derive(Clone, Debug, PartialEq)]
10118 #[non_exhaustive]
10119 pub enum RenderState {
10120 /// The render state is unspecified.
10121 Unspecified,
10122 /// All rendering operations have completed successfully.
10123 Succeeded,
10124 /// All rendering operations have completed, and one or more have failed.
10125 Failed,
10126 /// Rendering has started and is not complete.
10127 InProgress,
10128 /// If set, the enum was initialized with an unknown value.
10129 ///
10130 /// Applications can examine the value using [RenderState::value] or
10131 /// [RenderState::name].
10132 UnknownValue(render_state::UnknownValue),
10133 }
10134
10135 #[doc(hidden)]
10136 pub mod render_state {
10137 #[allow(unused_imports)]
10138 use super::*;
10139 #[derive(Clone, Debug, PartialEq)]
10140 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10141 }
10142
10143 impl RenderState {
10144 /// Gets the enum value.
10145 ///
10146 /// Returns `None` if the enum contains an unknown value deserialized from
10147 /// the string representation of enums.
10148 pub fn value(&self) -> std::option::Option<i32> {
10149 match self {
10150 Self::Unspecified => std::option::Option::Some(0),
10151 Self::Succeeded => std::option::Option::Some(1),
10152 Self::Failed => std::option::Option::Some(2),
10153 Self::InProgress => std::option::Option::Some(3),
10154 Self::UnknownValue(u) => u.0.value(),
10155 }
10156 }
10157
10158 /// Gets the enum value as a string.
10159 ///
10160 /// Returns `None` if the enum contains an unknown value deserialized from
10161 /// the integer representation of enums.
10162 pub fn name(&self) -> std::option::Option<&str> {
10163 match self {
10164 Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
10165 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10166 Self::Failed => std::option::Option::Some("FAILED"),
10167 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10168 Self::UnknownValue(u) => u.0.name(),
10169 }
10170 }
10171 }
10172
10173 impl std::default::Default for RenderState {
10174 fn default() -> Self {
10175 use std::convert::From;
10176 Self::from(0)
10177 }
10178 }
10179
10180 impl std::fmt::Display for RenderState {
10181 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10182 wkt::internal::display_enum(f, self.name(), self.value())
10183 }
10184 }
10185
10186 impl std::convert::From<i32> for RenderState {
10187 fn from(value: i32) -> Self {
10188 match value {
10189 0 => Self::Unspecified,
10190 1 => Self::Succeeded,
10191 2 => Self::Failed,
10192 3 => Self::InProgress,
10193 _ => Self::UnknownValue(render_state::UnknownValue(
10194 wkt::internal::UnknownEnumValue::Integer(value),
10195 )),
10196 }
10197 }
10198 }
10199
10200 impl std::convert::From<&str> for RenderState {
10201 fn from(value: &str) -> Self {
10202 use std::string::ToString;
10203 match value {
10204 "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
10205 "SUCCEEDED" => Self::Succeeded,
10206 "FAILED" => Self::Failed,
10207 "IN_PROGRESS" => Self::InProgress,
10208 _ => Self::UnknownValue(render_state::UnknownValue(
10209 wkt::internal::UnknownEnumValue::String(value.to_string()),
10210 )),
10211 }
10212 }
10213 }
10214
10215 impl serde::ser::Serialize for RenderState {
10216 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10217 where
10218 S: serde::Serializer,
10219 {
10220 match self {
10221 Self::Unspecified => serializer.serialize_i32(0),
10222 Self::Succeeded => serializer.serialize_i32(1),
10223 Self::Failed => serializer.serialize_i32(2),
10224 Self::InProgress => serializer.serialize_i32(3),
10225 Self::UnknownValue(u) => u.0.serialize(serializer),
10226 }
10227 }
10228 }
10229
10230 impl<'de> serde::de::Deserialize<'de> for RenderState {
10231 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10232 where
10233 D: serde::Deserializer<'de>,
10234 {
10235 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
10236 ".google.cloud.deploy.v1.Release.RenderState",
10237 ))
10238 }
10239 }
10240}
10241
10242/// The request object for `CreateDeployPolicy`.
10243#[derive(Clone, Default, PartialEq)]
10244#[non_exhaustive]
10245pub struct CreateDeployPolicyRequest {
10246 /// Required. The parent collection in which the `DeployPolicy` must be
10247 /// created. The format is `projects/{project_id}/locations/{location_name}`.
10248 pub parent: std::string::String,
10249
10250 /// Required. ID of the `DeployPolicy`.
10251 pub deploy_policy_id: std::string::String,
10252
10253 /// Required. The `DeployPolicy` to create.
10254 pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10255
10256 /// Optional. A request ID to identify requests. Specify a unique request ID
10257 /// so that if you must retry your request, the server knows to ignore the
10258 /// request if it has already been completed. The server guarantees that for
10259 /// at least 60 minutes after the first request.
10260 ///
10261 /// For example, consider a situation where you make an initial request and the
10262 /// request times out. If you make the request again with the same request ID,
10263 /// the server can check if original operation with the same request ID was
10264 /// received, and if so, will ignore the second request. This prevents clients
10265 /// from accidentally creating duplicate commitments.
10266 ///
10267 /// The request ID must be a valid UUID with the exception that zero UUID is
10268 /// not supported (00000000-0000-0000-0000-000000000000).
10269 pub request_id: std::string::String,
10270
10271 /// Optional. If set to true, the request is validated and the user is provided
10272 /// with an expected result, but no actual change is made.
10273 pub validate_only: bool,
10274
10275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10276}
10277
10278impl CreateDeployPolicyRequest {
10279 pub fn new() -> Self {
10280 std::default::Default::default()
10281 }
10282
10283 /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
10284 ///
10285 /// # Example
10286 /// ```ignore,no_run
10287 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10288 /// let x = CreateDeployPolicyRequest::new().set_parent("example");
10289 /// ```
10290 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10291 self.parent = v.into();
10292 self
10293 }
10294
10295 /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
10296 ///
10297 /// # Example
10298 /// ```ignore,no_run
10299 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10300 /// let x = CreateDeployPolicyRequest::new().set_deploy_policy_id("example");
10301 /// ```
10302 pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
10303 mut self,
10304 v: T,
10305 ) -> Self {
10306 self.deploy_policy_id = v.into();
10307 self
10308 }
10309
10310 /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10311 ///
10312 /// # Example
10313 /// ```ignore,no_run
10314 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10315 /// use google_cloud_deploy_v1::model::DeployPolicy;
10316 /// let x = CreateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10317 /// ```
10318 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10319 where
10320 T: std::convert::Into<crate::model::DeployPolicy>,
10321 {
10322 self.deploy_policy = std::option::Option::Some(v.into());
10323 self
10324 }
10325
10326 /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10327 ///
10328 /// # Example
10329 /// ```ignore,no_run
10330 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10331 /// use google_cloud_deploy_v1::model::DeployPolicy;
10332 /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10333 /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10334 /// ```
10335 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10336 where
10337 T: std::convert::Into<crate::model::DeployPolicy>,
10338 {
10339 self.deploy_policy = v.map(|x| x.into());
10340 self
10341 }
10342
10343 /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
10344 ///
10345 /// # Example
10346 /// ```ignore,no_run
10347 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10348 /// let x = CreateDeployPolicyRequest::new().set_request_id("example");
10349 /// ```
10350 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10351 self.request_id = v.into();
10352 self
10353 }
10354
10355 /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
10356 ///
10357 /// # Example
10358 /// ```ignore,no_run
10359 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10360 /// let x = CreateDeployPolicyRequest::new().set_validate_only(true);
10361 /// ```
10362 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10363 self.validate_only = v.into();
10364 self
10365 }
10366}
10367
10368impl wkt::message::Message for CreateDeployPolicyRequest {
10369 fn typename() -> &'static str {
10370 "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
10371 }
10372}
10373
10374/// The request object for `UpdateDeployPolicy`.
10375#[derive(Clone, Default, PartialEq)]
10376#[non_exhaustive]
10377pub struct UpdateDeployPolicyRequest {
10378 /// Required. Field mask is used to specify the fields to be overwritten by the
10379 /// update in the `DeployPolicy` resource. The fields specified in the
10380 /// update_mask are relative to the resource, not the full request. A field
10381 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
10382 /// then all fields are overwritten.
10383 pub update_mask: std::option::Option<wkt::FieldMask>,
10384
10385 /// Required. The `DeployPolicy` to update.
10386 pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10387
10388 /// Optional. A request ID to identify requests. Specify a unique request ID
10389 /// so that if you must retry your request, the server knows to ignore the
10390 /// request if it has already been completed. The server guarantees that for
10391 /// at least 60 minutes after the first request.
10392 ///
10393 /// For example, consider a situation where you make an initial request and the
10394 /// request times out. If you make the request again with the same request ID,
10395 /// the server can check if original operation with the same request ID was
10396 /// received, and if so, will ignore the second request. This prevents clients
10397 /// from accidentally creating duplicate commitments.
10398 ///
10399 /// The request ID must be a valid UUID with the exception that zero UUID is
10400 /// not supported (00000000-0000-0000-0000-000000000000).
10401 pub request_id: std::string::String,
10402
10403 /// Optional. If set to true, updating a `DeployPolicy` that does not exist
10404 /// will result in the creation of a new `DeployPolicy`.
10405 pub allow_missing: bool,
10406
10407 /// Optional. If set to true, the request is validated and the user is provided
10408 /// with an expected result, but no actual change is made.
10409 pub validate_only: bool,
10410
10411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10412}
10413
10414impl UpdateDeployPolicyRequest {
10415 pub fn new() -> Self {
10416 std::default::Default::default()
10417 }
10418
10419 /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10420 ///
10421 /// # Example
10422 /// ```ignore,no_run
10423 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10424 /// use wkt::FieldMask;
10425 /// let x = UpdateDeployPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10426 /// ```
10427 pub fn set_update_mask<T>(mut self, v: T) -> Self
10428 where
10429 T: std::convert::Into<wkt::FieldMask>,
10430 {
10431 self.update_mask = std::option::Option::Some(v.into());
10432 self
10433 }
10434
10435 /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10436 ///
10437 /// # Example
10438 /// ```ignore,no_run
10439 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10440 /// use wkt::FieldMask;
10441 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10442 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10443 /// ```
10444 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10445 where
10446 T: std::convert::Into<wkt::FieldMask>,
10447 {
10448 self.update_mask = v.map(|x| x.into());
10449 self
10450 }
10451
10452 /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10453 ///
10454 /// # Example
10455 /// ```ignore,no_run
10456 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10457 /// use google_cloud_deploy_v1::model::DeployPolicy;
10458 /// let x = UpdateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10459 /// ```
10460 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10461 where
10462 T: std::convert::Into<crate::model::DeployPolicy>,
10463 {
10464 self.deploy_policy = std::option::Option::Some(v.into());
10465 self
10466 }
10467
10468 /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10469 ///
10470 /// # Example
10471 /// ```ignore,no_run
10472 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10473 /// use google_cloud_deploy_v1::model::DeployPolicy;
10474 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10475 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10476 /// ```
10477 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10478 where
10479 T: std::convert::Into<crate::model::DeployPolicy>,
10480 {
10481 self.deploy_policy = v.map(|x| x.into());
10482 self
10483 }
10484
10485 /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
10486 ///
10487 /// # Example
10488 /// ```ignore,no_run
10489 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10490 /// let x = UpdateDeployPolicyRequest::new().set_request_id("example");
10491 /// ```
10492 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10493 self.request_id = v.into();
10494 self
10495 }
10496
10497 /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10502 /// let x = UpdateDeployPolicyRequest::new().set_allow_missing(true);
10503 /// ```
10504 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10505 self.allow_missing = v.into();
10506 self
10507 }
10508
10509 /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
10510 ///
10511 /// # Example
10512 /// ```ignore,no_run
10513 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10514 /// let x = UpdateDeployPolicyRequest::new().set_validate_only(true);
10515 /// ```
10516 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10517 self.validate_only = v.into();
10518 self
10519 }
10520}
10521
10522impl wkt::message::Message for UpdateDeployPolicyRequest {
10523 fn typename() -> &'static str {
10524 "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
10525 }
10526}
10527
10528/// The request object for `DeleteDeployPolicy`.
10529#[derive(Clone, Default, PartialEq)]
10530#[non_exhaustive]
10531pub struct DeleteDeployPolicyRequest {
10532 /// Required. The name of the `DeployPolicy` to delete. The format is
10533 /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10534 pub name: std::string::String,
10535
10536 /// Optional. A request ID to identify requests. Specify a unique request ID
10537 /// so that if you must retry your request, the server knows to ignore the
10538 /// request if it has already been completed. The server guarantees that for
10539 /// at least 60 minutes after the first request.
10540 ///
10541 /// For example, consider a situation where you make an initial request and the
10542 /// request times out. If you make the request again with the same request ID,
10543 /// the server can check if original operation with the same request ID was
10544 /// received, and if so, will ignore the second request. This prevents clients
10545 /// from accidentally creating duplicate commitments.
10546 ///
10547 /// The request ID must be a valid UUID with the exception that zero UUID is
10548 /// not supported (00000000-0000-0000-0000-000000000000).
10549 pub request_id: std::string::String,
10550
10551 /// Optional. If set to true, then deleting an already deleted or non-existing
10552 /// `DeployPolicy` will succeed.
10553 pub allow_missing: bool,
10554
10555 /// Optional. If set, validate the request and preview the review, but do not
10556 /// actually post it.
10557 pub validate_only: bool,
10558
10559 /// Optional. This checksum is computed by the server based on the value of
10560 /// other fields, and may be sent on update and delete requests to ensure the
10561 /// client has an up-to-date value before proceeding.
10562 pub etag: std::string::String,
10563
10564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10565}
10566
10567impl DeleteDeployPolicyRequest {
10568 pub fn new() -> Self {
10569 std::default::Default::default()
10570 }
10571
10572 /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
10573 ///
10574 /// # Example
10575 /// ```ignore,no_run
10576 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10577 /// let x = DeleteDeployPolicyRequest::new().set_name("example");
10578 /// ```
10579 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10580 self.name = v.into();
10581 self
10582 }
10583
10584 /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
10585 ///
10586 /// # Example
10587 /// ```ignore,no_run
10588 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10589 /// let x = DeleteDeployPolicyRequest::new().set_request_id("example");
10590 /// ```
10591 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10592 self.request_id = v.into();
10593 self
10594 }
10595
10596 /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
10597 ///
10598 /// # Example
10599 /// ```ignore,no_run
10600 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10601 /// let x = DeleteDeployPolicyRequest::new().set_allow_missing(true);
10602 /// ```
10603 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10604 self.allow_missing = v.into();
10605 self
10606 }
10607
10608 /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
10609 ///
10610 /// # Example
10611 /// ```ignore,no_run
10612 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10613 /// let x = DeleteDeployPolicyRequest::new().set_validate_only(true);
10614 /// ```
10615 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10616 self.validate_only = v.into();
10617 self
10618 }
10619
10620 /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
10621 ///
10622 /// # Example
10623 /// ```ignore,no_run
10624 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10625 /// let x = DeleteDeployPolicyRequest::new().set_etag("example");
10626 /// ```
10627 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10628 self.etag = v.into();
10629 self
10630 }
10631}
10632
10633impl wkt::message::Message for DeleteDeployPolicyRequest {
10634 fn typename() -> &'static str {
10635 "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
10636 }
10637}
10638
10639/// The request object for `ListDeployPolicies`.
10640#[derive(Clone, Default, PartialEq)]
10641#[non_exhaustive]
10642pub struct ListDeployPoliciesRequest {
10643 /// Required. The parent, which owns this collection of deploy policies. Format
10644 /// must be `projects/{project_id}/locations/{location_name}`.
10645 pub parent: std::string::String,
10646
10647 /// The maximum number of deploy policies to return. The service may return
10648 /// fewer than this value. If unspecified, at most 50 deploy policies will
10649 /// be returned. The maximum value is 1000; values above 1000 will be set
10650 /// to 1000.
10651 pub page_size: i32,
10652
10653 /// A page token, received from a previous `ListDeployPolicies` call.
10654 /// Provide this to retrieve the subsequent page.
10655 ///
10656 /// When paginating, all other provided parameters match
10657 /// the call that provided the page token.
10658 pub page_token: std::string::String,
10659
10660 /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
10661 /// more details. All fields can be used in the filter.
10662 pub filter: std::string::String,
10663
10664 /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
10665 pub order_by: std::string::String,
10666
10667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10668}
10669
10670impl ListDeployPoliciesRequest {
10671 pub fn new() -> Self {
10672 std::default::Default::default()
10673 }
10674
10675 /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
10676 ///
10677 /// # Example
10678 /// ```ignore,no_run
10679 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10680 /// let x = ListDeployPoliciesRequest::new().set_parent("example");
10681 /// ```
10682 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10683 self.parent = v.into();
10684 self
10685 }
10686
10687 /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
10688 ///
10689 /// # Example
10690 /// ```ignore,no_run
10691 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10692 /// let x = ListDeployPoliciesRequest::new().set_page_size(42);
10693 /// ```
10694 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10695 self.page_size = v.into();
10696 self
10697 }
10698
10699 /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
10700 ///
10701 /// # Example
10702 /// ```ignore,no_run
10703 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10704 /// let x = ListDeployPoliciesRequest::new().set_page_token("example");
10705 /// ```
10706 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10707 self.page_token = v.into();
10708 self
10709 }
10710
10711 /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
10712 ///
10713 /// # Example
10714 /// ```ignore,no_run
10715 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10716 /// let x = ListDeployPoliciesRequest::new().set_filter("example");
10717 /// ```
10718 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10719 self.filter = v.into();
10720 self
10721 }
10722
10723 /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
10724 ///
10725 /// # Example
10726 /// ```ignore,no_run
10727 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10728 /// let x = ListDeployPoliciesRequest::new().set_order_by("example");
10729 /// ```
10730 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10731 self.order_by = v.into();
10732 self
10733 }
10734}
10735
10736impl wkt::message::Message for ListDeployPoliciesRequest {
10737 fn typename() -> &'static str {
10738 "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
10739 }
10740}
10741
10742/// The response object from `ListDeployPolicies`.
10743#[derive(Clone, Default, PartialEq)]
10744#[non_exhaustive]
10745pub struct ListDeployPoliciesResponse {
10746 /// The `DeployPolicy` objects.
10747 pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
10748
10749 /// A token, which can be sent as `page_token` to retrieve the next page.
10750 /// If this field is omitted, there are no subsequent pages.
10751 pub next_page_token: std::string::String,
10752
10753 /// Locations that could not be reached.
10754 pub unreachable: std::vec::Vec<std::string::String>,
10755
10756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10757}
10758
10759impl ListDeployPoliciesResponse {
10760 pub fn new() -> Self {
10761 std::default::Default::default()
10762 }
10763
10764 /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
10765 ///
10766 /// # Example
10767 /// ```ignore,no_run
10768 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10769 /// use google_cloud_deploy_v1::model::DeployPolicy;
10770 /// let x = ListDeployPoliciesResponse::new()
10771 /// .set_deploy_policies([
10772 /// DeployPolicy::default()/* use setters */,
10773 /// DeployPolicy::default()/* use (different) setters */,
10774 /// ]);
10775 /// ```
10776 pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
10777 where
10778 T: std::iter::IntoIterator<Item = V>,
10779 V: std::convert::Into<crate::model::DeployPolicy>,
10780 {
10781 use std::iter::Iterator;
10782 self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
10783 self
10784 }
10785
10786 /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
10787 ///
10788 /// # Example
10789 /// ```ignore,no_run
10790 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10791 /// let x = ListDeployPoliciesResponse::new().set_next_page_token("example");
10792 /// ```
10793 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10794 self.next_page_token = v.into();
10795 self
10796 }
10797
10798 /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
10799 ///
10800 /// # Example
10801 /// ```ignore,no_run
10802 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10803 /// let x = ListDeployPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10804 /// ```
10805 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10806 where
10807 T: std::iter::IntoIterator<Item = V>,
10808 V: std::convert::Into<std::string::String>,
10809 {
10810 use std::iter::Iterator;
10811 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10812 self
10813 }
10814}
10815
10816impl wkt::message::Message for ListDeployPoliciesResponse {
10817 fn typename() -> &'static str {
10818 "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
10819 }
10820}
10821
10822#[doc(hidden)]
10823impl google_cloud_gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
10824 type PageItem = crate::model::DeployPolicy;
10825
10826 fn items(self) -> std::vec::Vec<Self::PageItem> {
10827 self.deploy_policies
10828 }
10829
10830 fn next_page_token(&self) -> std::string::String {
10831 use std::clone::Clone;
10832 self.next_page_token.clone()
10833 }
10834}
10835
10836/// The request object for `GetDeployPolicy`
10837#[derive(Clone, Default, PartialEq)]
10838#[non_exhaustive]
10839pub struct GetDeployPolicyRequest {
10840 /// Required. Name of the `DeployPolicy`. Format must be
10841 /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10842 pub name: std::string::String,
10843
10844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10845}
10846
10847impl GetDeployPolicyRequest {
10848 pub fn new() -> Self {
10849 std::default::Default::default()
10850 }
10851
10852 /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
10853 ///
10854 /// # Example
10855 /// ```ignore,no_run
10856 /// # use google_cloud_deploy_v1::model::GetDeployPolicyRequest;
10857 /// let x = GetDeployPolicyRequest::new().set_name("example");
10858 /// ```
10859 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10860 self.name = v.into();
10861 self
10862 }
10863}
10864
10865impl wkt::message::Message for GetDeployPolicyRequest {
10866 fn typename() -> &'static str {
10867 "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
10868 }
10869}
10870
10871/// Description of an a image to use during Skaffold rendering.
10872#[derive(Clone, Default, PartialEq)]
10873#[non_exhaustive]
10874pub struct BuildArtifact {
10875 /// Optional. Image name in Skaffold configuration.
10876 pub image: std::string::String,
10877
10878 /// Optional. Image tag to use. This will generally be the full path to an
10879 /// image, such as "gcr.io/my-project/busybox:1.2.3" or
10880 /// "gcr.io/my-project/busybox@sha256:abc123".
10881 pub tag: std::string::String,
10882
10883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10884}
10885
10886impl BuildArtifact {
10887 pub fn new() -> Self {
10888 std::default::Default::default()
10889 }
10890
10891 /// Sets the value of [image][crate::model::BuildArtifact::image].
10892 ///
10893 /// # Example
10894 /// ```ignore,no_run
10895 /// # use google_cloud_deploy_v1::model::BuildArtifact;
10896 /// let x = BuildArtifact::new().set_image("example");
10897 /// ```
10898 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10899 self.image = v.into();
10900 self
10901 }
10902
10903 /// Sets the value of [tag][crate::model::BuildArtifact::tag].
10904 ///
10905 /// # Example
10906 /// ```ignore,no_run
10907 /// # use google_cloud_deploy_v1::model::BuildArtifact;
10908 /// let x = BuildArtifact::new().set_tag("example");
10909 /// ```
10910 pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10911 self.tag = v.into();
10912 self
10913 }
10914}
10915
10916impl wkt::message::Message for BuildArtifact {
10917 fn typename() -> &'static str {
10918 "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
10919 }
10920}
10921
10922/// The artifacts produced by a target render operation.
10923#[derive(Clone, Default, PartialEq)]
10924#[non_exhaustive]
10925pub struct TargetArtifact {
10926 /// Output only. File path of the resolved Skaffold configuration for the
10927 /// stable phase, relative to the URI.
10928 pub skaffold_config_path: std::string::String,
10929
10930 /// Output only. File path of the rendered manifest relative to the URI for the
10931 /// stable phase.
10932 pub manifest_path: std::string::String,
10933
10934 /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
10935 pub phase_artifacts: std::collections::HashMap<
10936 std::string::String,
10937 crate::model::target_artifact::PhaseArtifact,
10938 >,
10939
10940 pub uri: std::option::Option<crate::model::target_artifact::Uri>,
10941
10942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10943}
10944
10945impl TargetArtifact {
10946 pub fn new() -> Self {
10947 std::default::Default::default()
10948 }
10949
10950 /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
10951 ///
10952 /// # Example
10953 /// ```ignore,no_run
10954 /// # use google_cloud_deploy_v1::model::TargetArtifact;
10955 /// let x = TargetArtifact::new().set_skaffold_config_path("example");
10956 /// ```
10957 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
10958 mut self,
10959 v: T,
10960 ) -> Self {
10961 self.skaffold_config_path = v.into();
10962 self
10963 }
10964
10965 /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
10966 ///
10967 /// # Example
10968 /// ```ignore,no_run
10969 /// # use google_cloud_deploy_v1::model::TargetArtifact;
10970 /// let x = TargetArtifact::new().set_manifest_path("example");
10971 /// ```
10972 pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10973 self.manifest_path = v.into();
10974 self
10975 }
10976
10977 /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
10978 ///
10979 /// # Example
10980 /// ```ignore,no_run
10981 /// # use google_cloud_deploy_v1::model::TargetArtifact;
10982 /// use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
10983 /// let x = TargetArtifact::new().set_phase_artifacts([
10984 /// ("key0", PhaseArtifact::default()/* use setters */),
10985 /// ("key1", PhaseArtifact::default()/* use (different) setters */),
10986 /// ]);
10987 /// ```
10988 pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
10989 where
10990 T: std::iter::IntoIterator<Item = (K, V)>,
10991 K: std::convert::Into<std::string::String>,
10992 V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
10993 {
10994 use std::iter::Iterator;
10995 self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10996 self
10997 }
10998
10999 /// Sets the value of [uri][crate::model::TargetArtifact::uri].
11000 ///
11001 /// Note that all the setters affecting `uri` are mutually
11002 /// exclusive.
11003 ///
11004 /// # Example
11005 /// ```ignore,no_run
11006 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11007 /// use google_cloud_deploy_v1::model::target_artifact::Uri;
11008 /// let x = TargetArtifact::new().set_uri(Some(Uri::ArtifactUri("example".to_string())));
11009 /// ```
11010 pub fn set_uri<
11011 T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
11012 >(
11013 mut self,
11014 v: T,
11015 ) -> Self {
11016 self.uri = v.into();
11017 self
11018 }
11019
11020 /// The value of [uri][crate::model::TargetArtifact::uri]
11021 /// if it holds a `ArtifactUri`, `None` if the field is not set or
11022 /// holds a different branch.
11023 pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
11024 #[allow(unreachable_patterns)]
11025 self.uri.as_ref().and_then(|v| match v {
11026 crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
11027 _ => std::option::Option::None,
11028 })
11029 }
11030
11031 /// Sets the value of [uri][crate::model::TargetArtifact::uri]
11032 /// to hold a `ArtifactUri`.
11033 ///
11034 /// Note that all the setters affecting `uri` are
11035 /// mutually exclusive.
11036 ///
11037 /// # Example
11038 /// ```ignore,no_run
11039 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11040 /// let x = TargetArtifact::new().set_artifact_uri("example");
11041 /// assert!(x.artifact_uri().is_some());
11042 /// ```
11043 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11044 self.uri =
11045 std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
11046 self
11047 }
11048}
11049
11050impl wkt::message::Message for TargetArtifact {
11051 fn typename() -> &'static str {
11052 "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
11053 }
11054}
11055
11056/// Defines additional types related to [TargetArtifact].
11057pub mod target_artifact {
11058 #[allow(unused_imports)]
11059 use super::*;
11060
11061 /// Contains the paths to the artifacts, relative to the URI, for a phase.
11062 #[derive(Clone, Default, PartialEq)]
11063 #[non_exhaustive]
11064 pub struct PhaseArtifact {
11065 /// Output only. File path of the resolved Skaffold configuration relative to
11066 /// the URI.
11067 pub skaffold_config_path: std::string::String,
11068
11069 /// Output only. File path of the rendered manifest relative to the URI.
11070 pub manifest_path: std::string::String,
11071
11072 /// Output only. File path of the directory of rendered job manifests
11073 /// relative to the URI. This is only set if it is applicable.
11074 pub job_manifests_path: std::string::String,
11075
11076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11077 }
11078
11079 impl PhaseArtifact {
11080 pub fn new() -> Self {
11081 std::default::Default::default()
11082 }
11083
11084 /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
11085 ///
11086 /// # Example
11087 /// ```ignore,no_run
11088 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11089 /// let x = PhaseArtifact::new().set_skaffold_config_path("example");
11090 /// ```
11091 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11092 mut self,
11093 v: T,
11094 ) -> Self {
11095 self.skaffold_config_path = v.into();
11096 self
11097 }
11098
11099 /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
11100 ///
11101 /// # Example
11102 /// ```ignore,no_run
11103 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11104 /// let x = PhaseArtifact::new().set_manifest_path("example");
11105 /// ```
11106 pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
11107 mut self,
11108 v: T,
11109 ) -> Self {
11110 self.manifest_path = v.into();
11111 self
11112 }
11113
11114 /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
11115 ///
11116 /// # Example
11117 /// ```ignore,no_run
11118 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11119 /// let x = PhaseArtifact::new().set_job_manifests_path("example");
11120 /// ```
11121 pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
11122 mut self,
11123 v: T,
11124 ) -> Self {
11125 self.job_manifests_path = v.into();
11126 self
11127 }
11128 }
11129
11130 impl wkt::message::Message for PhaseArtifact {
11131 fn typename() -> &'static str {
11132 "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
11133 }
11134 }
11135
11136 #[derive(Clone, Debug, PartialEq)]
11137 #[non_exhaustive]
11138 pub enum Uri {
11139 /// Output only. URI of a directory containing the artifacts. This contains
11140 /// deployment configuration used by Skaffold during a rollout, and all
11141 /// paths are relative to this location.
11142 ArtifactUri(std::string::String),
11143 }
11144}
11145
11146/// The artifacts produced by a deploy operation.
11147#[derive(Clone, Default, PartialEq)]
11148#[non_exhaustive]
11149pub struct DeployArtifact {
11150 /// Output only. URI of a directory containing the artifacts. All paths are
11151 /// relative to this location.
11152 pub artifact_uri: std::string::String,
11153
11154 /// Output only. File paths of the manifests applied during the deploy
11155 /// operation relative to the URI.
11156 pub manifest_paths: std::vec::Vec<std::string::String>,
11157
11158 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11159}
11160
11161impl DeployArtifact {
11162 pub fn new() -> Self {
11163 std::default::Default::default()
11164 }
11165
11166 /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
11167 ///
11168 /// # Example
11169 /// ```ignore,no_run
11170 /// # use google_cloud_deploy_v1::model::DeployArtifact;
11171 /// let x = DeployArtifact::new().set_artifact_uri("example");
11172 /// ```
11173 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11174 self.artifact_uri = v.into();
11175 self
11176 }
11177
11178 /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
11179 ///
11180 /// # Example
11181 /// ```ignore,no_run
11182 /// # use google_cloud_deploy_v1::model::DeployArtifact;
11183 /// let x = DeployArtifact::new().set_manifest_paths(["a", "b", "c"]);
11184 /// ```
11185 pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
11186 where
11187 T: std::iter::IntoIterator<Item = V>,
11188 V: std::convert::Into<std::string::String>,
11189 {
11190 use std::iter::Iterator;
11191 self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
11192 self
11193 }
11194}
11195
11196impl wkt::message::Message for DeployArtifact {
11197 fn typename() -> &'static str {
11198 "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
11199 }
11200}
11201
11202/// CloudRunRenderMetadata contains Cloud Run information associated with a
11203/// `Release` render.
11204#[derive(Clone, Default, PartialEq)]
11205#[non_exhaustive]
11206pub struct CloudRunRenderMetadata {
11207 /// Output only. The name of the Cloud Run Service in the rendered manifest.
11208 /// Format is `projects/{project}/locations/{location}/services/{service}`.
11209 pub service: std::string::String,
11210
11211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11212}
11213
11214impl CloudRunRenderMetadata {
11215 pub fn new() -> Self {
11216 std::default::Default::default()
11217 }
11218
11219 /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
11220 ///
11221 /// # Example
11222 /// ```ignore,no_run
11223 /// # use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11224 /// let x = CloudRunRenderMetadata::new().set_service("example");
11225 /// ```
11226 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11227 self.service = v.into();
11228 self
11229 }
11230}
11231
11232impl wkt::message::Message for CloudRunRenderMetadata {
11233 fn typename() -> &'static str {
11234 "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
11235 }
11236}
11237
11238/// RenderMetadata includes information associated with a `Release` render.
11239#[derive(Clone, Default, PartialEq)]
11240#[non_exhaustive]
11241pub struct RenderMetadata {
11242 /// Output only. Metadata associated with rendering for Cloud Run.
11243 pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
11244
11245 /// Output only. Custom metadata provided by user-defined render operation.
11246 pub custom: std::option::Option<crate::model::CustomMetadata>,
11247
11248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11249}
11250
11251impl RenderMetadata {
11252 pub fn new() -> Self {
11253 std::default::Default::default()
11254 }
11255
11256 /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11257 ///
11258 /// # Example
11259 /// ```ignore,no_run
11260 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11261 /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11262 /// let x = RenderMetadata::new().set_cloud_run(CloudRunRenderMetadata::default()/* use setters */);
11263 /// ```
11264 pub fn set_cloud_run<T>(mut self, v: T) -> Self
11265 where
11266 T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11267 {
11268 self.cloud_run = std::option::Option::Some(v.into());
11269 self
11270 }
11271
11272 /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11273 ///
11274 /// # Example
11275 /// ```ignore,no_run
11276 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11277 /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11278 /// let x = RenderMetadata::new().set_or_clear_cloud_run(Some(CloudRunRenderMetadata::default()/* use setters */));
11279 /// let x = RenderMetadata::new().set_or_clear_cloud_run(None::<CloudRunRenderMetadata>);
11280 /// ```
11281 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
11282 where
11283 T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11284 {
11285 self.cloud_run = v.map(|x| x.into());
11286 self
11287 }
11288
11289 /// Sets the value of [custom][crate::model::RenderMetadata::custom].
11290 ///
11291 /// # Example
11292 /// ```ignore,no_run
11293 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11294 /// use google_cloud_deploy_v1::model::CustomMetadata;
11295 /// let x = RenderMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
11296 /// ```
11297 pub fn set_custom<T>(mut self, v: T) -> Self
11298 where
11299 T: std::convert::Into<crate::model::CustomMetadata>,
11300 {
11301 self.custom = std::option::Option::Some(v.into());
11302 self
11303 }
11304
11305 /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
11306 ///
11307 /// # Example
11308 /// ```ignore,no_run
11309 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11310 /// use google_cloud_deploy_v1::model::CustomMetadata;
11311 /// let x = RenderMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
11312 /// let x = RenderMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
11313 /// ```
11314 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
11315 where
11316 T: std::convert::Into<crate::model::CustomMetadata>,
11317 {
11318 self.custom = v.map(|x| x.into());
11319 self
11320 }
11321}
11322
11323impl wkt::message::Message for RenderMetadata {
11324 fn typename() -> &'static str {
11325 "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
11326 }
11327}
11328
11329/// The request object for `ListReleases`.
11330#[derive(Clone, Default, PartialEq)]
11331#[non_exhaustive]
11332pub struct ListReleasesRequest {
11333 /// Required. The `DeliveryPipeline` which owns this collection of `Release`
11334 /// objects.
11335 pub parent: std::string::String,
11336
11337 /// Optional. The maximum number of `Release` objects to return. The service
11338 /// may return fewer than this value. If unspecified, at most 50 `Release`
11339 /// objects will be returned. The maximum value is 1000; values above 1000 will
11340 /// be set to 1000.
11341 pub page_size: i32,
11342
11343 /// Optional. A page token, received from a previous `ListReleases` call.
11344 /// Provide this to retrieve the subsequent page.
11345 ///
11346 /// When paginating, all other provided parameters match
11347 /// the call that provided the page token.
11348 pub page_token: std::string::String,
11349
11350 /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
11351 /// for more details.
11352 pub filter: std::string::String,
11353
11354 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
11355 /// more details.
11356 pub order_by: std::string::String,
11357
11358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11359}
11360
11361impl ListReleasesRequest {
11362 pub fn new() -> Self {
11363 std::default::Default::default()
11364 }
11365
11366 /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
11367 ///
11368 /// # Example
11369 /// ```ignore,no_run
11370 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11371 /// let x = ListReleasesRequest::new().set_parent("example");
11372 /// ```
11373 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11374 self.parent = v.into();
11375 self
11376 }
11377
11378 /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
11379 ///
11380 /// # Example
11381 /// ```ignore,no_run
11382 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11383 /// let x = ListReleasesRequest::new().set_page_size(42);
11384 /// ```
11385 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11386 self.page_size = v.into();
11387 self
11388 }
11389
11390 /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
11391 ///
11392 /// # Example
11393 /// ```ignore,no_run
11394 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11395 /// let x = ListReleasesRequest::new().set_page_token("example");
11396 /// ```
11397 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11398 self.page_token = v.into();
11399 self
11400 }
11401
11402 /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
11403 ///
11404 /// # Example
11405 /// ```ignore,no_run
11406 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11407 /// let x = ListReleasesRequest::new().set_filter("example");
11408 /// ```
11409 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11410 self.filter = v.into();
11411 self
11412 }
11413
11414 /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
11415 ///
11416 /// # Example
11417 /// ```ignore,no_run
11418 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11419 /// let x = ListReleasesRequest::new().set_order_by("example");
11420 /// ```
11421 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11422 self.order_by = v.into();
11423 self
11424 }
11425}
11426
11427impl wkt::message::Message for ListReleasesRequest {
11428 fn typename() -> &'static str {
11429 "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
11430 }
11431}
11432
11433/// The response object from `ListReleases`.
11434#[derive(Clone, Default, PartialEq)]
11435#[non_exhaustive]
11436pub struct ListReleasesResponse {
11437 /// The `Release` objects.
11438 pub releases: std::vec::Vec<crate::model::Release>,
11439
11440 /// A token, which can be sent as `page_token` to retrieve the next page.
11441 /// If this field is omitted, there are no subsequent pages.
11442 pub next_page_token: std::string::String,
11443
11444 /// Locations that could not be reached.
11445 pub unreachable: std::vec::Vec<std::string::String>,
11446
11447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11448}
11449
11450impl ListReleasesResponse {
11451 pub fn new() -> Self {
11452 std::default::Default::default()
11453 }
11454
11455 /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
11456 ///
11457 /// # Example
11458 /// ```ignore,no_run
11459 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11460 /// use google_cloud_deploy_v1::model::Release;
11461 /// let x = ListReleasesResponse::new()
11462 /// .set_releases([
11463 /// Release::default()/* use setters */,
11464 /// Release::default()/* use (different) setters */,
11465 /// ]);
11466 /// ```
11467 pub fn set_releases<T, V>(mut self, v: T) -> Self
11468 where
11469 T: std::iter::IntoIterator<Item = V>,
11470 V: std::convert::Into<crate::model::Release>,
11471 {
11472 use std::iter::Iterator;
11473 self.releases = v.into_iter().map(|i| i.into()).collect();
11474 self
11475 }
11476
11477 /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
11478 ///
11479 /// # Example
11480 /// ```ignore,no_run
11481 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11482 /// let x = ListReleasesResponse::new().set_next_page_token("example");
11483 /// ```
11484 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11485 self.next_page_token = v.into();
11486 self
11487 }
11488
11489 /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
11490 ///
11491 /// # Example
11492 /// ```ignore,no_run
11493 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11494 /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
11495 /// ```
11496 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11497 where
11498 T: std::iter::IntoIterator<Item = V>,
11499 V: std::convert::Into<std::string::String>,
11500 {
11501 use std::iter::Iterator;
11502 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11503 self
11504 }
11505}
11506
11507impl wkt::message::Message for ListReleasesResponse {
11508 fn typename() -> &'static str {
11509 "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
11510 }
11511}
11512
11513#[doc(hidden)]
11514impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
11515 type PageItem = crate::model::Release;
11516
11517 fn items(self) -> std::vec::Vec<Self::PageItem> {
11518 self.releases
11519 }
11520
11521 fn next_page_token(&self) -> std::string::String {
11522 use std::clone::Clone;
11523 self.next_page_token.clone()
11524 }
11525}
11526
11527/// The request object for `GetRelease`.
11528#[derive(Clone, Default, PartialEq)]
11529#[non_exhaustive]
11530pub struct GetReleaseRequest {
11531 /// Required. Name of the `Release`. Format must be
11532 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11533 pub name: std::string::String,
11534
11535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11536}
11537
11538impl GetReleaseRequest {
11539 pub fn new() -> Self {
11540 std::default::Default::default()
11541 }
11542
11543 /// Sets the value of [name][crate::model::GetReleaseRequest::name].
11544 ///
11545 /// # Example
11546 /// ```ignore,no_run
11547 /// # use google_cloud_deploy_v1::model::GetReleaseRequest;
11548 /// let x = GetReleaseRequest::new().set_name("example");
11549 /// ```
11550 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11551 self.name = v.into();
11552 self
11553 }
11554}
11555
11556impl wkt::message::Message for GetReleaseRequest {
11557 fn typename() -> &'static str {
11558 "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
11559 }
11560}
11561
11562/// The request object for `CreateRelease`,
11563#[derive(Clone, Default, PartialEq)]
11564#[non_exhaustive]
11565pub struct CreateReleaseRequest {
11566 /// Required. The parent collection in which the `Release` is created.
11567 /// The format is
11568 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
11569 pub parent: std::string::String,
11570
11571 /// Required. ID of the `Release`.
11572 pub release_id: std::string::String,
11573
11574 /// Required. The `Release` to create.
11575 pub release: std::option::Option<crate::model::Release>,
11576
11577 /// Optional. A request ID to identify requests. Specify a unique request ID
11578 /// so that if you must retry your request, the server knows to ignore the
11579 /// request if it has already been completed. The server guarantees that for
11580 /// at least 60 minutes after the first request.
11581 ///
11582 /// For example, consider a situation where you make an initial request and the
11583 /// request times out. If you make the request again with the same request ID,
11584 /// the server can check if original operation with the same request ID was
11585 /// received, and if so, will ignore the second request. This prevents clients
11586 /// from accidentally creating duplicate commitments.
11587 ///
11588 /// The request ID must be a valid UUID with the exception that zero UUID is
11589 /// not supported (00000000-0000-0000-0000-000000000000).
11590 pub request_id: std::string::String,
11591
11592 /// Optional. If set to true, the request is validated and the user is provided
11593 /// with an expected result, but no actual change is made.
11594 pub validate_only: bool,
11595
11596 /// Optional. Deploy policies to override. Format is
11597 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11598 pub override_deploy_policy: std::vec::Vec<std::string::String>,
11599
11600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11601}
11602
11603impl CreateReleaseRequest {
11604 pub fn new() -> Self {
11605 std::default::Default::default()
11606 }
11607
11608 /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
11609 ///
11610 /// # Example
11611 /// ```ignore,no_run
11612 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11613 /// let x = CreateReleaseRequest::new().set_parent("example");
11614 /// ```
11615 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11616 self.parent = v.into();
11617 self
11618 }
11619
11620 /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
11621 ///
11622 /// # Example
11623 /// ```ignore,no_run
11624 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11625 /// let x = CreateReleaseRequest::new().set_release_id("example");
11626 /// ```
11627 pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11628 self.release_id = v.into();
11629 self
11630 }
11631
11632 /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
11633 ///
11634 /// # Example
11635 /// ```ignore,no_run
11636 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11637 /// use google_cloud_deploy_v1::model::Release;
11638 /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
11639 /// ```
11640 pub fn set_release<T>(mut self, v: T) -> Self
11641 where
11642 T: std::convert::Into<crate::model::Release>,
11643 {
11644 self.release = std::option::Option::Some(v.into());
11645 self
11646 }
11647
11648 /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
11649 ///
11650 /// # Example
11651 /// ```ignore,no_run
11652 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11653 /// use google_cloud_deploy_v1::model::Release;
11654 /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
11655 /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
11656 /// ```
11657 pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
11658 where
11659 T: std::convert::Into<crate::model::Release>,
11660 {
11661 self.release = v.map(|x| x.into());
11662 self
11663 }
11664
11665 /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
11666 ///
11667 /// # Example
11668 /// ```ignore,no_run
11669 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11670 /// let x = CreateReleaseRequest::new().set_request_id("example");
11671 /// ```
11672 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11673 self.request_id = v.into();
11674 self
11675 }
11676
11677 /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
11678 ///
11679 /// # Example
11680 /// ```ignore,no_run
11681 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11682 /// let x = CreateReleaseRequest::new().set_validate_only(true);
11683 /// ```
11684 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11685 self.validate_only = v.into();
11686 self
11687 }
11688
11689 /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
11690 ///
11691 /// # Example
11692 /// ```ignore,no_run
11693 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11694 /// let x = CreateReleaseRequest::new().set_override_deploy_policy(["a", "b", "c"]);
11695 /// ```
11696 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11697 where
11698 T: std::iter::IntoIterator<Item = V>,
11699 V: std::convert::Into<std::string::String>,
11700 {
11701 use std::iter::Iterator;
11702 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11703 self
11704 }
11705}
11706
11707impl wkt::message::Message for CreateReleaseRequest {
11708 fn typename() -> &'static str {
11709 "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
11710 }
11711}
11712
11713/// A `Rollout` resource in the Cloud Deploy API.
11714///
11715/// A `Rollout` contains information around a specific deployment to a `Target`.
11716#[derive(Clone, Default, PartialEq)]
11717#[non_exhaustive]
11718pub struct Rollout {
11719 /// Identifier. Name of the `Rollout`. Format is
11720 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11721 /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
11722 pub name: std::string::String,
11723
11724 /// Output only. Unique identifier of the `Rollout`.
11725 pub uid: std::string::String,
11726
11727 /// Optional. Description of the `Rollout` for user purposes. Max length is 255
11728 /// characters.
11729 pub description: std::string::String,
11730
11731 /// Optional. User annotations. These attributes can only be set and used by
11732 /// the user, and not by Cloud Deploy. See
11733 /// <https://google.aip.dev/128#annotations> for more details such as format and
11734 /// size limitations.
11735 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11736
11737 /// Labels are attributes that can be set and used by both the
11738 /// user and by Cloud Deploy. Labels must meet the following constraints:
11739 ///
11740 /// * Keys and values can contain only lowercase letters, numeric characters,
11741 /// underscores, and dashes.
11742 /// * All characters must use UTF-8 encoding, and international characters are
11743 /// allowed.
11744 /// * Keys must start with a lowercase letter or international character.
11745 /// * Each resource is limited to a maximum of 64 labels.
11746 ///
11747 /// Both keys and values are additionally constrained to be <= 128 bytes.
11748 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11749
11750 /// Output only. Time at which the `Rollout` was created.
11751 pub create_time: std::option::Option<wkt::Timestamp>,
11752
11753 /// Output only. Time at which the `Rollout` was approved.
11754 pub approve_time: std::option::Option<wkt::Timestamp>,
11755
11756 /// Output only. Time at which the `Rollout` was enqueued.
11757 pub enqueue_time: std::option::Option<wkt::Timestamp>,
11758
11759 /// Output only. Time at which the `Rollout` started deploying.
11760 pub deploy_start_time: std::option::Option<wkt::Timestamp>,
11761
11762 /// Output only. Time at which the `Rollout` finished deploying.
11763 pub deploy_end_time: std::option::Option<wkt::Timestamp>,
11764
11765 /// Required. The ID of Target to which this `Rollout` is deploying.
11766 pub target_id: std::string::String,
11767
11768 /// Output only. Approval state of the `Rollout`.
11769 pub approval_state: crate::model::rollout::ApprovalState,
11770
11771 /// Output only. Current state of the `Rollout`.
11772 pub state: crate::model::rollout::State,
11773
11774 /// Output only. Additional information about the rollout failure, if
11775 /// available.
11776 pub failure_reason: std::string::String,
11777
11778 /// Output only. The resource name of the Cloud Build `Build` object that is
11779 /// used to deploy the Rollout. Format is
11780 /// `projects/{project}/locations/{location}/builds/{build}`.
11781 pub deploying_build: std::string::String,
11782
11783 /// This checksum is computed by the server based on the value of other
11784 /// fields, and may be sent on update and delete requests to ensure the
11785 /// client has an up-to-date value before proceeding.
11786 pub etag: std::string::String,
11787
11788 /// Output only. The reason this rollout failed. This will always be
11789 /// unspecified while the rollout is in progress.
11790 pub deploy_failure_cause: crate::model::rollout::FailureCause,
11791
11792 /// Output only. The phases that represent the workflows of this `Rollout`.
11793 pub phases: std::vec::Vec<crate::model::Phase>,
11794
11795 /// Output only. Metadata contains information about the rollout.
11796 pub metadata: std::option::Option<crate::model::Metadata>,
11797
11798 /// Output only. Name of the `ControllerRollout`. Format is
11799 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11800 pub controller_rollout: std::string::String,
11801
11802 /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
11803 /// Empty if this `Rollout` wasn't created as a rollback.
11804 pub rollback_of_rollout: std::string::String,
11805
11806 /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
11807 pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
11808
11809 /// Output only. The AutomationRun actively repairing the rollout.
11810 pub active_repair_automation_run: std::string::String,
11811
11812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11813}
11814
11815impl Rollout {
11816 pub fn new() -> Self {
11817 std::default::Default::default()
11818 }
11819
11820 /// Sets the value of [name][crate::model::Rollout::name].
11821 ///
11822 /// # Example
11823 /// ```ignore,no_run
11824 /// # use google_cloud_deploy_v1::model::Rollout;
11825 /// let x = Rollout::new().set_name("example");
11826 /// ```
11827 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11828 self.name = v.into();
11829 self
11830 }
11831
11832 /// Sets the value of [uid][crate::model::Rollout::uid].
11833 ///
11834 /// # Example
11835 /// ```ignore,no_run
11836 /// # use google_cloud_deploy_v1::model::Rollout;
11837 /// let x = Rollout::new().set_uid("example");
11838 /// ```
11839 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11840 self.uid = v.into();
11841 self
11842 }
11843
11844 /// Sets the value of [description][crate::model::Rollout::description].
11845 ///
11846 /// # Example
11847 /// ```ignore,no_run
11848 /// # use google_cloud_deploy_v1::model::Rollout;
11849 /// let x = Rollout::new().set_description("example");
11850 /// ```
11851 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11852 self.description = v.into();
11853 self
11854 }
11855
11856 /// Sets the value of [annotations][crate::model::Rollout::annotations].
11857 ///
11858 /// # Example
11859 /// ```ignore,no_run
11860 /// # use google_cloud_deploy_v1::model::Rollout;
11861 /// let x = Rollout::new().set_annotations([
11862 /// ("key0", "abc"),
11863 /// ("key1", "xyz"),
11864 /// ]);
11865 /// ```
11866 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11867 where
11868 T: std::iter::IntoIterator<Item = (K, V)>,
11869 K: std::convert::Into<std::string::String>,
11870 V: std::convert::Into<std::string::String>,
11871 {
11872 use std::iter::Iterator;
11873 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11874 self
11875 }
11876
11877 /// Sets the value of [labels][crate::model::Rollout::labels].
11878 ///
11879 /// # Example
11880 /// ```ignore,no_run
11881 /// # use google_cloud_deploy_v1::model::Rollout;
11882 /// let x = Rollout::new().set_labels([
11883 /// ("key0", "abc"),
11884 /// ("key1", "xyz"),
11885 /// ]);
11886 /// ```
11887 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11888 where
11889 T: std::iter::IntoIterator<Item = (K, V)>,
11890 K: std::convert::Into<std::string::String>,
11891 V: std::convert::Into<std::string::String>,
11892 {
11893 use std::iter::Iterator;
11894 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11895 self
11896 }
11897
11898 /// Sets the value of [create_time][crate::model::Rollout::create_time].
11899 ///
11900 /// # Example
11901 /// ```ignore,no_run
11902 /// # use google_cloud_deploy_v1::model::Rollout;
11903 /// use wkt::Timestamp;
11904 /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
11905 /// ```
11906 pub fn set_create_time<T>(mut self, v: T) -> Self
11907 where
11908 T: std::convert::Into<wkt::Timestamp>,
11909 {
11910 self.create_time = std::option::Option::Some(v.into());
11911 self
11912 }
11913
11914 /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
11915 ///
11916 /// # Example
11917 /// ```ignore,no_run
11918 /// # use google_cloud_deploy_v1::model::Rollout;
11919 /// use wkt::Timestamp;
11920 /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11921 /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
11922 /// ```
11923 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11924 where
11925 T: std::convert::Into<wkt::Timestamp>,
11926 {
11927 self.create_time = v.map(|x| x.into());
11928 self
11929 }
11930
11931 /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
11932 ///
11933 /// # Example
11934 /// ```ignore,no_run
11935 /// # use google_cloud_deploy_v1::model::Rollout;
11936 /// use wkt::Timestamp;
11937 /// let x = Rollout::new().set_approve_time(Timestamp::default()/* use setters */);
11938 /// ```
11939 pub fn set_approve_time<T>(mut self, v: T) -> Self
11940 where
11941 T: std::convert::Into<wkt::Timestamp>,
11942 {
11943 self.approve_time = std::option::Option::Some(v.into());
11944 self
11945 }
11946
11947 /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
11948 ///
11949 /// # Example
11950 /// ```ignore,no_run
11951 /// # use google_cloud_deploy_v1::model::Rollout;
11952 /// use wkt::Timestamp;
11953 /// let x = Rollout::new().set_or_clear_approve_time(Some(Timestamp::default()/* use setters */));
11954 /// let x = Rollout::new().set_or_clear_approve_time(None::<Timestamp>);
11955 /// ```
11956 pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
11957 where
11958 T: std::convert::Into<wkt::Timestamp>,
11959 {
11960 self.approve_time = v.map(|x| x.into());
11961 self
11962 }
11963
11964 /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
11965 ///
11966 /// # Example
11967 /// ```ignore,no_run
11968 /// # use google_cloud_deploy_v1::model::Rollout;
11969 /// use wkt::Timestamp;
11970 /// let x = Rollout::new().set_enqueue_time(Timestamp::default()/* use setters */);
11971 /// ```
11972 pub fn set_enqueue_time<T>(mut self, v: T) -> Self
11973 where
11974 T: std::convert::Into<wkt::Timestamp>,
11975 {
11976 self.enqueue_time = std::option::Option::Some(v.into());
11977 self
11978 }
11979
11980 /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
11981 ///
11982 /// # Example
11983 /// ```ignore,no_run
11984 /// # use google_cloud_deploy_v1::model::Rollout;
11985 /// use wkt::Timestamp;
11986 /// let x = Rollout::new().set_or_clear_enqueue_time(Some(Timestamp::default()/* use setters */));
11987 /// let x = Rollout::new().set_or_clear_enqueue_time(None::<Timestamp>);
11988 /// ```
11989 pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
11990 where
11991 T: std::convert::Into<wkt::Timestamp>,
11992 {
11993 self.enqueue_time = v.map(|x| x.into());
11994 self
11995 }
11996
11997 /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
11998 ///
11999 /// # Example
12000 /// ```ignore,no_run
12001 /// # use google_cloud_deploy_v1::model::Rollout;
12002 /// use wkt::Timestamp;
12003 /// let x = Rollout::new().set_deploy_start_time(Timestamp::default()/* use setters */);
12004 /// ```
12005 pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
12006 where
12007 T: std::convert::Into<wkt::Timestamp>,
12008 {
12009 self.deploy_start_time = std::option::Option::Some(v.into());
12010 self
12011 }
12012
12013 /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12014 ///
12015 /// # Example
12016 /// ```ignore,no_run
12017 /// # use google_cloud_deploy_v1::model::Rollout;
12018 /// use wkt::Timestamp;
12019 /// let x = Rollout::new().set_or_clear_deploy_start_time(Some(Timestamp::default()/* use setters */));
12020 /// let x = Rollout::new().set_or_clear_deploy_start_time(None::<Timestamp>);
12021 /// ```
12022 pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12023 where
12024 T: std::convert::Into<wkt::Timestamp>,
12025 {
12026 self.deploy_start_time = v.map(|x| x.into());
12027 self
12028 }
12029
12030 /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12031 ///
12032 /// # Example
12033 /// ```ignore,no_run
12034 /// # use google_cloud_deploy_v1::model::Rollout;
12035 /// use wkt::Timestamp;
12036 /// let x = Rollout::new().set_deploy_end_time(Timestamp::default()/* use setters */);
12037 /// ```
12038 pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
12039 where
12040 T: std::convert::Into<wkt::Timestamp>,
12041 {
12042 self.deploy_end_time = std::option::Option::Some(v.into());
12043 self
12044 }
12045
12046 /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12047 ///
12048 /// # Example
12049 /// ```ignore,no_run
12050 /// # use google_cloud_deploy_v1::model::Rollout;
12051 /// use wkt::Timestamp;
12052 /// let x = Rollout::new().set_or_clear_deploy_end_time(Some(Timestamp::default()/* use setters */));
12053 /// let x = Rollout::new().set_or_clear_deploy_end_time(None::<Timestamp>);
12054 /// ```
12055 pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12056 where
12057 T: std::convert::Into<wkt::Timestamp>,
12058 {
12059 self.deploy_end_time = v.map(|x| x.into());
12060 self
12061 }
12062
12063 /// Sets the value of [target_id][crate::model::Rollout::target_id].
12064 ///
12065 /// # Example
12066 /// ```ignore,no_run
12067 /// # use google_cloud_deploy_v1::model::Rollout;
12068 /// let x = Rollout::new().set_target_id("example");
12069 /// ```
12070 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12071 self.target_id = v.into();
12072 self
12073 }
12074
12075 /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
12076 ///
12077 /// # Example
12078 /// ```ignore,no_run
12079 /// # use google_cloud_deploy_v1::model::Rollout;
12080 /// use google_cloud_deploy_v1::model::rollout::ApprovalState;
12081 /// let x0 = Rollout::new().set_approval_state(ApprovalState::NeedsApproval);
12082 /// let x1 = Rollout::new().set_approval_state(ApprovalState::DoesNotNeedApproval);
12083 /// let x2 = Rollout::new().set_approval_state(ApprovalState::Approved);
12084 /// ```
12085 pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
12086 mut self,
12087 v: T,
12088 ) -> Self {
12089 self.approval_state = v.into();
12090 self
12091 }
12092
12093 /// Sets the value of [state][crate::model::Rollout::state].
12094 ///
12095 /// # Example
12096 /// ```ignore,no_run
12097 /// # use google_cloud_deploy_v1::model::Rollout;
12098 /// use google_cloud_deploy_v1::model::rollout::State;
12099 /// let x0 = Rollout::new().set_state(State::Succeeded);
12100 /// let x1 = Rollout::new().set_state(State::Failed);
12101 /// let x2 = Rollout::new().set_state(State::InProgress);
12102 /// ```
12103 pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
12104 self.state = v.into();
12105 self
12106 }
12107
12108 /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
12109 ///
12110 /// # Example
12111 /// ```ignore,no_run
12112 /// # use google_cloud_deploy_v1::model::Rollout;
12113 /// let x = Rollout::new().set_failure_reason("example");
12114 /// ```
12115 pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12116 self.failure_reason = v.into();
12117 self
12118 }
12119
12120 /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
12121 ///
12122 /// # Example
12123 /// ```ignore,no_run
12124 /// # use google_cloud_deploy_v1::model::Rollout;
12125 /// let x = Rollout::new().set_deploying_build("example");
12126 /// ```
12127 pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12128 self.deploying_build = v.into();
12129 self
12130 }
12131
12132 /// Sets the value of [etag][crate::model::Rollout::etag].
12133 ///
12134 /// # Example
12135 /// ```ignore,no_run
12136 /// # use google_cloud_deploy_v1::model::Rollout;
12137 /// let x = Rollout::new().set_etag("example");
12138 /// ```
12139 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12140 self.etag = v.into();
12141 self
12142 }
12143
12144 /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
12145 ///
12146 /// # Example
12147 /// ```ignore,no_run
12148 /// # use google_cloud_deploy_v1::model::Rollout;
12149 /// use google_cloud_deploy_v1::model::rollout::FailureCause;
12150 /// let x0 = Rollout::new().set_deploy_failure_cause(FailureCause::CloudBuildUnavailable);
12151 /// let x1 = Rollout::new().set_deploy_failure_cause(FailureCause::ExecutionFailed);
12152 /// let x2 = Rollout::new().set_deploy_failure_cause(FailureCause::DeadlineExceeded);
12153 /// ```
12154 pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
12155 mut self,
12156 v: T,
12157 ) -> Self {
12158 self.deploy_failure_cause = v.into();
12159 self
12160 }
12161
12162 /// Sets the value of [phases][crate::model::Rollout::phases].
12163 ///
12164 /// # Example
12165 /// ```ignore,no_run
12166 /// # use google_cloud_deploy_v1::model::Rollout;
12167 /// use google_cloud_deploy_v1::model::Phase;
12168 /// let x = Rollout::new()
12169 /// .set_phases([
12170 /// Phase::default()/* use setters */,
12171 /// Phase::default()/* use (different) setters */,
12172 /// ]);
12173 /// ```
12174 pub fn set_phases<T, V>(mut self, v: T) -> Self
12175 where
12176 T: std::iter::IntoIterator<Item = V>,
12177 V: std::convert::Into<crate::model::Phase>,
12178 {
12179 use std::iter::Iterator;
12180 self.phases = v.into_iter().map(|i| i.into()).collect();
12181 self
12182 }
12183
12184 /// Sets the value of [metadata][crate::model::Rollout::metadata].
12185 ///
12186 /// # Example
12187 /// ```ignore,no_run
12188 /// # use google_cloud_deploy_v1::model::Rollout;
12189 /// use google_cloud_deploy_v1::model::Metadata;
12190 /// let x = Rollout::new().set_metadata(Metadata::default()/* use setters */);
12191 /// ```
12192 pub fn set_metadata<T>(mut self, v: T) -> Self
12193 where
12194 T: std::convert::Into<crate::model::Metadata>,
12195 {
12196 self.metadata = std::option::Option::Some(v.into());
12197 self
12198 }
12199
12200 /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
12201 ///
12202 /// # Example
12203 /// ```ignore,no_run
12204 /// # use google_cloud_deploy_v1::model::Rollout;
12205 /// use google_cloud_deploy_v1::model::Metadata;
12206 /// let x = Rollout::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
12207 /// let x = Rollout::new().set_or_clear_metadata(None::<Metadata>);
12208 /// ```
12209 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12210 where
12211 T: std::convert::Into<crate::model::Metadata>,
12212 {
12213 self.metadata = v.map(|x| x.into());
12214 self
12215 }
12216
12217 /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
12218 ///
12219 /// # Example
12220 /// ```ignore,no_run
12221 /// # use google_cloud_deploy_v1::model::Rollout;
12222 /// let x = Rollout::new().set_controller_rollout("example");
12223 /// ```
12224 pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
12225 mut self,
12226 v: T,
12227 ) -> Self {
12228 self.controller_rollout = v.into();
12229 self
12230 }
12231
12232 /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
12233 ///
12234 /// # Example
12235 /// ```ignore,no_run
12236 /// # use google_cloud_deploy_v1::model::Rollout;
12237 /// let x = Rollout::new().set_rollback_of_rollout("example");
12238 /// ```
12239 pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
12240 mut self,
12241 v: T,
12242 ) -> Self {
12243 self.rollback_of_rollout = v.into();
12244 self
12245 }
12246
12247 /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
12248 ///
12249 /// # Example
12250 /// ```ignore,no_run
12251 /// # use google_cloud_deploy_v1::model::Rollout;
12252 /// let x = Rollout::new().set_rolled_back_by_rollouts(["a", "b", "c"]);
12253 /// ```
12254 pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
12255 where
12256 T: std::iter::IntoIterator<Item = V>,
12257 V: std::convert::Into<std::string::String>,
12258 {
12259 use std::iter::Iterator;
12260 self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
12261 self
12262 }
12263
12264 /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
12265 ///
12266 /// # Example
12267 /// ```ignore,no_run
12268 /// # use google_cloud_deploy_v1::model::Rollout;
12269 /// let x = Rollout::new().set_active_repair_automation_run("example");
12270 /// ```
12271 pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
12272 mut self,
12273 v: T,
12274 ) -> Self {
12275 self.active_repair_automation_run = v.into();
12276 self
12277 }
12278}
12279
12280impl wkt::message::Message for Rollout {
12281 fn typename() -> &'static str {
12282 "type.googleapis.com/google.cloud.deploy.v1.Rollout"
12283 }
12284}
12285
12286/// Defines additional types related to [Rollout].
12287pub mod rollout {
12288 #[allow(unused_imports)]
12289 use super::*;
12290
12291 /// Valid approval states of a `Rollout`.
12292 ///
12293 /// # Working with unknown values
12294 ///
12295 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12296 /// additional enum variants at any time. Adding new variants is not considered
12297 /// a breaking change. Applications should write their code in anticipation of:
12298 ///
12299 /// - New values appearing in future releases of the client library, **and**
12300 /// - New values received dynamically, without application changes.
12301 ///
12302 /// Please consult the [Working with enums] section in the user guide for some
12303 /// guidelines.
12304 ///
12305 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12306 #[derive(Clone, Debug, PartialEq)]
12307 #[non_exhaustive]
12308 pub enum ApprovalState {
12309 /// The `Rollout` has an unspecified approval state.
12310 Unspecified,
12311 /// The `Rollout` requires approval.
12312 NeedsApproval,
12313 /// The `Rollout` does not require approval.
12314 DoesNotNeedApproval,
12315 /// The `Rollout` has been approved.
12316 Approved,
12317 /// The `Rollout` has been rejected.
12318 Rejected,
12319 /// If set, the enum was initialized with an unknown value.
12320 ///
12321 /// Applications can examine the value using [ApprovalState::value] or
12322 /// [ApprovalState::name].
12323 UnknownValue(approval_state::UnknownValue),
12324 }
12325
12326 #[doc(hidden)]
12327 pub mod approval_state {
12328 #[allow(unused_imports)]
12329 use super::*;
12330 #[derive(Clone, Debug, PartialEq)]
12331 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12332 }
12333
12334 impl ApprovalState {
12335 /// Gets the enum value.
12336 ///
12337 /// Returns `None` if the enum contains an unknown value deserialized from
12338 /// the string representation of enums.
12339 pub fn value(&self) -> std::option::Option<i32> {
12340 match self {
12341 Self::Unspecified => std::option::Option::Some(0),
12342 Self::NeedsApproval => std::option::Option::Some(1),
12343 Self::DoesNotNeedApproval => std::option::Option::Some(2),
12344 Self::Approved => std::option::Option::Some(3),
12345 Self::Rejected => std::option::Option::Some(4),
12346 Self::UnknownValue(u) => u.0.value(),
12347 }
12348 }
12349
12350 /// Gets the enum value as a string.
12351 ///
12352 /// Returns `None` if the enum contains an unknown value deserialized from
12353 /// the integer representation of enums.
12354 pub fn name(&self) -> std::option::Option<&str> {
12355 match self {
12356 Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
12357 Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
12358 Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
12359 Self::Approved => std::option::Option::Some("APPROVED"),
12360 Self::Rejected => std::option::Option::Some("REJECTED"),
12361 Self::UnknownValue(u) => u.0.name(),
12362 }
12363 }
12364 }
12365
12366 impl std::default::Default for ApprovalState {
12367 fn default() -> Self {
12368 use std::convert::From;
12369 Self::from(0)
12370 }
12371 }
12372
12373 impl std::fmt::Display for ApprovalState {
12374 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12375 wkt::internal::display_enum(f, self.name(), self.value())
12376 }
12377 }
12378
12379 impl std::convert::From<i32> for ApprovalState {
12380 fn from(value: i32) -> Self {
12381 match value {
12382 0 => Self::Unspecified,
12383 1 => Self::NeedsApproval,
12384 2 => Self::DoesNotNeedApproval,
12385 3 => Self::Approved,
12386 4 => Self::Rejected,
12387 _ => Self::UnknownValue(approval_state::UnknownValue(
12388 wkt::internal::UnknownEnumValue::Integer(value),
12389 )),
12390 }
12391 }
12392 }
12393
12394 impl std::convert::From<&str> for ApprovalState {
12395 fn from(value: &str) -> Self {
12396 use std::string::ToString;
12397 match value {
12398 "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
12399 "NEEDS_APPROVAL" => Self::NeedsApproval,
12400 "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
12401 "APPROVED" => Self::Approved,
12402 "REJECTED" => Self::Rejected,
12403 _ => Self::UnknownValue(approval_state::UnknownValue(
12404 wkt::internal::UnknownEnumValue::String(value.to_string()),
12405 )),
12406 }
12407 }
12408 }
12409
12410 impl serde::ser::Serialize for ApprovalState {
12411 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12412 where
12413 S: serde::Serializer,
12414 {
12415 match self {
12416 Self::Unspecified => serializer.serialize_i32(0),
12417 Self::NeedsApproval => serializer.serialize_i32(1),
12418 Self::DoesNotNeedApproval => serializer.serialize_i32(2),
12419 Self::Approved => serializer.serialize_i32(3),
12420 Self::Rejected => serializer.serialize_i32(4),
12421 Self::UnknownValue(u) => u.0.serialize(serializer),
12422 }
12423 }
12424 }
12425
12426 impl<'de> serde::de::Deserialize<'de> for ApprovalState {
12427 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12428 where
12429 D: serde::Deserializer<'de>,
12430 {
12431 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
12432 ".google.cloud.deploy.v1.Rollout.ApprovalState",
12433 ))
12434 }
12435 }
12436
12437 /// Valid states of a `Rollout`.
12438 ///
12439 /// # Working with unknown values
12440 ///
12441 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12442 /// additional enum variants at any time. Adding new variants is not considered
12443 /// a breaking change. Applications should write their code in anticipation of:
12444 ///
12445 /// - New values appearing in future releases of the client library, **and**
12446 /// - New values received dynamically, without application changes.
12447 ///
12448 /// Please consult the [Working with enums] section in the user guide for some
12449 /// guidelines.
12450 ///
12451 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12452 #[derive(Clone, Debug, PartialEq)]
12453 #[non_exhaustive]
12454 pub enum State {
12455 /// The `Rollout` has an unspecified state.
12456 Unspecified,
12457 /// The `Rollout` has completed successfully.
12458 Succeeded,
12459 /// The `Rollout` has failed.
12460 Failed,
12461 /// The `Rollout` is being deployed.
12462 InProgress,
12463 /// The `Rollout` needs approval.
12464 PendingApproval,
12465 /// An approver rejected the `Rollout`.
12466 ApprovalRejected,
12467 /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
12468 /// `Target`.
12469 Pending,
12470 /// The `Rollout` is waiting for the `Release` to be fully rendered.
12471 PendingRelease,
12472 /// The `Rollout` is in the process of being cancelled.
12473 Cancelling,
12474 /// The `Rollout` has been cancelled.
12475 Cancelled,
12476 /// The `Rollout` is halted.
12477 Halted,
12478 /// If set, the enum was initialized with an unknown value.
12479 ///
12480 /// Applications can examine the value using [State::value] or
12481 /// [State::name].
12482 UnknownValue(state::UnknownValue),
12483 }
12484
12485 #[doc(hidden)]
12486 pub mod state {
12487 #[allow(unused_imports)]
12488 use super::*;
12489 #[derive(Clone, Debug, PartialEq)]
12490 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12491 }
12492
12493 impl State {
12494 /// Gets the enum value.
12495 ///
12496 /// Returns `None` if the enum contains an unknown value deserialized from
12497 /// the string representation of enums.
12498 pub fn value(&self) -> std::option::Option<i32> {
12499 match self {
12500 Self::Unspecified => std::option::Option::Some(0),
12501 Self::Succeeded => std::option::Option::Some(1),
12502 Self::Failed => std::option::Option::Some(2),
12503 Self::InProgress => std::option::Option::Some(3),
12504 Self::PendingApproval => std::option::Option::Some(4),
12505 Self::ApprovalRejected => std::option::Option::Some(5),
12506 Self::Pending => std::option::Option::Some(6),
12507 Self::PendingRelease => std::option::Option::Some(7),
12508 Self::Cancelling => std::option::Option::Some(8),
12509 Self::Cancelled => std::option::Option::Some(9),
12510 Self::Halted => std::option::Option::Some(10),
12511 Self::UnknownValue(u) => u.0.value(),
12512 }
12513 }
12514
12515 /// Gets the enum value as a string.
12516 ///
12517 /// Returns `None` if the enum contains an unknown value deserialized from
12518 /// the integer representation of enums.
12519 pub fn name(&self) -> std::option::Option<&str> {
12520 match self {
12521 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12522 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12523 Self::Failed => std::option::Option::Some("FAILED"),
12524 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12525 Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
12526 Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
12527 Self::Pending => std::option::Option::Some("PENDING"),
12528 Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
12529 Self::Cancelling => std::option::Option::Some("CANCELLING"),
12530 Self::Cancelled => std::option::Option::Some("CANCELLED"),
12531 Self::Halted => std::option::Option::Some("HALTED"),
12532 Self::UnknownValue(u) => u.0.name(),
12533 }
12534 }
12535 }
12536
12537 impl std::default::Default for State {
12538 fn default() -> Self {
12539 use std::convert::From;
12540 Self::from(0)
12541 }
12542 }
12543
12544 impl std::fmt::Display for State {
12545 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12546 wkt::internal::display_enum(f, self.name(), self.value())
12547 }
12548 }
12549
12550 impl std::convert::From<i32> for State {
12551 fn from(value: i32) -> Self {
12552 match value {
12553 0 => Self::Unspecified,
12554 1 => Self::Succeeded,
12555 2 => Self::Failed,
12556 3 => Self::InProgress,
12557 4 => Self::PendingApproval,
12558 5 => Self::ApprovalRejected,
12559 6 => Self::Pending,
12560 7 => Self::PendingRelease,
12561 8 => Self::Cancelling,
12562 9 => Self::Cancelled,
12563 10 => Self::Halted,
12564 _ => Self::UnknownValue(state::UnknownValue(
12565 wkt::internal::UnknownEnumValue::Integer(value),
12566 )),
12567 }
12568 }
12569 }
12570
12571 impl std::convert::From<&str> for State {
12572 fn from(value: &str) -> Self {
12573 use std::string::ToString;
12574 match value {
12575 "STATE_UNSPECIFIED" => Self::Unspecified,
12576 "SUCCEEDED" => Self::Succeeded,
12577 "FAILED" => Self::Failed,
12578 "IN_PROGRESS" => Self::InProgress,
12579 "PENDING_APPROVAL" => Self::PendingApproval,
12580 "APPROVAL_REJECTED" => Self::ApprovalRejected,
12581 "PENDING" => Self::Pending,
12582 "PENDING_RELEASE" => Self::PendingRelease,
12583 "CANCELLING" => Self::Cancelling,
12584 "CANCELLED" => Self::Cancelled,
12585 "HALTED" => Self::Halted,
12586 _ => Self::UnknownValue(state::UnknownValue(
12587 wkt::internal::UnknownEnumValue::String(value.to_string()),
12588 )),
12589 }
12590 }
12591 }
12592
12593 impl serde::ser::Serialize for State {
12594 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12595 where
12596 S: serde::Serializer,
12597 {
12598 match self {
12599 Self::Unspecified => serializer.serialize_i32(0),
12600 Self::Succeeded => serializer.serialize_i32(1),
12601 Self::Failed => serializer.serialize_i32(2),
12602 Self::InProgress => serializer.serialize_i32(3),
12603 Self::PendingApproval => serializer.serialize_i32(4),
12604 Self::ApprovalRejected => serializer.serialize_i32(5),
12605 Self::Pending => serializer.serialize_i32(6),
12606 Self::PendingRelease => serializer.serialize_i32(7),
12607 Self::Cancelling => serializer.serialize_i32(8),
12608 Self::Cancelled => serializer.serialize_i32(9),
12609 Self::Halted => serializer.serialize_i32(10),
12610 Self::UnknownValue(u) => u.0.serialize(serializer),
12611 }
12612 }
12613 }
12614
12615 impl<'de> serde::de::Deserialize<'de> for State {
12616 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12617 where
12618 D: serde::Deserializer<'de>,
12619 {
12620 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12621 ".google.cloud.deploy.v1.Rollout.State",
12622 ))
12623 }
12624 }
12625
12626 /// Well-known rollout failures.
12627 ///
12628 /// # Working with unknown values
12629 ///
12630 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12631 /// additional enum variants at any time. Adding new variants is not considered
12632 /// a breaking change. Applications should write their code in anticipation of:
12633 ///
12634 /// - New values appearing in future releases of the client library, **and**
12635 /// - New values received dynamically, without application changes.
12636 ///
12637 /// Please consult the [Working with enums] section in the user guide for some
12638 /// guidelines.
12639 ///
12640 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12641 #[derive(Clone, Debug, PartialEq)]
12642 #[non_exhaustive]
12643 pub enum FailureCause {
12644 /// No reason for failure is specified.
12645 Unspecified,
12646 /// Cloud Build is not available, either because it is not enabled or because
12647 /// Cloud Deploy has insufficient permissions. See [required
12648 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12649 CloudBuildUnavailable,
12650 /// The deploy operation did not complete successfully; check Cloud Build
12651 /// logs.
12652 ExecutionFailed,
12653 /// Deployment did not complete within the allotted time.
12654 DeadlineExceeded,
12655 /// Release is in a failed state.
12656 ReleaseFailed,
12657 /// Release is abandoned.
12658 ReleaseAbandoned,
12659 /// No Skaffold verify configuration was found.
12660 VerificationConfigNotFound,
12661 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12662 /// for additional details.
12663 CloudBuildRequestFailed,
12664 /// A Rollout operation had a feature configured that is not supported.
12665 OperationFeatureNotSupported,
12666 /// If set, the enum was initialized with an unknown value.
12667 ///
12668 /// Applications can examine the value using [FailureCause::value] or
12669 /// [FailureCause::name].
12670 UnknownValue(failure_cause::UnknownValue),
12671 }
12672
12673 #[doc(hidden)]
12674 pub mod failure_cause {
12675 #[allow(unused_imports)]
12676 use super::*;
12677 #[derive(Clone, Debug, PartialEq)]
12678 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12679 }
12680
12681 impl FailureCause {
12682 /// Gets the enum value.
12683 ///
12684 /// Returns `None` if the enum contains an unknown value deserialized from
12685 /// the string representation of enums.
12686 pub fn value(&self) -> std::option::Option<i32> {
12687 match self {
12688 Self::Unspecified => std::option::Option::Some(0),
12689 Self::CloudBuildUnavailable => std::option::Option::Some(1),
12690 Self::ExecutionFailed => std::option::Option::Some(2),
12691 Self::DeadlineExceeded => std::option::Option::Some(3),
12692 Self::ReleaseFailed => std::option::Option::Some(4),
12693 Self::ReleaseAbandoned => std::option::Option::Some(5),
12694 Self::VerificationConfigNotFound => std::option::Option::Some(6),
12695 Self::CloudBuildRequestFailed => std::option::Option::Some(7),
12696 Self::OperationFeatureNotSupported => std::option::Option::Some(8),
12697 Self::UnknownValue(u) => u.0.value(),
12698 }
12699 }
12700
12701 /// Gets the enum value as a string.
12702 ///
12703 /// Returns `None` if the enum contains an unknown value deserialized from
12704 /// the integer representation of enums.
12705 pub fn name(&self) -> std::option::Option<&str> {
12706 match self {
12707 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12708 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12709 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12710 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12711 Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
12712 Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
12713 Self::VerificationConfigNotFound => {
12714 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12715 }
12716 Self::CloudBuildRequestFailed => {
12717 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12718 }
12719 Self::OperationFeatureNotSupported => {
12720 std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
12721 }
12722 Self::UnknownValue(u) => u.0.name(),
12723 }
12724 }
12725 }
12726
12727 impl std::default::Default for FailureCause {
12728 fn default() -> Self {
12729 use std::convert::From;
12730 Self::from(0)
12731 }
12732 }
12733
12734 impl std::fmt::Display for FailureCause {
12735 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12736 wkt::internal::display_enum(f, self.name(), self.value())
12737 }
12738 }
12739
12740 impl std::convert::From<i32> for FailureCause {
12741 fn from(value: i32) -> Self {
12742 match value {
12743 0 => Self::Unspecified,
12744 1 => Self::CloudBuildUnavailable,
12745 2 => Self::ExecutionFailed,
12746 3 => Self::DeadlineExceeded,
12747 4 => Self::ReleaseFailed,
12748 5 => Self::ReleaseAbandoned,
12749 6 => Self::VerificationConfigNotFound,
12750 7 => Self::CloudBuildRequestFailed,
12751 8 => Self::OperationFeatureNotSupported,
12752 _ => Self::UnknownValue(failure_cause::UnknownValue(
12753 wkt::internal::UnknownEnumValue::Integer(value),
12754 )),
12755 }
12756 }
12757 }
12758
12759 impl std::convert::From<&str> for FailureCause {
12760 fn from(value: &str) -> Self {
12761 use std::string::ToString;
12762 match value {
12763 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12764 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12765 "EXECUTION_FAILED" => Self::ExecutionFailed,
12766 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12767 "RELEASE_FAILED" => Self::ReleaseFailed,
12768 "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
12769 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12770 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12771 "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
12772 _ => Self::UnknownValue(failure_cause::UnknownValue(
12773 wkt::internal::UnknownEnumValue::String(value.to_string()),
12774 )),
12775 }
12776 }
12777 }
12778
12779 impl serde::ser::Serialize for FailureCause {
12780 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12781 where
12782 S: serde::Serializer,
12783 {
12784 match self {
12785 Self::Unspecified => serializer.serialize_i32(0),
12786 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12787 Self::ExecutionFailed => serializer.serialize_i32(2),
12788 Self::DeadlineExceeded => serializer.serialize_i32(3),
12789 Self::ReleaseFailed => serializer.serialize_i32(4),
12790 Self::ReleaseAbandoned => serializer.serialize_i32(5),
12791 Self::VerificationConfigNotFound => serializer.serialize_i32(6),
12792 Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
12793 Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
12794 Self::UnknownValue(u) => u.0.serialize(serializer),
12795 }
12796 }
12797 }
12798
12799 impl<'de> serde::de::Deserialize<'de> for FailureCause {
12800 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12801 where
12802 D: serde::Deserializer<'de>,
12803 {
12804 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12805 ".google.cloud.deploy.v1.Rollout.FailureCause",
12806 ))
12807 }
12808 }
12809}
12810
12811/// Metadata includes information associated with a `Rollout`.
12812#[derive(Clone, Default, PartialEq)]
12813#[non_exhaustive]
12814pub struct Metadata {
12815 /// Output only. The name of the Cloud Run Service that is associated with a
12816 /// `Rollout`.
12817 pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12818
12819 /// Output only. AutomationRolloutMetadata contains the information about the
12820 /// interactions between Automation service and this rollout.
12821 pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
12822
12823 /// Output only. Custom metadata provided by user-defined `Rollout` operations.
12824 pub custom: std::option::Option<crate::model::CustomMetadata>,
12825
12826 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12827}
12828
12829impl Metadata {
12830 pub fn new() -> Self {
12831 std::default::Default::default()
12832 }
12833
12834 /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
12835 ///
12836 /// # Example
12837 /// ```ignore,no_run
12838 /// # use google_cloud_deploy_v1::model::Metadata;
12839 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12840 /// let x = Metadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12841 /// ```
12842 pub fn set_cloud_run<T>(mut self, v: T) -> Self
12843 where
12844 T: std::convert::Into<crate::model::CloudRunMetadata>,
12845 {
12846 self.cloud_run = std::option::Option::Some(v.into());
12847 self
12848 }
12849
12850 /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
12851 ///
12852 /// # Example
12853 /// ```ignore,no_run
12854 /// # use google_cloud_deploy_v1::model::Metadata;
12855 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12856 /// let x = Metadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12857 /// let x = Metadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12858 /// ```
12859 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12860 where
12861 T: std::convert::Into<crate::model::CloudRunMetadata>,
12862 {
12863 self.cloud_run = v.map(|x| x.into());
12864 self
12865 }
12866
12867 /// Sets the value of [automation][crate::model::Metadata::automation].
12868 ///
12869 /// # Example
12870 /// ```ignore,no_run
12871 /// # use google_cloud_deploy_v1::model::Metadata;
12872 /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12873 /// let x = Metadata::new().set_automation(AutomationRolloutMetadata::default()/* use setters */);
12874 /// ```
12875 pub fn set_automation<T>(mut self, v: T) -> Self
12876 where
12877 T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12878 {
12879 self.automation = std::option::Option::Some(v.into());
12880 self
12881 }
12882
12883 /// Sets or clears the value of [automation][crate::model::Metadata::automation].
12884 ///
12885 /// # Example
12886 /// ```ignore,no_run
12887 /// # use google_cloud_deploy_v1::model::Metadata;
12888 /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12889 /// let x = Metadata::new().set_or_clear_automation(Some(AutomationRolloutMetadata::default()/* use setters */));
12890 /// let x = Metadata::new().set_or_clear_automation(None::<AutomationRolloutMetadata>);
12891 /// ```
12892 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
12893 where
12894 T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12895 {
12896 self.automation = v.map(|x| x.into());
12897 self
12898 }
12899
12900 /// Sets the value of [custom][crate::model::Metadata::custom].
12901 ///
12902 /// # Example
12903 /// ```ignore,no_run
12904 /// # use google_cloud_deploy_v1::model::Metadata;
12905 /// use google_cloud_deploy_v1::model::CustomMetadata;
12906 /// let x = Metadata::new().set_custom(CustomMetadata::default()/* use setters */);
12907 /// ```
12908 pub fn set_custom<T>(mut self, v: T) -> Self
12909 where
12910 T: std::convert::Into<crate::model::CustomMetadata>,
12911 {
12912 self.custom = std::option::Option::Some(v.into());
12913 self
12914 }
12915
12916 /// Sets or clears the value of [custom][crate::model::Metadata::custom].
12917 ///
12918 /// # Example
12919 /// ```ignore,no_run
12920 /// # use google_cloud_deploy_v1::model::Metadata;
12921 /// use google_cloud_deploy_v1::model::CustomMetadata;
12922 /// let x = Metadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
12923 /// let x = Metadata::new().set_or_clear_custom(None::<CustomMetadata>);
12924 /// ```
12925 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
12926 where
12927 T: std::convert::Into<crate::model::CustomMetadata>,
12928 {
12929 self.custom = v.map(|x| x.into());
12930 self
12931 }
12932}
12933
12934impl wkt::message::Message for Metadata {
12935 fn typename() -> &'static str {
12936 "type.googleapis.com/google.cloud.deploy.v1.Metadata"
12937 }
12938}
12939
12940/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
12941/// the user.
12942#[derive(Clone, Default, PartialEq)]
12943#[non_exhaustive]
12944pub struct DeployJobRunMetadata {
12945 /// Output only. The name of the Cloud Run Service that is associated with a
12946 /// `DeployJobRun`.
12947 pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12948
12949 /// Output only. Custom Target metadata associated with a `DeployJobRun`.
12950 pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
12951
12952 /// Output only. Custom metadata provided by user-defined deploy operation.
12953 pub custom: std::option::Option<crate::model::CustomMetadata>,
12954
12955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12956}
12957
12958impl DeployJobRunMetadata {
12959 pub fn new() -> Self {
12960 std::default::Default::default()
12961 }
12962
12963 /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
12964 ///
12965 /// # Example
12966 /// ```ignore,no_run
12967 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
12968 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12969 /// let x = DeployJobRunMetadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12970 /// ```
12971 pub fn set_cloud_run<T>(mut self, v: T) -> Self
12972 where
12973 T: std::convert::Into<crate::model::CloudRunMetadata>,
12974 {
12975 self.cloud_run = std::option::Option::Some(v.into());
12976 self
12977 }
12978
12979 /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
12980 ///
12981 /// # Example
12982 /// ```ignore,no_run
12983 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
12984 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12985 /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12986 /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12987 /// ```
12988 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12989 where
12990 T: std::convert::Into<crate::model::CloudRunMetadata>,
12991 {
12992 self.cloud_run = v.map(|x| x.into());
12993 self
12994 }
12995
12996 /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
12997 ///
12998 /// # Example
12999 /// ```ignore,no_run
13000 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13001 /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13002 /// let x = DeployJobRunMetadata::new().set_custom_target(CustomTargetDeployMetadata::default()/* use setters */);
13003 /// ```
13004 pub fn set_custom_target<T>(mut self, v: T) -> Self
13005 where
13006 T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13007 {
13008 self.custom_target = std::option::Option::Some(v.into());
13009 self
13010 }
13011
13012 /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13013 ///
13014 /// # Example
13015 /// ```ignore,no_run
13016 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13017 /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13018 /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(Some(CustomTargetDeployMetadata::default()/* use setters */));
13019 /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(None::<CustomTargetDeployMetadata>);
13020 /// ```
13021 pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
13022 where
13023 T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13024 {
13025 self.custom_target = v.map(|x| x.into());
13026 self
13027 }
13028
13029 /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
13030 ///
13031 /// # Example
13032 /// ```ignore,no_run
13033 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13034 /// use google_cloud_deploy_v1::model::CustomMetadata;
13035 /// let x = DeployJobRunMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
13036 /// ```
13037 pub fn set_custom<T>(mut self, v: T) -> Self
13038 where
13039 T: std::convert::Into<crate::model::CustomMetadata>,
13040 {
13041 self.custom = std::option::Option::Some(v.into());
13042 self
13043 }
13044
13045 /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
13046 ///
13047 /// # Example
13048 /// ```ignore,no_run
13049 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13050 /// use google_cloud_deploy_v1::model::CustomMetadata;
13051 /// let x = DeployJobRunMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13052 /// let x = DeployJobRunMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
13053 /// ```
13054 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13055 where
13056 T: std::convert::Into<crate::model::CustomMetadata>,
13057 {
13058 self.custom = v.map(|x| x.into());
13059 self
13060 }
13061}
13062
13063impl wkt::message::Message for DeployJobRunMetadata {
13064 fn typename() -> &'static str {
13065 "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
13066 }
13067}
13068
13069/// CloudRunMetadata contains information from a Cloud Run deployment.
13070#[derive(Clone, Default, PartialEq)]
13071#[non_exhaustive]
13072pub struct CloudRunMetadata {
13073 /// Output only. The name of the Cloud Run Service that is associated with a
13074 /// `Rollout`. Format is
13075 /// `projects/{project}/locations/{location}/services/{service}`.
13076 pub service: std::string::String,
13077
13078 /// Output only. The Cloud Run Service urls that are associated with a
13079 /// `Rollout`.
13080 pub service_urls: std::vec::Vec<std::string::String>,
13081
13082 /// Output only. The Cloud Run Revision id associated with a `Rollout`.
13083 pub revision: std::string::String,
13084
13085 /// Output only. The name of the Cloud Run job that is associated with a
13086 /// `Rollout`. Format is
13087 /// `projects/{project}/locations/{location}/jobs/{job_name}`.
13088 pub job: std::string::String,
13089
13090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13091}
13092
13093impl CloudRunMetadata {
13094 pub fn new() -> Self {
13095 std::default::Default::default()
13096 }
13097
13098 /// Sets the value of [service][crate::model::CloudRunMetadata::service].
13099 ///
13100 /// # Example
13101 /// ```ignore,no_run
13102 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13103 /// let x = CloudRunMetadata::new().set_service("example");
13104 /// ```
13105 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13106 self.service = v.into();
13107 self
13108 }
13109
13110 /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
13111 ///
13112 /// # Example
13113 /// ```ignore,no_run
13114 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13115 /// let x = CloudRunMetadata::new().set_service_urls(["a", "b", "c"]);
13116 /// ```
13117 pub fn set_service_urls<T, V>(mut self, v: T) -> Self
13118 where
13119 T: std::iter::IntoIterator<Item = V>,
13120 V: std::convert::Into<std::string::String>,
13121 {
13122 use std::iter::Iterator;
13123 self.service_urls = v.into_iter().map(|i| i.into()).collect();
13124 self
13125 }
13126
13127 /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
13128 ///
13129 /// # Example
13130 /// ```ignore,no_run
13131 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13132 /// let x = CloudRunMetadata::new().set_revision("example");
13133 /// ```
13134 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13135 self.revision = v.into();
13136 self
13137 }
13138
13139 /// Sets the value of [job][crate::model::CloudRunMetadata::job].
13140 ///
13141 /// # Example
13142 /// ```ignore,no_run
13143 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13144 /// let x = CloudRunMetadata::new().set_job("example");
13145 /// ```
13146 pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13147 self.job = v.into();
13148 self
13149 }
13150}
13151
13152impl wkt::message::Message for CloudRunMetadata {
13153 fn typename() -> &'static str {
13154 "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
13155 }
13156}
13157
13158/// CustomTargetDeployMetadata contains information from a Custom Target
13159/// deploy operation.
13160#[derive(Clone, Default, PartialEq)]
13161#[non_exhaustive]
13162pub struct CustomTargetDeployMetadata {
13163 /// Output only. Skip message provided in the results of a custom deploy
13164 /// operation.
13165 pub skip_message: std::string::String,
13166
13167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13168}
13169
13170impl CustomTargetDeployMetadata {
13171 pub fn new() -> Self {
13172 std::default::Default::default()
13173 }
13174
13175 /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
13176 ///
13177 /// # Example
13178 /// ```ignore,no_run
13179 /// # use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13180 /// let x = CustomTargetDeployMetadata::new().set_skip_message("example");
13181 /// ```
13182 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13183 self.skip_message = v.into();
13184 self
13185 }
13186}
13187
13188impl wkt::message::Message for CustomTargetDeployMetadata {
13189 fn typename() -> &'static str {
13190 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
13191 }
13192}
13193
13194/// AutomationRolloutMetadata contains Automation-related actions that
13195/// were performed on a rollout.
13196#[derive(Clone, Default, PartialEq)]
13197#[non_exhaustive]
13198pub struct AutomationRolloutMetadata {
13199 /// Output only. The name of the AutomationRun initiated by a promote release
13200 /// rule.
13201 pub promote_automation_run: std::string::String,
13202
13203 /// Output only. The names of the AutomationRuns initiated by an advance
13204 /// rollout rule.
13205 pub advance_automation_runs: std::vec::Vec<std::string::String>,
13206
13207 /// Output only. The names of the AutomationRuns initiated by a repair rollout
13208 /// rule.
13209 pub repair_automation_runs: std::vec::Vec<std::string::String>,
13210
13211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13212}
13213
13214impl AutomationRolloutMetadata {
13215 pub fn new() -> Self {
13216 std::default::Default::default()
13217 }
13218
13219 /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
13220 ///
13221 /// # Example
13222 /// ```ignore,no_run
13223 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13224 /// let x = AutomationRolloutMetadata::new().set_promote_automation_run("example");
13225 /// ```
13226 pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
13227 mut self,
13228 v: T,
13229 ) -> Self {
13230 self.promote_automation_run = v.into();
13231 self
13232 }
13233
13234 /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
13235 ///
13236 /// # Example
13237 /// ```ignore,no_run
13238 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13239 /// let x = AutomationRolloutMetadata::new().set_advance_automation_runs(["a", "b", "c"]);
13240 /// ```
13241 pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
13242 where
13243 T: std::iter::IntoIterator<Item = V>,
13244 V: std::convert::Into<std::string::String>,
13245 {
13246 use std::iter::Iterator;
13247 self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
13248 self
13249 }
13250
13251 /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
13252 ///
13253 /// # Example
13254 /// ```ignore,no_run
13255 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13256 /// let x = AutomationRolloutMetadata::new().set_repair_automation_runs(["a", "b", "c"]);
13257 /// ```
13258 pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
13259 where
13260 T: std::iter::IntoIterator<Item = V>,
13261 V: std::convert::Into<std::string::String>,
13262 {
13263 use std::iter::Iterator;
13264 self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
13265 self
13266 }
13267}
13268
13269impl wkt::message::Message for AutomationRolloutMetadata {
13270 fn typename() -> &'static str {
13271 "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
13272 }
13273}
13274
13275/// CustomMetadata contains information from a user-defined operation.
13276#[derive(Clone, Default, PartialEq)]
13277#[non_exhaustive]
13278pub struct CustomMetadata {
13279 /// Output only. Key-value pairs provided by the user-defined operation.
13280 pub values: std::collections::HashMap<std::string::String, std::string::String>,
13281
13282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13283}
13284
13285impl CustomMetadata {
13286 pub fn new() -> Self {
13287 std::default::Default::default()
13288 }
13289
13290 /// Sets the value of [values][crate::model::CustomMetadata::values].
13291 ///
13292 /// # Example
13293 /// ```ignore,no_run
13294 /// # use google_cloud_deploy_v1::model::CustomMetadata;
13295 /// let x = CustomMetadata::new().set_values([
13296 /// ("key0", "abc"),
13297 /// ("key1", "xyz"),
13298 /// ]);
13299 /// ```
13300 pub fn set_values<T, K, V>(mut self, v: T) -> Self
13301 where
13302 T: std::iter::IntoIterator<Item = (K, V)>,
13303 K: std::convert::Into<std::string::String>,
13304 V: std::convert::Into<std::string::String>,
13305 {
13306 use std::iter::Iterator;
13307 self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13308 self
13309 }
13310}
13311
13312impl wkt::message::Message for CustomMetadata {
13313 fn typename() -> &'static str {
13314 "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
13315 }
13316}
13317
13318/// Phase represents a collection of jobs that are logically grouped together
13319/// for a `Rollout`.
13320#[derive(Clone, Default, PartialEq)]
13321#[non_exhaustive]
13322pub struct Phase {
13323 /// Output only. The ID of the Phase.
13324 pub id: std::string::String,
13325
13326 /// Output only. Current state of the Phase.
13327 pub state: crate::model::phase::State,
13328
13329 /// Output only. Additional information on why the Phase was skipped, if
13330 /// available.
13331 pub skip_message: std::string::String,
13332
13333 /// The job composition of this Phase.
13334 pub jobs: std::option::Option<crate::model::phase::Jobs>,
13335
13336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13337}
13338
13339impl Phase {
13340 pub fn new() -> Self {
13341 std::default::Default::default()
13342 }
13343
13344 /// Sets the value of [id][crate::model::Phase::id].
13345 ///
13346 /// # Example
13347 /// ```ignore,no_run
13348 /// # use google_cloud_deploy_v1::model::Phase;
13349 /// let x = Phase::new().set_id("example");
13350 /// ```
13351 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13352 self.id = v.into();
13353 self
13354 }
13355
13356 /// Sets the value of [state][crate::model::Phase::state].
13357 ///
13358 /// # Example
13359 /// ```ignore,no_run
13360 /// # use google_cloud_deploy_v1::model::Phase;
13361 /// use google_cloud_deploy_v1::model::phase::State;
13362 /// let x0 = Phase::new().set_state(State::Pending);
13363 /// let x1 = Phase::new().set_state(State::InProgress);
13364 /// let x2 = Phase::new().set_state(State::Succeeded);
13365 /// ```
13366 pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
13367 self.state = v.into();
13368 self
13369 }
13370
13371 /// Sets the value of [skip_message][crate::model::Phase::skip_message].
13372 ///
13373 /// # Example
13374 /// ```ignore,no_run
13375 /// # use google_cloud_deploy_v1::model::Phase;
13376 /// let x = Phase::new().set_skip_message("example");
13377 /// ```
13378 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13379 self.skip_message = v.into();
13380 self
13381 }
13382
13383 /// Sets the value of [jobs][crate::model::Phase::jobs].
13384 ///
13385 /// Note that all the setters affecting `jobs` are mutually
13386 /// exclusive.
13387 ///
13388 /// # Example
13389 /// ```ignore,no_run
13390 /// # use google_cloud_deploy_v1::model::Phase;
13391 /// use google_cloud_deploy_v1::model::DeploymentJobs;
13392 /// let x = Phase::new().set_jobs(Some(
13393 /// google_cloud_deploy_v1::model::phase::Jobs::DeploymentJobs(DeploymentJobs::default().into())));
13394 /// ```
13395 pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
13396 mut self,
13397 v: T,
13398 ) -> Self {
13399 self.jobs = v.into();
13400 self
13401 }
13402
13403 /// The value of [jobs][crate::model::Phase::jobs]
13404 /// if it holds a `DeploymentJobs`, `None` if the field is not set or
13405 /// holds a different branch.
13406 pub fn deployment_jobs(
13407 &self,
13408 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
13409 #[allow(unreachable_patterns)]
13410 self.jobs.as_ref().and_then(|v| match v {
13411 crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
13412 _ => std::option::Option::None,
13413 })
13414 }
13415
13416 /// Sets the value of [jobs][crate::model::Phase::jobs]
13417 /// to hold a `DeploymentJobs`.
13418 ///
13419 /// Note that all the setters affecting `jobs` are
13420 /// mutually exclusive.
13421 ///
13422 /// # Example
13423 /// ```ignore,no_run
13424 /// # use google_cloud_deploy_v1::model::Phase;
13425 /// use google_cloud_deploy_v1::model::DeploymentJobs;
13426 /// let x = Phase::new().set_deployment_jobs(DeploymentJobs::default()/* use setters */);
13427 /// assert!(x.deployment_jobs().is_some());
13428 /// assert!(x.child_rollout_jobs().is_none());
13429 /// ```
13430 pub fn set_deployment_jobs<
13431 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
13432 >(
13433 mut self,
13434 v: T,
13435 ) -> Self {
13436 self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
13437 self
13438 }
13439
13440 /// The value of [jobs][crate::model::Phase::jobs]
13441 /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
13442 /// holds a different branch.
13443 pub fn child_rollout_jobs(
13444 &self,
13445 ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
13446 #[allow(unreachable_patterns)]
13447 self.jobs.as_ref().and_then(|v| match v {
13448 crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
13449 _ => std::option::Option::None,
13450 })
13451 }
13452
13453 /// Sets the value of [jobs][crate::model::Phase::jobs]
13454 /// to hold a `ChildRolloutJobs`.
13455 ///
13456 /// Note that all the setters affecting `jobs` are
13457 /// mutually exclusive.
13458 ///
13459 /// # Example
13460 /// ```ignore,no_run
13461 /// # use google_cloud_deploy_v1::model::Phase;
13462 /// use google_cloud_deploy_v1::model::ChildRolloutJobs;
13463 /// let x = Phase::new().set_child_rollout_jobs(ChildRolloutJobs::default()/* use setters */);
13464 /// assert!(x.child_rollout_jobs().is_some());
13465 /// assert!(x.deployment_jobs().is_none());
13466 /// ```
13467 pub fn set_child_rollout_jobs<
13468 T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
13469 >(
13470 mut self,
13471 v: T,
13472 ) -> Self {
13473 self.jobs =
13474 std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
13475 self
13476 }
13477}
13478
13479impl wkt::message::Message for Phase {
13480 fn typename() -> &'static str {
13481 "type.googleapis.com/google.cloud.deploy.v1.Phase"
13482 }
13483}
13484
13485/// Defines additional types related to [Phase].
13486pub mod phase {
13487 #[allow(unused_imports)]
13488 use super::*;
13489
13490 /// Valid states of a Phase.
13491 ///
13492 /// # Working with unknown values
13493 ///
13494 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13495 /// additional enum variants at any time. Adding new variants is not considered
13496 /// a breaking change. Applications should write their code in anticipation of:
13497 ///
13498 /// - New values appearing in future releases of the client library, **and**
13499 /// - New values received dynamically, without application changes.
13500 ///
13501 /// Please consult the [Working with enums] section in the user guide for some
13502 /// guidelines.
13503 ///
13504 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13505 #[derive(Clone, Debug, PartialEq)]
13506 #[non_exhaustive]
13507 pub enum State {
13508 /// The Phase has an unspecified state.
13509 Unspecified,
13510 /// The Phase is waiting for an earlier Phase(s) to complete.
13511 Pending,
13512 /// The Phase is in progress.
13513 InProgress,
13514 /// The Phase has succeeded.
13515 Succeeded,
13516 /// The Phase has failed.
13517 Failed,
13518 /// The Phase was aborted.
13519 Aborted,
13520 /// The Phase was skipped.
13521 Skipped,
13522 /// If set, the enum was initialized with an unknown value.
13523 ///
13524 /// Applications can examine the value using [State::value] or
13525 /// [State::name].
13526 UnknownValue(state::UnknownValue),
13527 }
13528
13529 #[doc(hidden)]
13530 pub mod state {
13531 #[allow(unused_imports)]
13532 use super::*;
13533 #[derive(Clone, Debug, PartialEq)]
13534 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13535 }
13536
13537 impl State {
13538 /// Gets the enum value.
13539 ///
13540 /// Returns `None` if the enum contains an unknown value deserialized from
13541 /// the string representation of enums.
13542 pub fn value(&self) -> std::option::Option<i32> {
13543 match self {
13544 Self::Unspecified => std::option::Option::Some(0),
13545 Self::Pending => std::option::Option::Some(1),
13546 Self::InProgress => std::option::Option::Some(2),
13547 Self::Succeeded => std::option::Option::Some(3),
13548 Self::Failed => std::option::Option::Some(4),
13549 Self::Aborted => std::option::Option::Some(5),
13550 Self::Skipped => std::option::Option::Some(6),
13551 Self::UnknownValue(u) => u.0.value(),
13552 }
13553 }
13554
13555 /// Gets the enum value as a string.
13556 ///
13557 /// Returns `None` if the enum contains an unknown value deserialized from
13558 /// the integer representation of enums.
13559 pub fn name(&self) -> std::option::Option<&str> {
13560 match self {
13561 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13562 Self::Pending => std::option::Option::Some("PENDING"),
13563 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
13564 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13565 Self::Failed => std::option::Option::Some("FAILED"),
13566 Self::Aborted => std::option::Option::Some("ABORTED"),
13567 Self::Skipped => std::option::Option::Some("SKIPPED"),
13568 Self::UnknownValue(u) => u.0.name(),
13569 }
13570 }
13571 }
13572
13573 impl std::default::Default for State {
13574 fn default() -> Self {
13575 use std::convert::From;
13576 Self::from(0)
13577 }
13578 }
13579
13580 impl std::fmt::Display for State {
13581 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13582 wkt::internal::display_enum(f, self.name(), self.value())
13583 }
13584 }
13585
13586 impl std::convert::From<i32> for State {
13587 fn from(value: i32) -> Self {
13588 match value {
13589 0 => Self::Unspecified,
13590 1 => Self::Pending,
13591 2 => Self::InProgress,
13592 3 => Self::Succeeded,
13593 4 => Self::Failed,
13594 5 => Self::Aborted,
13595 6 => Self::Skipped,
13596 _ => Self::UnknownValue(state::UnknownValue(
13597 wkt::internal::UnknownEnumValue::Integer(value),
13598 )),
13599 }
13600 }
13601 }
13602
13603 impl std::convert::From<&str> for State {
13604 fn from(value: &str) -> Self {
13605 use std::string::ToString;
13606 match value {
13607 "STATE_UNSPECIFIED" => Self::Unspecified,
13608 "PENDING" => Self::Pending,
13609 "IN_PROGRESS" => Self::InProgress,
13610 "SUCCEEDED" => Self::Succeeded,
13611 "FAILED" => Self::Failed,
13612 "ABORTED" => Self::Aborted,
13613 "SKIPPED" => Self::Skipped,
13614 _ => Self::UnknownValue(state::UnknownValue(
13615 wkt::internal::UnknownEnumValue::String(value.to_string()),
13616 )),
13617 }
13618 }
13619 }
13620
13621 impl serde::ser::Serialize for State {
13622 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13623 where
13624 S: serde::Serializer,
13625 {
13626 match self {
13627 Self::Unspecified => serializer.serialize_i32(0),
13628 Self::Pending => serializer.serialize_i32(1),
13629 Self::InProgress => serializer.serialize_i32(2),
13630 Self::Succeeded => serializer.serialize_i32(3),
13631 Self::Failed => serializer.serialize_i32(4),
13632 Self::Aborted => serializer.serialize_i32(5),
13633 Self::Skipped => serializer.serialize_i32(6),
13634 Self::UnknownValue(u) => u.0.serialize(serializer),
13635 }
13636 }
13637 }
13638
13639 impl<'de> serde::de::Deserialize<'de> for State {
13640 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13641 where
13642 D: serde::Deserializer<'de>,
13643 {
13644 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13645 ".google.cloud.deploy.v1.Phase.State",
13646 ))
13647 }
13648 }
13649
13650 /// The job composition of this Phase.
13651 #[derive(Clone, Debug, PartialEq)]
13652 #[non_exhaustive]
13653 pub enum Jobs {
13654 /// Output only. Deployment job composition.
13655 DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
13656 /// Output only. ChildRollout job composition.
13657 ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
13658 }
13659}
13660
13661/// Deployment job composition.
13662#[derive(Clone, Default, PartialEq)]
13663#[non_exhaustive]
13664pub struct DeploymentJobs {
13665 /// Output only. The predeploy Job, which is the first job on the phase.
13666 pub predeploy_job: std::option::Option<crate::model::Job>,
13667
13668 /// Output only. The deploy Job. This is the deploy job in the phase.
13669 pub deploy_job: std::option::Option<crate::model::Job>,
13670
13671 /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
13672 pub verify_job: std::option::Option<crate::model::Job>,
13673
13674 /// Output only. The postdeploy Job, which is the last job on the phase.
13675 pub postdeploy_job: std::option::Option<crate::model::Job>,
13676
13677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13678}
13679
13680impl DeploymentJobs {
13681 pub fn new() -> Self {
13682 std::default::Default::default()
13683 }
13684
13685 /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13686 ///
13687 /// # Example
13688 /// ```ignore,no_run
13689 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13690 /// use google_cloud_deploy_v1::model::Job;
13691 /// let x = DeploymentJobs::new().set_predeploy_job(Job::default()/* use setters */);
13692 /// ```
13693 pub fn set_predeploy_job<T>(mut self, v: T) -> Self
13694 where
13695 T: std::convert::Into<crate::model::Job>,
13696 {
13697 self.predeploy_job = std::option::Option::Some(v.into());
13698 self
13699 }
13700
13701 /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13702 ///
13703 /// # Example
13704 /// ```ignore,no_run
13705 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13706 /// use google_cloud_deploy_v1::model::Job;
13707 /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(Some(Job::default()/* use setters */));
13708 /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(None::<Job>);
13709 /// ```
13710 pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13711 where
13712 T: std::convert::Into<crate::model::Job>,
13713 {
13714 self.predeploy_job = v.map(|x| x.into());
13715 self
13716 }
13717
13718 /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13719 ///
13720 /// # Example
13721 /// ```ignore,no_run
13722 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13723 /// use google_cloud_deploy_v1::model::Job;
13724 /// let x = DeploymentJobs::new().set_deploy_job(Job::default()/* use setters */);
13725 /// ```
13726 pub fn set_deploy_job<T>(mut self, v: T) -> Self
13727 where
13728 T: std::convert::Into<crate::model::Job>,
13729 {
13730 self.deploy_job = std::option::Option::Some(v.into());
13731 self
13732 }
13733
13734 /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13735 ///
13736 /// # Example
13737 /// ```ignore,no_run
13738 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13739 /// use google_cloud_deploy_v1::model::Job;
13740 /// let x = DeploymentJobs::new().set_or_clear_deploy_job(Some(Job::default()/* use setters */));
13741 /// let x = DeploymentJobs::new().set_or_clear_deploy_job(None::<Job>);
13742 /// ```
13743 pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13744 where
13745 T: std::convert::Into<crate::model::Job>,
13746 {
13747 self.deploy_job = v.map(|x| x.into());
13748 self
13749 }
13750
13751 /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13752 ///
13753 /// # Example
13754 /// ```ignore,no_run
13755 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13756 /// use google_cloud_deploy_v1::model::Job;
13757 /// let x = DeploymentJobs::new().set_verify_job(Job::default()/* use setters */);
13758 /// ```
13759 pub fn set_verify_job<T>(mut self, v: T) -> Self
13760 where
13761 T: std::convert::Into<crate::model::Job>,
13762 {
13763 self.verify_job = std::option::Option::Some(v.into());
13764 self
13765 }
13766
13767 /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13768 ///
13769 /// # Example
13770 /// ```ignore,no_run
13771 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13772 /// use google_cloud_deploy_v1::model::Job;
13773 /// let x = DeploymentJobs::new().set_or_clear_verify_job(Some(Job::default()/* use setters */));
13774 /// let x = DeploymentJobs::new().set_or_clear_verify_job(None::<Job>);
13775 /// ```
13776 pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
13777 where
13778 T: std::convert::Into<crate::model::Job>,
13779 {
13780 self.verify_job = v.map(|x| x.into());
13781 self
13782 }
13783
13784 /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13785 ///
13786 /// # Example
13787 /// ```ignore,no_run
13788 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13789 /// use google_cloud_deploy_v1::model::Job;
13790 /// let x = DeploymentJobs::new().set_postdeploy_job(Job::default()/* use setters */);
13791 /// ```
13792 pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
13793 where
13794 T: std::convert::Into<crate::model::Job>,
13795 {
13796 self.postdeploy_job = std::option::Option::Some(v.into());
13797 self
13798 }
13799
13800 /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13801 ///
13802 /// # Example
13803 /// ```ignore,no_run
13804 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13805 /// use google_cloud_deploy_v1::model::Job;
13806 /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(Some(Job::default()/* use setters */));
13807 /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(None::<Job>);
13808 /// ```
13809 pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13810 where
13811 T: std::convert::Into<crate::model::Job>,
13812 {
13813 self.postdeploy_job = v.map(|x| x.into());
13814 self
13815 }
13816}
13817
13818impl wkt::message::Message for DeploymentJobs {
13819 fn typename() -> &'static str {
13820 "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
13821 }
13822}
13823
13824/// ChildRollouts job composition
13825#[derive(Clone, Default, PartialEq)]
13826#[non_exhaustive]
13827pub struct ChildRolloutJobs {
13828 /// Output only. List of CreateChildRolloutJobs
13829 pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
13830
13831 /// Output only. List of AdvanceChildRolloutJobs
13832 pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
13833
13834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13835}
13836
13837impl ChildRolloutJobs {
13838 pub fn new() -> Self {
13839 std::default::Default::default()
13840 }
13841
13842 /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
13843 ///
13844 /// # Example
13845 /// ```ignore,no_run
13846 /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13847 /// use google_cloud_deploy_v1::model::Job;
13848 /// let x = ChildRolloutJobs::new()
13849 /// .set_create_rollout_jobs([
13850 /// Job::default()/* use setters */,
13851 /// Job::default()/* use (different) setters */,
13852 /// ]);
13853 /// ```
13854 pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
13855 where
13856 T: std::iter::IntoIterator<Item = V>,
13857 V: std::convert::Into<crate::model::Job>,
13858 {
13859 use std::iter::Iterator;
13860 self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13861 self
13862 }
13863
13864 /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
13865 ///
13866 /// # Example
13867 /// ```ignore,no_run
13868 /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13869 /// use google_cloud_deploy_v1::model::Job;
13870 /// let x = ChildRolloutJobs::new()
13871 /// .set_advance_rollout_jobs([
13872 /// Job::default()/* use setters */,
13873 /// Job::default()/* use (different) setters */,
13874 /// ]);
13875 /// ```
13876 pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
13877 where
13878 T: std::iter::IntoIterator<Item = V>,
13879 V: std::convert::Into<crate::model::Job>,
13880 {
13881 use std::iter::Iterator;
13882 self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13883 self
13884 }
13885}
13886
13887impl wkt::message::Message for ChildRolloutJobs {
13888 fn typename() -> &'static str {
13889 "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
13890 }
13891}
13892
13893/// Job represents an operation for a `Rollout`.
13894#[derive(Clone, Default, PartialEq)]
13895#[non_exhaustive]
13896pub struct Job {
13897 /// Output only. The ID of the Job.
13898 pub id: std::string::String,
13899
13900 /// Output only. The current state of the Job.
13901 pub state: crate::model::job::State,
13902
13903 /// Output only. Additional information on why the Job was skipped, if
13904 /// available.
13905 pub skip_message: std::string::String,
13906
13907 /// Output only. The name of the `JobRun` responsible for the most recent
13908 /// invocation of this Job.
13909 pub job_run: std::string::String,
13910
13911 /// The type of Job.
13912 pub job_type: std::option::Option<crate::model::job::JobType>,
13913
13914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13915}
13916
13917impl Job {
13918 pub fn new() -> Self {
13919 std::default::Default::default()
13920 }
13921
13922 /// Sets the value of [id][crate::model::Job::id].
13923 ///
13924 /// # Example
13925 /// ```ignore,no_run
13926 /// # use google_cloud_deploy_v1::model::Job;
13927 /// let x = Job::new().set_id("example");
13928 /// ```
13929 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13930 self.id = v.into();
13931 self
13932 }
13933
13934 /// Sets the value of [state][crate::model::Job::state].
13935 ///
13936 /// # Example
13937 /// ```ignore,no_run
13938 /// # use google_cloud_deploy_v1::model::Job;
13939 /// use google_cloud_deploy_v1::model::job::State;
13940 /// let x0 = Job::new().set_state(State::Pending);
13941 /// let x1 = Job::new().set_state(State::Disabled);
13942 /// let x2 = Job::new().set_state(State::InProgress);
13943 /// ```
13944 pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
13945 self.state = v.into();
13946 self
13947 }
13948
13949 /// Sets the value of [skip_message][crate::model::Job::skip_message].
13950 ///
13951 /// # Example
13952 /// ```ignore,no_run
13953 /// # use google_cloud_deploy_v1::model::Job;
13954 /// let x = Job::new().set_skip_message("example");
13955 /// ```
13956 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13957 self.skip_message = v.into();
13958 self
13959 }
13960
13961 /// Sets the value of [job_run][crate::model::Job::job_run].
13962 ///
13963 /// # Example
13964 /// ```ignore,no_run
13965 /// # use google_cloud_deploy_v1::model::Job;
13966 /// let x = Job::new().set_job_run("example");
13967 /// ```
13968 pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13969 self.job_run = v.into();
13970 self
13971 }
13972
13973 /// Sets the value of [job_type][crate::model::Job::job_type].
13974 ///
13975 /// Note that all the setters affecting `job_type` are mutually
13976 /// exclusive.
13977 ///
13978 /// # Example
13979 /// ```ignore,no_run
13980 /// # use google_cloud_deploy_v1::model::Job;
13981 /// use google_cloud_deploy_v1::model::DeployJob;
13982 /// let x = Job::new().set_job_type(Some(
13983 /// google_cloud_deploy_v1::model::job::JobType::DeployJob(DeployJob::default().into())));
13984 /// ```
13985 pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
13986 mut self,
13987 v: T,
13988 ) -> Self {
13989 self.job_type = v.into();
13990 self
13991 }
13992
13993 /// The value of [job_type][crate::model::Job::job_type]
13994 /// if it holds a `DeployJob`, `None` if the field is not set or
13995 /// holds a different branch.
13996 pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
13997 #[allow(unreachable_patterns)]
13998 self.job_type.as_ref().and_then(|v| match v {
13999 crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
14000 _ => std::option::Option::None,
14001 })
14002 }
14003
14004 /// Sets the value of [job_type][crate::model::Job::job_type]
14005 /// to hold a `DeployJob`.
14006 ///
14007 /// Note that all the setters affecting `job_type` are
14008 /// mutually exclusive.
14009 ///
14010 /// # Example
14011 /// ```ignore,no_run
14012 /// # use google_cloud_deploy_v1::model::Job;
14013 /// use google_cloud_deploy_v1::model::DeployJob;
14014 /// let x = Job::new().set_deploy_job(DeployJob::default()/* use setters */);
14015 /// assert!(x.deploy_job().is_some());
14016 /// assert!(x.verify_job().is_none());
14017 /// assert!(x.predeploy_job().is_none());
14018 /// assert!(x.postdeploy_job().is_none());
14019 /// assert!(x.create_child_rollout_job().is_none());
14020 /// assert!(x.advance_child_rollout_job().is_none());
14021 /// ```
14022 pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
14023 mut self,
14024 v: T,
14025 ) -> Self {
14026 self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
14027 self
14028 }
14029
14030 /// The value of [job_type][crate::model::Job::job_type]
14031 /// if it holds a `VerifyJob`, `None` if the field is not set or
14032 /// holds a different branch.
14033 pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
14034 #[allow(unreachable_patterns)]
14035 self.job_type.as_ref().and_then(|v| match v {
14036 crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
14037 _ => std::option::Option::None,
14038 })
14039 }
14040
14041 /// Sets the value of [job_type][crate::model::Job::job_type]
14042 /// to hold a `VerifyJob`.
14043 ///
14044 /// Note that all the setters affecting `job_type` are
14045 /// mutually exclusive.
14046 ///
14047 /// # Example
14048 /// ```ignore,no_run
14049 /// # use google_cloud_deploy_v1::model::Job;
14050 /// use google_cloud_deploy_v1::model::VerifyJob;
14051 /// let x = Job::new().set_verify_job(VerifyJob::default()/* use setters */);
14052 /// assert!(x.verify_job().is_some());
14053 /// assert!(x.deploy_job().is_none());
14054 /// assert!(x.predeploy_job().is_none());
14055 /// assert!(x.postdeploy_job().is_none());
14056 /// assert!(x.create_child_rollout_job().is_none());
14057 /// assert!(x.advance_child_rollout_job().is_none());
14058 /// ```
14059 pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
14060 mut self,
14061 v: T,
14062 ) -> Self {
14063 self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
14064 self
14065 }
14066
14067 /// The value of [job_type][crate::model::Job::job_type]
14068 /// if it holds a `PredeployJob`, `None` if the field is not set or
14069 /// holds a different branch.
14070 pub fn predeploy_job(
14071 &self,
14072 ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
14073 #[allow(unreachable_patterns)]
14074 self.job_type.as_ref().and_then(|v| match v {
14075 crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
14076 _ => std::option::Option::None,
14077 })
14078 }
14079
14080 /// Sets the value of [job_type][crate::model::Job::job_type]
14081 /// to hold a `PredeployJob`.
14082 ///
14083 /// Note that all the setters affecting `job_type` are
14084 /// mutually exclusive.
14085 ///
14086 /// # Example
14087 /// ```ignore,no_run
14088 /// # use google_cloud_deploy_v1::model::Job;
14089 /// use google_cloud_deploy_v1::model::PredeployJob;
14090 /// let x = Job::new().set_predeploy_job(PredeployJob::default()/* use setters */);
14091 /// assert!(x.predeploy_job().is_some());
14092 /// assert!(x.deploy_job().is_none());
14093 /// assert!(x.verify_job().is_none());
14094 /// assert!(x.postdeploy_job().is_none());
14095 /// assert!(x.create_child_rollout_job().is_none());
14096 /// assert!(x.advance_child_rollout_job().is_none());
14097 /// ```
14098 pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
14099 mut self,
14100 v: T,
14101 ) -> Self {
14102 self.job_type =
14103 std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
14104 self
14105 }
14106
14107 /// The value of [job_type][crate::model::Job::job_type]
14108 /// if it holds a `PostdeployJob`, `None` if the field is not set or
14109 /// holds a different branch.
14110 pub fn postdeploy_job(
14111 &self,
14112 ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
14113 #[allow(unreachable_patterns)]
14114 self.job_type.as_ref().and_then(|v| match v {
14115 crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
14116 _ => std::option::Option::None,
14117 })
14118 }
14119
14120 /// Sets the value of [job_type][crate::model::Job::job_type]
14121 /// to hold a `PostdeployJob`.
14122 ///
14123 /// Note that all the setters affecting `job_type` are
14124 /// mutually exclusive.
14125 ///
14126 /// # Example
14127 /// ```ignore,no_run
14128 /// # use google_cloud_deploy_v1::model::Job;
14129 /// use google_cloud_deploy_v1::model::PostdeployJob;
14130 /// let x = Job::new().set_postdeploy_job(PostdeployJob::default()/* use setters */);
14131 /// assert!(x.postdeploy_job().is_some());
14132 /// assert!(x.deploy_job().is_none());
14133 /// assert!(x.verify_job().is_none());
14134 /// assert!(x.predeploy_job().is_none());
14135 /// assert!(x.create_child_rollout_job().is_none());
14136 /// assert!(x.advance_child_rollout_job().is_none());
14137 /// ```
14138 pub fn set_postdeploy_job<
14139 T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
14140 >(
14141 mut self,
14142 v: T,
14143 ) -> Self {
14144 self.job_type =
14145 std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
14146 self
14147 }
14148
14149 /// The value of [job_type][crate::model::Job::job_type]
14150 /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
14151 /// holds a different branch.
14152 pub fn create_child_rollout_job(
14153 &self,
14154 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
14155 #[allow(unreachable_patterns)]
14156 self.job_type.as_ref().and_then(|v| match v {
14157 crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
14158 _ => std::option::Option::None,
14159 })
14160 }
14161
14162 /// Sets the value of [job_type][crate::model::Job::job_type]
14163 /// to hold a `CreateChildRolloutJob`.
14164 ///
14165 /// Note that all the setters affecting `job_type` are
14166 /// mutually exclusive.
14167 ///
14168 /// # Example
14169 /// ```ignore,no_run
14170 /// # use google_cloud_deploy_v1::model::Job;
14171 /// use google_cloud_deploy_v1::model::CreateChildRolloutJob;
14172 /// let x = Job::new().set_create_child_rollout_job(CreateChildRolloutJob::default()/* use setters */);
14173 /// assert!(x.create_child_rollout_job().is_some());
14174 /// assert!(x.deploy_job().is_none());
14175 /// assert!(x.verify_job().is_none());
14176 /// assert!(x.predeploy_job().is_none());
14177 /// assert!(x.postdeploy_job().is_none());
14178 /// assert!(x.advance_child_rollout_job().is_none());
14179 /// ```
14180 pub fn set_create_child_rollout_job<
14181 T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
14182 >(
14183 mut self,
14184 v: T,
14185 ) -> Self {
14186 self.job_type =
14187 std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
14188 self
14189 }
14190
14191 /// The value of [job_type][crate::model::Job::job_type]
14192 /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
14193 /// holds a different branch.
14194 pub fn advance_child_rollout_job(
14195 &self,
14196 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
14197 #[allow(unreachable_patterns)]
14198 self.job_type.as_ref().and_then(|v| match v {
14199 crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
14200 _ => std::option::Option::None,
14201 })
14202 }
14203
14204 /// Sets the value of [job_type][crate::model::Job::job_type]
14205 /// to hold a `AdvanceChildRolloutJob`.
14206 ///
14207 /// Note that all the setters affecting `job_type` are
14208 /// mutually exclusive.
14209 ///
14210 /// # Example
14211 /// ```ignore,no_run
14212 /// # use google_cloud_deploy_v1::model::Job;
14213 /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJob;
14214 /// let x = Job::new().set_advance_child_rollout_job(AdvanceChildRolloutJob::default()/* use setters */);
14215 /// assert!(x.advance_child_rollout_job().is_some());
14216 /// assert!(x.deploy_job().is_none());
14217 /// assert!(x.verify_job().is_none());
14218 /// assert!(x.predeploy_job().is_none());
14219 /// assert!(x.postdeploy_job().is_none());
14220 /// assert!(x.create_child_rollout_job().is_none());
14221 /// ```
14222 pub fn set_advance_child_rollout_job<
14223 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
14224 >(
14225 mut self,
14226 v: T,
14227 ) -> Self {
14228 self.job_type =
14229 std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
14230 self
14231 }
14232}
14233
14234impl wkt::message::Message for Job {
14235 fn typename() -> &'static str {
14236 "type.googleapis.com/google.cloud.deploy.v1.Job"
14237 }
14238}
14239
14240/// Defines additional types related to [Job].
14241pub mod job {
14242 #[allow(unused_imports)]
14243 use super::*;
14244
14245 /// Valid states of a Job.
14246 ///
14247 /// # Working with unknown values
14248 ///
14249 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14250 /// additional enum variants at any time. Adding new variants is not considered
14251 /// a breaking change. Applications should write their code in anticipation of:
14252 ///
14253 /// - New values appearing in future releases of the client library, **and**
14254 /// - New values received dynamically, without application changes.
14255 ///
14256 /// Please consult the [Working with enums] section in the user guide for some
14257 /// guidelines.
14258 ///
14259 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14260 #[derive(Clone, Debug, PartialEq)]
14261 #[non_exhaustive]
14262 pub enum State {
14263 /// The Job has an unspecified state.
14264 Unspecified,
14265 /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
14266 Pending,
14267 /// The Job is disabled.
14268 Disabled,
14269 /// The Job is in progress.
14270 InProgress,
14271 /// The Job succeeded.
14272 Succeeded,
14273 /// The Job failed.
14274 Failed,
14275 /// The Job was aborted.
14276 Aborted,
14277 /// The Job was skipped.
14278 Skipped,
14279 /// The Job was ignored.
14280 Ignored,
14281 /// If set, the enum was initialized with an unknown value.
14282 ///
14283 /// Applications can examine the value using [State::value] or
14284 /// [State::name].
14285 UnknownValue(state::UnknownValue),
14286 }
14287
14288 #[doc(hidden)]
14289 pub mod state {
14290 #[allow(unused_imports)]
14291 use super::*;
14292 #[derive(Clone, Debug, PartialEq)]
14293 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14294 }
14295
14296 impl State {
14297 /// Gets the enum value.
14298 ///
14299 /// Returns `None` if the enum contains an unknown value deserialized from
14300 /// the string representation of enums.
14301 pub fn value(&self) -> std::option::Option<i32> {
14302 match self {
14303 Self::Unspecified => std::option::Option::Some(0),
14304 Self::Pending => std::option::Option::Some(1),
14305 Self::Disabled => std::option::Option::Some(2),
14306 Self::InProgress => std::option::Option::Some(3),
14307 Self::Succeeded => std::option::Option::Some(4),
14308 Self::Failed => std::option::Option::Some(5),
14309 Self::Aborted => std::option::Option::Some(6),
14310 Self::Skipped => std::option::Option::Some(7),
14311 Self::Ignored => std::option::Option::Some(8),
14312 Self::UnknownValue(u) => u.0.value(),
14313 }
14314 }
14315
14316 /// Gets the enum value as a string.
14317 ///
14318 /// Returns `None` if the enum contains an unknown value deserialized from
14319 /// the integer representation of enums.
14320 pub fn name(&self) -> std::option::Option<&str> {
14321 match self {
14322 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14323 Self::Pending => std::option::Option::Some("PENDING"),
14324 Self::Disabled => std::option::Option::Some("DISABLED"),
14325 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
14326 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14327 Self::Failed => std::option::Option::Some("FAILED"),
14328 Self::Aborted => std::option::Option::Some("ABORTED"),
14329 Self::Skipped => std::option::Option::Some("SKIPPED"),
14330 Self::Ignored => std::option::Option::Some("IGNORED"),
14331 Self::UnknownValue(u) => u.0.name(),
14332 }
14333 }
14334 }
14335
14336 impl std::default::Default for State {
14337 fn default() -> Self {
14338 use std::convert::From;
14339 Self::from(0)
14340 }
14341 }
14342
14343 impl std::fmt::Display for State {
14344 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14345 wkt::internal::display_enum(f, self.name(), self.value())
14346 }
14347 }
14348
14349 impl std::convert::From<i32> for State {
14350 fn from(value: i32) -> Self {
14351 match value {
14352 0 => Self::Unspecified,
14353 1 => Self::Pending,
14354 2 => Self::Disabled,
14355 3 => Self::InProgress,
14356 4 => Self::Succeeded,
14357 5 => Self::Failed,
14358 6 => Self::Aborted,
14359 7 => Self::Skipped,
14360 8 => Self::Ignored,
14361 _ => Self::UnknownValue(state::UnknownValue(
14362 wkt::internal::UnknownEnumValue::Integer(value),
14363 )),
14364 }
14365 }
14366 }
14367
14368 impl std::convert::From<&str> for State {
14369 fn from(value: &str) -> Self {
14370 use std::string::ToString;
14371 match value {
14372 "STATE_UNSPECIFIED" => Self::Unspecified,
14373 "PENDING" => Self::Pending,
14374 "DISABLED" => Self::Disabled,
14375 "IN_PROGRESS" => Self::InProgress,
14376 "SUCCEEDED" => Self::Succeeded,
14377 "FAILED" => Self::Failed,
14378 "ABORTED" => Self::Aborted,
14379 "SKIPPED" => Self::Skipped,
14380 "IGNORED" => Self::Ignored,
14381 _ => Self::UnknownValue(state::UnknownValue(
14382 wkt::internal::UnknownEnumValue::String(value.to_string()),
14383 )),
14384 }
14385 }
14386 }
14387
14388 impl serde::ser::Serialize for State {
14389 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14390 where
14391 S: serde::Serializer,
14392 {
14393 match self {
14394 Self::Unspecified => serializer.serialize_i32(0),
14395 Self::Pending => serializer.serialize_i32(1),
14396 Self::Disabled => serializer.serialize_i32(2),
14397 Self::InProgress => serializer.serialize_i32(3),
14398 Self::Succeeded => serializer.serialize_i32(4),
14399 Self::Failed => serializer.serialize_i32(5),
14400 Self::Aborted => serializer.serialize_i32(6),
14401 Self::Skipped => serializer.serialize_i32(7),
14402 Self::Ignored => serializer.serialize_i32(8),
14403 Self::UnknownValue(u) => u.0.serialize(serializer),
14404 }
14405 }
14406 }
14407
14408 impl<'de> serde::de::Deserialize<'de> for State {
14409 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14410 where
14411 D: serde::Deserializer<'de>,
14412 {
14413 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14414 ".google.cloud.deploy.v1.Job.State",
14415 ))
14416 }
14417 }
14418
14419 /// The type of Job.
14420 #[derive(Clone, Debug, PartialEq)]
14421 #[non_exhaustive]
14422 pub enum JobType {
14423 /// Output only. A deploy Job.
14424 DeployJob(std::boxed::Box<crate::model::DeployJob>),
14425 /// Output only. A verify Job.
14426 VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
14427 /// Output only. A predeploy Job.
14428 PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
14429 /// Output only. A postdeploy Job.
14430 PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
14431 /// Output only. A createChildRollout Job.
14432 CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
14433 /// Output only. An advanceChildRollout Job.
14434 AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
14435 }
14436}
14437
14438/// A deploy Job.
14439#[derive(Clone, Default, PartialEq)]
14440#[non_exhaustive]
14441pub struct DeployJob {
14442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14443}
14444
14445impl DeployJob {
14446 pub fn new() -> Self {
14447 std::default::Default::default()
14448 }
14449}
14450
14451impl wkt::message::Message for DeployJob {
14452 fn typename() -> &'static str {
14453 "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
14454 }
14455}
14456
14457/// A verify Job.
14458#[derive(Clone, Default, PartialEq)]
14459#[non_exhaustive]
14460pub struct VerifyJob {
14461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14462}
14463
14464impl VerifyJob {
14465 pub fn new() -> Self {
14466 std::default::Default::default()
14467 }
14468}
14469
14470impl wkt::message::Message for VerifyJob {
14471 fn typename() -> &'static str {
14472 "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
14473 }
14474}
14475
14476/// A predeploy Job.
14477#[derive(Clone, Default, PartialEq)]
14478#[non_exhaustive]
14479pub struct PredeployJob {
14480 /// Output only. The custom actions that the predeploy Job executes.
14481 pub actions: std::vec::Vec<std::string::String>,
14482
14483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14484}
14485
14486impl PredeployJob {
14487 pub fn new() -> Self {
14488 std::default::Default::default()
14489 }
14490
14491 /// Sets the value of [actions][crate::model::PredeployJob::actions].
14492 ///
14493 /// # Example
14494 /// ```ignore,no_run
14495 /// # use google_cloud_deploy_v1::model::PredeployJob;
14496 /// let x = PredeployJob::new().set_actions(["a", "b", "c"]);
14497 /// ```
14498 pub fn set_actions<T, V>(mut self, v: T) -> Self
14499 where
14500 T: std::iter::IntoIterator<Item = V>,
14501 V: std::convert::Into<std::string::String>,
14502 {
14503 use std::iter::Iterator;
14504 self.actions = v.into_iter().map(|i| i.into()).collect();
14505 self
14506 }
14507}
14508
14509impl wkt::message::Message for PredeployJob {
14510 fn typename() -> &'static str {
14511 "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
14512 }
14513}
14514
14515/// A postdeploy Job.
14516#[derive(Clone, Default, PartialEq)]
14517#[non_exhaustive]
14518pub struct PostdeployJob {
14519 /// Output only. The custom actions that the postdeploy Job executes.
14520 pub actions: std::vec::Vec<std::string::String>,
14521
14522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14523}
14524
14525impl PostdeployJob {
14526 pub fn new() -> Self {
14527 std::default::Default::default()
14528 }
14529
14530 /// Sets the value of [actions][crate::model::PostdeployJob::actions].
14531 ///
14532 /// # Example
14533 /// ```ignore,no_run
14534 /// # use google_cloud_deploy_v1::model::PostdeployJob;
14535 /// let x = PostdeployJob::new().set_actions(["a", "b", "c"]);
14536 /// ```
14537 pub fn set_actions<T, V>(mut self, v: T) -> Self
14538 where
14539 T: std::iter::IntoIterator<Item = V>,
14540 V: std::convert::Into<std::string::String>,
14541 {
14542 use std::iter::Iterator;
14543 self.actions = v.into_iter().map(|i| i.into()).collect();
14544 self
14545 }
14546}
14547
14548impl wkt::message::Message for PostdeployJob {
14549 fn typename() -> &'static str {
14550 "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
14551 }
14552}
14553
14554/// A createChildRollout Job.
14555#[derive(Clone, Default, PartialEq)]
14556#[non_exhaustive]
14557pub struct CreateChildRolloutJob {
14558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14559}
14560
14561impl CreateChildRolloutJob {
14562 pub fn new() -> Self {
14563 std::default::Default::default()
14564 }
14565}
14566
14567impl wkt::message::Message for CreateChildRolloutJob {
14568 fn typename() -> &'static str {
14569 "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
14570 }
14571}
14572
14573/// An advanceChildRollout Job.
14574#[derive(Clone, Default, PartialEq)]
14575#[non_exhaustive]
14576pub struct AdvanceChildRolloutJob {
14577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14578}
14579
14580impl AdvanceChildRolloutJob {
14581 pub fn new() -> Self {
14582 std::default::Default::default()
14583 }
14584}
14585
14586impl wkt::message::Message for AdvanceChildRolloutJob {
14587 fn typename() -> &'static str {
14588 "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
14589 }
14590}
14591
14592/// ListRolloutsRequest is the request object used by `ListRollouts`.
14593#[derive(Clone, Default, PartialEq)]
14594#[non_exhaustive]
14595pub struct ListRolloutsRequest {
14596 /// Required. The `Release` which owns this collection of `Rollout` objects.
14597 pub parent: std::string::String,
14598
14599 /// Optional. The maximum number of `Rollout` objects to return. The service
14600 /// may return fewer than this value. If unspecified, at most 50 `Rollout`
14601 /// objects will be returned. The maximum value is 1000; values above 1000 will
14602 /// be set to 1000.
14603 pub page_size: i32,
14604
14605 /// Optional. A page token, received from a previous `ListRollouts` call.
14606 /// Provide this to retrieve the subsequent page.
14607 ///
14608 /// When paginating, all other provided parameters match
14609 /// the call that provided the page token.
14610 pub page_token: std::string::String,
14611
14612 /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
14613 /// for more details.
14614 pub filter: std::string::String,
14615
14616 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
14617 /// more details.
14618 pub order_by: std::string::String,
14619
14620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14621}
14622
14623impl ListRolloutsRequest {
14624 pub fn new() -> Self {
14625 std::default::Default::default()
14626 }
14627
14628 /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
14629 ///
14630 /// # Example
14631 /// ```ignore,no_run
14632 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14633 /// let x = ListRolloutsRequest::new().set_parent("example");
14634 /// ```
14635 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14636 self.parent = v.into();
14637 self
14638 }
14639
14640 /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
14641 ///
14642 /// # Example
14643 /// ```ignore,no_run
14644 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14645 /// let x = ListRolloutsRequest::new().set_page_size(42);
14646 /// ```
14647 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14648 self.page_size = v.into();
14649 self
14650 }
14651
14652 /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
14653 ///
14654 /// # Example
14655 /// ```ignore,no_run
14656 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14657 /// let x = ListRolloutsRequest::new().set_page_token("example");
14658 /// ```
14659 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14660 self.page_token = v.into();
14661 self
14662 }
14663
14664 /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
14665 ///
14666 /// # Example
14667 /// ```ignore,no_run
14668 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14669 /// let x = ListRolloutsRequest::new().set_filter("example");
14670 /// ```
14671 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14672 self.filter = v.into();
14673 self
14674 }
14675
14676 /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
14677 ///
14678 /// # Example
14679 /// ```ignore,no_run
14680 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14681 /// let x = ListRolloutsRequest::new().set_order_by("example");
14682 /// ```
14683 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14684 self.order_by = v.into();
14685 self
14686 }
14687}
14688
14689impl wkt::message::Message for ListRolloutsRequest {
14690 fn typename() -> &'static str {
14691 "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
14692 }
14693}
14694
14695/// ListRolloutsResponse is the response object returned by `ListRollouts`.
14696#[derive(Clone, Default, PartialEq)]
14697#[non_exhaustive]
14698pub struct ListRolloutsResponse {
14699 /// The `Rollout` objects.
14700 pub rollouts: std::vec::Vec<crate::model::Rollout>,
14701
14702 /// A token, which can be sent as `page_token` to retrieve the next page.
14703 /// If this field is omitted, there are no subsequent pages.
14704 pub next_page_token: std::string::String,
14705
14706 /// Locations that could not be reached.
14707 pub unreachable: std::vec::Vec<std::string::String>,
14708
14709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14710}
14711
14712impl ListRolloutsResponse {
14713 pub fn new() -> Self {
14714 std::default::Default::default()
14715 }
14716
14717 /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
14718 ///
14719 /// # Example
14720 /// ```ignore,no_run
14721 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14722 /// use google_cloud_deploy_v1::model::Rollout;
14723 /// let x = ListRolloutsResponse::new()
14724 /// .set_rollouts([
14725 /// Rollout::default()/* use setters */,
14726 /// Rollout::default()/* use (different) setters */,
14727 /// ]);
14728 /// ```
14729 pub fn set_rollouts<T, V>(mut self, v: T) -> Self
14730 where
14731 T: std::iter::IntoIterator<Item = V>,
14732 V: std::convert::Into<crate::model::Rollout>,
14733 {
14734 use std::iter::Iterator;
14735 self.rollouts = v.into_iter().map(|i| i.into()).collect();
14736 self
14737 }
14738
14739 /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
14740 ///
14741 /// # Example
14742 /// ```ignore,no_run
14743 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14744 /// let x = ListRolloutsResponse::new().set_next_page_token("example");
14745 /// ```
14746 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14747 self.next_page_token = v.into();
14748 self
14749 }
14750
14751 /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
14752 ///
14753 /// # Example
14754 /// ```ignore,no_run
14755 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14756 /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
14757 /// ```
14758 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14759 where
14760 T: std::iter::IntoIterator<Item = V>,
14761 V: std::convert::Into<std::string::String>,
14762 {
14763 use std::iter::Iterator;
14764 self.unreachable = v.into_iter().map(|i| i.into()).collect();
14765 self
14766 }
14767}
14768
14769impl wkt::message::Message for ListRolloutsResponse {
14770 fn typename() -> &'static str {
14771 "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
14772 }
14773}
14774
14775#[doc(hidden)]
14776impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
14777 type PageItem = crate::model::Rollout;
14778
14779 fn items(self) -> std::vec::Vec<Self::PageItem> {
14780 self.rollouts
14781 }
14782
14783 fn next_page_token(&self) -> std::string::String {
14784 use std::clone::Clone;
14785 self.next_page_token.clone()
14786 }
14787}
14788
14789/// GetRolloutRequest is the request object used by `GetRollout`.
14790#[derive(Clone, Default, PartialEq)]
14791#[non_exhaustive]
14792pub struct GetRolloutRequest {
14793 /// Required. Name of the `Rollout`. Format must be
14794 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
14795 pub name: std::string::String,
14796
14797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14798}
14799
14800impl GetRolloutRequest {
14801 pub fn new() -> Self {
14802 std::default::Default::default()
14803 }
14804
14805 /// Sets the value of [name][crate::model::GetRolloutRequest::name].
14806 ///
14807 /// # Example
14808 /// ```ignore,no_run
14809 /// # use google_cloud_deploy_v1::model::GetRolloutRequest;
14810 /// let x = GetRolloutRequest::new().set_name("example");
14811 /// ```
14812 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14813 self.name = v.into();
14814 self
14815 }
14816}
14817
14818impl wkt::message::Message for GetRolloutRequest {
14819 fn typename() -> &'static str {
14820 "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
14821 }
14822}
14823
14824/// CreateRolloutRequest is the request object used by `CreateRollout`.
14825#[derive(Clone, Default, PartialEq)]
14826#[non_exhaustive]
14827pub struct CreateRolloutRequest {
14828 /// Required. The parent collection in which the `Rollout` must be created.
14829 /// The format is
14830 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
14831 pub parent: std::string::String,
14832
14833 /// Required. ID of the `Rollout`.
14834 pub rollout_id: std::string::String,
14835
14836 /// Required. The `Rollout` to create.
14837 pub rollout: std::option::Option<crate::model::Rollout>,
14838
14839 /// Optional. A request ID to identify requests. Specify a unique request ID
14840 /// so that if you must retry your request, the server knows to ignore the
14841 /// request if it has already been completed. The server guarantees that for
14842 /// at least 60 minutes after the first request.
14843 ///
14844 /// For example, consider a situation where you make an initial request and the
14845 /// request times out. If you make the request again with the same request ID,
14846 /// the server can check if original operation with the same request ID was
14847 /// received, and if so, will ignore the second request. This prevents clients
14848 /// from accidentally creating duplicate commitments.
14849 ///
14850 /// The request ID must be a valid UUID with the exception that zero UUID is
14851 /// not supported (00000000-0000-0000-0000-000000000000).
14852 pub request_id: std::string::String,
14853
14854 /// Optional. If set to true, the request is validated and the user is provided
14855 /// with an expected result, but no actual change is made.
14856 pub validate_only: bool,
14857
14858 /// Optional. Deploy policies to override. Format is
14859 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
14860 pub override_deploy_policy: std::vec::Vec<std::string::String>,
14861
14862 /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
14863 /// will start at the first phase.
14864 pub starting_phase_id: std::string::String,
14865
14866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14867}
14868
14869impl CreateRolloutRequest {
14870 pub fn new() -> Self {
14871 std::default::Default::default()
14872 }
14873
14874 /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
14875 ///
14876 /// # Example
14877 /// ```ignore,no_run
14878 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14879 /// let x = CreateRolloutRequest::new().set_parent("example");
14880 /// ```
14881 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14882 self.parent = v.into();
14883 self
14884 }
14885
14886 /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
14887 ///
14888 /// # Example
14889 /// ```ignore,no_run
14890 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14891 /// let x = CreateRolloutRequest::new().set_rollout_id("example");
14892 /// ```
14893 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14894 self.rollout_id = v.into();
14895 self
14896 }
14897
14898 /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
14899 ///
14900 /// # Example
14901 /// ```ignore,no_run
14902 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14903 /// use google_cloud_deploy_v1::model::Rollout;
14904 /// let x = CreateRolloutRequest::new().set_rollout(Rollout::default()/* use setters */);
14905 /// ```
14906 pub fn set_rollout<T>(mut self, v: T) -> Self
14907 where
14908 T: std::convert::Into<crate::model::Rollout>,
14909 {
14910 self.rollout = std::option::Option::Some(v.into());
14911 self
14912 }
14913
14914 /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
14915 ///
14916 /// # Example
14917 /// ```ignore,no_run
14918 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14919 /// use google_cloud_deploy_v1::model::Rollout;
14920 /// let x = CreateRolloutRequest::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
14921 /// let x = CreateRolloutRequest::new().set_or_clear_rollout(None::<Rollout>);
14922 /// ```
14923 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
14924 where
14925 T: std::convert::Into<crate::model::Rollout>,
14926 {
14927 self.rollout = v.map(|x| x.into());
14928 self
14929 }
14930
14931 /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
14932 ///
14933 /// # Example
14934 /// ```ignore,no_run
14935 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14936 /// let x = CreateRolloutRequest::new().set_request_id("example");
14937 /// ```
14938 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14939 self.request_id = v.into();
14940 self
14941 }
14942
14943 /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
14944 ///
14945 /// # Example
14946 /// ```ignore,no_run
14947 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14948 /// let x = CreateRolloutRequest::new().set_validate_only(true);
14949 /// ```
14950 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14951 self.validate_only = v.into();
14952 self
14953 }
14954
14955 /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
14956 ///
14957 /// # Example
14958 /// ```ignore,no_run
14959 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14960 /// let x = CreateRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
14961 /// ```
14962 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
14963 where
14964 T: std::iter::IntoIterator<Item = V>,
14965 V: std::convert::Into<std::string::String>,
14966 {
14967 use std::iter::Iterator;
14968 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
14969 self
14970 }
14971
14972 /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
14973 ///
14974 /// # Example
14975 /// ```ignore,no_run
14976 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14977 /// let x = CreateRolloutRequest::new().set_starting_phase_id("example");
14978 /// ```
14979 pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
14980 mut self,
14981 v: T,
14982 ) -> Self {
14983 self.starting_phase_id = v.into();
14984 self
14985 }
14986}
14987
14988impl wkt::message::Message for CreateRolloutRequest {
14989 fn typename() -> &'static str {
14990 "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
14991 }
14992}
14993
14994/// Represents the metadata of the long-running operation.
14995#[derive(Clone, Default, PartialEq)]
14996#[non_exhaustive]
14997pub struct OperationMetadata {
14998 /// Output only. The time the operation was created.
14999 pub create_time: std::option::Option<wkt::Timestamp>,
15000
15001 /// Output only. The time the operation finished running.
15002 pub end_time: std::option::Option<wkt::Timestamp>,
15003
15004 /// Output only. Server-defined resource path for the target of the operation.
15005 pub target: std::string::String,
15006
15007 /// Output only. Name of the verb executed by the operation.
15008 pub verb: std::string::String,
15009
15010 /// Output only. Human-readable status of the operation, if any.
15011 pub status_message: std::string::String,
15012
15013 /// Output only. Identifies whether the user has requested cancellation
15014 /// of the operation. Operations that have successfully been cancelled
15015 /// have
15016 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
15017 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
15018 /// corresponding to `Code.CANCELLED`.
15019 ///
15020 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
15021 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
15022 pub requested_cancellation: bool,
15023
15024 /// Output only. API version used to start the operation.
15025 pub api_version: std::string::String,
15026
15027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15028}
15029
15030impl OperationMetadata {
15031 pub fn new() -> Self {
15032 std::default::Default::default()
15033 }
15034
15035 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
15036 ///
15037 /// # Example
15038 /// ```ignore,no_run
15039 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15040 /// use wkt::Timestamp;
15041 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15042 /// ```
15043 pub fn set_create_time<T>(mut self, v: T) -> Self
15044 where
15045 T: std::convert::Into<wkt::Timestamp>,
15046 {
15047 self.create_time = std::option::Option::Some(v.into());
15048 self
15049 }
15050
15051 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
15052 ///
15053 /// # Example
15054 /// ```ignore,no_run
15055 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15056 /// use wkt::Timestamp;
15057 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15058 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15059 /// ```
15060 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15061 where
15062 T: std::convert::Into<wkt::Timestamp>,
15063 {
15064 self.create_time = v.map(|x| x.into());
15065 self
15066 }
15067
15068 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
15069 ///
15070 /// # Example
15071 /// ```ignore,no_run
15072 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15073 /// use wkt::Timestamp;
15074 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15075 /// ```
15076 pub fn set_end_time<T>(mut self, v: T) -> Self
15077 where
15078 T: std::convert::Into<wkt::Timestamp>,
15079 {
15080 self.end_time = std::option::Option::Some(v.into());
15081 self
15082 }
15083
15084 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
15085 ///
15086 /// # Example
15087 /// ```ignore,no_run
15088 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15089 /// use wkt::Timestamp;
15090 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15091 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15092 /// ```
15093 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15094 where
15095 T: std::convert::Into<wkt::Timestamp>,
15096 {
15097 self.end_time = v.map(|x| x.into());
15098 self
15099 }
15100
15101 /// Sets the value of [target][crate::model::OperationMetadata::target].
15102 ///
15103 /// # Example
15104 /// ```ignore,no_run
15105 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15106 /// let x = OperationMetadata::new().set_target("example");
15107 /// ```
15108 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15109 self.target = v.into();
15110 self
15111 }
15112
15113 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
15114 ///
15115 /// # Example
15116 /// ```ignore,no_run
15117 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15118 /// let x = OperationMetadata::new().set_verb("example");
15119 /// ```
15120 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15121 self.verb = v.into();
15122 self
15123 }
15124
15125 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
15126 ///
15127 /// # Example
15128 /// ```ignore,no_run
15129 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15130 /// let x = OperationMetadata::new().set_status_message("example");
15131 /// ```
15132 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15133 self.status_message = v.into();
15134 self
15135 }
15136
15137 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
15138 ///
15139 /// # Example
15140 /// ```ignore,no_run
15141 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15142 /// let x = OperationMetadata::new().set_requested_cancellation(true);
15143 /// ```
15144 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15145 self.requested_cancellation = v.into();
15146 self
15147 }
15148
15149 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
15150 ///
15151 /// # Example
15152 /// ```ignore,no_run
15153 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15154 /// let x = OperationMetadata::new().set_api_version("example");
15155 /// ```
15156 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15157 self.api_version = v.into();
15158 self
15159 }
15160}
15161
15162impl wkt::message::Message for OperationMetadata {
15163 fn typename() -> &'static str {
15164 "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
15165 }
15166}
15167
15168/// The request object used by `ApproveRollout`.
15169#[derive(Clone, Default, PartialEq)]
15170#[non_exhaustive]
15171pub struct ApproveRolloutRequest {
15172 /// Required. Name of the Rollout. Format is
15173 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15174 pub name: std::string::String,
15175
15176 /// Required. True = approve; false = reject
15177 pub approved: bool,
15178
15179 /// Optional. Deploy policies to override. Format is
15180 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15181 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15182
15183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15184}
15185
15186impl ApproveRolloutRequest {
15187 pub fn new() -> Self {
15188 std::default::Default::default()
15189 }
15190
15191 /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
15192 ///
15193 /// # Example
15194 /// ```ignore,no_run
15195 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15196 /// let x = ApproveRolloutRequest::new().set_name("example");
15197 /// ```
15198 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15199 self.name = v.into();
15200 self
15201 }
15202
15203 /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
15204 ///
15205 /// # Example
15206 /// ```ignore,no_run
15207 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15208 /// let x = ApproveRolloutRequest::new().set_approved(true);
15209 /// ```
15210 pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15211 self.approved = v.into();
15212 self
15213 }
15214
15215 /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
15216 ///
15217 /// # Example
15218 /// ```ignore,no_run
15219 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15220 /// let x = ApproveRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15221 /// ```
15222 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15223 where
15224 T: std::iter::IntoIterator<Item = V>,
15225 V: std::convert::Into<std::string::String>,
15226 {
15227 use std::iter::Iterator;
15228 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15229 self
15230 }
15231}
15232
15233impl wkt::message::Message for ApproveRolloutRequest {
15234 fn typename() -> &'static str {
15235 "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
15236 }
15237}
15238
15239/// The response object from `ApproveRollout`.
15240#[derive(Clone, Default, PartialEq)]
15241#[non_exhaustive]
15242pub struct ApproveRolloutResponse {
15243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15244}
15245
15246impl ApproveRolloutResponse {
15247 pub fn new() -> Self {
15248 std::default::Default::default()
15249 }
15250}
15251
15252impl wkt::message::Message for ApproveRolloutResponse {
15253 fn typename() -> &'static str {
15254 "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
15255 }
15256}
15257
15258/// The request object used by `AdvanceRollout`.
15259#[derive(Clone, Default, PartialEq)]
15260#[non_exhaustive]
15261pub struct AdvanceRolloutRequest {
15262 /// Required. Name of the Rollout. Format is
15263 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15264 pub name: std::string::String,
15265
15266 /// Required. The phase ID to advance the `Rollout` to.
15267 pub phase_id: std::string::String,
15268
15269 /// Optional. Deploy policies to override. Format is
15270 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15271 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15272
15273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15274}
15275
15276impl AdvanceRolloutRequest {
15277 pub fn new() -> Self {
15278 std::default::Default::default()
15279 }
15280
15281 /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
15282 ///
15283 /// # Example
15284 /// ```ignore,no_run
15285 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15286 /// let x = AdvanceRolloutRequest::new().set_name("example");
15287 /// ```
15288 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15289 self.name = v.into();
15290 self
15291 }
15292
15293 /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
15294 ///
15295 /// # Example
15296 /// ```ignore,no_run
15297 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15298 /// let x = AdvanceRolloutRequest::new().set_phase_id("example");
15299 /// ```
15300 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15301 self.phase_id = v.into();
15302 self
15303 }
15304
15305 /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
15306 ///
15307 /// # Example
15308 /// ```ignore,no_run
15309 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15310 /// let x = AdvanceRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15311 /// ```
15312 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15313 where
15314 T: std::iter::IntoIterator<Item = V>,
15315 V: std::convert::Into<std::string::String>,
15316 {
15317 use std::iter::Iterator;
15318 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15319 self
15320 }
15321}
15322
15323impl wkt::message::Message for AdvanceRolloutRequest {
15324 fn typename() -> &'static str {
15325 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
15326 }
15327}
15328
15329/// The response object from `AdvanceRollout`.
15330#[derive(Clone, Default, PartialEq)]
15331#[non_exhaustive]
15332pub struct AdvanceRolloutResponse {
15333 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15334}
15335
15336impl AdvanceRolloutResponse {
15337 pub fn new() -> Self {
15338 std::default::Default::default()
15339 }
15340}
15341
15342impl wkt::message::Message for AdvanceRolloutResponse {
15343 fn typename() -> &'static str {
15344 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
15345 }
15346}
15347
15348/// The request object used by `CancelRollout`.
15349#[derive(Clone, Default, PartialEq)]
15350#[non_exhaustive]
15351pub struct CancelRolloutRequest {
15352 /// Required. Name of the Rollout. Format is
15353 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15354 pub name: std::string::String,
15355
15356 /// Optional. Deploy policies to override. Format is
15357 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15358 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15359
15360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15361}
15362
15363impl CancelRolloutRequest {
15364 pub fn new() -> Self {
15365 std::default::Default::default()
15366 }
15367
15368 /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
15369 ///
15370 /// # Example
15371 /// ```ignore,no_run
15372 /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15373 /// let x = CancelRolloutRequest::new().set_name("example");
15374 /// ```
15375 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15376 self.name = v.into();
15377 self
15378 }
15379
15380 /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
15381 ///
15382 /// # Example
15383 /// ```ignore,no_run
15384 /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15385 /// let x = CancelRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15386 /// ```
15387 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15388 where
15389 T: std::iter::IntoIterator<Item = V>,
15390 V: std::convert::Into<std::string::String>,
15391 {
15392 use std::iter::Iterator;
15393 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15394 self
15395 }
15396}
15397
15398impl wkt::message::Message for CancelRolloutRequest {
15399 fn typename() -> &'static str {
15400 "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
15401 }
15402}
15403
15404/// The response object from `CancelRollout`.
15405#[derive(Clone, Default, PartialEq)]
15406#[non_exhaustive]
15407pub struct CancelRolloutResponse {
15408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15409}
15410
15411impl CancelRolloutResponse {
15412 pub fn new() -> Self {
15413 std::default::Default::default()
15414 }
15415}
15416
15417impl wkt::message::Message for CancelRolloutResponse {
15418 fn typename() -> &'static str {
15419 "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
15420 }
15421}
15422
15423/// The request object used by `IgnoreJob`.
15424#[derive(Clone, Default, PartialEq)]
15425#[non_exhaustive]
15426pub struct IgnoreJobRequest {
15427 /// Required. Name of the Rollout. Format is
15428 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15429 pub rollout: std::string::String,
15430
15431 /// Required. The phase ID the Job to ignore belongs to.
15432 pub phase_id: std::string::String,
15433
15434 /// Required. The job ID for the Job to ignore.
15435 pub job_id: std::string::String,
15436
15437 /// Optional. Deploy policies to override. Format is
15438 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15439 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15440
15441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15442}
15443
15444impl IgnoreJobRequest {
15445 pub fn new() -> Self {
15446 std::default::Default::default()
15447 }
15448
15449 /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
15450 ///
15451 /// # Example
15452 /// ```ignore,no_run
15453 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15454 /// let x = IgnoreJobRequest::new().set_rollout("example");
15455 /// ```
15456 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15457 self.rollout = v.into();
15458 self
15459 }
15460
15461 /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
15462 ///
15463 /// # Example
15464 /// ```ignore,no_run
15465 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15466 /// let x = IgnoreJobRequest::new().set_phase_id("example");
15467 /// ```
15468 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15469 self.phase_id = v.into();
15470 self
15471 }
15472
15473 /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
15474 ///
15475 /// # Example
15476 /// ```ignore,no_run
15477 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15478 /// let x = IgnoreJobRequest::new().set_job_id("example");
15479 /// ```
15480 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15481 self.job_id = v.into();
15482 self
15483 }
15484
15485 /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
15486 ///
15487 /// # Example
15488 /// ```ignore,no_run
15489 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15490 /// let x = IgnoreJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15491 /// ```
15492 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15493 where
15494 T: std::iter::IntoIterator<Item = V>,
15495 V: std::convert::Into<std::string::String>,
15496 {
15497 use std::iter::Iterator;
15498 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15499 self
15500 }
15501}
15502
15503impl wkt::message::Message for IgnoreJobRequest {
15504 fn typename() -> &'static str {
15505 "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
15506 }
15507}
15508
15509/// The response object from `IgnoreJob`.
15510#[derive(Clone, Default, PartialEq)]
15511#[non_exhaustive]
15512pub struct IgnoreJobResponse {
15513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15514}
15515
15516impl IgnoreJobResponse {
15517 pub fn new() -> Self {
15518 std::default::Default::default()
15519 }
15520}
15521
15522impl wkt::message::Message for IgnoreJobResponse {
15523 fn typename() -> &'static str {
15524 "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
15525 }
15526}
15527
15528/// RetryJobRequest is the request object used by `RetryJob`.
15529#[derive(Clone, Default, PartialEq)]
15530#[non_exhaustive]
15531pub struct RetryJobRequest {
15532 /// Required. Name of the Rollout. Format is
15533 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15534 pub rollout: std::string::String,
15535
15536 /// Required. The phase ID the Job to retry belongs to.
15537 pub phase_id: std::string::String,
15538
15539 /// Required. The job ID for the Job to retry.
15540 pub job_id: std::string::String,
15541
15542 /// Optional. Deploy policies to override. Format is
15543 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15544 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15545
15546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15547}
15548
15549impl RetryJobRequest {
15550 pub fn new() -> Self {
15551 std::default::Default::default()
15552 }
15553
15554 /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
15555 ///
15556 /// # Example
15557 /// ```ignore,no_run
15558 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15559 /// let x = RetryJobRequest::new().set_rollout("example");
15560 /// ```
15561 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15562 self.rollout = v.into();
15563 self
15564 }
15565
15566 /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
15567 ///
15568 /// # Example
15569 /// ```ignore,no_run
15570 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15571 /// let x = RetryJobRequest::new().set_phase_id("example");
15572 /// ```
15573 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15574 self.phase_id = v.into();
15575 self
15576 }
15577
15578 /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
15579 ///
15580 /// # Example
15581 /// ```ignore,no_run
15582 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15583 /// let x = RetryJobRequest::new().set_job_id("example");
15584 /// ```
15585 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15586 self.job_id = v.into();
15587 self
15588 }
15589
15590 /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
15591 ///
15592 /// # Example
15593 /// ```ignore,no_run
15594 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15595 /// let x = RetryJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15596 /// ```
15597 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15598 where
15599 T: std::iter::IntoIterator<Item = V>,
15600 V: std::convert::Into<std::string::String>,
15601 {
15602 use std::iter::Iterator;
15603 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15604 self
15605 }
15606}
15607
15608impl wkt::message::Message for RetryJobRequest {
15609 fn typename() -> &'static str {
15610 "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
15611 }
15612}
15613
15614/// The response object from 'RetryJob'.
15615#[derive(Clone, Default, PartialEq)]
15616#[non_exhaustive]
15617pub struct RetryJobResponse {
15618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15619}
15620
15621impl RetryJobResponse {
15622 pub fn new() -> Self {
15623 std::default::Default::default()
15624 }
15625}
15626
15627impl wkt::message::Message for RetryJobResponse {
15628 fn typename() -> &'static str {
15629 "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
15630 }
15631}
15632
15633/// The request object used by `AbandonRelease`.
15634#[derive(Clone, Default, PartialEq)]
15635#[non_exhaustive]
15636pub struct AbandonReleaseRequest {
15637 /// Required. Name of the Release. Format is
15638 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
15639 pub name: std::string::String,
15640
15641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15642}
15643
15644impl AbandonReleaseRequest {
15645 pub fn new() -> Self {
15646 std::default::Default::default()
15647 }
15648
15649 /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
15650 ///
15651 /// # Example
15652 /// ```ignore,no_run
15653 /// # use google_cloud_deploy_v1::model::AbandonReleaseRequest;
15654 /// let x = AbandonReleaseRequest::new().set_name("example");
15655 /// ```
15656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15657 self.name = v.into();
15658 self
15659 }
15660}
15661
15662impl wkt::message::Message for AbandonReleaseRequest {
15663 fn typename() -> &'static str {
15664 "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
15665 }
15666}
15667
15668/// The response object for `AbandonRelease`.
15669#[derive(Clone, Default, PartialEq)]
15670#[non_exhaustive]
15671pub struct AbandonReleaseResponse {
15672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15673}
15674
15675impl AbandonReleaseResponse {
15676 pub fn new() -> Self {
15677 std::default::Default::default()
15678 }
15679}
15680
15681impl wkt::message::Message for AbandonReleaseResponse {
15682 fn typename() -> &'static str {
15683 "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
15684 }
15685}
15686
15687/// A `JobRun` resource in the Cloud Deploy API.
15688///
15689/// A `JobRun` contains information of a single `Rollout` job evaluation.
15690#[derive(Clone, Default, PartialEq)]
15691#[non_exhaustive]
15692pub struct JobRun {
15693 /// Output only. Name of the `JobRun`. Format is
15694 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
15695 pub name: std::string::String,
15696
15697 /// Output only. Unique identifier of the `JobRun`.
15698 pub uid: std::string::String,
15699
15700 /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
15701 pub phase_id: std::string::String,
15702
15703 /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
15704 pub job_id: std::string::String,
15705
15706 /// Output only. Time at which the `JobRun` was created.
15707 pub create_time: std::option::Option<wkt::Timestamp>,
15708
15709 /// Output only. Time at which the `JobRun` was started.
15710 pub start_time: std::option::Option<wkt::Timestamp>,
15711
15712 /// Output only. Time at which the `JobRun` ended.
15713 pub end_time: std::option::Option<wkt::Timestamp>,
15714
15715 /// Output only. The current state of the `JobRun`.
15716 pub state: crate::model::job_run::State,
15717
15718 /// Output only. This checksum is computed by the server based on the value of
15719 /// other fields, and may be sent on update and delete requests to ensure the
15720 /// client has an up-to-date value before proceeding.
15721 pub etag: std::string::String,
15722
15723 /// The `JobRun` type and the information for that type.
15724 pub job_run: std::option::Option<crate::model::job_run::JobRun>,
15725
15726 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15727}
15728
15729impl JobRun {
15730 pub fn new() -> Self {
15731 std::default::Default::default()
15732 }
15733
15734 /// Sets the value of [name][crate::model::JobRun::name].
15735 ///
15736 /// # Example
15737 /// ```ignore,no_run
15738 /// # use google_cloud_deploy_v1::model::JobRun;
15739 /// let x = JobRun::new().set_name("example");
15740 /// ```
15741 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15742 self.name = v.into();
15743 self
15744 }
15745
15746 /// Sets the value of [uid][crate::model::JobRun::uid].
15747 ///
15748 /// # Example
15749 /// ```ignore,no_run
15750 /// # use google_cloud_deploy_v1::model::JobRun;
15751 /// let x = JobRun::new().set_uid("example");
15752 /// ```
15753 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15754 self.uid = v.into();
15755 self
15756 }
15757
15758 /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
15759 ///
15760 /// # Example
15761 /// ```ignore,no_run
15762 /// # use google_cloud_deploy_v1::model::JobRun;
15763 /// let x = JobRun::new().set_phase_id("example");
15764 /// ```
15765 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15766 self.phase_id = v.into();
15767 self
15768 }
15769
15770 /// Sets the value of [job_id][crate::model::JobRun::job_id].
15771 ///
15772 /// # Example
15773 /// ```ignore,no_run
15774 /// # use google_cloud_deploy_v1::model::JobRun;
15775 /// let x = JobRun::new().set_job_id("example");
15776 /// ```
15777 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15778 self.job_id = v.into();
15779 self
15780 }
15781
15782 /// Sets the value of [create_time][crate::model::JobRun::create_time].
15783 ///
15784 /// # Example
15785 /// ```ignore,no_run
15786 /// # use google_cloud_deploy_v1::model::JobRun;
15787 /// use wkt::Timestamp;
15788 /// let x = JobRun::new().set_create_time(Timestamp::default()/* use setters */);
15789 /// ```
15790 pub fn set_create_time<T>(mut self, v: T) -> Self
15791 where
15792 T: std::convert::Into<wkt::Timestamp>,
15793 {
15794 self.create_time = std::option::Option::Some(v.into());
15795 self
15796 }
15797
15798 /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
15799 ///
15800 /// # Example
15801 /// ```ignore,no_run
15802 /// # use google_cloud_deploy_v1::model::JobRun;
15803 /// use wkt::Timestamp;
15804 /// let x = JobRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15805 /// let x = JobRun::new().set_or_clear_create_time(None::<Timestamp>);
15806 /// ```
15807 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15808 where
15809 T: std::convert::Into<wkt::Timestamp>,
15810 {
15811 self.create_time = v.map(|x| x.into());
15812 self
15813 }
15814
15815 /// Sets the value of [start_time][crate::model::JobRun::start_time].
15816 ///
15817 /// # Example
15818 /// ```ignore,no_run
15819 /// # use google_cloud_deploy_v1::model::JobRun;
15820 /// use wkt::Timestamp;
15821 /// let x = JobRun::new().set_start_time(Timestamp::default()/* use setters */);
15822 /// ```
15823 pub fn set_start_time<T>(mut self, v: T) -> Self
15824 where
15825 T: std::convert::Into<wkt::Timestamp>,
15826 {
15827 self.start_time = std::option::Option::Some(v.into());
15828 self
15829 }
15830
15831 /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
15832 ///
15833 /// # Example
15834 /// ```ignore,no_run
15835 /// # use google_cloud_deploy_v1::model::JobRun;
15836 /// use wkt::Timestamp;
15837 /// let x = JobRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
15838 /// let x = JobRun::new().set_or_clear_start_time(None::<Timestamp>);
15839 /// ```
15840 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15841 where
15842 T: std::convert::Into<wkt::Timestamp>,
15843 {
15844 self.start_time = v.map(|x| x.into());
15845 self
15846 }
15847
15848 /// Sets the value of [end_time][crate::model::JobRun::end_time].
15849 ///
15850 /// # Example
15851 /// ```ignore,no_run
15852 /// # use google_cloud_deploy_v1::model::JobRun;
15853 /// use wkt::Timestamp;
15854 /// let x = JobRun::new().set_end_time(Timestamp::default()/* use setters */);
15855 /// ```
15856 pub fn set_end_time<T>(mut self, v: T) -> Self
15857 where
15858 T: std::convert::Into<wkt::Timestamp>,
15859 {
15860 self.end_time = std::option::Option::Some(v.into());
15861 self
15862 }
15863
15864 /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
15865 ///
15866 /// # Example
15867 /// ```ignore,no_run
15868 /// # use google_cloud_deploy_v1::model::JobRun;
15869 /// use wkt::Timestamp;
15870 /// let x = JobRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15871 /// let x = JobRun::new().set_or_clear_end_time(None::<Timestamp>);
15872 /// ```
15873 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15874 where
15875 T: std::convert::Into<wkt::Timestamp>,
15876 {
15877 self.end_time = v.map(|x| x.into());
15878 self
15879 }
15880
15881 /// Sets the value of [state][crate::model::JobRun::state].
15882 ///
15883 /// # Example
15884 /// ```ignore,no_run
15885 /// # use google_cloud_deploy_v1::model::JobRun;
15886 /// use google_cloud_deploy_v1::model::job_run::State;
15887 /// let x0 = JobRun::new().set_state(State::InProgress);
15888 /// let x1 = JobRun::new().set_state(State::Succeeded);
15889 /// let x2 = JobRun::new().set_state(State::Failed);
15890 /// ```
15891 pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
15892 self.state = v.into();
15893 self
15894 }
15895
15896 /// Sets the value of [etag][crate::model::JobRun::etag].
15897 ///
15898 /// # Example
15899 /// ```ignore,no_run
15900 /// # use google_cloud_deploy_v1::model::JobRun;
15901 /// let x = JobRun::new().set_etag("example");
15902 /// ```
15903 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15904 self.etag = v.into();
15905 self
15906 }
15907
15908 /// Sets the value of [job_run][crate::model::JobRun::job_run].
15909 ///
15910 /// Note that all the setters affecting `job_run` are mutually
15911 /// exclusive.
15912 ///
15913 /// # Example
15914 /// ```ignore,no_run
15915 /// # use google_cloud_deploy_v1::model::JobRun;
15916 /// use google_cloud_deploy_v1::model::DeployJobRun;
15917 /// let x = JobRun::new().set_job_run(Some(
15918 /// google_cloud_deploy_v1::model::job_run::JobRun::DeployJobRun(DeployJobRun::default().into())));
15919 /// ```
15920 pub fn set_job_run<
15921 T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
15922 >(
15923 mut self,
15924 v: T,
15925 ) -> Self {
15926 self.job_run = v.into();
15927 self
15928 }
15929
15930 /// The value of [job_run][crate::model::JobRun::job_run]
15931 /// if it holds a `DeployJobRun`, `None` if the field is not set or
15932 /// holds a different branch.
15933 pub fn deploy_job_run(
15934 &self,
15935 ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
15936 #[allow(unreachable_patterns)]
15937 self.job_run.as_ref().and_then(|v| match v {
15938 crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
15939 _ => std::option::Option::None,
15940 })
15941 }
15942
15943 /// Sets the value of [job_run][crate::model::JobRun::job_run]
15944 /// to hold a `DeployJobRun`.
15945 ///
15946 /// Note that all the setters affecting `job_run` are
15947 /// mutually exclusive.
15948 ///
15949 /// # Example
15950 /// ```ignore,no_run
15951 /// # use google_cloud_deploy_v1::model::JobRun;
15952 /// use google_cloud_deploy_v1::model::DeployJobRun;
15953 /// let x = JobRun::new().set_deploy_job_run(DeployJobRun::default()/* use setters */);
15954 /// assert!(x.deploy_job_run().is_some());
15955 /// assert!(x.verify_job_run().is_none());
15956 /// assert!(x.predeploy_job_run().is_none());
15957 /// assert!(x.postdeploy_job_run().is_none());
15958 /// assert!(x.create_child_rollout_job_run().is_none());
15959 /// assert!(x.advance_child_rollout_job_run().is_none());
15960 /// ```
15961 pub fn set_deploy_job_run<
15962 T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
15963 >(
15964 mut self,
15965 v: T,
15966 ) -> Self {
15967 self.job_run =
15968 std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
15969 self
15970 }
15971
15972 /// The value of [job_run][crate::model::JobRun::job_run]
15973 /// if it holds a `VerifyJobRun`, `None` if the field is not set or
15974 /// holds a different branch.
15975 pub fn verify_job_run(
15976 &self,
15977 ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
15978 #[allow(unreachable_patterns)]
15979 self.job_run.as_ref().and_then(|v| match v {
15980 crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
15981 _ => std::option::Option::None,
15982 })
15983 }
15984
15985 /// Sets the value of [job_run][crate::model::JobRun::job_run]
15986 /// to hold a `VerifyJobRun`.
15987 ///
15988 /// Note that all the setters affecting `job_run` are
15989 /// mutually exclusive.
15990 ///
15991 /// # Example
15992 /// ```ignore,no_run
15993 /// # use google_cloud_deploy_v1::model::JobRun;
15994 /// use google_cloud_deploy_v1::model::VerifyJobRun;
15995 /// let x = JobRun::new().set_verify_job_run(VerifyJobRun::default()/* use setters */);
15996 /// assert!(x.verify_job_run().is_some());
15997 /// assert!(x.deploy_job_run().is_none());
15998 /// assert!(x.predeploy_job_run().is_none());
15999 /// assert!(x.postdeploy_job_run().is_none());
16000 /// assert!(x.create_child_rollout_job_run().is_none());
16001 /// assert!(x.advance_child_rollout_job_run().is_none());
16002 /// ```
16003 pub fn set_verify_job_run<
16004 T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
16005 >(
16006 mut self,
16007 v: T,
16008 ) -> Self {
16009 self.job_run =
16010 std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
16011 self
16012 }
16013
16014 /// The value of [job_run][crate::model::JobRun::job_run]
16015 /// if it holds a `PredeployJobRun`, `None` if the field is not set or
16016 /// holds a different branch.
16017 pub fn predeploy_job_run(
16018 &self,
16019 ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
16020 #[allow(unreachable_patterns)]
16021 self.job_run.as_ref().and_then(|v| match v {
16022 crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
16023 _ => std::option::Option::None,
16024 })
16025 }
16026
16027 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16028 /// to hold a `PredeployJobRun`.
16029 ///
16030 /// Note that all the setters affecting `job_run` are
16031 /// mutually exclusive.
16032 ///
16033 /// # Example
16034 /// ```ignore,no_run
16035 /// # use google_cloud_deploy_v1::model::JobRun;
16036 /// use google_cloud_deploy_v1::model::PredeployJobRun;
16037 /// let x = JobRun::new().set_predeploy_job_run(PredeployJobRun::default()/* use setters */);
16038 /// assert!(x.predeploy_job_run().is_some());
16039 /// assert!(x.deploy_job_run().is_none());
16040 /// assert!(x.verify_job_run().is_none());
16041 /// assert!(x.postdeploy_job_run().is_none());
16042 /// assert!(x.create_child_rollout_job_run().is_none());
16043 /// assert!(x.advance_child_rollout_job_run().is_none());
16044 /// ```
16045 pub fn set_predeploy_job_run<
16046 T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
16047 >(
16048 mut self,
16049 v: T,
16050 ) -> Self {
16051 self.job_run =
16052 std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
16053 self
16054 }
16055
16056 /// The value of [job_run][crate::model::JobRun::job_run]
16057 /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
16058 /// holds a different branch.
16059 pub fn postdeploy_job_run(
16060 &self,
16061 ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
16062 #[allow(unreachable_patterns)]
16063 self.job_run.as_ref().and_then(|v| match v {
16064 crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
16065 _ => std::option::Option::None,
16066 })
16067 }
16068
16069 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16070 /// to hold a `PostdeployJobRun`.
16071 ///
16072 /// Note that all the setters affecting `job_run` are
16073 /// mutually exclusive.
16074 ///
16075 /// # Example
16076 /// ```ignore,no_run
16077 /// # use google_cloud_deploy_v1::model::JobRun;
16078 /// use google_cloud_deploy_v1::model::PostdeployJobRun;
16079 /// let x = JobRun::new().set_postdeploy_job_run(PostdeployJobRun::default()/* use setters */);
16080 /// assert!(x.postdeploy_job_run().is_some());
16081 /// assert!(x.deploy_job_run().is_none());
16082 /// assert!(x.verify_job_run().is_none());
16083 /// assert!(x.predeploy_job_run().is_none());
16084 /// assert!(x.create_child_rollout_job_run().is_none());
16085 /// assert!(x.advance_child_rollout_job_run().is_none());
16086 /// ```
16087 pub fn set_postdeploy_job_run<
16088 T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
16089 >(
16090 mut self,
16091 v: T,
16092 ) -> Self {
16093 self.job_run =
16094 std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
16095 self
16096 }
16097
16098 /// The value of [job_run][crate::model::JobRun::job_run]
16099 /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
16100 /// holds a different branch.
16101 pub fn create_child_rollout_job_run(
16102 &self,
16103 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
16104 #[allow(unreachable_patterns)]
16105 self.job_run.as_ref().and_then(|v| match v {
16106 crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
16107 std::option::Option::Some(v)
16108 }
16109 _ => std::option::Option::None,
16110 })
16111 }
16112
16113 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16114 /// to hold a `CreateChildRolloutJobRun`.
16115 ///
16116 /// Note that all the setters affecting `job_run` are
16117 /// mutually exclusive.
16118 ///
16119 /// # Example
16120 /// ```ignore,no_run
16121 /// # use google_cloud_deploy_v1::model::JobRun;
16122 /// use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
16123 /// let x = JobRun::new().set_create_child_rollout_job_run(CreateChildRolloutJobRun::default()/* use setters */);
16124 /// assert!(x.create_child_rollout_job_run().is_some());
16125 /// assert!(x.deploy_job_run().is_none());
16126 /// assert!(x.verify_job_run().is_none());
16127 /// assert!(x.predeploy_job_run().is_none());
16128 /// assert!(x.postdeploy_job_run().is_none());
16129 /// assert!(x.advance_child_rollout_job_run().is_none());
16130 /// ```
16131 pub fn set_create_child_rollout_job_run<
16132 T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
16133 >(
16134 mut self,
16135 v: T,
16136 ) -> Self {
16137 self.job_run = std::option::Option::Some(
16138 crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
16139 );
16140 self
16141 }
16142
16143 /// The value of [job_run][crate::model::JobRun::job_run]
16144 /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
16145 /// holds a different branch.
16146 pub fn advance_child_rollout_job_run(
16147 &self,
16148 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
16149 #[allow(unreachable_patterns)]
16150 self.job_run.as_ref().and_then(|v| match v {
16151 crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
16152 std::option::Option::Some(v)
16153 }
16154 _ => std::option::Option::None,
16155 })
16156 }
16157
16158 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16159 /// to hold a `AdvanceChildRolloutJobRun`.
16160 ///
16161 /// Note that all the setters affecting `job_run` are
16162 /// mutually exclusive.
16163 ///
16164 /// # Example
16165 /// ```ignore,no_run
16166 /// # use google_cloud_deploy_v1::model::JobRun;
16167 /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
16168 /// let x = JobRun::new().set_advance_child_rollout_job_run(AdvanceChildRolloutJobRun::default()/* use setters */);
16169 /// assert!(x.advance_child_rollout_job_run().is_some());
16170 /// assert!(x.deploy_job_run().is_none());
16171 /// assert!(x.verify_job_run().is_none());
16172 /// assert!(x.predeploy_job_run().is_none());
16173 /// assert!(x.postdeploy_job_run().is_none());
16174 /// assert!(x.create_child_rollout_job_run().is_none());
16175 /// ```
16176 pub fn set_advance_child_rollout_job_run<
16177 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
16178 >(
16179 mut self,
16180 v: T,
16181 ) -> Self {
16182 self.job_run = std::option::Option::Some(
16183 crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
16184 );
16185 self
16186 }
16187}
16188
16189impl wkt::message::Message for JobRun {
16190 fn typename() -> &'static str {
16191 "type.googleapis.com/google.cloud.deploy.v1.JobRun"
16192 }
16193}
16194
16195/// Defines additional types related to [JobRun].
16196pub mod job_run {
16197 #[allow(unused_imports)]
16198 use super::*;
16199
16200 /// Valid states of a `JobRun`.
16201 ///
16202 /// # Working with unknown values
16203 ///
16204 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16205 /// additional enum variants at any time. Adding new variants is not considered
16206 /// a breaking change. Applications should write their code in anticipation of:
16207 ///
16208 /// - New values appearing in future releases of the client library, **and**
16209 /// - New values received dynamically, without application changes.
16210 ///
16211 /// Please consult the [Working with enums] section in the user guide for some
16212 /// guidelines.
16213 ///
16214 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16215 #[derive(Clone, Debug, PartialEq)]
16216 #[non_exhaustive]
16217 pub enum State {
16218 /// The `JobRun` has an unspecified state.
16219 Unspecified,
16220 /// The `JobRun` is in progress.
16221 InProgress,
16222 /// The `JobRun` has succeeded.
16223 Succeeded,
16224 /// The `JobRun` has failed.
16225 Failed,
16226 /// The `JobRun` is terminating.
16227 Terminating,
16228 /// The `JobRun` was terminated.
16229 Terminated,
16230 /// If set, the enum was initialized with an unknown value.
16231 ///
16232 /// Applications can examine the value using [State::value] or
16233 /// [State::name].
16234 UnknownValue(state::UnknownValue),
16235 }
16236
16237 #[doc(hidden)]
16238 pub mod state {
16239 #[allow(unused_imports)]
16240 use super::*;
16241 #[derive(Clone, Debug, PartialEq)]
16242 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16243 }
16244
16245 impl State {
16246 /// Gets the enum value.
16247 ///
16248 /// Returns `None` if the enum contains an unknown value deserialized from
16249 /// the string representation of enums.
16250 pub fn value(&self) -> std::option::Option<i32> {
16251 match self {
16252 Self::Unspecified => std::option::Option::Some(0),
16253 Self::InProgress => std::option::Option::Some(1),
16254 Self::Succeeded => std::option::Option::Some(2),
16255 Self::Failed => std::option::Option::Some(3),
16256 Self::Terminating => std::option::Option::Some(4),
16257 Self::Terminated => std::option::Option::Some(5),
16258 Self::UnknownValue(u) => u.0.value(),
16259 }
16260 }
16261
16262 /// Gets the enum value as a string.
16263 ///
16264 /// Returns `None` if the enum contains an unknown value deserialized from
16265 /// the integer representation of enums.
16266 pub fn name(&self) -> std::option::Option<&str> {
16267 match self {
16268 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16269 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16270 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16271 Self::Failed => std::option::Option::Some("FAILED"),
16272 Self::Terminating => std::option::Option::Some("TERMINATING"),
16273 Self::Terminated => std::option::Option::Some("TERMINATED"),
16274 Self::UnknownValue(u) => u.0.name(),
16275 }
16276 }
16277 }
16278
16279 impl std::default::Default for State {
16280 fn default() -> Self {
16281 use std::convert::From;
16282 Self::from(0)
16283 }
16284 }
16285
16286 impl std::fmt::Display for State {
16287 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16288 wkt::internal::display_enum(f, self.name(), self.value())
16289 }
16290 }
16291
16292 impl std::convert::From<i32> for State {
16293 fn from(value: i32) -> Self {
16294 match value {
16295 0 => Self::Unspecified,
16296 1 => Self::InProgress,
16297 2 => Self::Succeeded,
16298 3 => Self::Failed,
16299 4 => Self::Terminating,
16300 5 => Self::Terminated,
16301 _ => Self::UnknownValue(state::UnknownValue(
16302 wkt::internal::UnknownEnumValue::Integer(value),
16303 )),
16304 }
16305 }
16306 }
16307
16308 impl std::convert::From<&str> for State {
16309 fn from(value: &str) -> Self {
16310 use std::string::ToString;
16311 match value {
16312 "STATE_UNSPECIFIED" => Self::Unspecified,
16313 "IN_PROGRESS" => Self::InProgress,
16314 "SUCCEEDED" => Self::Succeeded,
16315 "FAILED" => Self::Failed,
16316 "TERMINATING" => Self::Terminating,
16317 "TERMINATED" => Self::Terminated,
16318 _ => Self::UnknownValue(state::UnknownValue(
16319 wkt::internal::UnknownEnumValue::String(value.to_string()),
16320 )),
16321 }
16322 }
16323 }
16324
16325 impl serde::ser::Serialize for State {
16326 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16327 where
16328 S: serde::Serializer,
16329 {
16330 match self {
16331 Self::Unspecified => serializer.serialize_i32(0),
16332 Self::InProgress => serializer.serialize_i32(1),
16333 Self::Succeeded => serializer.serialize_i32(2),
16334 Self::Failed => serializer.serialize_i32(3),
16335 Self::Terminating => serializer.serialize_i32(4),
16336 Self::Terminated => serializer.serialize_i32(5),
16337 Self::UnknownValue(u) => u.0.serialize(serializer),
16338 }
16339 }
16340 }
16341
16342 impl<'de> serde::de::Deserialize<'de> for State {
16343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16344 where
16345 D: serde::Deserializer<'de>,
16346 {
16347 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16348 ".google.cloud.deploy.v1.JobRun.State",
16349 ))
16350 }
16351 }
16352
16353 /// The `JobRun` type and the information for that type.
16354 #[derive(Clone, Debug, PartialEq)]
16355 #[non_exhaustive]
16356 pub enum JobRun {
16357 /// Output only. Information specific to a deploy `JobRun`.
16358 DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
16359 /// Output only. Information specific to a verify `JobRun`.
16360 VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
16361 /// Output only. Information specific to a predeploy `JobRun`.
16362 PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
16363 /// Output only. Information specific to a postdeploy `JobRun`.
16364 PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
16365 /// Output only. Information specific to a createChildRollout `JobRun`.
16366 CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
16367 /// Output only. Information specific to an advanceChildRollout `JobRun`
16368 AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
16369 }
16370}
16371
16372/// DeployJobRun contains information specific to a deploy `JobRun`.
16373#[derive(Clone, Default, PartialEq)]
16374#[non_exhaustive]
16375pub struct DeployJobRun {
16376 /// Output only. The resource name of the Cloud Build `Build` object that is
16377 /// used to deploy. Format is
16378 /// `projects/{project}/locations/{location}/builds/{build}`.
16379 pub build: std::string::String,
16380
16381 /// Output only. The reason the deploy failed. This will always be unspecified
16382 /// while the deploy is in progress or if it succeeded.
16383 pub failure_cause: crate::model::deploy_job_run::FailureCause,
16384
16385 /// Output only. Additional information about the deploy failure, if available.
16386 pub failure_message: std::string::String,
16387
16388 /// Output only. Metadata containing information about the deploy job run.
16389 pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
16390
16391 /// Output only. The artifact of a deploy job run, if available.
16392 pub artifact: std::option::Option<crate::model::DeployArtifact>,
16393
16394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16395}
16396
16397impl DeployJobRun {
16398 pub fn new() -> Self {
16399 std::default::Default::default()
16400 }
16401
16402 /// Sets the value of [build][crate::model::DeployJobRun::build].
16403 ///
16404 /// # Example
16405 /// ```ignore,no_run
16406 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16407 /// let x = DeployJobRun::new().set_build("example");
16408 /// ```
16409 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16410 self.build = v.into();
16411 self
16412 }
16413
16414 /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
16415 ///
16416 /// # Example
16417 /// ```ignore,no_run
16418 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16419 /// use google_cloud_deploy_v1::model::deploy_job_run::FailureCause;
16420 /// let x0 = DeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16421 /// let x1 = DeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16422 /// let x2 = DeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16423 /// ```
16424 pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
16425 mut self,
16426 v: T,
16427 ) -> Self {
16428 self.failure_cause = v.into();
16429 self
16430 }
16431
16432 /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
16433 ///
16434 /// # Example
16435 /// ```ignore,no_run
16436 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16437 /// let x = DeployJobRun::new().set_failure_message("example");
16438 /// ```
16439 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16440 self.failure_message = v.into();
16441 self
16442 }
16443
16444 /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
16445 ///
16446 /// # Example
16447 /// ```ignore,no_run
16448 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16449 /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16450 /// let x = DeployJobRun::new().set_metadata(DeployJobRunMetadata::default()/* use setters */);
16451 /// ```
16452 pub fn set_metadata<T>(mut self, v: T) -> Self
16453 where
16454 T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16455 {
16456 self.metadata = std::option::Option::Some(v.into());
16457 self
16458 }
16459
16460 /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
16461 ///
16462 /// # Example
16463 /// ```ignore,no_run
16464 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16465 /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16466 /// let x = DeployJobRun::new().set_or_clear_metadata(Some(DeployJobRunMetadata::default()/* use setters */));
16467 /// let x = DeployJobRun::new().set_or_clear_metadata(None::<DeployJobRunMetadata>);
16468 /// ```
16469 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16470 where
16471 T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16472 {
16473 self.metadata = v.map(|x| x.into());
16474 self
16475 }
16476
16477 /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
16478 ///
16479 /// # Example
16480 /// ```ignore,no_run
16481 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16482 /// use google_cloud_deploy_v1::model::DeployArtifact;
16483 /// let x = DeployJobRun::new().set_artifact(DeployArtifact::default()/* use setters */);
16484 /// ```
16485 pub fn set_artifact<T>(mut self, v: T) -> Self
16486 where
16487 T: std::convert::Into<crate::model::DeployArtifact>,
16488 {
16489 self.artifact = std::option::Option::Some(v.into());
16490 self
16491 }
16492
16493 /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
16494 ///
16495 /// # Example
16496 /// ```ignore,no_run
16497 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16498 /// use google_cloud_deploy_v1::model::DeployArtifact;
16499 /// let x = DeployJobRun::new().set_or_clear_artifact(Some(DeployArtifact::default()/* use setters */));
16500 /// let x = DeployJobRun::new().set_or_clear_artifact(None::<DeployArtifact>);
16501 /// ```
16502 pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
16503 where
16504 T: std::convert::Into<crate::model::DeployArtifact>,
16505 {
16506 self.artifact = v.map(|x| x.into());
16507 self
16508 }
16509}
16510
16511impl wkt::message::Message for DeployJobRun {
16512 fn typename() -> &'static str {
16513 "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
16514 }
16515}
16516
16517/// Defines additional types related to [DeployJobRun].
16518pub mod deploy_job_run {
16519 #[allow(unused_imports)]
16520 use super::*;
16521
16522 /// Well-known deploy failures.
16523 ///
16524 /// # Working with unknown values
16525 ///
16526 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16527 /// additional enum variants at any time. Adding new variants is not considered
16528 /// a breaking change. Applications should write their code in anticipation of:
16529 ///
16530 /// - New values appearing in future releases of the client library, **and**
16531 /// - New values received dynamically, without application changes.
16532 ///
16533 /// Please consult the [Working with enums] section in the user guide for some
16534 /// guidelines.
16535 ///
16536 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16537 #[derive(Clone, Debug, PartialEq)]
16538 #[non_exhaustive]
16539 pub enum FailureCause {
16540 /// No reason for failure is specified.
16541 Unspecified,
16542 /// Cloud Build is not available, either because it is not enabled or because
16543 /// Cloud Deploy has insufficient permissions. See [Required
16544 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16545 CloudBuildUnavailable,
16546 /// The deploy operation did not complete successfully; check Cloud Build
16547 /// logs.
16548 ExecutionFailed,
16549 /// The deploy job run did not complete within the allotted time.
16550 DeadlineExceeded,
16551 /// There were missing resources in the runtime environment required for a
16552 /// canary deployment. Check the Cloud Build logs for more information.
16553 MissingResourcesForCanary,
16554 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16555 /// for additional details.
16556 CloudBuildRequestFailed,
16557 /// The deploy operation had a feature configured that is not supported.
16558 DeployFeatureNotSupported,
16559 /// If set, the enum was initialized with an unknown value.
16560 ///
16561 /// Applications can examine the value using [FailureCause::value] or
16562 /// [FailureCause::name].
16563 UnknownValue(failure_cause::UnknownValue),
16564 }
16565
16566 #[doc(hidden)]
16567 pub mod failure_cause {
16568 #[allow(unused_imports)]
16569 use super::*;
16570 #[derive(Clone, Debug, PartialEq)]
16571 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16572 }
16573
16574 impl FailureCause {
16575 /// Gets the enum value.
16576 ///
16577 /// Returns `None` if the enum contains an unknown value deserialized from
16578 /// the string representation of enums.
16579 pub fn value(&self) -> std::option::Option<i32> {
16580 match self {
16581 Self::Unspecified => std::option::Option::Some(0),
16582 Self::CloudBuildUnavailable => std::option::Option::Some(1),
16583 Self::ExecutionFailed => std::option::Option::Some(2),
16584 Self::DeadlineExceeded => std::option::Option::Some(3),
16585 Self::MissingResourcesForCanary => std::option::Option::Some(4),
16586 Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16587 Self::DeployFeatureNotSupported => std::option::Option::Some(6),
16588 Self::UnknownValue(u) => u.0.value(),
16589 }
16590 }
16591
16592 /// Gets the enum value as a string.
16593 ///
16594 /// Returns `None` if the enum contains an unknown value deserialized from
16595 /// the integer representation of enums.
16596 pub fn name(&self) -> std::option::Option<&str> {
16597 match self {
16598 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16599 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16600 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16601 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16602 Self::MissingResourcesForCanary => {
16603 std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
16604 }
16605 Self::CloudBuildRequestFailed => {
16606 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16607 }
16608 Self::DeployFeatureNotSupported => {
16609 std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
16610 }
16611 Self::UnknownValue(u) => u.0.name(),
16612 }
16613 }
16614 }
16615
16616 impl std::default::Default for FailureCause {
16617 fn default() -> Self {
16618 use std::convert::From;
16619 Self::from(0)
16620 }
16621 }
16622
16623 impl std::fmt::Display for FailureCause {
16624 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16625 wkt::internal::display_enum(f, self.name(), self.value())
16626 }
16627 }
16628
16629 impl std::convert::From<i32> for FailureCause {
16630 fn from(value: i32) -> Self {
16631 match value {
16632 0 => Self::Unspecified,
16633 1 => Self::CloudBuildUnavailable,
16634 2 => Self::ExecutionFailed,
16635 3 => Self::DeadlineExceeded,
16636 4 => Self::MissingResourcesForCanary,
16637 5 => Self::CloudBuildRequestFailed,
16638 6 => Self::DeployFeatureNotSupported,
16639 _ => Self::UnknownValue(failure_cause::UnknownValue(
16640 wkt::internal::UnknownEnumValue::Integer(value),
16641 )),
16642 }
16643 }
16644 }
16645
16646 impl std::convert::From<&str> for FailureCause {
16647 fn from(value: &str) -> Self {
16648 use std::string::ToString;
16649 match value {
16650 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16651 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16652 "EXECUTION_FAILED" => Self::ExecutionFailed,
16653 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16654 "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
16655 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16656 "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
16657 _ => Self::UnknownValue(failure_cause::UnknownValue(
16658 wkt::internal::UnknownEnumValue::String(value.to_string()),
16659 )),
16660 }
16661 }
16662 }
16663
16664 impl serde::ser::Serialize for FailureCause {
16665 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16666 where
16667 S: serde::Serializer,
16668 {
16669 match self {
16670 Self::Unspecified => serializer.serialize_i32(0),
16671 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16672 Self::ExecutionFailed => serializer.serialize_i32(2),
16673 Self::DeadlineExceeded => serializer.serialize_i32(3),
16674 Self::MissingResourcesForCanary => serializer.serialize_i32(4),
16675 Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16676 Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
16677 Self::UnknownValue(u) => u.0.serialize(serializer),
16678 }
16679 }
16680 }
16681
16682 impl<'de> serde::de::Deserialize<'de> for FailureCause {
16683 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16684 where
16685 D: serde::Deserializer<'de>,
16686 {
16687 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16688 ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
16689 ))
16690 }
16691 }
16692}
16693
16694/// VerifyJobRun contains information specific to a verify `JobRun`.
16695#[derive(Clone, Default, PartialEq)]
16696#[non_exhaustive]
16697pub struct VerifyJobRun {
16698 /// Output only. The resource name of the Cloud Build `Build` object that is
16699 /// used to verify. Format is
16700 /// `projects/{project}/locations/{location}/builds/{build}`.
16701 pub build: std::string::String,
16702
16703 /// Output only. URI of a directory containing the verify artifacts. This
16704 /// contains the Skaffold event log.
16705 pub artifact_uri: std::string::String,
16706
16707 /// Output only. File path of the Skaffold event log relative to the artifact
16708 /// URI.
16709 pub event_log_path: std::string::String,
16710
16711 /// Output only. The reason the verify failed. This will always be unspecified
16712 /// while the verify is in progress or if it succeeded.
16713 pub failure_cause: crate::model::verify_job_run::FailureCause,
16714
16715 /// Output only. Additional information about the verify failure, if available.
16716 pub failure_message: std::string::String,
16717
16718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16719}
16720
16721impl VerifyJobRun {
16722 pub fn new() -> Self {
16723 std::default::Default::default()
16724 }
16725
16726 /// Sets the value of [build][crate::model::VerifyJobRun::build].
16727 ///
16728 /// # Example
16729 /// ```ignore,no_run
16730 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16731 /// let x = VerifyJobRun::new().set_build("example");
16732 /// ```
16733 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16734 self.build = v.into();
16735 self
16736 }
16737
16738 /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
16739 ///
16740 /// # Example
16741 /// ```ignore,no_run
16742 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16743 /// let x = VerifyJobRun::new().set_artifact_uri("example");
16744 /// ```
16745 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16746 self.artifact_uri = v.into();
16747 self
16748 }
16749
16750 /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
16751 ///
16752 /// # Example
16753 /// ```ignore,no_run
16754 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16755 /// let x = VerifyJobRun::new().set_event_log_path("example");
16756 /// ```
16757 pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16758 self.event_log_path = v.into();
16759 self
16760 }
16761
16762 /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
16763 ///
16764 /// # Example
16765 /// ```ignore,no_run
16766 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16767 /// use google_cloud_deploy_v1::model::verify_job_run::FailureCause;
16768 /// let x0 = VerifyJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16769 /// let x1 = VerifyJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16770 /// let x2 = VerifyJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16771 /// ```
16772 pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
16773 mut self,
16774 v: T,
16775 ) -> Self {
16776 self.failure_cause = v.into();
16777 self
16778 }
16779
16780 /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
16781 ///
16782 /// # Example
16783 /// ```ignore,no_run
16784 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16785 /// let x = VerifyJobRun::new().set_failure_message("example");
16786 /// ```
16787 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16788 self.failure_message = v.into();
16789 self
16790 }
16791}
16792
16793impl wkt::message::Message for VerifyJobRun {
16794 fn typename() -> &'static str {
16795 "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
16796 }
16797}
16798
16799/// Defines additional types related to [VerifyJobRun].
16800pub mod verify_job_run {
16801 #[allow(unused_imports)]
16802 use super::*;
16803
16804 /// Well-known verify failures.
16805 ///
16806 /// # Working with unknown values
16807 ///
16808 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16809 /// additional enum variants at any time. Adding new variants is not considered
16810 /// a breaking change. Applications should write their code in anticipation of:
16811 ///
16812 /// - New values appearing in future releases of the client library, **and**
16813 /// - New values received dynamically, without application changes.
16814 ///
16815 /// Please consult the [Working with enums] section in the user guide for some
16816 /// guidelines.
16817 ///
16818 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16819 #[derive(Clone, Debug, PartialEq)]
16820 #[non_exhaustive]
16821 pub enum FailureCause {
16822 /// No reason for failure is specified.
16823 Unspecified,
16824 /// Cloud Build is not available, either because it is not enabled or because
16825 /// Cloud Deploy has insufficient permissions. See [required
16826 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16827 CloudBuildUnavailable,
16828 /// The verify operation did not complete successfully; check Cloud Build
16829 /// logs.
16830 ExecutionFailed,
16831 /// The verify job run did not complete within the allotted time.
16832 DeadlineExceeded,
16833 /// No Skaffold verify configuration was found.
16834 VerificationConfigNotFound,
16835 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16836 /// for additional details.
16837 CloudBuildRequestFailed,
16838 /// If set, the enum was initialized with an unknown value.
16839 ///
16840 /// Applications can examine the value using [FailureCause::value] or
16841 /// [FailureCause::name].
16842 UnknownValue(failure_cause::UnknownValue),
16843 }
16844
16845 #[doc(hidden)]
16846 pub mod failure_cause {
16847 #[allow(unused_imports)]
16848 use super::*;
16849 #[derive(Clone, Debug, PartialEq)]
16850 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16851 }
16852
16853 impl FailureCause {
16854 /// Gets the enum value.
16855 ///
16856 /// Returns `None` if the enum contains an unknown value deserialized from
16857 /// the string representation of enums.
16858 pub fn value(&self) -> std::option::Option<i32> {
16859 match self {
16860 Self::Unspecified => std::option::Option::Some(0),
16861 Self::CloudBuildUnavailable => std::option::Option::Some(1),
16862 Self::ExecutionFailed => std::option::Option::Some(2),
16863 Self::DeadlineExceeded => std::option::Option::Some(3),
16864 Self::VerificationConfigNotFound => std::option::Option::Some(4),
16865 Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16866 Self::UnknownValue(u) => u.0.value(),
16867 }
16868 }
16869
16870 /// Gets the enum value as a string.
16871 ///
16872 /// Returns `None` if the enum contains an unknown value deserialized from
16873 /// the integer representation of enums.
16874 pub fn name(&self) -> std::option::Option<&str> {
16875 match self {
16876 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16877 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16878 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16879 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16880 Self::VerificationConfigNotFound => {
16881 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
16882 }
16883 Self::CloudBuildRequestFailed => {
16884 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16885 }
16886 Self::UnknownValue(u) => u.0.name(),
16887 }
16888 }
16889 }
16890
16891 impl std::default::Default for FailureCause {
16892 fn default() -> Self {
16893 use std::convert::From;
16894 Self::from(0)
16895 }
16896 }
16897
16898 impl std::fmt::Display for FailureCause {
16899 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16900 wkt::internal::display_enum(f, self.name(), self.value())
16901 }
16902 }
16903
16904 impl std::convert::From<i32> for FailureCause {
16905 fn from(value: i32) -> Self {
16906 match value {
16907 0 => Self::Unspecified,
16908 1 => Self::CloudBuildUnavailable,
16909 2 => Self::ExecutionFailed,
16910 3 => Self::DeadlineExceeded,
16911 4 => Self::VerificationConfigNotFound,
16912 5 => Self::CloudBuildRequestFailed,
16913 _ => Self::UnknownValue(failure_cause::UnknownValue(
16914 wkt::internal::UnknownEnumValue::Integer(value),
16915 )),
16916 }
16917 }
16918 }
16919
16920 impl std::convert::From<&str> for FailureCause {
16921 fn from(value: &str) -> Self {
16922 use std::string::ToString;
16923 match value {
16924 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16925 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16926 "EXECUTION_FAILED" => Self::ExecutionFailed,
16927 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16928 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
16929 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16930 _ => Self::UnknownValue(failure_cause::UnknownValue(
16931 wkt::internal::UnknownEnumValue::String(value.to_string()),
16932 )),
16933 }
16934 }
16935 }
16936
16937 impl serde::ser::Serialize for FailureCause {
16938 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16939 where
16940 S: serde::Serializer,
16941 {
16942 match self {
16943 Self::Unspecified => serializer.serialize_i32(0),
16944 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16945 Self::ExecutionFailed => serializer.serialize_i32(2),
16946 Self::DeadlineExceeded => serializer.serialize_i32(3),
16947 Self::VerificationConfigNotFound => serializer.serialize_i32(4),
16948 Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16949 Self::UnknownValue(u) => u.0.serialize(serializer),
16950 }
16951 }
16952 }
16953
16954 impl<'de> serde::de::Deserialize<'de> for FailureCause {
16955 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16956 where
16957 D: serde::Deserializer<'de>,
16958 {
16959 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16960 ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
16961 ))
16962 }
16963 }
16964}
16965
16966/// PredeployJobRun contains information specific to a predeploy `JobRun`.
16967#[derive(Clone, Default, PartialEq)]
16968#[non_exhaustive]
16969pub struct PredeployJobRun {
16970 /// Output only. The resource name of the Cloud Build `Build` object that is
16971 /// used to execute the custom actions associated with the predeploy Job.
16972 /// Format is `projects/{project}/locations/{location}/builds/{build}`.
16973 pub build: std::string::String,
16974
16975 /// Output only. The reason the predeploy failed. This will always be
16976 /// unspecified while the predeploy is in progress or if it succeeded.
16977 pub failure_cause: crate::model::predeploy_job_run::FailureCause,
16978
16979 /// Output only. Additional information about the predeploy failure, if
16980 /// available.
16981 pub failure_message: std::string::String,
16982
16983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16984}
16985
16986impl PredeployJobRun {
16987 pub fn new() -> Self {
16988 std::default::Default::default()
16989 }
16990
16991 /// Sets the value of [build][crate::model::PredeployJobRun::build].
16992 ///
16993 /// # Example
16994 /// ```ignore,no_run
16995 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
16996 /// let x = PredeployJobRun::new().set_build("example");
16997 /// ```
16998 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16999 self.build = v.into();
17000 self
17001 }
17002
17003 /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
17004 ///
17005 /// # Example
17006 /// ```ignore,no_run
17007 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17008 /// use google_cloud_deploy_v1::model::predeploy_job_run::FailureCause;
17009 /// let x0 = PredeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17010 /// let x1 = PredeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17011 /// let x2 = PredeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17012 /// ```
17013 pub fn set_failure_cause<
17014 T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
17015 >(
17016 mut self,
17017 v: T,
17018 ) -> Self {
17019 self.failure_cause = v.into();
17020 self
17021 }
17022
17023 /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
17024 ///
17025 /// # Example
17026 /// ```ignore,no_run
17027 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17028 /// let x = PredeployJobRun::new().set_failure_message("example");
17029 /// ```
17030 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17031 self.failure_message = v.into();
17032 self
17033 }
17034}
17035
17036impl wkt::message::Message for PredeployJobRun {
17037 fn typename() -> &'static str {
17038 "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
17039 }
17040}
17041
17042/// Defines additional types related to [PredeployJobRun].
17043pub mod predeploy_job_run {
17044 #[allow(unused_imports)]
17045 use super::*;
17046
17047 /// Well-known predeploy failures.
17048 ///
17049 /// # Working with unknown values
17050 ///
17051 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17052 /// additional enum variants at any time. Adding new variants is not considered
17053 /// a breaking change. Applications should write their code in anticipation of:
17054 ///
17055 /// - New values appearing in future releases of the client library, **and**
17056 /// - New values received dynamically, without application changes.
17057 ///
17058 /// Please consult the [Working with enums] section in the user guide for some
17059 /// guidelines.
17060 ///
17061 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17062 #[derive(Clone, Debug, PartialEq)]
17063 #[non_exhaustive]
17064 pub enum FailureCause {
17065 /// No reason for failure is specified.
17066 Unspecified,
17067 /// Cloud Build is not available, either because it is not enabled or because
17068 /// Cloud Deploy has insufficient permissions. See [required
17069 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17070 CloudBuildUnavailable,
17071 /// The predeploy operation did not complete successfully; check Cloud Build
17072 /// logs.
17073 ExecutionFailed,
17074 /// The predeploy job run did not complete within the allotted time.
17075 DeadlineExceeded,
17076 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17077 /// for additional details.
17078 CloudBuildRequestFailed,
17079 /// If set, the enum was initialized with an unknown value.
17080 ///
17081 /// Applications can examine the value using [FailureCause::value] or
17082 /// [FailureCause::name].
17083 UnknownValue(failure_cause::UnknownValue),
17084 }
17085
17086 #[doc(hidden)]
17087 pub mod failure_cause {
17088 #[allow(unused_imports)]
17089 use super::*;
17090 #[derive(Clone, Debug, PartialEq)]
17091 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17092 }
17093
17094 impl FailureCause {
17095 /// Gets the enum value.
17096 ///
17097 /// Returns `None` if the enum contains an unknown value deserialized from
17098 /// the string representation of enums.
17099 pub fn value(&self) -> std::option::Option<i32> {
17100 match self {
17101 Self::Unspecified => std::option::Option::Some(0),
17102 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17103 Self::ExecutionFailed => std::option::Option::Some(2),
17104 Self::DeadlineExceeded => std::option::Option::Some(3),
17105 Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17106 Self::UnknownValue(u) => u.0.value(),
17107 }
17108 }
17109
17110 /// Gets the enum value as a string.
17111 ///
17112 /// Returns `None` if the enum contains an unknown value deserialized from
17113 /// the integer representation of enums.
17114 pub fn name(&self) -> std::option::Option<&str> {
17115 match self {
17116 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17117 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17118 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17119 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17120 Self::CloudBuildRequestFailed => {
17121 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17122 }
17123 Self::UnknownValue(u) => u.0.name(),
17124 }
17125 }
17126 }
17127
17128 impl std::default::Default for FailureCause {
17129 fn default() -> Self {
17130 use std::convert::From;
17131 Self::from(0)
17132 }
17133 }
17134
17135 impl std::fmt::Display for FailureCause {
17136 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17137 wkt::internal::display_enum(f, self.name(), self.value())
17138 }
17139 }
17140
17141 impl std::convert::From<i32> for FailureCause {
17142 fn from(value: i32) -> Self {
17143 match value {
17144 0 => Self::Unspecified,
17145 1 => Self::CloudBuildUnavailable,
17146 2 => Self::ExecutionFailed,
17147 3 => Self::DeadlineExceeded,
17148 4 => Self::CloudBuildRequestFailed,
17149 _ => Self::UnknownValue(failure_cause::UnknownValue(
17150 wkt::internal::UnknownEnumValue::Integer(value),
17151 )),
17152 }
17153 }
17154 }
17155
17156 impl std::convert::From<&str> for FailureCause {
17157 fn from(value: &str) -> Self {
17158 use std::string::ToString;
17159 match value {
17160 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17161 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17162 "EXECUTION_FAILED" => Self::ExecutionFailed,
17163 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17164 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17165 _ => Self::UnknownValue(failure_cause::UnknownValue(
17166 wkt::internal::UnknownEnumValue::String(value.to_string()),
17167 )),
17168 }
17169 }
17170 }
17171
17172 impl serde::ser::Serialize for FailureCause {
17173 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17174 where
17175 S: serde::Serializer,
17176 {
17177 match self {
17178 Self::Unspecified => serializer.serialize_i32(0),
17179 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17180 Self::ExecutionFailed => serializer.serialize_i32(2),
17181 Self::DeadlineExceeded => serializer.serialize_i32(3),
17182 Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17183 Self::UnknownValue(u) => u.0.serialize(serializer),
17184 }
17185 }
17186 }
17187
17188 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17189 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17190 where
17191 D: serde::Deserializer<'de>,
17192 {
17193 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17194 ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
17195 ))
17196 }
17197 }
17198}
17199
17200/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
17201#[derive(Clone, Default, PartialEq)]
17202#[non_exhaustive]
17203pub struct PostdeployJobRun {
17204 /// Output only. The resource name of the Cloud Build `Build` object that is
17205 /// used to execute the custom actions associated with the postdeploy Job.
17206 /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17207 pub build: std::string::String,
17208
17209 /// Output only. The reason the postdeploy failed. This will always be
17210 /// unspecified while the postdeploy is in progress or if it succeeded.
17211 pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
17212
17213 /// Output only. Additional information about the postdeploy failure, if
17214 /// available.
17215 pub failure_message: std::string::String,
17216
17217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17218}
17219
17220impl PostdeployJobRun {
17221 pub fn new() -> Self {
17222 std::default::Default::default()
17223 }
17224
17225 /// Sets the value of [build][crate::model::PostdeployJobRun::build].
17226 ///
17227 /// # Example
17228 /// ```ignore,no_run
17229 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17230 /// let x = PostdeployJobRun::new().set_build("example");
17231 /// ```
17232 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17233 self.build = v.into();
17234 self
17235 }
17236
17237 /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
17238 ///
17239 /// # Example
17240 /// ```ignore,no_run
17241 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17242 /// use google_cloud_deploy_v1::model::postdeploy_job_run::FailureCause;
17243 /// let x0 = PostdeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17244 /// let x1 = PostdeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17245 /// let x2 = PostdeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17246 /// ```
17247 pub fn set_failure_cause<
17248 T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
17249 >(
17250 mut self,
17251 v: T,
17252 ) -> Self {
17253 self.failure_cause = v.into();
17254 self
17255 }
17256
17257 /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
17258 ///
17259 /// # Example
17260 /// ```ignore,no_run
17261 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17262 /// let x = PostdeployJobRun::new().set_failure_message("example");
17263 /// ```
17264 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17265 self.failure_message = v.into();
17266 self
17267 }
17268}
17269
17270impl wkt::message::Message for PostdeployJobRun {
17271 fn typename() -> &'static str {
17272 "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
17273 }
17274}
17275
17276/// Defines additional types related to [PostdeployJobRun].
17277pub mod postdeploy_job_run {
17278 #[allow(unused_imports)]
17279 use super::*;
17280
17281 /// Well-known postdeploy failures.
17282 ///
17283 /// # Working with unknown values
17284 ///
17285 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17286 /// additional enum variants at any time. Adding new variants is not considered
17287 /// a breaking change. Applications should write their code in anticipation of:
17288 ///
17289 /// - New values appearing in future releases of the client library, **and**
17290 /// - New values received dynamically, without application changes.
17291 ///
17292 /// Please consult the [Working with enums] section in the user guide for some
17293 /// guidelines.
17294 ///
17295 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17296 #[derive(Clone, Debug, PartialEq)]
17297 #[non_exhaustive]
17298 pub enum FailureCause {
17299 /// No reason for failure is specified.
17300 Unspecified,
17301 /// Cloud Build is not available, either because it is not enabled or because
17302 /// Cloud Deploy has insufficient permissions. See [required
17303 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17304 CloudBuildUnavailable,
17305 /// The postdeploy operation did not complete successfully; check Cloud Build
17306 /// logs.
17307 ExecutionFailed,
17308 /// The postdeploy job run did not complete within the allotted time.
17309 DeadlineExceeded,
17310 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17311 /// for additional details.
17312 CloudBuildRequestFailed,
17313 /// If set, the enum was initialized with an unknown value.
17314 ///
17315 /// Applications can examine the value using [FailureCause::value] or
17316 /// [FailureCause::name].
17317 UnknownValue(failure_cause::UnknownValue),
17318 }
17319
17320 #[doc(hidden)]
17321 pub mod failure_cause {
17322 #[allow(unused_imports)]
17323 use super::*;
17324 #[derive(Clone, Debug, PartialEq)]
17325 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17326 }
17327
17328 impl FailureCause {
17329 /// Gets the enum value.
17330 ///
17331 /// Returns `None` if the enum contains an unknown value deserialized from
17332 /// the string representation of enums.
17333 pub fn value(&self) -> std::option::Option<i32> {
17334 match self {
17335 Self::Unspecified => std::option::Option::Some(0),
17336 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17337 Self::ExecutionFailed => std::option::Option::Some(2),
17338 Self::DeadlineExceeded => std::option::Option::Some(3),
17339 Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17340 Self::UnknownValue(u) => u.0.value(),
17341 }
17342 }
17343
17344 /// Gets the enum value as a string.
17345 ///
17346 /// Returns `None` if the enum contains an unknown value deserialized from
17347 /// the integer representation of enums.
17348 pub fn name(&self) -> std::option::Option<&str> {
17349 match self {
17350 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17351 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17352 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17353 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17354 Self::CloudBuildRequestFailed => {
17355 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17356 }
17357 Self::UnknownValue(u) => u.0.name(),
17358 }
17359 }
17360 }
17361
17362 impl std::default::Default for FailureCause {
17363 fn default() -> Self {
17364 use std::convert::From;
17365 Self::from(0)
17366 }
17367 }
17368
17369 impl std::fmt::Display for FailureCause {
17370 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17371 wkt::internal::display_enum(f, self.name(), self.value())
17372 }
17373 }
17374
17375 impl std::convert::From<i32> for FailureCause {
17376 fn from(value: i32) -> Self {
17377 match value {
17378 0 => Self::Unspecified,
17379 1 => Self::CloudBuildUnavailable,
17380 2 => Self::ExecutionFailed,
17381 3 => Self::DeadlineExceeded,
17382 4 => Self::CloudBuildRequestFailed,
17383 _ => Self::UnknownValue(failure_cause::UnknownValue(
17384 wkt::internal::UnknownEnumValue::Integer(value),
17385 )),
17386 }
17387 }
17388 }
17389
17390 impl std::convert::From<&str> for FailureCause {
17391 fn from(value: &str) -> Self {
17392 use std::string::ToString;
17393 match value {
17394 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17395 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17396 "EXECUTION_FAILED" => Self::ExecutionFailed,
17397 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17398 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17399 _ => Self::UnknownValue(failure_cause::UnknownValue(
17400 wkt::internal::UnknownEnumValue::String(value.to_string()),
17401 )),
17402 }
17403 }
17404 }
17405
17406 impl serde::ser::Serialize for FailureCause {
17407 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17408 where
17409 S: serde::Serializer,
17410 {
17411 match self {
17412 Self::Unspecified => serializer.serialize_i32(0),
17413 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17414 Self::ExecutionFailed => serializer.serialize_i32(2),
17415 Self::DeadlineExceeded => serializer.serialize_i32(3),
17416 Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17417 Self::UnknownValue(u) => u.0.serialize(serializer),
17418 }
17419 }
17420 }
17421
17422 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17423 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17424 where
17425 D: serde::Deserializer<'de>,
17426 {
17427 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17428 ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
17429 ))
17430 }
17431 }
17432}
17433
17434/// CreateChildRolloutJobRun contains information specific to a
17435/// createChildRollout `JobRun`.
17436#[derive(Clone, Default, PartialEq)]
17437#[non_exhaustive]
17438pub struct CreateChildRolloutJobRun {
17439 /// Output only. Name of the `ChildRollout`. Format is
17440 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17441 pub rollout: std::string::String,
17442
17443 /// Output only. The ID of the childRollout Phase initiated by this JobRun.
17444 pub rollout_phase_id: std::string::String,
17445
17446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17447}
17448
17449impl CreateChildRolloutJobRun {
17450 pub fn new() -> Self {
17451 std::default::Default::default()
17452 }
17453
17454 /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
17455 ///
17456 /// # Example
17457 /// ```ignore,no_run
17458 /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17459 /// let x = CreateChildRolloutJobRun::new().set_rollout("example");
17460 /// ```
17461 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17462 self.rollout = v.into();
17463 self
17464 }
17465
17466 /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
17467 ///
17468 /// # Example
17469 /// ```ignore,no_run
17470 /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17471 /// let x = CreateChildRolloutJobRun::new().set_rollout_phase_id("example");
17472 /// ```
17473 pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17474 mut self,
17475 v: T,
17476 ) -> Self {
17477 self.rollout_phase_id = v.into();
17478 self
17479 }
17480}
17481
17482impl wkt::message::Message for CreateChildRolloutJobRun {
17483 fn typename() -> &'static str {
17484 "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
17485 }
17486}
17487
17488/// AdvanceChildRolloutJobRun contains information specific to a
17489/// advanceChildRollout `JobRun`.
17490#[derive(Clone, Default, PartialEq)]
17491#[non_exhaustive]
17492pub struct AdvanceChildRolloutJobRun {
17493 /// Output only. Name of the `ChildRollout`. Format is
17494 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17495 pub rollout: std::string::String,
17496
17497 /// Output only. the ID of the ChildRollout's Phase.
17498 pub rollout_phase_id: std::string::String,
17499
17500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17501}
17502
17503impl AdvanceChildRolloutJobRun {
17504 pub fn new() -> Self {
17505 std::default::Default::default()
17506 }
17507
17508 /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
17509 ///
17510 /// # Example
17511 /// ```ignore,no_run
17512 /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17513 /// let x = AdvanceChildRolloutJobRun::new().set_rollout("example");
17514 /// ```
17515 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17516 self.rollout = v.into();
17517 self
17518 }
17519
17520 /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
17521 ///
17522 /// # Example
17523 /// ```ignore,no_run
17524 /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17525 /// let x = AdvanceChildRolloutJobRun::new().set_rollout_phase_id("example");
17526 /// ```
17527 pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17528 mut self,
17529 v: T,
17530 ) -> Self {
17531 self.rollout_phase_id = v.into();
17532 self
17533 }
17534}
17535
17536impl wkt::message::Message for AdvanceChildRolloutJobRun {
17537 fn typename() -> &'static str {
17538 "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
17539 }
17540}
17541
17542/// ListJobRunsRequest is the request object used by `ListJobRuns`.
17543#[derive(Clone, Default, PartialEq)]
17544#[non_exhaustive]
17545pub struct ListJobRunsRequest {
17546 /// Required. The `Rollout` which owns this collection of `JobRun` objects.
17547 pub parent: std::string::String,
17548
17549 /// Optional. The maximum number of `JobRun` objects to return. The service may
17550 /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
17551 /// will be returned. The maximum value is 1000; values above 1000 will be set
17552 /// to 1000.
17553 pub page_size: i32,
17554
17555 /// Optional. A page token, received from a previous `ListJobRuns` call.
17556 /// Provide this to retrieve the subsequent page.
17557 ///
17558 /// When paginating, all other provided parameters match the call that provided
17559 /// the page token.
17560 pub page_token: std::string::String,
17561
17562 /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
17563 /// more details.
17564 pub filter: std::string::String,
17565
17566 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
17567 /// more details.
17568 pub order_by: std::string::String,
17569
17570 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17571}
17572
17573impl ListJobRunsRequest {
17574 pub fn new() -> Self {
17575 std::default::Default::default()
17576 }
17577
17578 /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
17579 ///
17580 /// # Example
17581 /// ```ignore,no_run
17582 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17583 /// let x = ListJobRunsRequest::new().set_parent("example");
17584 /// ```
17585 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17586 self.parent = v.into();
17587 self
17588 }
17589
17590 /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
17591 ///
17592 /// # Example
17593 /// ```ignore,no_run
17594 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17595 /// let x = ListJobRunsRequest::new().set_page_size(42);
17596 /// ```
17597 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17598 self.page_size = v.into();
17599 self
17600 }
17601
17602 /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
17603 ///
17604 /// # Example
17605 /// ```ignore,no_run
17606 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17607 /// let x = ListJobRunsRequest::new().set_page_token("example");
17608 /// ```
17609 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17610 self.page_token = v.into();
17611 self
17612 }
17613
17614 /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
17615 ///
17616 /// # Example
17617 /// ```ignore,no_run
17618 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17619 /// let x = ListJobRunsRequest::new().set_filter("example");
17620 /// ```
17621 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17622 self.filter = v.into();
17623 self
17624 }
17625
17626 /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
17627 ///
17628 /// # Example
17629 /// ```ignore,no_run
17630 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17631 /// let x = ListJobRunsRequest::new().set_order_by("example");
17632 /// ```
17633 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17634 self.order_by = v.into();
17635 self
17636 }
17637}
17638
17639impl wkt::message::Message for ListJobRunsRequest {
17640 fn typename() -> &'static str {
17641 "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
17642 }
17643}
17644
17645/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
17646#[derive(Clone, Default, PartialEq)]
17647#[non_exhaustive]
17648pub struct ListJobRunsResponse {
17649 /// The `JobRun` objects.
17650 pub job_runs: std::vec::Vec<crate::model::JobRun>,
17651
17652 /// A token, which can be sent as `page_token` to retrieve the next page. If
17653 /// this field is omitted, there are no subsequent pages.
17654 pub next_page_token: std::string::String,
17655
17656 /// Locations that could not be reached
17657 pub unreachable: std::vec::Vec<std::string::String>,
17658
17659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17660}
17661
17662impl ListJobRunsResponse {
17663 pub fn new() -> Self {
17664 std::default::Default::default()
17665 }
17666
17667 /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
17668 ///
17669 /// # Example
17670 /// ```ignore,no_run
17671 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17672 /// use google_cloud_deploy_v1::model::JobRun;
17673 /// let x = ListJobRunsResponse::new()
17674 /// .set_job_runs([
17675 /// JobRun::default()/* use setters */,
17676 /// JobRun::default()/* use (different) setters */,
17677 /// ]);
17678 /// ```
17679 pub fn set_job_runs<T, V>(mut self, v: T) -> Self
17680 where
17681 T: std::iter::IntoIterator<Item = V>,
17682 V: std::convert::Into<crate::model::JobRun>,
17683 {
17684 use std::iter::Iterator;
17685 self.job_runs = v.into_iter().map(|i| i.into()).collect();
17686 self
17687 }
17688
17689 /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
17690 ///
17691 /// # Example
17692 /// ```ignore,no_run
17693 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17694 /// let x = ListJobRunsResponse::new().set_next_page_token("example");
17695 /// ```
17696 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17697 self.next_page_token = v.into();
17698 self
17699 }
17700
17701 /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
17702 ///
17703 /// # Example
17704 /// ```ignore,no_run
17705 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17706 /// let x = ListJobRunsResponse::new().set_unreachable(["a", "b", "c"]);
17707 /// ```
17708 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17709 where
17710 T: std::iter::IntoIterator<Item = V>,
17711 V: std::convert::Into<std::string::String>,
17712 {
17713 use std::iter::Iterator;
17714 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17715 self
17716 }
17717}
17718
17719impl wkt::message::Message for ListJobRunsResponse {
17720 fn typename() -> &'static str {
17721 "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
17722 }
17723}
17724
17725#[doc(hidden)]
17726impl google_cloud_gax::paginator::internal::PageableResponse for ListJobRunsResponse {
17727 type PageItem = crate::model::JobRun;
17728
17729 fn items(self) -> std::vec::Vec<Self::PageItem> {
17730 self.job_runs
17731 }
17732
17733 fn next_page_token(&self) -> std::string::String {
17734 use std::clone::Clone;
17735 self.next_page_token.clone()
17736 }
17737}
17738
17739/// GetJobRunRequest is the request object used by `GetJobRun`.
17740#[derive(Clone, Default, PartialEq)]
17741#[non_exhaustive]
17742pub struct GetJobRunRequest {
17743 /// Required. Name of the `JobRun`. Format must be
17744 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
17745 pub name: std::string::String,
17746
17747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17748}
17749
17750impl GetJobRunRequest {
17751 pub fn new() -> Self {
17752 std::default::Default::default()
17753 }
17754
17755 /// Sets the value of [name][crate::model::GetJobRunRequest::name].
17756 ///
17757 /// # Example
17758 /// ```ignore,no_run
17759 /// # use google_cloud_deploy_v1::model::GetJobRunRequest;
17760 /// let x = GetJobRunRequest::new().set_name("example");
17761 /// ```
17762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17763 self.name = v.into();
17764 self
17765 }
17766}
17767
17768impl wkt::message::Message for GetJobRunRequest {
17769 fn typename() -> &'static str {
17770 "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
17771 }
17772}
17773
17774/// The request object used by `TerminateJobRun`.
17775#[derive(Clone, Default, PartialEq)]
17776#[non_exhaustive]
17777pub struct TerminateJobRunRequest {
17778 /// Required. Name of the `JobRun`. Format must be
17779 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
17780 pub name: std::string::String,
17781
17782 /// Optional. Deploy policies to override. Format is
17783 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
17784 pub override_deploy_policy: std::vec::Vec<std::string::String>,
17785
17786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17787}
17788
17789impl TerminateJobRunRequest {
17790 pub fn new() -> Self {
17791 std::default::Default::default()
17792 }
17793
17794 /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
17795 ///
17796 /// # Example
17797 /// ```ignore,no_run
17798 /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17799 /// let x = TerminateJobRunRequest::new().set_name("example");
17800 /// ```
17801 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17802 self.name = v.into();
17803 self
17804 }
17805
17806 /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
17807 ///
17808 /// # Example
17809 /// ```ignore,no_run
17810 /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17811 /// let x = TerminateJobRunRequest::new().set_override_deploy_policy(["a", "b", "c"]);
17812 /// ```
17813 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
17814 where
17815 T: std::iter::IntoIterator<Item = V>,
17816 V: std::convert::Into<std::string::String>,
17817 {
17818 use std::iter::Iterator;
17819 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
17820 self
17821 }
17822}
17823
17824impl wkt::message::Message for TerminateJobRunRequest {
17825 fn typename() -> &'static str {
17826 "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
17827 }
17828}
17829
17830/// The response object from `TerminateJobRun`.
17831#[derive(Clone, Default, PartialEq)]
17832#[non_exhaustive]
17833pub struct TerminateJobRunResponse {
17834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17835}
17836
17837impl TerminateJobRunResponse {
17838 pub fn new() -> Self {
17839 std::default::Default::default()
17840 }
17841}
17842
17843impl wkt::message::Message for TerminateJobRunResponse {
17844 fn typename() -> &'static str {
17845 "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
17846 }
17847}
17848
17849/// Service-wide configuration.
17850#[derive(Clone, Default, PartialEq)]
17851#[non_exhaustive]
17852pub struct Config {
17853 /// Name of the configuration.
17854 pub name: std::string::String,
17855
17856 /// All supported versions of Skaffold.
17857 pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
17858
17859 /// Default Skaffold version that is assigned when a Release is created without
17860 /// specifying a Skaffold version.
17861 pub default_skaffold_version: std::string::String,
17862
17863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17864}
17865
17866impl Config {
17867 pub fn new() -> Self {
17868 std::default::Default::default()
17869 }
17870
17871 /// Sets the value of [name][crate::model::Config::name].
17872 ///
17873 /// # Example
17874 /// ```ignore,no_run
17875 /// # use google_cloud_deploy_v1::model::Config;
17876 /// let x = Config::new().set_name("example");
17877 /// ```
17878 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17879 self.name = v.into();
17880 self
17881 }
17882
17883 /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
17884 ///
17885 /// # Example
17886 /// ```ignore,no_run
17887 /// # use google_cloud_deploy_v1::model::Config;
17888 /// use google_cloud_deploy_v1::model::SkaffoldVersion;
17889 /// let x = Config::new()
17890 /// .set_supported_versions([
17891 /// SkaffoldVersion::default()/* use setters */,
17892 /// SkaffoldVersion::default()/* use (different) setters */,
17893 /// ]);
17894 /// ```
17895 pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
17896 where
17897 T: std::iter::IntoIterator<Item = V>,
17898 V: std::convert::Into<crate::model::SkaffoldVersion>,
17899 {
17900 use std::iter::Iterator;
17901 self.supported_versions = v.into_iter().map(|i| i.into()).collect();
17902 self
17903 }
17904
17905 /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
17906 ///
17907 /// # Example
17908 /// ```ignore,no_run
17909 /// # use google_cloud_deploy_v1::model::Config;
17910 /// let x = Config::new().set_default_skaffold_version("example");
17911 /// ```
17912 pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
17913 mut self,
17914 v: T,
17915 ) -> Self {
17916 self.default_skaffold_version = v.into();
17917 self
17918 }
17919}
17920
17921impl wkt::message::Message for Config {
17922 fn typename() -> &'static str {
17923 "type.googleapis.com/google.cloud.deploy.v1.Config"
17924 }
17925}
17926
17927/// Details of a supported Skaffold version.
17928#[derive(Clone, Default, PartialEq)]
17929#[non_exhaustive]
17930pub struct SkaffoldVersion {
17931 /// Release version number. For example, "1.20.3".
17932 pub version: std::string::String,
17933
17934 /// The time at which this version of Skaffold will enter maintenance mode.
17935 pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
17936
17937 /// The time at which this version of Skaffold will no longer be supported.
17938 pub support_expiration_time: std::option::Option<wkt::Timestamp>,
17939
17940 /// Date when this version is expected to no longer be supported.
17941 pub support_end_date: std::option::Option<google_cloud_type::model::Date>,
17942
17943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17944}
17945
17946impl SkaffoldVersion {
17947 pub fn new() -> Self {
17948 std::default::Default::default()
17949 }
17950
17951 /// Sets the value of [version][crate::model::SkaffoldVersion::version].
17952 ///
17953 /// # Example
17954 /// ```ignore,no_run
17955 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17956 /// let x = SkaffoldVersion::new().set_version("example");
17957 /// ```
17958 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17959 self.version = v.into();
17960 self
17961 }
17962
17963 /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
17964 ///
17965 /// # Example
17966 /// ```ignore,no_run
17967 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17968 /// use wkt::Timestamp;
17969 /// let x = SkaffoldVersion::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
17970 /// ```
17971 pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
17972 where
17973 T: std::convert::Into<wkt::Timestamp>,
17974 {
17975 self.maintenance_mode_time = std::option::Option::Some(v.into());
17976 self
17977 }
17978
17979 /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
17980 ///
17981 /// # Example
17982 /// ```ignore,no_run
17983 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17984 /// use wkt::Timestamp;
17985 /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
17986 /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
17987 /// ```
17988 pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
17989 where
17990 T: std::convert::Into<wkt::Timestamp>,
17991 {
17992 self.maintenance_mode_time = v.map(|x| x.into());
17993 self
17994 }
17995
17996 /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
17997 ///
17998 /// # Example
17999 /// ```ignore,no_run
18000 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18001 /// use wkt::Timestamp;
18002 /// let x = SkaffoldVersion::new().set_support_expiration_time(Timestamp::default()/* use setters */);
18003 /// ```
18004 pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
18005 where
18006 T: std::convert::Into<wkt::Timestamp>,
18007 {
18008 self.support_expiration_time = std::option::Option::Some(v.into());
18009 self
18010 }
18011
18012 /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18013 ///
18014 /// # Example
18015 /// ```ignore,no_run
18016 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18017 /// use wkt::Timestamp;
18018 /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
18019 /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(None::<Timestamp>);
18020 /// ```
18021 pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18022 where
18023 T: std::convert::Into<wkt::Timestamp>,
18024 {
18025 self.support_expiration_time = v.map(|x| x.into());
18026 self
18027 }
18028
18029 /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18030 ///
18031 /// # Example
18032 /// ```ignore,no_run
18033 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18034 /// use google_cloud_type::model::Date;
18035 /// let x = SkaffoldVersion::new().set_support_end_date(Date::default()/* use setters */);
18036 /// ```
18037 pub fn set_support_end_date<T>(mut self, v: T) -> Self
18038 where
18039 T: std::convert::Into<google_cloud_type::model::Date>,
18040 {
18041 self.support_end_date = std::option::Option::Some(v.into());
18042 self
18043 }
18044
18045 /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18046 ///
18047 /// # Example
18048 /// ```ignore,no_run
18049 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18050 /// use google_cloud_type::model::Date;
18051 /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(Some(Date::default()/* use setters */));
18052 /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(None::<Date>);
18053 /// ```
18054 pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
18055 where
18056 T: std::convert::Into<google_cloud_type::model::Date>,
18057 {
18058 self.support_end_date = v.map(|x| x.into());
18059 self
18060 }
18061}
18062
18063impl wkt::message::Message for SkaffoldVersion {
18064 fn typename() -> &'static str {
18065 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
18066 }
18067}
18068
18069/// Request to get a configuration.
18070#[derive(Clone, Default, PartialEq)]
18071#[non_exhaustive]
18072pub struct GetConfigRequest {
18073 /// Required. Name of requested configuration.
18074 pub name: std::string::String,
18075
18076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18077}
18078
18079impl GetConfigRequest {
18080 pub fn new() -> Self {
18081 std::default::Default::default()
18082 }
18083
18084 /// Sets the value of [name][crate::model::GetConfigRequest::name].
18085 ///
18086 /// # Example
18087 /// ```ignore,no_run
18088 /// # use google_cloud_deploy_v1::model::GetConfigRequest;
18089 /// let x = GetConfigRequest::new().set_name("example");
18090 /// ```
18091 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18092 self.name = v.into();
18093 self
18094 }
18095}
18096
18097impl wkt::message::Message for GetConfigRequest {
18098 fn typename() -> &'static str {
18099 "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
18100 }
18101}
18102
18103/// An `Automation` resource in the Cloud Deploy API.
18104///
18105/// An `Automation` enables the automation of manually driven actions for
18106/// a Delivery Pipeline, which includes Release promotion among Targets,
18107/// Rollout repair and Rollout deployment strategy advancement. The intention
18108/// of Automation is to reduce manual intervention in the continuous delivery
18109/// process.
18110#[derive(Clone, Default, PartialEq)]
18111#[non_exhaustive]
18112pub struct Automation {
18113 /// Output only. Name of the `Automation`. Format is
18114 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
18115 pub name: std::string::String,
18116
18117 /// Output only. Unique identifier of the `Automation`.
18118 pub uid: std::string::String,
18119
18120 /// Optional. Description of the `Automation`. Max length is 255 characters.
18121 pub description: std::string::String,
18122
18123 /// Output only. Time at which the automation was created.
18124 pub create_time: std::option::Option<wkt::Timestamp>,
18125
18126 /// Output only. Time at which the automation was updated.
18127 pub update_time: std::option::Option<wkt::Timestamp>,
18128
18129 /// Optional. User annotations. These attributes can only be set and used by
18130 /// the user, and not by Cloud Deploy. Annotations must meet the following
18131 /// constraints:
18132 ///
18133 /// * Annotations are key/value pairs.
18134 /// * Valid annotation keys have two segments: an optional prefix and name,
18135 /// separated by a slash (`/`).
18136 /// * The name segment is required and must be 63 characters or less,
18137 /// beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
18138 /// dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
18139 /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
18140 /// a series of DNS labels separated by dots(`.`), not longer than 253
18141 /// characters in total, followed by a slash (`/`).
18142 ///
18143 /// See
18144 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
18145 /// for more details.
18146 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18147
18148 /// Optional. Labels are attributes that can be set and used by both the
18149 /// user and by Cloud Deploy. Labels must meet the following constraints:
18150 ///
18151 /// * Keys and values can contain only lowercase letters, numeric characters,
18152 /// underscores, and dashes.
18153 /// * All characters must use UTF-8 encoding, and international characters are
18154 /// allowed.
18155 /// * Keys must start with a lowercase letter or international character.
18156 /// * Each resource is limited to a maximum of 64 labels.
18157 ///
18158 /// Both keys and values are additionally constrained to be <= 63 characters.
18159 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18160
18161 /// Optional. The weak etag of the `Automation` resource.
18162 /// This checksum is computed by the server based on the value of other
18163 /// fields, and may be sent on update and delete requests to ensure the
18164 /// client has an up-to-date value before proceeding.
18165 pub etag: std::string::String,
18166
18167 /// Optional. When Suspended, automation is deactivated from execution.
18168 pub suspended: bool,
18169
18170 /// Required. Email address of the user-managed IAM service account that
18171 /// creates Cloud Deploy release and rollout resources.
18172 pub service_account: std::string::String,
18173
18174 /// Required. Selected resources to which the automation will be applied.
18175 pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
18176
18177 /// Required. List of Automation rules associated with the Automation resource.
18178 /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
18179 /// Note: the order of the rules here is not the same as the order of
18180 /// execution.
18181 pub rules: std::vec::Vec<crate::model::AutomationRule>,
18182
18183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18184}
18185
18186impl Automation {
18187 pub fn new() -> Self {
18188 std::default::Default::default()
18189 }
18190
18191 /// Sets the value of [name][crate::model::Automation::name].
18192 ///
18193 /// # Example
18194 /// ```ignore,no_run
18195 /// # use google_cloud_deploy_v1::model::Automation;
18196 /// let x = Automation::new().set_name("example");
18197 /// ```
18198 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18199 self.name = v.into();
18200 self
18201 }
18202
18203 /// Sets the value of [uid][crate::model::Automation::uid].
18204 ///
18205 /// # Example
18206 /// ```ignore,no_run
18207 /// # use google_cloud_deploy_v1::model::Automation;
18208 /// let x = Automation::new().set_uid("example");
18209 /// ```
18210 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18211 self.uid = v.into();
18212 self
18213 }
18214
18215 /// Sets the value of [description][crate::model::Automation::description].
18216 ///
18217 /// # Example
18218 /// ```ignore,no_run
18219 /// # use google_cloud_deploy_v1::model::Automation;
18220 /// let x = Automation::new().set_description("example");
18221 /// ```
18222 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18223 self.description = v.into();
18224 self
18225 }
18226
18227 /// Sets the value of [create_time][crate::model::Automation::create_time].
18228 ///
18229 /// # Example
18230 /// ```ignore,no_run
18231 /// # use google_cloud_deploy_v1::model::Automation;
18232 /// use wkt::Timestamp;
18233 /// let x = Automation::new().set_create_time(Timestamp::default()/* use setters */);
18234 /// ```
18235 pub fn set_create_time<T>(mut self, v: T) -> Self
18236 where
18237 T: std::convert::Into<wkt::Timestamp>,
18238 {
18239 self.create_time = std::option::Option::Some(v.into());
18240 self
18241 }
18242
18243 /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
18244 ///
18245 /// # Example
18246 /// ```ignore,no_run
18247 /// # use google_cloud_deploy_v1::model::Automation;
18248 /// use wkt::Timestamp;
18249 /// let x = Automation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18250 /// let x = Automation::new().set_or_clear_create_time(None::<Timestamp>);
18251 /// ```
18252 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18253 where
18254 T: std::convert::Into<wkt::Timestamp>,
18255 {
18256 self.create_time = v.map(|x| x.into());
18257 self
18258 }
18259
18260 /// Sets the value of [update_time][crate::model::Automation::update_time].
18261 ///
18262 /// # Example
18263 /// ```ignore,no_run
18264 /// # use google_cloud_deploy_v1::model::Automation;
18265 /// use wkt::Timestamp;
18266 /// let x = Automation::new().set_update_time(Timestamp::default()/* use setters */);
18267 /// ```
18268 pub fn set_update_time<T>(mut self, v: T) -> Self
18269 where
18270 T: std::convert::Into<wkt::Timestamp>,
18271 {
18272 self.update_time = std::option::Option::Some(v.into());
18273 self
18274 }
18275
18276 /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
18277 ///
18278 /// # Example
18279 /// ```ignore,no_run
18280 /// # use google_cloud_deploy_v1::model::Automation;
18281 /// use wkt::Timestamp;
18282 /// let x = Automation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18283 /// let x = Automation::new().set_or_clear_update_time(None::<Timestamp>);
18284 /// ```
18285 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18286 where
18287 T: std::convert::Into<wkt::Timestamp>,
18288 {
18289 self.update_time = v.map(|x| x.into());
18290 self
18291 }
18292
18293 /// Sets the value of [annotations][crate::model::Automation::annotations].
18294 ///
18295 /// # Example
18296 /// ```ignore,no_run
18297 /// # use google_cloud_deploy_v1::model::Automation;
18298 /// let x = Automation::new().set_annotations([
18299 /// ("key0", "abc"),
18300 /// ("key1", "xyz"),
18301 /// ]);
18302 /// ```
18303 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18304 where
18305 T: std::iter::IntoIterator<Item = (K, V)>,
18306 K: std::convert::Into<std::string::String>,
18307 V: std::convert::Into<std::string::String>,
18308 {
18309 use std::iter::Iterator;
18310 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18311 self
18312 }
18313
18314 /// Sets the value of [labels][crate::model::Automation::labels].
18315 ///
18316 /// # Example
18317 /// ```ignore,no_run
18318 /// # use google_cloud_deploy_v1::model::Automation;
18319 /// let x = Automation::new().set_labels([
18320 /// ("key0", "abc"),
18321 /// ("key1", "xyz"),
18322 /// ]);
18323 /// ```
18324 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18325 where
18326 T: std::iter::IntoIterator<Item = (K, V)>,
18327 K: std::convert::Into<std::string::String>,
18328 V: std::convert::Into<std::string::String>,
18329 {
18330 use std::iter::Iterator;
18331 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18332 self
18333 }
18334
18335 /// Sets the value of [etag][crate::model::Automation::etag].
18336 ///
18337 /// # Example
18338 /// ```ignore,no_run
18339 /// # use google_cloud_deploy_v1::model::Automation;
18340 /// let x = Automation::new().set_etag("example");
18341 /// ```
18342 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18343 self.etag = v.into();
18344 self
18345 }
18346
18347 /// Sets the value of [suspended][crate::model::Automation::suspended].
18348 ///
18349 /// # Example
18350 /// ```ignore,no_run
18351 /// # use google_cloud_deploy_v1::model::Automation;
18352 /// let x = Automation::new().set_suspended(true);
18353 /// ```
18354 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18355 self.suspended = v.into();
18356 self
18357 }
18358
18359 /// Sets the value of [service_account][crate::model::Automation::service_account].
18360 ///
18361 /// # Example
18362 /// ```ignore,no_run
18363 /// # use google_cloud_deploy_v1::model::Automation;
18364 /// let x = Automation::new().set_service_account("example");
18365 /// ```
18366 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18367 self.service_account = v.into();
18368 self
18369 }
18370
18371 /// Sets the value of [selector][crate::model::Automation::selector].
18372 ///
18373 /// # Example
18374 /// ```ignore,no_run
18375 /// # use google_cloud_deploy_v1::model::Automation;
18376 /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18377 /// let x = Automation::new().set_selector(AutomationResourceSelector::default()/* use setters */);
18378 /// ```
18379 pub fn set_selector<T>(mut self, v: T) -> Self
18380 where
18381 T: std::convert::Into<crate::model::AutomationResourceSelector>,
18382 {
18383 self.selector = std::option::Option::Some(v.into());
18384 self
18385 }
18386
18387 /// Sets or clears the value of [selector][crate::model::Automation::selector].
18388 ///
18389 /// # Example
18390 /// ```ignore,no_run
18391 /// # use google_cloud_deploy_v1::model::Automation;
18392 /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18393 /// let x = Automation::new().set_or_clear_selector(Some(AutomationResourceSelector::default()/* use setters */));
18394 /// let x = Automation::new().set_or_clear_selector(None::<AutomationResourceSelector>);
18395 /// ```
18396 pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
18397 where
18398 T: std::convert::Into<crate::model::AutomationResourceSelector>,
18399 {
18400 self.selector = v.map(|x| x.into());
18401 self
18402 }
18403
18404 /// Sets the value of [rules][crate::model::Automation::rules].
18405 ///
18406 /// # Example
18407 /// ```ignore,no_run
18408 /// # use google_cloud_deploy_v1::model::Automation;
18409 /// use google_cloud_deploy_v1::model::AutomationRule;
18410 /// let x = Automation::new()
18411 /// .set_rules([
18412 /// AutomationRule::default()/* use setters */,
18413 /// AutomationRule::default()/* use (different) setters */,
18414 /// ]);
18415 /// ```
18416 pub fn set_rules<T, V>(mut self, v: T) -> Self
18417 where
18418 T: std::iter::IntoIterator<Item = V>,
18419 V: std::convert::Into<crate::model::AutomationRule>,
18420 {
18421 use std::iter::Iterator;
18422 self.rules = v.into_iter().map(|i| i.into()).collect();
18423 self
18424 }
18425}
18426
18427impl wkt::message::Message for Automation {
18428 fn typename() -> &'static str {
18429 "type.googleapis.com/google.cloud.deploy.v1.Automation"
18430 }
18431}
18432
18433/// AutomationResourceSelector contains the information to select the resources
18434/// to which an Automation is going to be applied.
18435#[derive(Clone, Default, PartialEq)]
18436#[non_exhaustive]
18437pub struct AutomationResourceSelector {
18438 /// Optional. Contains attributes about a target.
18439 pub targets: std::vec::Vec<crate::model::TargetAttribute>,
18440
18441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18442}
18443
18444impl AutomationResourceSelector {
18445 pub fn new() -> Self {
18446 std::default::Default::default()
18447 }
18448
18449 /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
18450 ///
18451 /// # Example
18452 /// ```ignore,no_run
18453 /// # use google_cloud_deploy_v1::model::AutomationResourceSelector;
18454 /// use google_cloud_deploy_v1::model::TargetAttribute;
18455 /// let x = AutomationResourceSelector::new()
18456 /// .set_targets([
18457 /// TargetAttribute::default()/* use setters */,
18458 /// TargetAttribute::default()/* use (different) setters */,
18459 /// ]);
18460 /// ```
18461 pub fn set_targets<T, V>(mut self, v: T) -> Self
18462 where
18463 T: std::iter::IntoIterator<Item = V>,
18464 V: std::convert::Into<crate::model::TargetAttribute>,
18465 {
18466 use std::iter::Iterator;
18467 self.targets = v.into_iter().map(|i| i.into()).collect();
18468 self
18469 }
18470}
18471
18472impl wkt::message::Message for AutomationResourceSelector {
18473 fn typename() -> &'static str {
18474 "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
18475 }
18476}
18477
18478/// `AutomationRule` defines the automation activities.
18479#[derive(Clone, Default, PartialEq)]
18480#[non_exhaustive]
18481pub struct AutomationRule {
18482 /// The configuration of the Automation rule.
18483 pub rule: std::option::Option<crate::model::automation_rule::Rule>,
18484
18485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18486}
18487
18488impl AutomationRule {
18489 pub fn new() -> Self {
18490 std::default::Default::default()
18491 }
18492
18493 /// Sets the value of [rule][crate::model::AutomationRule::rule].
18494 ///
18495 /// Note that all the setters affecting `rule` are mutually
18496 /// exclusive.
18497 ///
18498 /// # Example
18499 /// ```ignore,no_run
18500 /// # use google_cloud_deploy_v1::model::AutomationRule;
18501 /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18502 /// let x = AutomationRule::new().set_rule(Some(
18503 /// google_cloud_deploy_v1::model::automation_rule::Rule::PromoteReleaseRule(PromoteReleaseRule::default().into())));
18504 /// ```
18505 pub fn set_rule<
18506 T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
18507 >(
18508 mut self,
18509 v: T,
18510 ) -> Self {
18511 self.rule = v.into();
18512 self
18513 }
18514
18515 /// The value of [rule][crate::model::AutomationRule::rule]
18516 /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
18517 /// holds a different branch.
18518 pub fn promote_release_rule(
18519 &self,
18520 ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
18521 #[allow(unreachable_patterns)]
18522 self.rule.as_ref().and_then(|v| match v {
18523 crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
18524 std::option::Option::Some(v)
18525 }
18526 _ => std::option::Option::None,
18527 })
18528 }
18529
18530 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18531 /// to hold a `PromoteReleaseRule`.
18532 ///
18533 /// Note that all the setters affecting `rule` are
18534 /// mutually exclusive.
18535 ///
18536 /// # Example
18537 /// ```ignore,no_run
18538 /// # use google_cloud_deploy_v1::model::AutomationRule;
18539 /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18540 /// let x = AutomationRule::new().set_promote_release_rule(PromoteReleaseRule::default()/* use setters */);
18541 /// assert!(x.promote_release_rule().is_some());
18542 /// assert!(x.advance_rollout_rule().is_none());
18543 /// assert!(x.repair_rollout_rule().is_none());
18544 /// assert!(x.timed_promote_release_rule().is_none());
18545 /// ```
18546 pub fn set_promote_release_rule<
18547 T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
18548 >(
18549 mut self,
18550 v: T,
18551 ) -> Self {
18552 self.rule = std::option::Option::Some(
18553 crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
18554 );
18555 self
18556 }
18557
18558 /// The value of [rule][crate::model::AutomationRule::rule]
18559 /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
18560 /// holds a different branch.
18561 pub fn advance_rollout_rule(
18562 &self,
18563 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
18564 #[allow(unreachable_patterns)]
18565 self.rule.as_ref().and_then(|v| match v {
18566 crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
18567 std::option::Option::Some(v)
18568 }
18569 _ => std::option::Option::None,
18570 })
18571 }
18572
18573 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18574 /// to hold a `AdvanceRolloutRule`.
18575 ///
18576 /// Note that all the setters affecting `rule` are
18577 /// mutually exclusive.
18578 ///
18579 /// # Example
18580 /// ```ignore,no_run
18581 /// # use google_cloud_deploy_v1::model::AutomationRule;
18582 /// use google_cloud_deploy_v1::model::AdvanceRolloutRule;
18583 /// let x = AutomationRule::new().set_advance_rollout_rule(AdvanceRolloutRule::default()/* use setters */);
18584 /// assert!(x.advance_rollout_rule().is_some());
18585 /// assert!(x.promote_release_rule().is_none());
18586 /// assert!(x.repair_rollout_rule().is_none());
18587 /// assert!(x.timed_promote_release_rule().is_none());
18588 /// ```
18589 pub fn set_advance_rollout_rule<
18590 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
18591 >(
18592 mut self,
18593 v: T,
18594 ) -> Self {
18595 self.rule = std::option::Option::Some(
18596 crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
18597 );
18598 self
18599 }
18600
18601 /// The value of [rule][crate::model::AutomationRule::rule]
18602 /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
18603 /// holds a different branch.
18604 pub fn repair_rollout_rule(
18605 &self,
18606 ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
18607 #[allow(unreachable_patterns)]
18608 self.rule.as_ref().and_then(|v| match v {
18609 crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
18610 std::option::Option::Some(v)
18611 }
18612 _ => std::option::Option::None,
18613 })
18614 }
18615
18616 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18617 /// to hold a `RepairRolloutRule`.
18618 ///
18619 /// Note that all the setters affecting `rule` are
18620 /// mutually exclusive.
18621 ///
18622 /// # Example
18623 /// ```ignore,no_run
18624 /// # use google_cloud_deploy_v1::model::AutomationRule;
18625 /// use google_cloud_deploy_v1::model::RepairRolloutRule;
18626 /// let x = AutomationRule::new().set_repair_rollout_rule(RepairRolloutRule::default()/* use setters */);
18627 /// assert!(x.repair_rollout_rule().is_some());
18628 /// assert!(x.promote_release_rule().is_none());
18629 /// assert!(x.advance_rollout_rule().is_none());
18630 /// assert!(x.timed_promote_release_rule().is_none());
18631 /// ```
18632 pub fn set_repair_rollout_rule<
18633 T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
18634 >(
18635 mut self,
18636 v: T,
18637 ) -> Self {
18638 self.rule = std::option::Option::Some(
18639 crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
18640 );
18641 self
18642 }
18643
18644 /// The value of [rule][crate::model::AutomationRule::rule]
18645 /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
18646 /// holds a different branch.
18647 pub fn timed_promote_release_rule(
18648 &self,
18649 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
18650 #[allow(unreachable_patterns)]
18651 self.rule.as_ref().and_then(|v| match v {
18652 crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
18653 std::option::Option::Some(v)
18654 }
18655 _ => std::option::Option::None,
18656 })
18657 }
18658
18659 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18660 /// to hold a `TimedPromoteReleaseRule`.
18661 ///
18662 /// Note that all the setters affecting `rule` are
18663 /// mutually exclusive.
18664 ///
18665 /// # Example
18666 /// ```ignore,no_run
18667 /// # use google_cloud_deploy_v1::model::AutomationRule;
18668 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18669 /// let x = AutomationRule::new().set_timed_promote_release_rule(TimedPromoteReleaseRule::default()/* use setters */);
18670 /// assert!(x.timed_promote_release_rule().is_some());
18671 /// assert!(x.promote_release_rule().is_none());
18672 /// assert!(x.advance_rollout_rule().is_none());
18673 /// assert!(x.repair_rollout_rule().is_none());
18674 /// ```
18675 pub fn set_timed_promote_release_rule<
18676 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
18677 >(
18678 mut self,
18679 v: T,
18680 ) -> Self {
18681 self.rule = std::option::Option::Some(
18682 crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
18683 );
18684 self
18685 }
18686}
18687
18688impl wkt::message::Message for AutomationRule {
18689 fn typename() -> &'static str {
18690 "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
18691 }
18692}
18693
18694/// Defines additional types related to [AutomationRule].
18695pub mod automation_rule {
18696 #[allow(unused_imports)]
18697 use super::*;
18698
18699 /// The configuration of the Automation rule.
18700 #[derive(Clone, Debug, PartialEq)]
18701 #[non_exhaustive]
18702 pub enum Rule {
18703 /// Optional. `PromoteReleaseRule` will automatically promote a release from
18704 /// the current target to a specified target.
18705 PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
18706 /// Optional. The `AdvanceRolloutRule` will automatically advance a
18707 /// successful Rollout.
18708 AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
18709 /// Optional. The `RepairRolloutRule` will automatically repair a failed
18710 /// rollout.
18711 RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
18712 /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
18713 /// release from the current target(s) to the specified target(s) on a
18714 /// configured schedule.
18715 TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
18716 }
18717}
18718
18719/// The `TimedPromoteReleaseRule` will automatically promote a release from the
18720/// current target(s) to the specified target(s) on a configured schedule.
18721#[derive(Clone, Default, PartialEq)]
18722#[non_exhaustive]
18723pub struct TimedPromoteReleaseRule {
18724 /// Required. ID of the rule. This ID must be unique in the `Automation`
18725 /// resource to which this rule belongs. The format is
18726 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
18727 pub id: std::string::String,
18728
18729 /// Optional. The ID of the stage in the pipeline to which this `Release` is
18730 /// deploying. If unspecified, default it to the next stage in the promotion
18731 /// flow. The value of this field could be one of the following:
18732 ///
18733 /// * The last segment of a target name
18734 /// * "@next", the next target in the promotion sequence
18735 pub destination_target_id: std::string::String,
18736
18737 /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
18738 /// 9am.
18739 pub schedule: std::string::String,
18740
18741 /// Required. The time zone in IANA format [IANA Time Zone
18742 /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
18743 pub time_zone: std::string::String,
18744
18745 /// Output only. Information around the state of the Automation rule.
18746 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18747
18748 /// Optional. The starting phase of the rollout created by this rule. Default
18749 /// to the first phase.
18750 pub destination_phase: std::string::String,
18751
18752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18753}
18754
18755impl TimedPromoteReleaseRule {
18756 pub fn new() -> Self {
18757 std::default::Default::default()
18758 }
18759
18760 /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
18761 ///
18762 /// # Example
18763 /// ```ignore,no_run
18764 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18765 /// let x = TimedPromoteReleaseRule::new().set_id("example");
18766 /// ```
18767 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18768 self.id = v.into();
18769 self
18770 }
18771
18772 /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
18773 ///
18774 /// # Example
18775 /// ```ignore,no_run
18776 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18777 /// let x = TimedPromoteReleaseRule::new().set_destination_target_id("example");
18778 /// ```
18779 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18780 mut self,
18781 v: T,
18782 ) -> Self {
18783 self.destination_target_id = v.into();
18784 self
18785 }
18786
18787 /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
18788 ///
18789 /// # Example
18790 /// ```ignore,no_run
18791 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18792 /// let x = TimedPromoteReleaseRule::new().set_schedule("example");
18793 /// ```
18794 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18795 self.schedule = v.into();
18796 self
18797 }
18798
18799 /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
18800 ///
18801 /// # Example
18802 /// ```ignore,no_run
18803 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18804 /// let x = TimedPromoteReleaseRule::new().set_time_zone("example");
18805 /// ```
18806 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18807 self.time_zone = v.into();
18808 self
18809 }
18810
18811 /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18812 ///
18813 /// # Example
18814 /// ```ignore,no_run
18815 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18816 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18817 /// let x = TimedPromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18818 /// ```
18819 pub fn set_condition<T>(mut self, v: T) -> Self
18820 where
18821 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18822 {
18823 self.condition = std::option::Option::Some(v.into());
18824 self
18825 }
18826
18827 /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18828 ///
18829 /// # Example
18830 /// ```ignore,no_run
18831 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18832 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18833 /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18834 /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18835 /// ```
18836 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18837 where
18838 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18839 {
18840 self.condition = v.map(|x| x.into());
18841 self
18842 }
18843
18844 /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
18845 ///
18846 /// # Example
18847 /// ```ignore,no_run
18848 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18849 /// let x = TimedPromoteReleaseRule::new().set_destination_phase("example");
18850 /// ```
18851 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
18852 mut self,
18853 v: T,
18854 ) -> Self {
18855 self.destination_phase = v.into();
18856 self
18857 }
18858}
18859
18860impl wkt::message::Message for TimedPromoteReleaseRule {
18861 fn typename() -> &'static str {
18862 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
18863 }
18864}
18865
18866/// The `PromoteRelease` rule will automatically promote a release from the
18867/// current target to a specified target.
18868#[derive(Clone, Default, PartialEq)]
18869#[non_exhaustive]
18870pub struct PromoteReleaseRule {
18871 /// Required. ID of the rule. This id must be unique in the `Automation`
18872 /// resource to which this rule belongs. The format is
18873 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
18874 pub id: std::string::String,
18875
18876 /// Optional. How long the release need to be paused until being promoted to
18877 /// the next target.
18878 pub wait: std::option::Option<wkt::Duration>,
18879
18880 /// Optional. The ID of the stage in the pipeline to which this `Release` is
18881 /// deploying. If unspecified, default it to the next stage in the promotion
18882 /// flow. The value of this field could be one of the following:
18883 ///
18884 /// * The last segment of a target name
18885 /// * "@next", the next target in the promotion sequence
18886 pub destination_target_id: std::string::String,
18887
18888 /// Output only. Information around the state of the Automation rule.
18889 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18890
18891 /// Optional. The starting phase of the rollout created by this operation.
18892 /// Default to the first phase.
18893 pub destination_phase: std::string::String,
18894
18895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18896}
18897
18898impl PromoteReleaseRule {
18899 pub fn new() -> Self {
18900 std::default::Default::default()
18901 }
18902
18903 /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
18904 ///
18905 /// # Example
18906 /// ```ignore,no_run
18907 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18908 /// let x = PromoteReleaseRule::new().set_id("example");
18909 /// ```
18910 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18911 self.id = v.into();
18912 self
18913 }
18914
18915 /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
18916 ///
18917 /// # Example
18918 /// ```ignore,no_run
18919 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18920 /// use wkt::Duration;
18921 /// let x = PromoteReleaseRule::new().set_wait(Duration::default()/* use setters */);
18922 /// ```
18923 pub fn set_wait<T>(mut self, v: T) -> Self
18924 where
18925 T: std::convert::Into<wkt::Duration>,
18926 {
18927 self.wait = std::option::Option::Some(v.into());
18928 self
18929 }
18930
18931 /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
18932 ///
18933 /// # Example
18934 /// ```ignore,no_run
18935 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18936 /// use wkt::Duration;
18937 /// let x = PromoteReleaseRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
18938 /// let x = PromoteReleaseRule::new().set_or_clear_wait(None::<Duration>);
18939 /// ```
18940 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
18941 where
18942 T: std::convert::Into<wkt::Duration>,
18943 {
18944 self.wait = v.map(|x| x.into());
18945 self
18946 }
18947
18948 /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
18949 ///
18950 /// # Example
18951 /// ```ignore,no_run
18952 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18953 /// let x = PromoteReleaseRule::new().set_destination_target_id("example");
18954 /// ```
18955 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18956 mut self,
18957 v: T,
18958 ) -> Self {
18959 self.destination_target_id = v.into();
18960 self
18961 }
18962
18963 /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
18964 ///
18965 /// # Example
18966 /// ```ignore,no_run
18967 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18968 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18969 /// let x = PromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18970 /// ```
18971 pub fn set_condition<T>(mut self, v: T) -> Self
18972 where
18973 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18974 {
18975 self.condition = std::option::Option::Some(v.into());
18976 self
18977 }
18978
18979 /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
18980 ///
18981 /// # Example
18982 /// ```ignore,no_run
18983 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18984 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18985 /// let x = PromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18986 /// let x = PromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18987 /// ```
18988 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18989 where
18990 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18991 {
18992 self.condition = v.map(|x| x.into());
18993 self
18994 }
18995
18996 /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
18997 ///
18998 /// # Example
18999 /// ```ignore,no_run
19000 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19001 /// let x = PromoteReleaseRule::new().set_destination_phase("example");
19002 /// ```
19003 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19004 mut self,
19005 v: T,
19006 ) -> Self {
19007 self.destination_phase = v.into();
19008 self
19009 }
19010}
19011
19012impl wkt::message::Message for PromoteReleaseRule {
19013 fn typename() -> &'static str {
19014 "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
19015 }
19016}
19017
19018/// The `AdvanceRollout` automation rule will automatically advance a successful
19019/// Rollout to the next phase.
19020#[derive(Clone, Default, PartialEq)]
19021#[non_exhaustive]
19022pub struct AdvanceRolloutRule {
19023 /// Required. ID of the rule. This id must be unique in the `Automation`
19024 /// resource to which this rule belongs. The format is
19025 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19026 pub id: std::string::String,
19027
19028 /// Optional. Proceeds only after phase name matched any one in the list.
19029 /// This value must consist of lower-case letters, numbers, and hyphens,
19030 /// start with a letter and end with a letter or a number, and have a max
19031 /// length of 63 characters. In other words, it must match the following
19032 /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19033 pub source_phases: std::vec::Vec<std::string::String>,
19034
19035 /// Optional. How long to wait after a rollout is finished.
19036 pub wait: std::option::Option<wkt::Duration>,
19037
19038 /// Output only. Information around the state of the Automation rule.
19039 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19040
19041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19042}
19043
19044impl AdvanceRolloutRule {
19045 pub fn new() -> Self {
19046 std::default::Default::default()
19047 }
19048
19049 /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
19050 ///
19051 /// # Example
19052 /// ```ignore,no_run
19053 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19054 /// let x = AdvanceRolloutRule::new().set_id("example");
19055 /// ```
19056 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19057 self.id = v.into();
19058 self
19059 }
19060
19061 /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
19062 ///
19063 /// # Example
19064 /// ```ignore,no_run
19065 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19066 /// let x = AdvanceRolloutRule::new().set_source_phases(["a", "b", "c"]);
19067 /// ```
19068 pub fn set_source_phases<T, V>(mut self, v: T) -> Self
19069 where
19070 T: std::iter::IntoIterator<Item = V>,
19071 V: std::convert::Into<std::string::String>,
19072 {
19073 use std::iter::Iterator;
19074 self.source_phases = v.into_iter().map(|i| i.into()).collect();
19075 self
19076 }
19077
19078 /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
19079 ///
19080 /// # Example
19081 /// ```ignore,no_run
19082 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19083 /// use wkt::Duration;
19084 /// let x = AdvanceRolloutRule::new().set_wait(Duration::default()/* use setters */);
19085 /// ```
19086 pub fn set_wait<T>(mut self, v: T) -> Self
19087 where
19088 T: std::convert::Into<wkt::Duration>,
19089 {
19090 self.wait = std::option::Option::Some(v.into());
19091 self
19092 }
19093
19094 /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
19095 ///
19096 /// # Example
19097 /// ```ignore,no_run
19098 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19099 /// use wkt::Duration;
19100 /// let x = AdvanceRolloutRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19101 /// let x = AdvanceRolloutRule::new().set_or_clear_wait(None::<Duration>);
19102 /// ```
19103 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19104 where
19105 T: std::convert::Into<wkt::Duration>,
19106 {
19107 self.wait = v.map(|x| x.into());
19108 self
19109 }
19110
19111 /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
19112 ///
19113 /// # Example
19114 /// ```ignore,no_run
19115 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19116 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19117 /// let x = AdvanceRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19118 /// ```
19119 pub fn set_condition<T>(mut self, v: T) -> Self
19120 where
19121 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19122 {
19123 self.condition = std::option::Option::Some(v.into());
19124 self
19125 }
19126
19127 /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
19128 ///
19129 /// # Example
19130 /// ```ignore,no_run
19131 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19132 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19133 /// let x = AdvanceRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19134 /// let x = AdvanceRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19135 /// ```
19136 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19137 where
19138 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19139 {
19140 self.condition = v.map(|x| x.into());
19141 self
19142 }
19143}
19144
19145impl wkt::message::Message for AdvanceRolloutRule {
19146 fn typename() -> &'static str {
19147 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
19148 }
19149}
19150
19151/// The `RepairRolloutRule` automation rule will automatically repair a failed
19152/// `Rollout`.
19153#[derive(Clone, Default, PartialEq)]
19154#[non_exhaustive]
19155pub struct RepairRolloutRule {
19156 /// Required. ID of the rule. This id must be unique in the `Automation`
19157 /// resource to which this rule belongs. The format is
19158 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19159 pub id: std::string::String,
19160
19161 /// Optional. Phases within which jobs are subject to automatic repair actions
19162 /// on failure. Proceeds only after phase name matched any one in the list, or
19163 /// for all phases if unspecified. This value must consist of lower-case
19164 /// letters, numbers, and hyphens, start with a letter and end with a letter or
19165 /// a number, and have a max length of 63 characters. In other words, it must
19166 /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19167 pub phases: std::vec::Vec<std::string::String>,
19168
19169 /// Optional. Jobs to repair. Proceeds only after job name matched any one in
19170 /// the list, or for all jobs if unspecified or empty. The phase that includes
19171 /// the job must match the phase ID specified in `source_phase`. This value
19172 /// must consist of lower-case letters, numbers, and hyphens, start with a
19173 /// letter and end with a letter or a number, and have a max length of 63
19174 /// characters. In other words, it must match the following regex:
19175 /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19176 pub jobs: std::vec::Vec<std::string::String>,
19177
19178 /// Output only. Information around the state of the 'Automation' rule.
19179 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19180
19181 /// Required. Defines the types of automatic repair phases for failed jobs.
19182 pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
19183
19184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19185}
19186
19187impl RepairRolloutRule {
19188 pub fn new() -> Self {
19189 std::default::Default::default()
19190 }
19191
19192 /// Sets the value of [id][crate::model::RepairRolloutRule::id].
19193 ///
19194 /// # Example
19195 /// ```ignore,no_run
19196 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19197 /// let x = RepairRolloutRule::new().set_id("example");
19198 /// ```
19199 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19200 self.id = v.into();
19201 self
19202 }
19203
19204 /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
19205 ///
19206 /// # Example
19207 /// ```ignore,no_run
19208 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19209 /// let x = RepairRolloutRule::new().set_phases(["a", "b", "c"]);
19210 /// ```
19211 pub fn set_phases<T, V>(mut self, v: T) -> Self
19212 where
19213 T: std::iter::IntoIterator<Item = V>,
19214 V: std::convert::Into<std::string::String>,
19215 {
19216 use std::iter::Iterator;
19217 self.phases = v.into_iter().map(|i| i.into()).collect();
19218 self
19219 }
19220
19221 /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
19222 ///
19223 /// # Example
19224 /// ```ignore,no_run
19225 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19226 /// let x = RepairRolloutRule::new().set_jobs(["a", "b", "c"]);
19227 /// ```
19228 pub fn set_jobs<T, V>(mut self, v: T) -> Self
19229 where
19230 T: std::iter::IntoIterator<Item = V>,
19231 V: std::convert::Into<std::string::String>,
19232 {
19233 use std::iter::Iterator;
19234 self.jobs = v.into_iter().map(|i| i.into()).collect();
19235 self
19236 }
19237
19238 /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
19239 ///
19240 /// # Example
19241 /// ```ignore,no_run
19242 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19243 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19244 /// let x = RepairRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19245 /// ```
19246 pub fn set_condition<T>(mut self, v: T) -> Self
19247 where
19248 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19249 {
19250 self.condition = std::option::Option::Some(v.into());
19251 self
19252 }
19253
19254 /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
19255 ///
19256 /// # Example
19257 /// ```ignore,no_run
19258 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19259 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19260 /// let x = RepairRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19261 /// let x = RepairRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19262 /// ```
19263 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19264 where
19265 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19266 {
19267 self.condition = v.map(|x| x.into());
19268 self
19269 }
19270
19271 /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
19272 ///
19273 /// # Example
19274 /// ```ignore,no_run
19275 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19276 /// use google_cloud_deploy_v1::model::RepairPhaseConfig;
19277 /// let x = RepairRolloutRule::new()
19278 /// .set_repair_phases([
19279 /// RepairPhaseConfig::default()/* use setters */,
19280 /// RepairPhaseConfig::default()/* use (different) setters */,
19281 /// ]);
19282 /// ```
19283 pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
19284 where
19285 T: std::iter::IntoIterator<Item = V>,
19286 V: std::convert::Into<crate::model::RepairPhaseConfig>,
19287 {
19288 use std::iter::Iterator;
19289 self.repair_phases = v.into_iter().map(|i| i.into()).collect();
19290 self
19291 }
19292}
19293
19294impl wkt::message::Message for RepairRolloutRule {
19295 fn typename() -> &'static str {
19296 "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
19297 }
19298}
19299
19300/// Configuration of the repair phase.
19301#[derive(Clone, Default, PartialEq)]
19302#[non_exhaustive]
19303pub struct RepairPhaseConfig {
19304 /// The repair phase to perform.
19305 pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
19306
19307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19308}
19309
19310impl RepairPhaseConfig {
19311 pub fn new() -> Self {
19312 std::default::Default::default()
19313 }
19314
19315 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
19316 ///
19317 /// Note that all the setters affecting `repair_phase` are mutually
19318 /// exclusive.
19319 ///
19320 /// # Example
19321 /// ```ignore,no_run
19322 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19323 /// use google_cloud_deploy_v1::model::Retry;
19324 /// let x = RepairPhaseConfig::new().set_repair_phase(Some(
19325 /// google_cloud_deploy_v1::model::repair_phase_config::RepairPhase::Retry(Retry::default().into())));
19326 /// ```
19327 pub fn set_repair_phase<
19328 T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
19329 >(
19330 mut self,
19331 v: T,
19332 ) -> Self {
19333 self.repair_phase = v.into();
19334 self
19335 }
19336
19337 /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19338 /// if it holds a `Retry`, `None` if the field is not set or
19339 /// holds a different branch.
19340 pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
19341 #[allow(unreachable_patterns)]
19342 self.repair_phase.as_ref().and_then(|v| match v {
19343 crate::model::repair_phase_config::RepairPhase::Retry(v) => {
19344 std::option::Option::Some(v)
19345 }
19346 _ => std::option::Option::None,
19347 })
19348 }
19349
19350 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19351 /// to hold a `Retry`.
19352 ///
19353 /// Note that all the setters affecting `repair_phase` are
19354 /// mutually exclusive.
19355 ///
19356 /// # Example
19357 /// ```ignore,no_run
19358 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19359 /// use google_cloud_deploy_v1::model::Retry;
19360 /// let x = RepairPhaseConfig::new().set_retry(Retry::default()/* use setters */);
19361 /// assert!(x.retry().is_some());
19362 /// assert!(x.rollback().is_none());
19363 /// ```
19364 pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
19365 mut self,
19366 v: T,
19367 ) -> Self {
19368 self.repair_phase = std::option::Option::Some(
19369 crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
19370 );
19371 self
19372 }
19373
19374 /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19375 /// if it holds a `Rollback`, `None` if the field is not set or
19376 /// holds a different branch.
19377 pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
19378 #[allow(unreachable_patterns)]
19379 self.repair_phase.as_ref().and_then(|v| match v {
19380 crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
19381 std::option::Option::Some(v)
19382 }
19383 _ => std::option::Option::None,
19384 })
19385 }
19386
19387 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19388 /// to hold a `Rollback`.
19389 ///
19390 /// Note that all the setters affecting `repair_phase` are
19391 /// mutually exclusive.
19392 ///
19393 /// # Example
19394 /// ```ignore,no_run
19395 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19396 /// use google_cloud_deploy_v1::model::Rollback;
19397 /// let x = RepairPhaseConfig::new().set_rollback(Rollback::default()/* use setters */);
19398 /// assert!(x.rollback().is_some());
19399 /// assert!(x.retry().is_none());
19400 /// ```
19401 pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
19402 mut self,
19403 v: T,
19404 ) -> Self {
19405 self.repair_phase = std::option::Option::Some(
19406 crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
19407 );
19408 self
19409 }
19410}
19411
19412impl wkt::message::Message for RepairPhaseConfig {
19413 fn typename() -> &'static str {
19414 "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
19415 }
19416}
19417
19418/// Defines additional types related to [RepairPhaseConfig].
19419pub mod repair_phase_config {
19420 #[allow(unused_imports)]
19421 use super::*;
19422
19423 /// The repair phase to perform.
19424 #[derive(Clone, Debug, PartialEq)]
19425 #[non_exhaustive]
19426 pub enum RepairPhase {
19427 /// Optional. Retries a failed job.
19428 Retry(std::boxed::Box<crate::model::Retry>),
19429 /// Optional. Rolls back a `Rollout`.
19430 Rollback(std::boxed::Box<crate::model::Rollback>),
19431 }
19432}
19433
19434/// Retries the failed job.
19435#[derive(Clone, Default, PartialEq)]
19436#[non_exhaustive]
19437pub struct Retry {
19438 /// Required. Total number of retries. Retry is skipped if set to 0; The
19439 /// minimum value is 1, and the maximum value is 10.
19440 pub attempts: i64,
19441
19442 /// Optional. How long to wait for the first retry. Default is 0, and the
19443 /// maximum value is 14d.
19444 pub wait: std::option::Option<wkt::Duration>,
19445
19446 /// Optional. The pattern of how wait time will be increased. Default is
19447 /// linear. Backoff mode will be ignored if `wait` is 0.
19448 pub backoff_mode: crate::model::BackoffMode,
19449
19450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19451}
19452
19453impl Retry {
19454 pub fn new() -> Self {
19455 std::default::Default::default()
19456 }
19457
19458 /// Sets the value of [attempts][crate::model::Retry::attempts].
19459 ///
19460 /// # Example
19461 /// ```ignore,no_run
19462 /// # use google_cloud_deploy_v1::model::Retry;
19463 /// let x = Retry::new().set_attempts(42);
19464 /// ```
19465 pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19466 self.attempts = v.into();
19467 self
19468 }
19469
19470 /// Sets the value of [wait][crate::model::Retry::wait].
19471 ///
19472 /// # Example
19473 /// ```ignore,no_run
19474 /// # use google_cloud_deploy_v1::model::Retry;
19475 /// use wkt::Duration;
19476 /// let x = Retry::new().set_wait(Duration::default()/* use setters */);
19477 /// ```
19478 pub fn set_wait<T>(mut self, v: T) -> Self
19479 where
19480 T: std::convert::Into<wkt::Duration>,
19481 {
19482 self.wait = std::option::Option::Some(v.into());
19483 self
19484 }
19485
19486 /// Sets or clears the value of [wait][crate::model::Retry::wait].
19487 ///
19488 /// # Example
19489 /// ```ignore,no_run
19490 /// # use google_cloud_deploy_v1::model::Retry;
19491 /// use wkt::Duration;
19492 /// let x = Retry::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19493 /// let x = Retry::new().set_or_clear_wait(None::<Duration>);
19494 /// ```
19495 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19496 where
19497 T: std::convert::Into<wkt::Duration>,
19498 {
19499 self.wait = v.map(|x| x.into());
19500 self
19501 }
19502
19503 /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
19504 ///
19505 /// # Example
19506 /// ```ignore,no_run
19507 /// # use google_cloud_deploy_v1::model::Retry;
19508 /// use google_cloud_deploy_v1::model::BackoffMode;
19509 /// let x0 = Retry::new().set_backoff_mode(BackoffMode::Linear);
19510 /// let x1 = Retry::new().set_backoff_mode(BackoffMode::Exponential);
19511 /// ```
19512 pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
19513 mut self,
19514 v: T,
19515 ) -> Self {
19516 self.backoff_mode = v.into();
19517 self
19518 }
19519}
19520
19521impl wkt::message::Message for Retry {
19522 fn typename() -> &'static str {
19523 "type.googleapis.com/google.cloud.deploy.v1.Retry"
19524 }
19525}
19526
19527/// Rolls back a `Rollout`.
19528#[derive(Clone, Default, PartialEq)]
19529#[non_exhaustive]
19530pub struct Rollback {
19531 /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
19532 /// `Rollout` will start in the stable phase.
19533 pub destination_phase: std::string::String,
19534
19535 /// Optional. If pending rollout exists on the target, the rollback operation
19536 /// will be aborted.
19537 pub disable_rollback_if_rollout_pending: bool,
19538
19539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19540}
19541
19542impl Rollback {
19543 pub fn new() -> Self {
19544 std::default::Default::default()
19545 }
19546
19547 /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
19548 ///
19549 /// # Example
19550 /// ```ignore,no_run
19551 /// # use google_cloud_deploy_v1::model::Rollback;
19552 /// let x = Rollback::new().set_destination_phase("example");
19553 /// ```
19554 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19555 mut self,
19556 v: T,
19557 ) -> Self {
19558 self.destination_phase = v.into();
19559 self
19560 }
19561
19562 /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
19563 ///
19564 /// # Example
19565 /// ```ignore,no_run
19566 /// # use google_cloud_deploy_v1::model::Rollback;
19567 /// let x = Rollback::new().set_disable_rollback_if_rollout_pending(true);
19568 /// ```
19569 pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
19570 mut self,
19571 v: T,
19572 ) -> Self {
19573 self.disable_rollback_if_rollout_pending = v.into();
19574 self
19575 }
19576}
19577
19578impl wkt::message::Message for Rollback {
19579 fn typename() -> &'static str {
19580 "type.googleapis.com/google.cloud.deploy.v1.Rollback"
19581 }
19582}
19583
19584/// `AutomationRuleCondition` contains conditions relevant to an
19585/// `Automation` rule.
19586#[derive(Clone, Default, PartialEq)]
19587#[non_exhaustive]
19588pub struct AutomationRuleCondition {
19589 /// Optional. Details around targets enumerated in the rule.
19590 pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
19591
19592 /// Details specific to the automation rule type.
19593 pub rule_type_condition:
19594 std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19595
19596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19597}
19598
19599impl AutomationRuleCondition {
19600 pub fn new() -> Self {
19601 std::default::Default::default()
19602 }
19603
19604 /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19605 ///
19606 /// # Example
19607 /// ```ignore,no_run
19608 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19609 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19610 /// let x = AutomationRuleCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
19611 /// ```
19612 pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
19613 where
19614 T: std::convert::Into<crate::model::TargetsPresentCondition>,
19615 {
19616 self.targets_present_condition = std::option::Option::Some(v.into());
19617 self
19618 }
19619
19620 /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19621 ///
19622 /// # Example
19623 /// ```ignore,no_run
19624 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19625 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19626 /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
19627 /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
19628 /// ```
19629 pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
19630 where
19631 T: std::convert::Into<crate::model::TargetsPresentCondition>,
19632 {
19633 self.targets_present_condition = v.map(|x| x.into());
19634 self
19635 }
19636
19637 /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
19638 ///
19639 /// Note that all the setters affecting `rule_type_condition` are mutually
19640 /// exclusive.
19641 ///
19642 /// # Example
19643 /// ```ignore,no_run
19644 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19645 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19646 /// let x = AutomationRuleCondition::new().set_rule_type_condition(Some(
19647 /// google_cloud_deploy_v1::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(TimedPromoteReleaseCondition::default().into())));
19648 /// ```
19649 pub fn set_rule_type_condition<
19650 T: std::convert::Into<
19651 std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19652 >,
19653 >(
19654 mut self,
19655 v: T,
19656 ) -> Self {
19657 self.rule_type_condition = v.into();
19658 self
19659 }
19660
19661 /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19662 /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
19663 /// holds a different branch.
19664 pub fn timed_promote_release_condition(
19665 &self,
19666 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
19667 #[allow(unreachable_patterns)]
19668 self.rule_type_condition.as_ref().and_then(|v| match v {
19669 crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
19670 _ => std::option::Option::None,
19671 })
19672 }
19673
19674 /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19675 /// to hold a `TimedPromoteReleaseCondition`.
19676 ///
19677 /// Note that all the setters affecting `rule_type_condition` are
19678 /// mutually exclusive.
19679 ///
19680 /// # Example
19681 /// ```ignore,no_run
19682 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19683 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19684 /// let x = AutomationRuleCondition::new().set_timed_promote_release_condition(TimedPromoteReleaseCondition::default()/* use setters */);
19685 /// assert!(x.timed_promote_release_condition().is_some());
19686 /// ```
19687 pub fn set_timed_promote_release_condition<
19688 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
19689 >(
19690 mut self,
19691 v: T,
19692 ) -> Self {
19693 self.rule_type_condition = std::option::Option::Some(
19694 crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
19695 v.into()
19696 )
19697 );
19698 self
19699 }
19700}
19701
19702impl wkt::message::Message for AutomationRuleCondition {
19703 fn typename() -> &'static str {
19704 "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
19705 }
19706}
19707
19708/// Defines additional types related to [AutomationRuleCondition].
19709pub mod automation_rule_condition {
19710 #[allow(unused_imports)]
19711 use super::*;
19712
19713 /// Details specific to the automation rule type.
19714 #[derive(Clone, Debug, PartialEq)]
19715 #[non_exhaustive]
19716 pub enum RuleTypeCondition {
19717 /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
19718 /// to a an Automation with a timed promote release rule defined.
19719 TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
19720 }
19721}
19722
19723/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
19724/// with a Timed Promote Release rule defined.
19725#[derive(Clone, Default, PartialEq)]
19726#[non_exhaustive]
19727pub struct TimedPromoteReleaseCondition {
19728 /// Output only. When the next scheduled promotion(s) will occur.
19729 pub next_promotion_time: std::option::Option<wkt::Timestamp>,
19730
19731 /// Output only. A list of targets involved in the upcoming timed promotion(s).
19732 pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
19733
19734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19735}
19736
19737impl TimedPromoteReleaseCondition {
19738 pub fn new() -> Self {
19739 std::default::Default::default()
19740 }
19741
19742 /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19743 ///
19744 /// # Example
19745 /// ```ignore,no_run
19746 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19747 /// use wkt::Timestamp;
19748 /// let x = TimedPromoteReleaseCondition::new().set_next_promotion_time(Timestamp::default()/* use setters */);
19749 /// ```
19750 pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
19751 where
19752 T: std::convert::Into<wkt::Timestamp>,
19753 {
19754 self.next_promotion_time = std::option::Option::Some(v.into());
19755 self
19756 }
19757
19758 /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19759 ///
19760 /// # Example
19761 /// ```ignore,no_run
19762 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19763 /// use wkt::Timestamp;
19764 /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(Some(Timestamp::default()/* use setters */));
19765 /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(None::<Timestamp>);
19766 /// ```
19767 pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
19768 where
19769 T: std::convert::Into<wkt::Timestamp>,
19770 {
19771 self.next_promotion_time = v.map(|x| x.into());
19772 self
19773 }
19774
19775 /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
19776 ///
19777 /// # Example
19778 /// ```ignore,no_run
19779 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19780 /// use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19781 /// let x = TimedPromoteReleaseCondition::new()
19782 /// .set_targets_list([
19783 /// Targets::default()/* use setters */,
19784 /// Targets::default()/* use (different) setters */,
19785 /// ]);
19786 /// ```
19787 pub fn set_targets_list<T, V>(mut self, v: T) -> Self
19788 where
19789 T: std::iter::IntoIterator<Item = V>,
19790 V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
19791 {
19792 use std::iter::Iterator;
19793 self.targets_list = v.into_iter().map(|i| i.into()).collect();
19794 self
19795 }
19796}
19797
19798impl wkt::message::Message for TimedPromoteReleaseCondition {
19799 fn typename() -> &'static str {
19800 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
19801 }
19802}
19803
19804/// Defines additional types related to [TimedPromoteReleaseCondition].
19805pub mod timed_promote_release_condition {
19806 #[allow(unused_imports)]
19807 use super::*;
19808
19809 /// The targets involved in a single timed promotion.
19810 #[derive(Clone, Default, PartialEq)]
19811 #[non_exhaustive]
19812 pub struct Targets {
19813 /// Optional. The source target ID.
19814 pub source_target_id: std::string::String,
19815
19816 /// Optional. The destination target ID.
19817 pub destination_target_id: std::string::String,
19818
19819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19820 }
19821
19822 impl Targets {
19823 pub fn new() -> Self {
19824 std::default::Default::default()
19825 }
19826
19827 /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
19828 ///
19829 /// # Example
19830 /// ```ignore,no_run
19831 /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19832 /// let x = Targets::new().set_source_target_id("example");
19833 /// ```
19834 pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
19835 mut self,
19836 v: T,
19837 ) -> Self {
19838 self.source_target_id = v.into();
19839 self
19840 }
19841
19842 /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
19843 ///
19844 /// # Example
19845 /// ```ignore,no_run
19846 /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19847 /// let x = Targets::new().set_destination_target_id("example");
19848 /// ```
19849 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19850 mut self,
19851 v: T,
19852 ) -> Self {
19853 self.destination_target_id = v.into();
19854 self
19855 }
19856 }
19857
19858 impl wkt::message::Message for Targets {
19859 fn typename() -> &'static str {
19860 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
19861 }
19862 }
19863}
19864
19865/// The request object for `CreateAutomation`.
19866#[derive(Clone, Default, PartialEq)]
19867#[non_exhaustive]
19868pub struct CreateAutomationRequest {
19869 /// Required. The parent collection in which the `Automation` must be created.
19870 /// The format is
19871 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
19872 pub parent: std::string::String,
19873
19874 /// Required. ID of the `Automation`.
19875 pub automation_id: std::string::String,
19876
19877 /// Required. The `Automation` to create.
19878 pub automation: std::option::Option<crate::model::Automation>,
19879
19880 /// Optional. A request ID to identify requests. Specify a unique request ID
19881 /// so that if you must retry your request, the server knows to ignore the
19882 /// request if it has already been completed. The server guarantees that for
19883 /// at least 60 minutes after the first request.
19884 ///
19885 /// For example, consider a situation where you make an initial request and the
19886 /// request times out. If you make the request again with the same request ID,
19887 /// the server can check if original operation with the same request ID was
19888 /// received, and if so, will ignore the second request. This prevents clients
19889 /// from accidentally creating duplicate commitments.
19890 ///
19891 /// The request ID must be a valid UUID with the exception that zero UUID is
19892 /// not supported (00000000-0000-0000-0000-000000000000).
19893 pub request_id: std::string::String,
19894
19895 /// Optional. If set to true, the request is validated and the user is provided
19896 /// with an expected result, but no actual change is made.
19897 pub validate_only: bool,
19898
19899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19900}
19901
19902impl CreateAutomationRequest {
19903 pub fn new() -> Self {
19904 std::default::Default::default()
19905 }
19906
19907 /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
19908 ///
19909 /// # Example
19910 /// ```ignore,no_run
19911 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19912 /// let x = CreateAutomationRequest::new().set_parent("example");
19913 /// ```
19914 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19915 self.parent = v.into();
19916 self
19917 }
19918
19919 /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
19920 ///
19921 /// # Example
19922 /// ```ignore,no_run
19923 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19924 /// let x = CreateAutomationRequest::new().set_automation_id("example");
19925 /// ```
19926 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19927 self.automation_id = v.into();
19928 self
19929 }
19930
19931 /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
19932 ///
19933 /// # Example
19934 /// ```ignore,no_run
19935 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19936 /// use google_cloud_deploy_v1::model::Automation;
19937 /// let x = CreateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
19938 /// ```
19939 pub fn set_automation<T>(mut self, v: T) -> Self
19940 where
19941 T: std::convert::Into<crate::model::Automation>,
19942 {
19943 self.automation = std::option::Option::Some(v.into());
19944 self
19945 }
19946
19947 /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
19948 ///
19949 /// # Example
19950 /// ```ignore,no_run
19951 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19952 /// use google_cloud_deploy_v1::model::Automation;
19953 /// let x = CreateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
19954 /// let x = CreateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
19955 /// ```
19956 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
19957 where
19958 T: std::convert::Into<crate::model::Automation>,
19959 {
19960 self.automation = v.map(|x| x.into());
19961 self
19962 }
19963
19964 /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
19965 ///
19966 /// # Example
19967 /// ```ignore,no_run
19968 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19969 /// let x = CreateAutomationRequest::new().set_request_id("example");
19970 /// ```
19971 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19972 self.request_id = v.into();
19973 self
19974 }
19975
19976 /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
19977 ///
19978 /// # Example
19979 /// ```ignore,no_run
19980 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19981 /// let x = CreateAutomationRequest::new().set_validate_only(true);
19982 /// ```
19983 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19984 self.validate_only = v.into();
19985 self
19986 }
19987}
19988
19989impl wkt::message::Message for CreateAutomationRequest {
19990 fn typename() -> &'static str {
19991 "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
19992 }
19993}
19994
19995/// The request object for `UpdateAutomation`.
19996#[derive(Clone, Default, PartialEq)]
19997#[non_exhaustive]
19998pub struct UpdateAutomationRequest {
19999 /// Required. Field mask is used to specify the fields to be overwritten by the
20000 /// update in the `Automation` resource. The fields specified in the
20001 /// update_mask are relative to the resource, not the full request. A field
20002 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
20003 /// then all fields are overwritten.
20004 pub update_mask: std::option::Option<wkt::FieldMask>,
20005
20006 /// Required. The `Automation` to update.
20007 pub automation: std::option::Option<crate::model::Automation>,
20008
20009 /// Optional. A request ID to identify requests. Specify a unique request ID
20010 /// so that if you must retry your request, the server knows to ignore the
20011 /// request if it has already been completed. The server guarantees that for
20012 /// at least 60 minutes after the first request.
20013 ///
20014 /// For example, consider a situation where you make an initial request and the
20015 /// request times out. If you make the request again with the same request ID,
20016 /// the server can check if original operation with the same request ID was
20017 /// received, and if so, will ignore the second request. This prevents clients
20018 /// from accidentally creating duplicate commitments.
20019 ///
20020 /// The request ID must be a valid UUID with the exception that zero UUID is
20021 /// not supported (00000000-0000-0000-0000-000000000000).
20022 pub request_id: std::string::String,
20023
20024 /// Optional. If set to true, updating a `Automation` that does not exist will
20025 /// result in the creation of a new `Automation`.
20026 pub allow_missing: bool,
20027
20028 /// Optional. If set to true, the request is validated and the user is provided
20029 /// with an expected result, but no actual change is made.
20030 pub validate_only: bool,
20031
20032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20033}
20034
20035impl UpdateAutomationRequest {
20036 pub fn new() -> Self {
20037 std::default::Default::default()
20038 }
20039
20040 /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20041 ///
20042 /// # Example
20043 /// ```ignore,no_run
20044 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20045 /// use wkt::FieldMask;
20046 /// let x = UpdateAutomationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20047 /// ```
20048 pub fn set_update_mask<T>(mut self, v: T) -> Self
20049 where
20050 T: std::convert::Into<wkt::FieldMask>,
20051 {
20052 self.update_mask = std::option::Option::Some(v.into());
20053 self
20054 }
20055
20056 /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20057 ///
20058 /// # Example
20059 /// ```ignore,no_run
20060 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20061 /// use wkt::FieldMask;
20062 /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20063 /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20064 /// ```
20065 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20066 where
20067 T: std::convert::Into<wkt::FieldMask>,
20068 {
20069 self.update_mask = v.map(|x| x.into());
20070 self
20071 }
20072
20073 /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
20074 ///
20075 /// # Example
20076 /// ```ignore,no_run
20077 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20078 /// use google_cloud_deploy_v1::model::Automation;
20079 /// let x = UpdateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20080 /// ```
20081 pub fn set_automation<T>(mut self, v: T) -> Self
20082 where
20083 T: std::convert::Into<crate::model::Automation>,
20084 {
20085 self.automation = std::option::Option::Some(v.into());
20086 self
20087 }
20088
20089 /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
20090 ///
20091 /// # Example
20092 /// ```ignore,no_run
20093 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20094 /// use google_cloud_deploy_v1::model::Automation;
20095 /// let x = UpdateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20096 /// let x = UpdateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20097 /// ```
20098 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20099 where
20100 T: std::convert::Into<crate::model::Automation>,
20101 {
20102 self.automation = v.map(|x| x.into());
20103 self
20104 }
20105
20106 /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
20107 ///
20108 /// # Example
20109 /// ```ignore,no_run
20110 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20111 /// let x = UpdateAutomationRequest::new().set_request_id("example");
20112 /// ```
20113 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20114 self.request_id = v.into();
20115 self
20116 }
20117
20118 /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
20119 ///
20120 /// # Example
20121 /// ```ignore,no_run
20122 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20123 /// let x = UpdateAutomationRequest::new().set_allow_missing(true);
20124 /// ```
20125 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20126 self.allow_missing = v.into();
20127 self
20128 }
20129
20130 /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
20131 ///
20132 /// # Example
20133 /// ```ignore,no_run
20134 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20135 /// let x = UpdateAutomationRequest::new().set_validate_only(true);
20136 /// ```
20137 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20138 self.validate_only = v.into();
20139 self
20140 }
20141}
20142
20143impl wkt::message::Message for UpdateAutomationRequest {
20144 fn typename() -> &'static str {
20145 "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
20146 }
20147}
20148
20149/// The request object for `DeleteAutomation`.
20150#[derive(Clone, Default, PartialEq)]
20151#[non_exhaustive]
20152pub struct DeleteAutomationRequest {
20153 /// Required. The name of the `Automation` to delete. The format is
20154 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20155 pub name: std::string::String,
20156
20157 /// Optional. A request ID to identify requests. Specify a unique request ID
20158 /// so that if you must retry your request, the server knows to ignore the
20159 /// request if it has already been completed. The server guarantees that for
20160 /// at least 60 minutes after the first request.
20161 ///
20162 /// For example, consider a situation where you make an initial request and the
20163 /// request times out. If you make the request again with the same request ID,
20164 /// the server can check if original operation with the same request ID was
20165 /// received, and if so, will ignore the second request. This prevents clients
20166 /// from accidentally creating duplicate commitments.
20167 ///
20168 /// The request ID must be a valid UUID with the exception that zero UUID is
20169 /// not supported (00000000-0000-0000-0000-000000000000).
20170 pub request_id: std::string::String,
20171
20172 /// Optional. If set to true, then deleting an already deleted or non-existing
20173 /// `Automation` will succeed.
20174 pub allow_missing: bool,
20175
20176 /// Optional. If set, validate the request and verify whether the resource
20177 /// exists, but do not actually post it.
20178 pub validate_only: bool,
20179
20180 /// Optional. The weak etag of the request.
20181 /// This checksum is computed by the server based on the value of other
20182 /// fields, and may be sent on update and delete requests to ensure the
20183 /// client has an up-to-date value before proceeding.
20184 pub etag: std::string::String,
20185
20186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20187}
20188
20189impl DeleteAutomationRequest {
20190 pub fn new() -> Self {
20191 std::default::Default::default()
20192 }
20193
20194 /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
20195 ///
20196 /// # Example
20197 /// ```ignore,no_run
20198 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20199 /// let x = DeleteAutomationRequest::new().set_name("example");
20200 /// ```
20201 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20202 self.name = v.into();
20203 self
20204 }
20205
20206 /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
20207 ///
20208 /// # Example
20209 /// ```ignore,no_run
20210 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20211 /// let x = DeleteAutomationRequest::new().set_request_id("example");
20212 /// ```
20213 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20214 self.request_id = v.into();
20215 self
20216 }
20217
20218 /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
20219 ///
20220 /// # Example
20221 /// ```ignore,no_run
20222 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20223 /// let x = DeleteAutomationRequest::new().set_allow_missing(true);
20224 /// ```
20225 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20226 self.allow_missing = v.into();
20227 self
20228 }
20229
20230 /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
20231 ///
20232 /// # Example
20233 /// ```ignore,no_run
20234 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20235 /// let x = DeleteAutomationRequest::new().set_validate_only(true);
20236 /// ```
20237 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20238 self.validate_only = v.into();
20239 self
20240 }
20241
20242 /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
20243 ///
20244 /// # Example
20245 /// ```ignore,no_run
20246 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20247 /// let x = DeleteAutomationRequest::new().set_etag("example");
20248 /// ```
20249 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20250 self.etag = v.into();
20251 self
20252 }
20253}
20254
20255impl wkt::message::Message for DeleteAutomationRequest {
20256 fn typename() -> &'static str {
20257 "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
20258 }
20259}
20260
20261/// The request object for `ListAutomations`.
20262#[derive(Clone, Default, PartialEq)]
20263#[non_exhaustive]
20264pub struct ListAutomationsRequest {
20265 /// Required. The parent `Delivery Pipeline`, which owns this collection of
20266 /// automations. Format must be
20267 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20268 pub parent: std::string::String,
20269
20270 /// The maximum number of automations to return. The service may return
20271 /// fewer than this value. If unspecified, at most 50 automations will
20272 /// be returned. The maximum value is 1000; values above 1000 will be set
20273 /// to 1000.
20274 pub page_size: i32,
20275
20276 /// A page token, received from a previous `ListAutomations` call.
20277 /// Provide this to retrieve the subsequent page.
20278 ///
20279 /// When paginating, all other provided parameters match
20280 /// the call that provided the page token.
20281 pub page_token: std::string::String,
20282
20283 /// Filter automations to be returned. All fields can be used in the
20284 /// filter.
20285 pub filter: std::string::String,
20286
20287 /// Field to sort by.
20288 pub order_by: std::string::String,
20289
20290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20291}
20292
20293impl ListAutomationsRequest {
20294 pub fn new() -> Self {
20295 std::default::Default::default()
20296 }
20297
20298 /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
20299 ///
20300 /// # Example
20301 /// ```ignore,no_run
20302 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20303 /// let x = ListAutomationsRequest::new().set_parent("example");
20304 /// ```
20305 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20306 self.parent = v.into();
20307 self
20308 }
20309
20310 /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
20311 ///
20312 /// # Example
20313 /// ```ignore,no_run
20314 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20315 /// let x = ListAutomationsRequest::new().set_page_size(42);
20316 /// ```
20317 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20318 self.page_size = v.into();
20319 self
20320 }
20321
20322 /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
20323 ///
20324 /// # Example
20325 /// ```ignore,no_run
20326 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20327 /// let x = ListAutomationsRequest::new().set_page_token("example");
20328 /// ```
20329 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20330 self.page_token = v.into();
20331 self
20332 }
20333
20334 /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
20335 ///
20336 /// # Example
20337 /// ```ignore,no_run
20338 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20339 /// let x = ListAutomationsRequest::new().set_filter("example");
20340 /// ```
20341 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20342 self.filter = v.into();
20343 self
20344 }
20345
20346 /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
20347 ///
20348 /// # Example
20349 /// ```ignore,no_run
20350 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20351 /// let x = ListAutomationsRequest::new().set_order_by("example");
20352 /// ```
20353 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20354 self.order_by = v.into();
20355 self
20356 }
20357}
20358
20359impl wkt::message::Message for ListAutomationsRequest {
20360 fn typename() -> &'static str {
20361 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
20362 }
20363}
20364
20365/// The response object from `ListAutomations`.
20366#[derive(Clone, Default, PartialEq)]
20367#[non_exhaustive]
20368pub struct ListAutomationsResponse {
20369 /// The `Automation` objects.
20370 pub automations: std::vec::Vec<crate::model::Automation>,
20371
20372 /// A token, which can be sent as `page_token` to retrieve the next page.
20373 /// If this field is omitted, there are no subsequent pages.
20374 pub next_page_token: std::string::String,
20375
20376 /// Locations that could not be reached.
20377 pub unreachable: std::vec::Vec<std::string::String>,
20378
20379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20380}
20381
20382impl ListAutomationsResponse {
20383 pub fn new() -> Self {
20384 std::default::Default::default()
20385 }
20386
20387 /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
20388 ///
20389 /// # Example
20390 /// ```ignore,no_run
20391 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20392 /// use google_cloud_deploy_v1::model::Automation;
20393 /// let x = ListAutomationsResponse::new()
20394 /// .set_automations([
20395 /// Automation::default()/* use setters */,
20396 /// Automation::default()/* use (different) setters */,
20397 /// ]);
20398 /// ```
20399 pub fn set_automations<T, V>(mut self, v: T) -> Self
20400 where
20401 T: std::iter::IntoIterator<Item = V>,
20402 V: std::convert::Into<crate::model::Automation>,
20403 {
20404 use std::iter::Iterator;
20405 self.automations = v.into_iter().map(|i| i.into()).collect();
20406 self
20407 }
20408
20409 /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
20410 ///
20411 /// # Example
20412 /// ```ignore,no_run
20413 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20414 /// let x = ListAutomationsResponse::new().set_next_page_token("example");
20415 /// ```
20416 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20417 self.next_page_token = v.into();
20418 self
20419 }
20420
20421 /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
20422 ///
20423 /// # Example
20424 /// ```ignore,no_run
20425 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20426 /// let x = ListAutomationsResponse::new().set_unreachable(["a", "b", "c"]);
20427 /// ```
20428 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20429 where
20430 T: std::iter::IntoIterator<Item = V>,
20431 V: std::convert::Into<std::string::String>,
20432 {
20433 use std::iter::Iterator;
20434 self.unreachable = v.into_iter().map(|i| i.into()).collect();
20435 self
20436 }
20437}
20438
20439impl wkt::message::Message for ListAutomationsResponse {
20440 fn typename() -> &'static str {
20441 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
20442 }
20443}
20444
20445#[doc(hidden)]
20446impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationsResponse {
20447 type PageItem = crate::model::Automation;
20448
20449 fn items(self) -> std::vec::Vec<Self::PageItem> {
20450 self.automations
20451 }
20452
20453 fn next_page_token(&self) -> std::string::String {
20454 use std::clone::Clone;
20455 self.next_page_token.clone()
20456 }
20457}
20458
20459/// The request object for `GetAutomation`
20460#[derive(Clone, Default, PartialEq)]
20461#[non_exhaustive]
20462pub struct GetAutomationRequest {
20463 /// Required. Name of the `Automation`. Format must be
20464 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20465 pub name: std::string::String,
20466
20467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20468}
20469
20470impl GetAutomationRequest {
20471 pub fn new() -> Self {
20472 std::default::Default::default()
20473 }
20474
20475 /// Sets the value of [name][crate::model::GetAutomationRequest::name].
20476 ///
20477 /// # Example
20478 /// ```ignore,no_run
20479 /// # use google_cloud_deploy_v1::model::GetAutomationRequest;
20480 /// let x = GetAutomationRequest::new().set_name("example");
20481 /// ```
20482 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20483 self.name = v.into();
20484 self
20485 }
20486}
20487
20488impl wkt::message::Message for GetAutomationRequest {
20489 fn typename() -> &'static str {
20490 "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
20491 }
20492}
20493
20494/// An `AutomationRun` resource in the Cloud Deploy API.
20495///
20496/// An `AutomationRun` represents an execution instance of an
20497/// automation rule.
20498#[derive(Clone, Default, PartialEq)]
20499#[non_exhaustive]
20500pub struct AutomationRun {
20501 /// Output only. Name of the `AutomationRun`. Format is
20502 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
20503 pub name: std::string::String,
20504
20505 /// Output only. Time at which the `AutomationRun` was created.
20506 pub create_time: std::option::Option<wkt::Timestamp>,
20507
20508 /// Output only. Time at which the automationRun was updated.
20509 pub update_time: std::option::Option<wkt::Timestamp>,
20510
20511 /// Output only. The weak etag of the `AutomationRun` resource.
20512 /// This checksum is computed by the server based on the value of other
20513 /// fields, and may be sent on update and delete requests to ensure the
20514 /// client has an up-to-date value before proceeding.
20515 pub etag: std::string::String,
20516
20517 /// Output only. Email address of the user-managed IAM service account that
20518 /// performs the operations against Cloud Deploy resources.
20519 pub service_account: std::string::String,
20520
20521 /// Output only. Snapshot of the Automation taken at AutomationRun creation
20522 /// time.
20523 pub automation_snapshot: std::option::Option<crate::model::Automation>,
20524
20525 /// Output only. The ID of the source target that initiates the
20526 /// `AutomationRun`. The value of this field is the last segment of a target
20527 /// name.
20528 pub target_id: std::string::String,
20529
20530 /// Output only. Current state of the `AutomationRun`.
20531 pub state: crate::model::automation_run::State,
20532
20533 /// Output only. Explains the current state of the `AutomationRun`. Present
20534 /// only when an explanation is needed.
20535 pub state_description: std::string::String,
20536
20537 /// Output only. Contains information about what policies prevented the
20538 /// `AutomationRun` from proceeding.
20539 pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
20540
20541 /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
20542 /// after 14 days from its creation date.
20543 pub expire_time: std::option::Option<wkt::Timestamp>,
20544
20545 /// Output only. The ID of the automation rule that initiated the operation.
20546 pub rule_id: std::string::String,
20547
20548 /// Output only. The ID of the automation that initiated the operation.
20549 pub automation_id: std::string::String,
20550
20551 /// Output only. Earliest time the `AutomationRun` will attempt to resume.
20552 /// Wait-time is configured by `wait` in automation rule.
20553 pub wait_until_time: std::option::Option<wkt::Timestamp>,
20554
20555 /// The operation that the `AutomationRun` will perform.
20556 pub operation: std::option::Option<crate::model::automation_run::Operation>,
20557
20558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20559}
20560
20561impl AutomationRun {
20562 pub fn new() -> Self {
20563 std::default::Default::default()
20564 }
20565
20566 /// Sets the value of [name][crate::model::AutomationRun::name].
20567 ///
20568 /// # Example
20569 /// ```ignore,no_run
20570 /// # use google_cloud_deploy_v1::model::AutomationRun;
20571 /// let x = AutomationRun::new().set_name("example");
20572 /// ```
20573 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20574 self.name = v.into();
20575 self
20576 }
20577
20578 /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
20579 ///
20580 /// # Example
20581 /// ```ignore,no_run
20582 /// # use google_cloud_deploy_v1::model::AutomationRun;
20583 /// use wkt::Timestamp;
20584 /// let x = AutomationRun::new().set_create_time(Timestamp::default()/* use setters */);
20585 /// ```
20586 pub fn set_create_time<T>(mut self, v: T) -> Self
20587 where
20588 T: std::convert::Into<wkt::Timestamp>,
20589 {
20590 self.create_time = std::option::Option::Some(v.into());
20591 self
20592 }
20593
20594 /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
20595 ///
20596 /// # Example
20597 /// ```ignore,no_run
20598 /// # use google_cloud_deploy_v1::model::AutomationRun;
20599 /// use wkt::Timestamp;
20600 /// let x = AutomationRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20601 /// let x = AutomationRun::new().set_or_clear_create_time(None::<Timestamp>);
20602 /// ```
20603 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20604 where
20605 T: std::convert::Into<wkt::Timestamp>,
20606 {
20607 self.create_time = v.map(|x| x.into());
20608 self
20609 }
20610
20611 /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
20612 ///
20613 /// # Example
20614 /// ```ignore,no_run
20615 /// # use google_cloud_deploy_v1::model::AutomationRun;
20616 /// use wkt::Timestamp;
20617 /// let x = AutomationRun::new().set_update_time(Timestamp::default()/* use setters */);
20618 /// ```
20619 pub fn set_update_time<T>(mut self, v: T) -> Self
20620 where
20621 T: std::convert::Into<wkt::Timestamp>,
20622 {
20623 self.update_time = std::option::Option::Some(v.into());
20624 self
20625 }
20626
20627 /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
20628 ///
20629 /// # Example
20630 /// ```ignore,no_run
20631 /// # use google_cloud_deploy_v1::model::AutomationRun;
20632 /// use wkt::Timestamp;
20633 /// let x = AutomationRun::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20634 /// let x = AutomationRun::new().set_or_clear_update_time(None::<Timestamp>);
20635 /// ```
20636 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20637 where
20638 T: std::convert::Into<wkt::Timestamp>,
20639 {
20640 self.update_time = v.map(|x| x.into());
20641 self
20642 }
20643
20644 /// Sets the value of [etag][crate::model::AutomationRun::etag].
20645 ///
20646 /// # Example
20647 /// ```ignore,no_run
20648 /// # use google_cloud_deploy_v1::model::AutomationRun;
20649 /// let x = AutomationRun::new().set_etag("example");
20650 /// ```
20651 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20652 self.etag = v.into();
20653 self
20654 }
20655
20656 /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
20657 ///
20658 /// # Example
20659 /// ```ignore,no_run
20660 /// # use google_cloud_deploy_v1::model::AutomationRun;
20661 /// let x = AutomationRun::new().set_service_account("example");
20662 /// ```
20663 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20664 self.service_account = v.into();
20665 self
20666 }
20667
20668 /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20669 ///
20670 /// # Example
20671 /// ```ignore,no_run
20672 /// # use google_cloud_deploy_v1::model::AutomationRun;
20673 /// use google_cloud_deploy_v1::model::Automation;
20674 /// let x = AutomationRun::new().set_automation_snapshot(Automation::default()/* use setters */);
20675 /// ```
20676 pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
20677 where
20678 T: std::convert::Into<crate::model::Automation>,
20679 {
20680 self.automation_snapshot = std::option::Option::Some(v.into());
20681 self
20682 }
20683
20684 /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20685 ///
20686 /// # Example
20687 /// ```ignore,no_run
20688 /// # use google_cloud_deploy_v1::model::AutomationRun;
20689 /// use google_cloud_deploy_v1::model::Automation;
20690 /// let x = AutomationRun::new().set_or_clear_automation_snapshot(Some(Automation::default()/* use setters */));
20691 /// let x = AutomationRun::new().set_or_clear_automation_snapshot(None::<Automation>);
20692 /// ```
20693 pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
20694 where
20695 T: std::convert::Into<crate::model::Automation>,
20696 {
20697 self.automation_snapshot = v.map(|x| x.into());
20698 self
20699 }
20700
20701 /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
20702 ///
20703 /// # Example
20704 /// ```ignore,no_run
20705 /// # use google_cloud_deploy_v1::model::AutomationRun;
20706 /// let x = AutomationRun::new().set_target_id("example");
20707 /// ```
20708 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20709 self.target_id = v.into();
20710 self
20711 }
20712
20713 /// Sets the value of [state][crate::model::AutomationRun::state].
20714 ///
20715 /// # Example
20716 /// ```ignore,no_run
20717 /// # use google_cloud_deploy_v1::model::AutomationRun;
20718 /// use google_cloud_deploy_v1::model::automation_run::State;
20719 /// let x0 = AutomationRun::new().set_state(State::Succeeded);
20720 /// let x1 = AutomationRun::new().set_state(State::Cancelled);
20721 /// let x2 = AutomationRun::new().set_state(State::Failed);
20722 /// ```
20723 pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
20724 mut self,
20725 v: T,
20726 ) -> Self {
20727 self.state = v.into();
20728 self
20729 }
20730
20731 /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
20732 ///
20733 /// # Example
20734 /// ```ignore,no_run
20735 /// # use google_cloud_deploy_v1::model::AutomationRun;
20736 /// let x = AutomationRun::new().set_state_description("example");
20737 /// ```
20738 pub fn set_state_description<T: std::convert::Into<std::string::String>>(
20739 mut self,
20740 v: T,
20741 ) -> Self {
20742 self.state_description = v.into();
20743 self
20744 }
20745
20746 /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20747 ///
20748 /// # Example
20749 /// ```ignore,no_run
20750 /// # use google_cloud_deploy_v1::model::AutomationRun;
20751 /// use google_cloud_deploy_v1::model::PolicyViolation;
20752 /// let x = AutomationRun::new().set_policy_violation(PolicyViolation::default()/* use setters */);
20753 /// ```
20754 pub fn set_policy_violation<T>(mut self, v: T) -> Self
20755 where
20756 T: std::convert::Into<crate::model::PolicyViolation>,
20757 {
20758 self.policy_violation = std::option::Option::Some(v.into());
20759 self
20760 }
20761
20762 /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20763 ///
20764 /// # Example
20765 /// ```ignore,no_run
20766 /// # use google_cloud_deploy_v1::model::AutomationRun;
20767 /// use google_cloud_deploy_v1::model::PolicyViolation;
20768 /// let x = AutomationRun::new().set_or_clear_policy_violation(Some(PolicyViolation::default()/* use setters */));
20769 /// let x = AutomationRun::new().set_or_clear_policy_violation(None::<PolicyViolation>);
20770 /// ```
20771 pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
20772 where
20773 T: std::convert::Into<crate::model::PolicyViolation>,
20774 {
20775 self.policy_violation = v.map(|x| x.into());
20776 self
20777 }
20778
20779 /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
20780 ///
20781 /// # Example
20782 /// ```ignore,no_run
20783 /// # use google_cloud_deploy_v1::model::AutomationRun;
20784 /// use wkt::Timestamp;
20785 /// let x = AutomationRun::new().set_expire_time(Timestamp::default()/* use setters */);
20786 /// ```
20787 pub fn set_expire_time<T>(mut self, v: T) -> Self
20788 where
20789 T: std::convert::Into<wkt::Timestamp>,
20790 {
20791 self.expire_time = std::option::Option::Some(v.into());
20792 self
20793 }
20794
20795 /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
20796 ///
20797 /// # Example
20798 /// ```ignore,no_run
20799 /// # use google_cloud_deploy_v1::model::AutomationRun;
20800 /// use wkt::Timestamp;
20801 /// let x = AutomationRun::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
20802 /// let x = AutomationRun::new().set_or_clear_expire_time(None::<Timestamp>);
20803 /// ```
20804 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
20805 where
20806 T: std::convert::Into<wkt::Timestamp>,
20807 {
20808 self.expire_time = v.map(|x| x.into());
20809 self
20810 }
20811
20812 /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
20813 ///
20814 /// # Example
20815 /// ```ignore,no_run
20816 /// # use google_cloud_deploy_v1::model::AutomationRun;
20817 /// let x = AutomationRun::new().set_rule_id("example");
20818 /// ```
20819 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20820 self.rule_id = v.into();
20821 self
20822 }
20823
20824 /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
20825 ///
20826 /// # Example
20827 /// ```ignore,no_run
20828 /// # use google_cloud_deploy_v1::model::AutomationRun;
20829 /// let x = AutomationRun::new().set_automation_id("example");
20830 /// ```
20831 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20832 self.automation_id = v.into();
20833 self
20834 }
20835
20836 /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
20837 ///
20838 /// # Example
20839 /// ```ignore,no_run
20840 /// # use google_cloud_deploy_v1::model::AutomationRun;
20841 /// use wkt::Timestamp;
20842 /// let x = AutomationRun::new().set_wait_until_time(Timestamp::default()/* use setters */);
20843 /// ```
20844 pub fn set_wait_until_time<T>(mut self, v: T) -> Self
20845 where
20846 T: std::convert::Into<wkt::Timestamp>,
20847 {
20848 self.wait_until_time = std::option::Option::Some(v.into());
20849 self
20850 }
20851
20852 /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
20853 ///
20854 /// # Example
20855 /// ```ignore,no_run
20856 /// # use google_cloud_deploy_v1::model::AutomationRun;
20857 /// use wkt::Timestamp;
20858 /// let x = AutomationRun::new().set_or_clear_wait_until_time(Some(Timestamp::default()/* use setters */));
20859 /// let x = AutomationRun::new().set_or_clear_wait_until_time(None::<Timestamp>);
20860 /// ```
20861 pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
20862 where
20863 T: std::convert::Into<wkt::Timestamp>,
20864 {
20865 self.wait_until_time = v.map(|x| x.into());
20866 self
20867 }
20868
20869 /// Sets the value of [operation][crate::model::AutomationRun::operation].
20870 ///
20871 /// Note that all the setters affecting `operation` are mutually
20872 /// exclusive.
20873 ///
20874 /// # Example
20875 /// ```ignore,no_run
20876 /// # use google_cloud_deploy_v1::model::AutomationRun;
20877 /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
20878 /// let x = AutomationRun::new().set_operation(Some(
20879 /// google_cloud_deploy_v1::model::automation_run::Operation::PromoteReleaseOperation(PromoteReleaseOperation::default().into())));
20880 /// ```
20881 pub fn set_operation<
20882 T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
20883 >(
20884 mut self,
20885 v: T,
20886 ) -> Self {
20887 self.operation = v.into();
20888 self
20889 }
20890
20891 /// The value of [operation][crate::model::AutomationRun::operation]
20892 /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
20893 /// holds a different branch.
20894 pub fn promote_release_operation(
20895 &self,
20896 ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
20897 #[allow(unreachable_patterns)]
20898 self.operation.as_ref().and_then(|v| match v {
20899 crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
20900 std::option::Option::Some(v)
20901 }
20902 _ => std::option::Option::None,
20903 })
20904 }
20905
20906 /// Sets the value of [operation][crate::model::AutomationRun::operation]
20907 /// to hold a `PromoteReleaseOperation`.
20908 ///
20909 /// Note that all the setters affecting `operation` are
20910 /// mutually exclusive.
20911 ///
20912 /// # Example
20913 /// ```ignore,no_run
20914 /// # use google_cloud_deploy_v1::model::AutomationRun;
20915 /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
20916 /// let x = AutomationRun::new().set_promote_release_operation(PromoteReleaseOperation::default()/* use setters */);
20917 /// assert!(x.promote_release_operation().is_some());
20918 /// assert!(x.advance_rollout_operation().is_none());
20919 /// assert!(x.repair_rollout_operation().is_none());
20920 /// assert!(x.timed_promote_release_operation().is_none());
20921 /// ```
20922 pub fn set_promote_release_operation<
20923 T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
20924 >(
20925 mut self,
20926 v: T,
20927 ) -> Self {
20928 self.operation = std::option::Option::Some(
20929 crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
20930 );
20931 self
20932 }
20933
20934 /// The value of [operation][crate::model::AutomationRun::operation]
20935 /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
20936 /// holds a different branch.
20937 pub fn advance_rollout_operation(
20938 &self,
20939 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
20940 #[allow(unreachable_patterns)]
20941 self.operation.as_ref().and_then(|v| match v {
20942 crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
20943 std::option::Option::Some(v)
20944 }
20945 _ => std::option::Option::None,
20946 })
20947 }
20948
20949 /// Sets the value of [operation][crate::model::AutomationRun::operation]
20950 /// to hold a `AdvanceRolloutOperation`.
20951 ///
20952 /// Note that all the setters affecting `operation` are
20953 /// mutually exclusive.
20954 ///
20955 /// # Example
20956 /// ```ignore,no_run
20957 /// # use google_cloud_deploy_v1::model::AutomationRun;
20958 /// use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
20959 /// let x = AutomationRun::new().set_advance_rollout_operation(AdvanceRolloutOperation::default()/* use setters */);
20960 /// assert!(x.advance_rollout_operation().is_some());
20961 /// assert!(x.promote_release_operation().is_none());
20962 /// assert!(x.repair_rollout_operation().is_none());
20963 /// assert!(x.timed_promote_release_operation().is_none());
20964 /// ```
20965 pub fn set_advance_rollout_operation<
20966 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
20967 >(
20968 mut self,
20969 v: T,
20970 ) -> Self {
20971 self.operation = std::option::Option::Some(
20972 crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
20973 );
20974 self
20975 }
20976
20977 /// The value of [operation][crate::model::AutomationRun::operation]
20978 /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
20979 /// holds a different branch.
20980 pub fn repair_rollout_operation(
20981 &self,
20982 ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
20983 #[allow(unreachable_patterns)]
20984 self.operation.as_ref().and_then(|v| match v {
20985 crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
20986 std::option::Option::Some(v)
20987 }
20988 _ => std::option::Option::None,
20989 })
20990 }
20991
20992 /// Sets the value of [operation][crate::model::AutomationRun::operation]
20993 /// to hold a `RepairRolloutOperation`.
20994 ///
20995 /// Note that all the setters affecting `operation` are
20996 /// mutually exclusive.
20997 ///
20998 /// # Example
20999 /// ```ignore,no_run
21000 /// # use google_cloud_deploy_v1::model::AutomationRun;
21001 /// use google_cloud_deploy_v1::model::RepairRolloutOperation;
21002 /// let x = AutomationRun::new().set_repair_rollout_operation(RepairRolloutOperation::default()/* use setters */);
21003 /// assert!(x.repair_rollout_operation().is_some());
21004 /// assert!(x.promote_release_operation().is_none());
21005 /// assert!(x.advance_rollout_operation().is_none());
21006 /// assert!(x.timed_promote_release_operation().is_none());
21007 /// ```
21008 pub fn set_repair_rollout_operation<
21009 T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
21010 >(
21011 mut self,
21012 v: T,
21013 ) -> Self {
21014 self.operation = std::option::Option::Some(
21015 crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
21016 );
21017 self
21018 }
21019
21020 /// The value of [operation][crate::model::AutomationRun::operation]
21021 /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
21022 /// holds a different branch.
21023 pub fn timed_promote_release_operation(
21024 &self,
21025 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
21026 #[allow(unreachable_patterns)]
21027 self.operation.as_ref().and_then(|v| match v {
21028 crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
21029 std::option::Option::Some(v)
21030 }
21031 _ => std::option::Option::None,
21032 })
21033 }
21034
21035 /// Sets the value of [operation][crate::model::AutomationRun::operation]
21036 /// to hold a `TimedPromoteReleaseOperation`.
21037 ///
21038 /// Note that all the setters affecting `operation` are
21039 /// mutually exclusive.
21040 ///
21041 /// # Example
21042 /// ```ignore,no_run
21043 /// # use google_cloud_deploy_v1::model::AutomationRun;
21044 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21045 /// let x = AutomationRun::new().set_timed_promote_release_operation(TimedPromoteReleaseOperation::default()/* use setters */);
21046 /// assert!(x.timed_promote_release_operation().is_some());
21047 /// assert!(x.promote_release_operation().is_none());
21048 /// assert!(x.advance_rollout_operation().is_none());
21049 /// assert!(x.repair_rollout_operation().is_none());
21050 /// ```
21051 pub fn set_timed_promote_release_operation<
21052 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
21053 >(
21054 mut self,
21055 v: T,
21056 ) -> Self {
21057 self.operation = std::option::Option::Some(
21058 crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
21059 );
21060 self
21061 }
21062}
21063
21064impl wkt::message::Message for AutomationRun {
21065 fn typename() -> &'static str {
21066 "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
21067 }
21068}
21069
21070/// Defines additional types related to [AutomationRun].
21071pub mod automation_run {
21072 #[allow(unused_imports)]
21073 use super::*;
21074
21075 /// Valid state of an `AutomationRun`.
21076 ///
21077 /// # Working with unknown values
21078 ///
21079 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21080 /// additional enum variants at any time. Adding new variants is not considered
21081 /// a breaking change. Applications should write their code in anticipation of:
21082 ///
21083 /// - New values appearing in future releases of the client library, **and**
21084 /// - New values received dynamically, without application changes.
21085 ///
21086 /// Please consult the [Working with enums] section in the user guide for some
21087 /// guidelines.
21088 ///
21089 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21090 #[derive(Clone, Debug, PartialEq)]
21091 #[non_exhaustive]
21092 pub enum State {
21093 /// The `AutomationRun` has an unspecified state.
21094 Unspecified,
21095 /// The `AutomationRun` has succeeded.
21096 Succeeded,
21097 /// The `AutomationRun` was cancelled.
21098 Cancelled,
21099 /// The `AutomationRun` has failed.
21100 Failed,
21101 /// The `AutomationRun` is in progress.
21102 InProgress,
21103 /// The `AutomationRun` is pending.
21104 Pending,
21105 /// The `AutomationRun` was aborted.
21106 Aborted,
21107 /// If set, the enum was initialized with an unknown value.
21108 ///
21109 /// Applications can examine the value using [State::value] or
21110 /// [State::name].
21111 UnknownValue(state::UnknownValue),
21112 }
21113
21114 #[doc(hidden)]
21115 pub mod state {
21116 #[allow(unused_imports)]
21117 use super::*;
21118 #[derive(Clone, Debug, PartialEq)]
21119 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21120 }
21121
21122 impl State {
21123 /// Gets the enum value.
21124 ///
21125 /// Returns `None` if the enum contains an unknown value deserialized from
21126 /// the string representation of enums.
21127 pub fn value(&self) -> std::option::Option<i32> {
21128 match self {
21129 Self::Unspecified => std::option::Option::Some(0),
21130 Self::Succeeded => std::option::Option::Some(1),
21131 Self::Cancelled => std::option::Option::Some(2),
21132 Self::Failed => std::option::Option::Some(3),
21133 Self::InProgress => std::option::Option::Some(4),
21134 Self::Pending => std::option::Option::Some(5),
21135 Self::Aborted => std::option::Option::Some(6),
21136 Self::UnknownValue(u) => u.0.value(),
21137 }
21138 }
21139
21140 /// Gets the enum value as a string.
21141 ///
21142 /// Returns `None` if the enum contains an unknown value deserialized from
21143 /// the integer representation of enums.
21144 pub fn name(&self) -> std::option::Option<&str> {
21145 match self {
21146 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21147 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
21148 Self::Cancelled => std::option::Option::Some("CANCELLED"),
21149 Self::Failed => std::option::Option::Some("FAILED"),
21150 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
21151 Self::Pending => std::option::Option::Some("PENDING"),
21152 Self::Aborted => std::option::Option::Some("ABORTED"),
21153 Self::UnknownValue(u) => u.0.name(),
21154 }
21155 }
21156 }
21157
21158 impl std::default::Default for State {
21159 fn default() -> Self {
21160 use std::convert::From;
21161 Self::from(0)
21162 }
21163 }
21164
21165 impl std::fmt::Display for State {
21166 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21167 wkt::internal::display_enum(f, self.name(), self.value())
21168 }
21169 }
21170
21171 impl std::convert::From<i32> for State {
21172 fn from(value: i32) -> Self {
21173 match value {
21174 0 => Self::Unspecified,
21175 1 => Self::Succeeded,
21176 2 => Self::Cancelled,
21177 3 => Self::Failed,
21178 4 => Self::InProgress,
21179 5 => Self::Pending,
21180 6 => Self::Aborted,
21181 _ => Self::UnknownValue(state::UnknownValue(
21182 wkt::internal::UnknownEnumValue::Integer(value),
21183 )),
21184 }
21185 }
21186 }
21187
21188 impl std::convert::From<&str> for State {
21189 fn from(value: &str) -> Self {
21190 use std::string::ToString;
21191 match value {
21192 "STATE_UNSPECIFIED" => Self::Unspecified,
21193 "SUCCEEDED" => Self::Succeeded,
21194 "CANCELLED" => Self::Cancelled,
21195 "FAILED" => Self::Failed,
21196 "IN_PROGRESS" => Self::InProgress,
21197 "PENDING" => Self::Pending,
21198 "ABORTED" => Self::Aborted,
21199 _ => Self::UnknownValue(state::UnknownValue(
21200 wkt::internal::UnknownEnumValue::String(value.to_string()),
21201 )),
21202 }
21203 }
21204 }
21205
21206 impl serde::ser::Serialize for State {
21207 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21208 where
21209 S: serde::Serializer,
21210 {
21211 match self {
21212 Self::Unspecified => serializer.serialize_i32(0),
21213 Self::Succeeded => serializer.serialize_i32(1),
21214 Self::Cancelled => serializer.serialize_i32(2),
21215 Self::Failed => serializer.serialize_i32(3),
21216 Self::InProgress => serializer.serialize_i32(4),
21217 Self::Pending => serializer.serialize_i32(5),
21218 Self::Aborted => serializer.serialize_i32(6),
21219 Self::UnknownValue(u) => u.0.serialize(serializer),
21220 }
21221 }
21222 }
21223
21224 impl<'de> serde::de::Deserialize<'de> for State {
21225 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21226 where
21227 D: serde::Deserializer<'de>,
21228 {
21229 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21230 ".google.cloud.deploy.v1.AutomationRun.State",
21231 ))
21232 }
21233 }
21234
21235 /// The operation that the `AutomationRun` will perform.
21236 #[derive(Clone, Debug, PartialEq)]
21237 #[non_exhaustive]
21238 pub enum Operation {
21239 /// Output only. Promotes a release to a specified 'Target'.
21240 PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
21241 /// Output only. Advances a rollout to the next phase.
21242 AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
21243 /// Output only. Repairs a failed 'Rollout'.
21244 RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
21245 /// Output only. Promotes a release to a specified 'Target' as defined in a
21246 /// Timed Promote Release rule.
21247 TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
21248 }
21249}
21250
21251/// Contains the information of an automated promote-release operation.
21252#[derive(Clone, Default, PartialEq)]
21253#[non_exhaustive]
21254pub struct PromoteReleaseOperation {
21255 /// Output only. The ID of the target that represents the promotion stage to
21256 /// which the release will be promoted. The value of this field is the last
21257 /// segment of a target name.
21258 pub target_id: std::string::String,
21259
21260 /// Output only. How long the operation will be paused.
21261 pub wait: std::option::Option<wkt::Duration>,
21262
21263 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21264 pub rollout: std::string::String,
21265
21266 /// Output only. The starting phase of the rollout created by this operation.
21267 pub phase: std::string::String,
21268
21269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21270}
21271
21272impl PromoteReleaseOperation {
21273 pub fn new() -> Self {
21274 std::default::Default::default()
21275 }
21276
21277 /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
21278 ///
21279 /// # Example
21280 /// ```ignore,no_run
21281 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21282 /// let x = PromoteReleaseOperation::new().set_target_id("example");
21283 /// ```
21284 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21285 self.target_id = v.into();
21286 self
21287 }
21288
21289 /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
21290 ///
21291 /// # Example
21292 /// ```ignore,no_run
21293 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21294 /// use wkt::Duration;
21295 /// let x = PromoteReleaseOperation::new().set_wait(Duration::default()/* use setters */);
21296 /// ```
21297 pub fn set_wait<T>(mut self, v: T) -> Self
21298 where
21299 T: std::convert::Into<wkt::Duration>,
21300 {
21301 self.wait = std::option::Option::Some(v.into());
21302 self
21303 }
21304
21305 /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
21306 ///
21307 /// # Example
21308 /// ```ignore,no_run
21309 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21310 /// use wkt::Duration;
21311 /// let x = PromoteReleaseOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21312 /// let x = PromoteReleaseOperation::new().set_or_clear_wait(None::<Duration>);
21313 /// ```
21314 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21315 where
21316 T: std::convert::Into<wkt::Duration>,
21317 {
21318 self.wait = v.map(|x| x.into());
21319 self
21320 }
21321
21322 /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
21323 ///
21324 /// # Example
21325 /// ```ignore,no_run
21326 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21327 /// let x = PromoteReleaseOperation::new().set_rollout("example");
21328 /// ```
21329 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21330 self.rollout = v.into();
21331 self
21332 }
21333
21334 /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
21335 ///
21336 /// # Example
21337 /// ```ignore,no_run
21338 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21339 /// let x = PromoteReleaseOperation::new().set_phase("example");
21340 /// ```
21341 pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21342 self.phase = v.into();
21343 self
21344 }
21345}
21346
21347impl wkt::message::Message for PromoteReleaseOperation {
21348 fn typename() -> &'static str {
21349 "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
21350 }
21351}
21352
21353/// Contains the information of an automated advance-rollout operation.
21354#[derive(Clone, Default, PartialEq)]
21355#[non_exhaustive]
21356pub struct AdvanceRolloutOperation {
21357 /// Output only. The phase of a deployment that initiated the operation.
21358 pub source_phase: std::string::String,
21359
21360 /// Output only. How long the operation will be paused.
21361 pub wait: std::option::Option<wkt::Duration>,
21362
21363 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21364 pub rollout: std::string::String,
21365
21366 /// Output only. The phase the rollout will be advanced to.
21367 pub destination_phase: std::string::String,
21368
21369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21370}
21371
21372impl AdvanceRolloutOperation {
21373 pub fn new() -> Self {
21374 std::default::Default::default()
21375 }
21376
21377 /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
21378 ///
21379 /// # Example
21380 /// ```ignore,no_run
21381 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21382 /// let x = AdvanceRolloutOperation::new().set_source_phase("example");
21383 /// ```
21384 pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21385 self.source_phase = v.into();
21386 self
21387 }
21388
21389 /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21390 ///
21391 /// # Example
21392 /// ```ignore,no_run
21393 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21394 /// use wkt::Duration;
21395 /// let x = AdvanceRolloutOperation::new().set_wait(Duration::default()/* use setters */);
21396 /// ```
21397 pub fn set_wait<T>(mut self, v: T) -> Self
21398 where
21399 T: std::convert::Into<wkt::Duration>,
21400 {
21401 self.wait = std::option::Option::Some(v.into());
21402 self
21403 }
21404
21405 /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21406 ///
21407 /// # Example
21408 /// ```ignore,no_run
21409 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21410 /// use wkt::Duration;
21411 /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21412 /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(None::<Duration>);
21413 /// ```
21414 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21415 where
21416 T: std::convert::Into<wkt::Duration>,
21417 {
21418 self.wait = v.map(|x| x.into());
21419 self
21420 }
21421
21422 /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
21423 ///
21424 /// # Example
21425 /// ```ignore,no_run
21426 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21427 /// let x = AdvanceRolloutOperation::new().set_rollout("example");
21428 /// ```
21429 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21430 self.rollout = v.into();
21431 self
21432 }
21433
21434 /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
21435 ///
21436 /// # Example
21437 /// ```ignore,no_run
21438 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21439 /// let x = AdvanceRolloutOperation::new().set_destination_phase("example");
21440 /// ```
21441 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21442 mut self,
21443 v: T,
21444 ) -> Self {
21445 self.destination_phase = v.into();
21446 self
21447 }
21448}
21449
21450impl wkt::message::Message for AdvanceRolloutOperation {
21451 fn typename() -> &'static str {
21452 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
21453 }
21454}
21455
21456/// Contains the information for an automated `repair rollout` operation.
21457#[derive(Clone, Default, PartialEq)]
21458#[non_exhaustive]
21459pub struct RepairRolloutOperation {
21460 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21461 pub rollout: std::string::String,
21462
21463 /// Output only. The index of the current repair action in the repair sequence.
21464 pub current_repair_phase_index: i64,
21465
21466 /// Output only. Records of the repair attempts. Each repair phase may have
21467 /// multiple retry attempts or single rollback attempt.
21468 pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
21469
21470 /// Output only. The phase ID of the phase that includes the job being
21471 /// repaired.
21472 pub phase_id: std::string::String,
21473
21474 /// Output only. The job ID for the Job to repair.
21475 pub job_id: std::string::String,
21476
21477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21478}
21479
21480impl RepairRolloutOperation {
21481 pub fn new() -> Self {
21482 std::default::Default::default()
21483 }
21484
21485 /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
21486 ///
21487 /// # Example
21488 /// ```ignore,no_run
21489 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21490 /// let x = RepairRolloutOperation::new().set_rollout("example");
21491 /// ```
21492 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21493 self.rollout = v.into();
21494 self
21495 }
21496
21497 /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
21498 ///
21499 /// # Example
21500 /// ```ignore,no_run
21501 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21502 /// let x = RepairRolloutOperation::new().set_current_repair_phase_index(42);
21503 /// ```
21504 pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21505 self.current_repair_phase_index = v.into();
21506 self
21507 }
21508
21509 /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
21510 ///
21511 /// # Example
21512 /// ```ignore,no_run
21513 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21514 /// use google_cloud_deploy_v1::model::RepairPhase;
21515 /// let x = RepairRolloutOperation::new()
21516 /// .set_repair_phases([
21517 /// RepairPhase::default()/* use setters */,
21518 /// RepairPhase::default()/* use (different) setters */,
21519 /// ]);
21520 /// ```
21521 pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
21522 where
21523 T: std::iter::IntoIterator<Item = V>,
21524 V: std::convert::Into<crate::model::RepairPhase>,
21525 {
21526 use std::iter::Iterator;
21527 self.repair_phases = v.into_iter().map(|i| i.into()).collect();
21528 self
21529 }
21530
21531 /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
21532 ///
21533 /// # Example
21534 /// ```ignore,no_run
21535 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21536 /// let x = RepairRolloutOperation::new().set_phase_id("example");
21537 /// ```
21538 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21539 self.phase_id = v.into();
21540 self
21541 }
21542
21543 /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
21544 ///
21545 /// # Example
21546 /// ```ignore,no_run
21547 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21548 /// let x = RepairRolloutOperation::new().set_job_id("example");
21549 /// ```
21550 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21551 self.job_id = v.into();
21552 self
21553 }
21554}
21555
21556impl wkt::message::Message for RepairRolloutOperation {
21557 fn typename() -> &'static str {
21558 "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
21559 }
21560}
21561
21562/// Contains the information of an automated timed promote-release operation.
21563#[derive(Clone, Default, PartialEq)]
21564#[non_exhaustive]
21565pub struct TimedPromoteReleaseOperation {
21566 /// Output only. The ID of the target that represents the promotion stage to
21567 /// which the release will be promoted. The value of this field is the last
21568 /// segment of a target name.
21569 pub target_id: std::string::String,
21570
21571 /// Output only. The name of the release to be promoted.
21572 pub release: std::string::String,
21573
21574 /// Output only. The starting phase of the rollout created by this operation.
21575 pub phase: std::string::String,
21576
21577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21578}
21579
21580impl TimedPromoteReleaseOperation {
21581 pub fn new() -> Self {
21582 std::default::Default::default()
21583 }
21584
21585 /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
21586 ///
21587 /// # Example
21588 /// ```ignore,no_run
21589 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21590 /// let x = TimedPromoteReleaseOperation::new().set_target_id("example");
21591 /// ```
21592 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21593 self.target_id = v.into();
21594 self
21595 }
21596
21597 /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
21598 ///
21599 /// # Example
21600 /// ```ignore,no_run
21601 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21602 /// let x = TimedPromoteReleaseOperation::new().set_release("example");
21603 /// ```
21604 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21605 self.release = v.into();
21606 self
21607 }
21608
21609 /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
21610 ///
21611 /// # Example
21612 /// ```ignore,no_run
21613 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21614 /// let x = TimedPromoteReleaseOperation::new().set_phase("example");
21615 /// ```
21616 pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21617 self.phase = v.into();
21618 self
21619 }
21620}
21621
21622impl wkt::message::Message for TimedPromoteReleaseOperation {
21623 fn typename() -> &'static str {
21624 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
21625 }
21626}
21627
21628/// RepairPhase tracks the repair attempts that have been made for
21629/// each `RepairPhaseConfig` specified in the `Automation` resource.
21630#[derive(Clone, Default, PartialEq)]
21631#[non_exhaustive]
21632pub struct RepairPhase {
21633 /// The `RepairPhase` type and the information for that type.
21634 pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
21635
21636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21637}
21638
21639impl RepairPhase {
21640 pub fn new() -> Self {
21641 std::default::Default::default()
21642 }
21643
21644 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
21645 ///
21646 /// Note that all the setters affecting `repair_phase` are mutually
21647 /// exclusive.
21648 ///
21649 /// # Example
21650 /// ```ignore,no_run
21651 /// # use google_cloud_deploy_v1::model::RepairPhase;
21652 /// use google_cloud_deploy_v1::model::RetryPhase;
21653 /// let x = RepairPhase::new().set_repair_phase(Some(
21654 /// google_cloud_deploy_v1::model::repair_phase::RepairPhase::Retry(RetryPhase::default().into())));
21655 /// ```
21656 pub fn set_repair_phase<
21657 T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
21658 >(
21659 mut self,
21660 v: T,
21661 ) -> Self {
21662 self.repair_phase = v.into();
21663 self
21664 }
21665
21666 /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21667 /// if it holds a `Retry`, `None` if the field is not set or
21668 /// holds a different branch.
21669 pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
21670 #[allow(unreachable_patterns)]
21671 self.repair_phase.as_ref().and_then(|v| match v {
21672 crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
21673 _ => std::option::Option::None,
21674 })
21675 }
21676
21677 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21678 /// to hold a `Retry`.
21679 ///
21680 /// Note that all the setters affecting `repair_phase` are
21681 /// mutually exclusive.
21682 ///
21683 /// # Example
21684 /// ```ignore,no_run
21685 /// # use google_cloud_deploy_v1::model::RepairPhase;
21686 /// use google_cloud_deploy_v1::model::RetryPhase;
21687 /// let x = RepairPhase::new().set_retry(RetryPhase::default()/* use setters */);
21688 /// assert!(x.retry().is_some());
21689 /// assert!(x.rollback().is_none());
21690 /// ```
21691 pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
21692 mut self,
21693 v: T,
21694 ) -> Self {
21695 self.repair_phase =
21696 std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
21697 self
21698 }
21699
21700 /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21701 /// if it holds a `Rollback`, `None` if the field is not set or
21702 /// holds a different branch.
21703 pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
21704 #[allow(unreachable_patterns)]
21705 self.repair_phase.as_ref().and_then(|v| match v {
21706 crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
21707 _ => std::option::Option::None,
21708 })
21709 }
21710
21711 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21712 /// to hold a `Rollback`.
21713 ///
21714 /// Note that all the setters affecting `repair_phase` are
21715 /// mutually exclusive.
21716 ///
21717 /// # Example
21718 /// ```ignore,no_run
21719 /// # use google_cloud_deploy_v1::model::RepairPhase;
21720 /// use google_cloud_deploy_v1::model::RollbackAttempt;
21721 /// let x = RepairPhase::new().set_rollback(RollbackAttempt::default()/* use setters */);
21722 /// assert!(x.rollback().is_some());
21723 /// assert!(x.retry().is_none());
21724 /// ```
21725 pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
21726 mut self,
21727 v: T,
21728 ) -> Self {
21729 self.repair_phase =
21730 std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
21731 self
21732 }
21733}
21734
21735impl wkt::message::Message for RepairPhase {
21736 fn typename() -> &'static str {
21737 "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
21738 }
21739}
21740
21741/// Defines additional types related to [RepairPhase].
21742pub mod repair_phase {
21743 #[allow(unused_imports)]
21744 use super::*;
21745
21746 /// The `RepairPhase` type and the information for that type.
21747 #[derive(Clone, Debug, PartialEq)]
21748 #[non_exhaustive]
21749 pub enum RepairPhase {
21750 /// Output only. Records of the retry attempts for retry repair mode.
21751 Retry(std::boxed::Box<crate::model::RetryPhase>),
21752 /// Output only. Rollback attempt for rollback repair mode .
21753 Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
21754 }
21755}
21756
21757/// RetryPhase contains the retry attempts and the metadata for initiating a
21758/// new attempt.
21759#[derive(Clone, Default, PartialEq)]
21760#[non_exhaustive]
21761pub struct RetryPhase {
21762 /// Output only. The number of attempts that have been made.
21763 pub total_attempts: i64,
21764
21765 /// Output only. The pattern of how the wait time of the retry attempt is
21766 /// calculated.
21767 pub backoff_mode: crate::model::BackoffMode,
21768
21769 /// Output only. Detail of a retry action.
21770 pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
21771
21772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21773}
21774
21775impl RetryPhase {
21776 pub fn new() -> Self {
21777 std::default::Default::default()
21778 }
21779
21780 /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
21781 ///
21782 /// # Example
21783 /// ```ignore,no_run
21784 /// # use google_cloud_deploy_v1::model::RetryPhase;
21785 /// let x = RetryPhase::new().set_total_attempts(42);
21786 /// ```
21787 pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21788 self.total_attempts = v.into();
21789 self
21790 }
21791
21792 /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
21793 ///
21794 /// # Example
21795 /// ```ignore,no_run
21796 /// # use google_cloud_deploy_v1::model::RetryPhase;
21797 /// use google_cloud_deploy_v1::model::BackoffMode;
21798 /// let x0 = RetryPhase::new().set_backoff_mode(BackoffMode::Linear);
21799 /// let x1 = RetryPhase::new().set_backoff_mode(BackoffMode::Exponential);
21800 /// ```
21801 pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
21802 mut self,
21803 v: T,
21804 ) -> Self {
21805 self.backoff_mode = v.into();
21806 self
21807 }
21808
21809 /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
21810 ///
21811 /// # Example
21812 /// ```ignore,no_run
21813 /// # use google_cloud_deploy_v1::model::RetryPhase;
21814 /// use google_cloud_deploy_v1::model::RetryAttempt;
21815 /// let x = RetryPhase::new()
21816 /// .set_attempts([
21817 /// RetryAttempt::default()/* use setters */,
21818 /// RetryAttempt::default()/* use (different) setters */,
21819 /// ]);
21820 /// ```
21821 pub fn set_attempts<T, V>(mut self, v: T) -> Self
21822 where
21823 T: std::iter::IntoIterator<Item = V>,
21824 V: std::convert::Into<crate::model::RetryAttempt>,
21825 {
21826 use std::iter::Iterator;
21827 self.attempts = v.into_iter().map(|i| i.into()).collect();
21828 self
21829 }
21830}
21831
21832impl wkt::message::Message for RetryPhase {
21833 fn typename() -> &'static str {
21834 "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
21835 }
21836}
21837
21838/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
21839#[derive(Clone, Default, PartialEq)]
21840#[non_exhaustive]
21841pub struct RetryAttempt {
21842 /// Output only. The index of this retry attempt.
21843 pub attempt: i64,
21844
21845 /// Output only. How long the operation will be paused.
21846 pub wait: std::option::Option<wkt::Duration>,
21847
21848 /// Output only. Valid state of this retry action.
21849 pub state: crate::model::RepairState,
21850
21851 /// Output only. Description of the state of the Retry.
21852 pub state_desc: std::string::String,
21853
21854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21855}
21856
21857impl RetryAttempt {
21858 pub fn new() -> Self {
21859 std::default::Default::default()
21860 }
21861
21862 /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
21863 ///
21864 /// # Example
21865 /// ```ignore,no_run
21866 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21867 /// let x = RetryAttempt::new().set_attempt(42);
21868 /// ```
21869 pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21870 self.attempt = v.into();
21871 self
21872 }
21873
21874 /// Sets the value of [wait][crate::model::RetryAttempt::wait].
21875 ///
21876 /// # Example
21877 /// ```ignore,no_run
21878 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21879 /// use wkt::Duration;
21880 /// let x = RetryAttempt::new().set_wait(Duration::default()/* use setters */);
21881 /// ```
21882 pub fn set_wait<T>(mut self, v: T) -> Self
21883 where
21884 T: std::convert::Into<wkt::Duration>,
21885 {
21886 self.wait = std::option::Option::Some(v.into());
21887 self
21888 }
21889
21890 /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
21891 ///
21892 /// # Example
21893 /// ```ignore,no_run
21894 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21895 /// use wkt::Duration;
21896 /// let x = RetryAttempt::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21897 /// let x = RetryAttempt::new().set_or_clear_wait(None::<Duration>);
21898 /// ```
21899 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21900 where
21901 T: std::convert::Into<wkt::Duration>,
21902 {
21903 self.wait = v.map(|x| x.into());
21904 self
21905 }
21906
21907 /// Sets the value of [state][crate::model::RetryAttempt::state].
21908 ///
21909 /// # Example
21910 /// ```ignore,no_run
21911 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21912 /// use google_cloud_deploy_v1::model::RepairState;
21913 /// let x0 = RetryAttempt::new().set_state(RepairState::Succeeded);
21914 /// let x1 = RetryAttempt::new().set_state(RepairState::Cancelled);
21915 /// let x2 = RetryAttempt::new().set_state(RepairState::Failed);
21916 /// ```
21917 pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
21918 self.state = v.into();
21919 self
21920 }
21921
21922 /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
21923 ///
21924 /// # Example
21925 /// ```ignore,no_run
21926 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21927 /// let x = RetryAttempt::new().set_state_desc("example");
21928 /// ```
21929 pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21930 self.state_desc = v.into();
21931 self
21932 }
21933}
21934
21935impl wkt::message::Message for RetryAttempt {
21936 fn typename() -> &'static str {
21937 "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
21938 }
21939}
21940
21941/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
21942#[derive(Clone, Default, PartialEq)]
21943#[non_exhaustive]
21944pub struct RollbackAttempt {
21945 /// Output only. The phase to which the rollout will be rolled back to.
21946 pub destination_phase: std::string::String,
21947
21948 /// Output only. ID of the rollback `Rollout` to create.
21949 pub rollout_id: std::string::String,
21950
21951 /// Output only. Valid state of this rollback action.
21952 pub state: crate::model::RepairState,
21953
21954 /// Output only. Description of the state of the Rollback.
21955 pub state_desc: std::string::String,
21956
21957 /// Output only. If active rollout exists on the target, abort this rollback.
21958 pub disable_rollback_if_rollout_pending: bool,
21959
21960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21961}
21962
21963impl RollbackAttempt {
21964 pub fn new() -> Self {
21965 std::default::Default::default()
21966 }
21967
21968 /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
21969 ///
21970 /// # Example
21971 /// ```ignore,no_run
21972 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21973 /// let x = RollbackAttempt::new().set_destination_phase("example");
21974 /// ```
21975 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21976 mut self,
21977 v: T,
21978 ) -> Self {
21979 self.destination_phase = v.into();
21980 self
21981 }
21982
21983 /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
21984 ///
21985 /// # Example
21986 /// ```ignore,no_run
21987 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21988 /// let x = RollbackAttempt::new().set_rollout_id("example");
21989 /// ```
21990 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21991 self.rollout_id = v.into();
21992 self
21993 }
21994
21995 /// Sets the value of [state][crate::model::RollbackAttempt::state].
21996 ///
21997 /// # Example
21998 /// ```ignore,no_run
21999 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22000 /// use google_cloud_deploy_v1::model::RepairState;
22001 /// let x0 = RollbackAttempt::new().set_state(RepairState::Succeeded);
22002 /// let x1 = RollbackAttempt::new().set_state(RepairState::Cancelled);
22003 /// let x2 = RollbackAttempt::new().set_state(RepairState::Failed);
22004 /// ```
22005 pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22006 self.state = v.into();
22007 self
22008 }
22009
22010 /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
22011 ///
22012 /// # Example
22013 /// ```ignore,no_run
22014 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22015 /// let x = RollbackAttempt::new().set_state_desc("example");
22016 /// ```
22017 pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22018 self.state_desc = v.into();
22019 self
22020 }
22021
22022 /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
22023 ///
22024 /// # Example
22025 /// ```ignore,no_run
22026 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22027 /// let x = RollbackAttempt::new().set_disable_rollback_if_rollout_pending(true);
22028 /// ```
22029 pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
22030 mut self,
22031 v: T,
22032 ) -> Self {
22033 self.disable_rollback_if_rollout_pending = v.into();
22034 self
22035 }
22036}
22037
22038impl wkt::message::Message for RollbackAttempt {
22039 fn typename() -> &'static str {
22040 "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
22041 }
22042}
22043
22044/// The request object for `ListAutomationRuns`.
22045#[derive(Clone, Default, PartialEq)]
22046#[non_exhaustive]
22047pub struct ListAutomationRunsRequest {
22048 /// Required. The parent `Delivery Pipeline`, which owns this collection of
22049 /// automationRuns. Format must be
22050 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
22051 pub parent: std::string::String,
22052
22053 /// The maximum number of automationRuns to return. The service may return
22054 /// fewer than this value. If unspecified, at most 50 automationRuns will
22055 /// be returned. The maximum value is 1000; values above 1000 will be set
22056 /// to 1000.
22057 pub page_size: i32,
22058
22059 /// A page token, received from a previous `ListAutomationRuns` call.
22060 /// Provide this to retrieve the subsequent page.
22061 ///
22062 /// When paginating, all other provided parameters match
22063 /// the call that provided the page token.
22064 pub page_token: std::string::String,
22065
22066 /// Filter automationRuns to be returned. All fields can be used in the
22067 /// filter.
22068 pub filter: std::string::String,
22069
22070 /// Field to sort by.
22071 pub order_by: std::string::String,
22072
22073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22074}
22075
22076impl ListAutomationRunsRequest {
22077 pub fn new() -> Self {
22078 std::default::Default::default()
22079 }
22080
22081 /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
22082 ///
22083 /// # Example
22084 /// ```ignore,no_run
22085 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22086 /// let x = ListAutomationRunsRequest::new().set_parent("example");
22087 /// ```
22088 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22089 self.parent = v.into();
22090 self
22091 }
22092
22093 /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
22094 ///
22095 /// # Example
22096 /// ```ignore,no_run
22097 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22098 /// let x = ListAutomationRunsRequest::new().set_page_size(42);
22099 /// ```
22100 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22101 self.page_size = v.into();
22102 self
22103 }
22104
22105 /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
22106 ///
22107 /// # Example
22108 /// ```ignore,no_run
22109 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22110 /// let x = ListAutomationRunsRequest::new().set_page_token("example");
22111 /// ```
22112 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22113 self.page_token = v.into();
22114 self
22115 }
22116
22117 /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
22118 ///
22119 /// # Example
22120 /// ```ignore,no_run
22121 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22122 /// let x = ListAutomationRunsRequest::new().set_filter("example");
22123 /// ```
22124 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22125 self.filter = v.into();
22126 self
22127 }
22128
22129 /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
22130 ///
22131 /// # Example
22132 /// ```ignore,no_run
22133 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22134 /// let x = ListAutomationRunsRequest::new().set_order_by("example");
22135 /// ```
22136 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22137 self.order_by = v.into();
22138 self
22139 }
22140}
22141
22142impl wkt::message::Message for ListAutomationRunsRequest {
22143 fn typename() -> &'static str {
22144 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
22145 }
22146}
22147
22148/// The response object from `ListAutomationRuns`.
22149#[derive(Clone, Default, PartialEq)]
22150#[non_exhaustive]
22151pub struct ListAutomationRunsResponse {
22152 /// The `AutomationRuns` objects.
22153 pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
22154
22155 /// A token, which can be sent as `page_token` to retrieve the next page.
22156 /// If this field is omitted, there are no subsequent pages.
22157 pub next_page_token: std::string::String,
22158
22159 /// Locations that could not be reached.
22160 pub unreachable: std::vec::Vec<std::string::String>,
22161
22162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22163}
22164
22165impl ListAutomationRunsResponse {
22166 pub fn new() -> Self {
22167 std::default::Default::default()
22168 }
22169
22170 /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
22171 ///
22172 /// # Example
22173 /// ```ignore,no_run
22174 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22175 /// use google_cloud_deploy_v1::model::AutomationRun;
22176 /// let x = ListAutomationRunsResponse::new()
22177 /// .set_automation_runs([
22178 /// AutomationRun::default()/* use setters */,
22179 /// AutomationRun::default()/* use (different) setters */,
22180 /// ]);
22181 /// ```
22182 pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
22183 where
22184 T: std::iter::IntoIterator<Item = V>,
22185 V: std::convert::Into<crate::model::AutomationRun>,
22186 {
22187 use std::iter::Iterator;
22188 self.automation_runs = v.into_iter().map(|i| i.into()).collect();
22189 self
22190 }
22191
22192 /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
22193 ///
22194 /// # Example
22195 /// ```ignore,no_run
22196 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22197 /// let x = ListAutomationRunsResponse::new().set_next_page_token("example");
22198 /// ```
22199 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22200 self.next_page_token = v.into();
22201 self
22202 }
22203
22204 /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
22205 ///
22206 /// # Example
22207 /// ```ignore,no_run
22208 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22209 /// let x = ListAutomationRunsResponse::new().set_unreachable(["a", "b", "c"]);
22210 /// ```
22211 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
22212 where
22213 T: std::iter::IntoIterator<Item = V>,
22214 V: std::convert::Into<std::string::String>,
22215 {
22216 use std::iter::Iterator;
22217 self.unreachable = v.into_iter().map(|i| i.into()).collect();
22218 self
22219 }
22220}
22221
22222impl wkt::message::Message for ListAutomationRunsResponse {
22223 fn typename() -> &'static str {
22224 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
22225 }
22226}
22227
22228#[doc(hidden)]
22229impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
22230 type PageItem = crate::model::AutomationRun;
22231
22232 fn items(self) -> std::vec::Vec<Self::PageItem> {
22233 self.automation_runs
22234 }
22235
22236 fn next_page_token(&self) -> std::string::String {
22237 use std::clone::Clone;
22238 self.next_page_token.clone()
22239 }
22240}
22241
22242/// The request object for `GetAutomationRun`
22243#[derive(Clone, Default, PartialEq)]
22244#[non_exhaustive]
22245pub struct GetAutomationRunRequest {
22246 /// Required. Name of the `AutomationRun`. Format must be
22247 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22248 pub name: std::string::String,
22249
22250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22251}
22252
22253impl GetAutomationRunRequest {
22254 pub fn new() -> Self {
22255 std::default::Default::default()
22256 }
22257
22258 /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
22259 ///
22260 /// # Example
22261 /// ```ignore,no_run
22262 /// # use google_cloud_deploy_v1::model::GetAutomationRunRequest;
22263 /// let x = GetAutomationRunRequest::new().set_name("example");
22264 /// ```
22265 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22266 self.name = v.into();
22267 self
22268 }
22269}
22270
22271impl wkt::message::Message for GetAutomationRunRequest {
22272 fn typename() -> &'static str {
22273 "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
22274 }
22275}
22276
22277/// The request object used by `CancelAutomationRun`.
22278#[derive(Clone, Default, PartialEq)]
22279#[non_exhaustive]
22280pub struct CancelAutomationRunRequest {
22281 /// Required. Name of the `AutomationRun`. Format is
22282 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22283 pub name: std::string::String,
22284
22285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22286}
22287
22288impl CancelAutomationRunRequest {
22289 pub fn new() -> Self {
22290 std::default::Default::default()
22291 }
22292
22293 /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
22294 ///
22295 /// # Example
22296 /// ```ignore,no_run
22297 /// # use google_cloud_deploy_v1::model::CancelAutomationRunRequest;
22298 /// let x = CancelAutomationRunRequest::new().set_name("example");
22299 /// ```
22300 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22301 self.name = v.into();
22302 self
22303 }
22304}
22305
22306impl wkt::message::Message for CancelAutomationRunRequest {
22307 fn typename() -> &'static str {
22308 "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
22309 }
22310}
22311
22312/// The response object from `CancelAutomationRun`.
22313#[derive(Clone, Default, PartialEq)]
22314#[non_exhaustive]
22315pub struct CancelAutomationRunResponse {
22316 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22317}
22318
22319impl CancelAutomationRunResponse {
22320 pub fn new() -> Self {
22321 std::default::Default::default()
22322 }
22323}
22324
22325impl wkt::message::Message for CancelAutomationRunResponse {
22326 fn typename() -> &'static str {
22327 "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
22328 }
22329}
22330
22331/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
22332/// Platform Log event that describes the failure to send a custom target type
22333/// status change Pub/Sub notification.
22334#[derive(Clone, Default, PartialEq)]
22335#[non_exhaustive]
22336pub struct CustomTargetTypeNotificationEvent {
22337 /// Debug message for when a notification fails to send.
22338 pub message: std::string::String,
22339
22340 /// Unique identifier of the `CustomTargetType`.
22341 pub custom_target_type_uid: std::string::String,
22342
22343 /// The name of the `CustomTargetType`.
22344 pub custom_target_type: std::string::String,
22345
22346 /// Type of this notification, e.g. for a Pub/Sub failure.
22347 pub r#type: crate::model::Type,
22348
22349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22350}
22351
22352impl CustomTargetTypeNotificationEvent {
22353 pub fn new() -> Self {
22354 std::default::Default::default()
22355 }
22356
22357 /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
22358 ///
22359 /// # Example
22360 /// ```ignore,no_run
22361 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22362 /// let x = CustomTargetTypeNotificationEvent::new().set_message("example");
22363 /// ```
22364 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22365 self.message = v.into();
22366 self
22367 }
22368
22369 /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
22370 ///
22371 /// # Example
22372 /// ```ignore,no_run
22373 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22374 /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type_uid("example");
22375 /// ```
22376 pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
22377 mut self,
22378 v: T,
22379 ) -> Self {
22380 self.custom_target_type_uid = v.into();
22381 self
22382 }
22383
22384 /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
22385 ///
22386 /// # Example
22387 /// ```ignore,no_run
22388 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22389 /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type("example");
22390 /// ```
22391 pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
22392 mut self,
22393 v: T,
22394 ) -> Self {
22395 self.custom_target_type = v.into();
22396 self
22397 }
22398
22399 /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
22400 ///
22401 /// # Example
22402 /// ```ignore,no_run
22403 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22404 /// use google_cloud_deploy_v1::model::Type;
22405 /// let x0 = CustomTargetTypeNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22406 /// let x1 = CustomTargetTypeNotificationEvent::new().set_type(Type::ResourceStateChange);
22407 /// let x2 = CustomTargetTypeNotificationEvent::new().set_type(Type::ProcessAborted);
22408 /// ```
22409 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22410 self.r#type = v.into();
22411 self
22412 }
22413}
22414
22415impl wkt::message::Message for CustomTargetTypeNotificationEvent {
22416 fn typename() -> &'static str {
22417 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
22418 }
22419}
22420
22421/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
22422/// Platform Log event that describes the failure to send delivery pipeline
22423/// status change Pub/Sub notification.
22424#[derive(Clone, Default, PartialEq)]
22425#[non_exhaustive]
22426pub struct DeliveryPipelineNotificationEvent {
22427 /// Debug message for when a notification fails to send.
22428 pub message: std::string::String,
22429
22430 /// Unique identifier of the `DeliveryPipeline`.
22431 pub pipeline_uid: std::string::String,
22432
22433 /// The name of the `Delivery Pipeline`.
22434 pub delivery_pipeline: std::string::String,
22435
22436 /// Type of this notification, e.g. for a Pub/Sub failure.
22437 pub r#type: crate::model::Type,
22438
22439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22440}
22441
22442impl DeliveryPipelineNotificationEvent {
22443 pub fn new() -> Self {
22444 std::default::Default::default()
22445 }
22446
22447 /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
22448 ///
22449 /// # Example
22450 /// ```ignore,no_run
22451 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22452 /// let x = DeliveryPipelineNotificationEvent::new().set_message("example");
22453 /// ```
22454 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22455 self.message = v.into();
22456 self
22457 }
22458
22459 /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
22460 ///
22461 /// # Example
22462 /// ```ignore,no_run
22463 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22464 /// let x = DeliveryPipelineNotificationEvent::new().set_pipeline_uid("example");
22465 /// ```
22466 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22467 self.pipeline_uid = v.into();
22468 self
22469 }
22470
22471 /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
22472 ///
22473 /// # Example
22474 /// ```ignore,no_run
22475 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22476 /// let x = DeliveryPipelineNotificationEvent::new().set_delivery_pipeline("example");
22477 /// ```
22478 pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22479 mut self,
22480 v: T,
22481 ) -> Self {
22482 self.delivery_pipeline = v.into();
22483 self
22484 }
22485
22486 /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
22487 ///
22488 /// # Example
22489 /// ```ignore,no_run
22490 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22491 /// use google_cloud_deploy_v1::model::Type;
22492 /// let x0 = DeliveryPipelineNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22493 /// let x1 = DeliveryPipelineNotificationEvent::new().set_type(Type::ResourceStateChange);
22494 /// let x2 = DeliveryPipelineNotificationEvent::new().set_type(Type::ProcessAborted);
22495 /// ```
22496 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22497 self.r#type = v.into();
22498 self
22499 }
22500}
22501
22502impl wkt::message::Message for DeliveryPipelineNotificationEvent {
22503 fn typename() -> &'static str {
22504 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
22505 }
22506}
22507
22508/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
22509/// Platform Log event that describes the deploy policy evaluation event.
22510#[derive(Clone, Default, PartialEq)]
22511#[non_exhaustive]
22512pub struct DeployPolicyEvaluationEvent {
22513 /// Debug message for when a deploy policy event occurs.
22514 pub message: std::string::String,
22515
22516 /// Rule type (e.g. Restrict Rollouts).
22517 pub rule_type: std::string::String,
22518
22519 /// Rule id.
22520 pub rule: std::string::String,
22521
22522 /// Unique identifier of the `Delivery Pipeline`.
22523 pub pipeline_uid: std::string::String,
22524
22525 /// The name of the `Delivery Pipeline`.
22526 pub delivery_pipeline: std::string::String,
22527
22528 /// Unique identifier of the `Target`. This is an optional field, as a `Target`
22529 /// may not always be applicable to a policy.
22530 pub target_uid: std::string::String,
22531
22532 /// The name of the `Target`. This is an optional field, as a `Target` may not
22533 /// always be applicable to a policy.
22534 pub target: std::string::String,
22535
22536 /// What invoked the action (e.g. a user or automation).
22537 pub invoker: crate::model::deploy_policy::Invoker,
22538
22539 /// The name of the `DeployPolicy`.
22540 pub deploy_policy: std::string::String,
22541
22542 /// Unique identifier of the `DeployPolicy`.
22543 pub deploy_policy_uid: std::string::String,
22544
22545 /// Whether the request is allowed. Allowed is set as true if:
22546 /// (1) the request complies with the policy; or
22547 /// (2) the request doesn't comply with the policy but the policy was
22548 /// overridden; or
22549 /// (3) the request doesn't comply with the policy but the policy was suspended
22550 pub allowed: bool,
22551
22552 /// The policy verdict of the request.
22553 pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
22554
22555 /// Things that could have overridden the policy verdict. Overrides together
22556 /// with verdict decide whether the request is allowed.
22557 pub overrides:
22558 std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22559
22560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22561}
22562
22563impl DeployPolicyEvaluationEvent {
22564 pub fn new() -> Self {
22565 std::default::Default::default()
22566 }
22567
22568 /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
22569 ///
22570 /// # Example
22571 /// ```ignore,no_run
22572 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22573 /// let x = DeployPolicyEvaluationEvent::new().set_message("example");
22574 /// ```
22575 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22576 self.message = v.into();
22577 self
22578 }
22579
22580 /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
22581 ///
22582 /// # Example
22583 /// ```ignore,no_run
22584 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22585 /// let x = DeployPolicyEvaluationEvent::new().set_rule_type("example");
22586 /// ```
22587 pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22588 self.rule_type = v.into();
22589 self
22590 }
22591
22592 /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
22593 ///
22594 /// # Example
22595 /// ```ignore,no_run
22596 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22597 /// let x = DeployPolicyEvaluationEvent::new().set_rule("example");
22598 /// ```
22599 pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22600 self.rule = v.into();
22601 self
22602 }
22603
22604 /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
22605 ///
22606 /// # Example
22607 /// ```ignore,no_run
22608 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22609 /// let x = DeployPolicyEvaluationEvent::new().set_pipeline_uid("example");
22610 /// ```
22611 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22612 self.pipeline_uid = v.into();
22613 self
22614 }
22615
22616 /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
22617 ///
22618 /// # Example
22619 /// ```ignore,no_run
22620 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22621 /// let x = DeployPolicyEvaluationEvent::new().set_delivery_pipeline("example");
22622 /// ```
22623 pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22624 mut self,
22625 v: T,
22626 ) -> Self {
22627 self.delivery_pipeline = v.into();
22628 self
22629 }
22630
22631 /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
22632 ///
22633 /// # Example
22634 /// ```ignore,no_run
22635 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22636 /// let x = DeployPolicyEvaluationEvent::new().set_target_uid("example");
22637 /// ```
22638 pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22639 self.target_uid = v.into();
22640 self
22641 }
22642
22643 /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
22644 ///
22645 /// # Example
22646 /// ```ignore,no_run
22647 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22648 /// let x = DeployPolicyEvaluationEvent::new().set_target("example");
22649 /// ```
22650 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22651 self.target = v.into();
22652 self
22653 }
22654
22655 /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
22656 ///
22657 /// # Example
22658 /// ```ignore,no_run
22659 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22660 /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
22661 /// let x0 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::User);
22662 /// let x1 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::DeployAutomation);
22663 /// ```
22664 pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
22665 mut self,
22666 v: T,
22667 ) -> Self {
22668 self.invoker = v.into();
22669 self
22670 }
22671
22672 /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
22673 ///
22674 /// # Example
22675 /// ```ignore,no_run
22676 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22677 /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy("example");
22678 /// ```
22679 pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22680 self.deploy_policy = v.into();
22681 self
22682 }
22683
22684 /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
22685 ///
22686 /// # Example
22687 /// ```ignore,no_run
22688 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22689 /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy_uid("example");
22690 /// ```
22691 pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
22692 mut self,
22693 v: T,
22694 ) -> Self {
22695 self.deploy_policy_uid = v.into();
22696 self
22697 }
22698
22699 /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
22700 ///
22701 /// # Example
22702 /// ```ignore,no_run
22703 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22704 /// let x = DeployPolicyEvaluationEvent::new().set_allowed(true);
22705 /// ```
22706 pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22707 self.allowed = v.into();
22708 self
22709 }
22710
22711 /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
22712 ///
22713 /// # Example
22714 /// ```ignore,no_run
22715 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22716 /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdict;
22717 /// let x0 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::AllowedByPolicy);
22718 /// let x1 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::DeniedByPolicy);
22719 /// ```
22720 pub fn set_verdict<
22721 T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
22722 >(
22723 mut self,
22724 v: T,
22725 ) -> Self {
22726 self.verdict = v.into();
22727 self
22728 }
22729
22730 /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
22731 ///
22732 /// # Example
22733 /// ```ignore,no_run
22734 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22735 /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdictOverride;
22736 /// let x = DeployPolicyEvaluationEvent::new().set_overrides([
22737 /// PolicyVerdictOverride::PolicyOverridden,
22738 /// PolicyVerdictOverride::PolicySuspended,
22739 /// ]);
22740 /// ```
22741 pub fn set_overrides<T, V>(mut self, v: T) -> Self
22742 where
22743 T: std::iter::IntoIterator<Item = V>,
22744 V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22745 {
22746 use std::iter::Iterator;
22747 self.overrides = v.into_iter().map(|i| i.into()).collect();
22748 self
22749 }
22750}
22751
22752impl wkt::message::Message for DeployPolicyEvaluationEvent {
22753 fn typename() -> &'static str {
22754 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
22755 }
22756}
22757
22758/// Defines additional types related to [DeployPolicyEvaluationEvent].
22759pub mod deploy_policy_evaluation_event {
22760 #[allow(unused_imports)]
22761 use super::*;
22762
22763 /// The policy verdict of the request.
22764 ///
22765 /// # Working with unknown values
22766 ///
22767 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22768 /// additional enum variants at any time. Adding new variants is not considered
22769 /// a breaking change. Applications should write their code in anticipation of:
22770 ///
22771 /// - New values appearing in future releases of the client library, **and**
22772 /// - New values received dynamically, without application changes.
22773 ///
22774 /// Please consult the [Working with enums] section in the user guide for some
22775 /// guidelines.
22776 ///
22777 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22778 #[derive(Clone, Debug, PartialEq)]
22779 #[non_exhaustive]
22780 pub enum PolicyVerdict {
22781 /// This should never happen.
22782 Unspecified,
22783 /// Allowed by policy. This enum value is not currently used but may be used
22784 /// in the future. Currently logs are only generated when a request is denied
22785 /// by policy.
22786 AllowedByPolicy,
22787 /// Denied by policy.
22788 DeniedByPolicy,
22789 /// If set, the enum was initialized with an unknown value.
22790 ///
22791 /// Applications can examine the value using [PolicyVerdict::value] or
22792 /// [PolicyVerdict::name].
22793 UnknownValue(policy_verdict::UnknownValue),
22794 }
22795
22796 #[doc(hidden)]
22797 pub mod policy_verdict {
22798 #[allow(unused_imports)]
22799 use super::*;
22800 #[derive(Clone, Debug, PartialEq)]
22801 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22802 }
22803
22804 impl PolicyVerdict {
22805 /// Gets the enum value.
22806 ///
22807 /// Returns `None` if the enum contains an unknown value deserialized from
22808 /// the string representation of enums.
22809 pub fn value(&self) -> std::option::Option<i32> {
22810 match self {
22811 Self::Unspecified => std::option::Option::Some(0),
22812 Self::AllowedByPolicy => std::option::Option::Some(1),
22813 Self::DeniedByPolicy => std::option::Option::Some(2),
22814 Self::UnknownValue(u) => u.0.value(),
22815 }
22816 }
22817
22818 /// Gets the enum value as a string.
22819 ///
22820 /// Returns `None` if the enum contains an unknown value deserialized from
22821 /// the integer representation of enums.
22822 pub fn name(&self) -> std::option::Option<&str> {
22823 match self {
22824 Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
22825 Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
22826 Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
22827 Self::UnknownValue(u) => u.0.name(),
22828 }
22829 }
22830 }
22831
22832 impl std::default::Default for PolicyVerdict {
22833 fn default() -> Self {
22834 use std::convert::From;
22835 Self::from(0)
22836 }
22837 }
22838
22839 impl std::fmt::Display for PolicyVerdict {
22840 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22841 wkt::internal::display_enum(f, self.name(), self.value())
22842 }
22843 }
22844
22845 impl std::convert::From<i32> for PolicyVerdict {
22846 fn from(value: i32) -> Self {
22847 match value {
22848 0 => Self::Unspecified,
22849 1 => Self::AllowedByPolicy,
22850 2 => Self::DeniedByPolicy,
22851 _ => Self::UnknownValue(policy_verdict::UnknownValue(
22852 wkt::internal::UnknownEnumValue::Integer(value),
22853 )),
22854 }
22855 }
22856 }
22857
22858 impl std::convert::From<&str> for PolicyVerdict {
22859 fn from(value: &str) -> Self {
22860 use std::string::ToString;
22861 match value {
22862 "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
22863 "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
22864 "DENIED_BY_POLICY" => Self::DeniedByPolicy,
22865 _ => Self::UnknownValue(policy_verdict::UnknownValue(
22866 wkt::internal::UnknownEnumValue::String(value.to_string()),
22867 )),
22868 }
22869 }
22870 }
22871
22872 impl serde::ser::Serialize for PolicyVerdict {
22873 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22874 where
22875 S: serde::Serializer,
22876 {
22877 match self {
22878 Self::Unspecified => serializer.serialize_i32(0),
22879 Self::AllowedByPolicy => serializer.serialize_i32(1),
22880 Self::DeniedByPolicy => serializer.serialize_i32(2),
22881 Self::UnknownValue(u) => u.0.serialize(serializer),
22882 }
22883 }
22884 }
22885
22886 impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
22887 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22888 where
22889 D: serde::Deserializer<'de>,
22890 {
22891 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
22892 ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
22893 ))
22894 }
22895 }
22896
22897 /// Things that could have overridden the policy verdict. When overrides are
22898 /// used, the request will be allowed even if it is DENIED_BY_POLICY.
22899 ///
22900 /// # Working with unknown values
22901 ///
22902 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22903 /// additional enum variants at any time. Adding new variants is not considered
22904 /// a breaking change. Applications should write their code in anticipation of:
22905 ///
22906 /// - New values appearing in future releases of the client library, **and**
22907 /// - New values received dynamically, without application changes.
22908 ///
22909 /// Please consult the [Working with enums] section in the user guide for some
22910 /// guidelines.
22911 ///
22912 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22913 #[derive(Clone, Debug, PartialEq)]
22914 #[non_exhaustive]
22915 pub enum PolicyVerdictOverride {
22916 /// This should never happen.
22917 Unspecified,
22918 /// The policy was overridden.
22919 PolicyOverridden,
22920 /// The policy was suspended.
22921 PolicySuspended,
22922 /// If set, the enum was initialized with an unknown value.
22923 ///
22924 /// Applications can examine the value using [PolicyVerdictOverride::value] or
22925 /// [PolicyVerdictOverride::name].
22926 UnknownValue(policy_verdict_override::UnknownValue),
22927 }
22928
22929 #[doc(hidden)]
22930 pub mod policy_verdict_override {
22931 #[allow(unused_imports)]
22932 use super::*;
22933 #[derive(Clone, Debug, PartialEq)]
22934 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22935 }
22936
22937 impl PolicyVerdictOverride {
22938 /// Gets the enum value.
22939 ///
22940 /// Returns `None` if the enum contains an unknown value deserialized from
22941 /// the string representation of enums.
22942 pub fn value(&self) -> std::option::Option<i32> {
22943 match self {
22944 Self::Unspecified => std::option::Option::Some(0),
22945 Self::PolicyOverridden => std::option::Option::Some(1),
22946 Self::PolicySuspended => std::option::Option::Some(2),
22947 Self::UnknownValue(u) => u.0.value(),
22948 }
22949 }
22950
22951 /// Gets the enum value as a string.
22952 ///
22953 /// Returns `None` if the enum contains an unknown value deserialized from
22954 /// the integer representation of enums.
22955 pub fn name(&self) -> std::option::Option<&str> {
22956 match self {
22957 Self::Unspecified => {
22958 std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
22959 }
22960 Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
22961 Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
22962 Self::UnknownValue(u) => u.0.name(),
22963 }
22964 }
22965 }
22966
22967 impl std::default::Default for PolicyVerdictOverride {
22968 fn default() -> Self {
22969 use std::convert::From;
22970 Self::from(0)
22971 }
22972 }
22973
22974 impl std::fmt::Display for PolicyVerdictOverride {
22975 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22976 wkt::internal::display_enum(f, self.name(), self.value())
22977 }
22978 }
22979
22980 impl std::convert::From<i32> for PolicyVerdictOverride {
22981 fn from(value: i32) -> Self {
22982 match value {
22983 0 => Self::Unspecified,
22984 1 => Self::PolicyOverridden,
22985 2 => Self::PolicySuspended,
22986 _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
22987 wkt::internal::UnknownEnumValue::Integer(value),
22988 )),
22989 }
22990 }
22991 }
22992
22993 impl std::convert::From<&str> for PolicyVerdictOverride {
22994 fn from(value: &str) -> Self {
22995 use std::string::ToString;
22996 match value {
22997 "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
22998 "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
22999 "POLICY_SUSPENDED" => Self::PolicySuspended,
23000 _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23001 wkt::internal::UnknownEnumValue::String(value.to_string()),
23002 )),
23003 }
23004 }
23005 }
23006
23007 impl serde::ser::Serialize for PolicyVerdictOverride {
23008 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23009 where
23010 S: serde::Serializer,
23011 {
23012 match self {
23013 Self::Unspecified => serializer.serialize_i32(0),
23014 Self::PolicyOverridden => serializer.serialize_i32(1),
23015 Self::PolicySuspended => serializer.serialize_i32(2),
23016 Self::UnknownValue(u) => u.0.serialize(serializer),
23017 }
23018 }
23019 }
23020
23021 impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
23022 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23023 where
23024 D: serde::Deserializer<'de>,
23025 {
23026 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
23027 ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
23028 ))
23029 }
23030 }
23031}
23032
23033/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
23034/// Platform Log event that describes the failure to send a pub/sub notification
23035/// when there is a DeployPolicy status change.
23036#[derive(Clone, Default, PartialEq)]
23037#[non_exhaustive]
23038pub struct DeployPolicyNotificationEvent {
23039 /// Debug message for when a deploy policy fails to send a pub/sub
23040 /// notification.
23041 pub message: std::string::String,
23042
23043 /// The name of the `DeployPolicy`.
23044 pub deploy_policy: std::string::String,
23045
23046 /// Unique identifier of the deploy policy.
23047 pub deploy_policy_uid: std::string::String,
23048
23049 /// Type of this notification, e.g. for a Pub/Sub failure.
23050 pub r#type: crate::model::Type,
23051
23052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23053}
23054
23055impl DeployPolicyNotificationEvent {
23056 pub fn new() -> Self {
23057 std::default::Default::default()
23058 }
23059
23060 /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
23061 ///
23062 /// # Example
23063 /// ```ignore,no_run
23064 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23065 /// let x = DeployPolicyNotificationEvent::new().set_message("example");
23066 /// ```
23067 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23068 self.message = v.into();
23069 self
23070 }
23071
23072 /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
23073 ///
23074 /// # Example
23075 /// ```ignore,no_run
23076 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23077 /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy("example");
23078 /// ```
23079 pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23080 self.deploy_policy = v.into();
23081 self
23082 }
23083
23084 /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
23085 ///
23086 /// # Example
23087 /// ```ignore,no_run
23088 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23089 /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy_uid("example");
23090 /// ```
23091 pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23092 mut self,
23093 v: T,
23094 ) -> Self {
23095 self.deploy_policy_uid = v.into();
23096 self
23097 }
23098
23099 /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
23100 ///
23101 /// # Example
23102 /// ```ignore,no_run
23103 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23104 /// use google_cloud_deploy_v1::model::Type;
23105 /// let x0 = DeployPolicyNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23106 /// let x1 = DeployPolicyNotificationEvent::new().set_type(Type::ResourceStateChange);
23107 /// let x2 = DeployPolicyNotificationEvent::new().set_type(Type::ProcessAborted);
23108 /// ```
23109 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23110 self.r#type = v.into();
23111 self
23112 }
23113}
23114
23115impl wkt::message::Message for DeployPolicyNotificationEvent {
23116 fn typename() -> &'static str {
23117 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
23118 }
23119}
23120
23121/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
23122/// Platform Log event that describes the failure to send JobRun resource update
23123/// Pub/Sub notification.
23124#[derive(Clone, Default, PartialEq)]
23125#[non_exhaustive]
23126pub struct JobRunNotificationEvent {
23127 /// Debug message for when a notification fails to send.
23128 pub message: std::string::String,
23129
23130 /// The name of the `JobRun`.
23131 pub job_run: std::string::String,
23132
23133 /// Unique identifier of the `DeliveryPipeline`.
23134 pub pipeline_uid: std::string::String,
23135
23136 /// Unique identifier of the `Release`.
23137 pub release_uid: std::string::String,
23138
23139 /// The name of the `Release`.
23140 pub release: std::string::String,
23141
23142 /// Unique identifier of the `Rollout`.
23143 pub rollout_uid: std::string::String,
23144
23145 /// The name of the `Rollout`.
23146 pub rollout: std::string::String,
23147
23148 /// ID of the `Target`.
23149 pub target_id: std::string::String,
23150
23151 /// Type of this notification, e.g. for a Pub/Sub failure.
23152 pub r#type: crate::model::Type,
23153
23154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23155}
23156
23157impl JobRunNotificationEvent {
23158 pub fn new() -> Self {
23159 std::default::Default::default()
23160 }
23161
23162 /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
23163 ///
23164 /// # Example
23165 /// ```ignore,no_run
23166 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23167 /// let x = JobRunNotificationEvent::new().set_message("example");
23168 /// ```
23169 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23170 self.message = v.into();
23171 self
23172 }
23173
23174 /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
23175 ///
23176 /// # Example
23177 /// ```ignore,no_run
23178 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23179 /// let x = JobRunNotificationEvent::new().set_job_run("example");
23180 /// ```
23181 pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23182 self.job_run = v.into();
23183 self
23184 }
23185
23186 /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
23187 ///
23188 /// # Example
23189 /// ```ignore,no_run
23190 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23191 /// let x = JobRunNotificationEvent::new().set_pipeline_uid("example");
23192 /// ```
23193 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23194 self.pipeline_uid = v.into();
23195 self
23196 }
23197
23198 /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
23199 ///
23200 /// # Example
23201 /// ```ignore,no_run
23202 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23203 /// let x = JobRunNotificationEvent::new().set_release_uid("example");
23204 /// ```
23205 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23206 self.release_uid = v.into();
23207 self
23208 }
23209
23210 /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
23211 ///
23212 /// # Example
23213 /// ```ignore,no_run
23214 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23215 /// let x = JobRunNotificationEvent::new().set_release("example");
23216 /// ```
23217 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23218 self.release = v.into();
23219 self
23220 }
23221
23222 /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
23223 ///
23224 /// # Example
23225 /// ```ignore,no_run
23226 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23227 /// let x = JobRunNotificationEvent::new().set_rollout_uid("example");
23228 /// ```
23229 pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23230 self.rollout_uid = v.into();
23231 self
23232 }
23233
23234 /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
23235 ///
23236 /// # Example
23237 /// ```ignore,no_run
23238 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23239 /// let x = JobRunNotificationEvent::new().set_rollout("example");
23240 /// ```
23241 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23242 self.rollout = v.into();
23243 self
23244 }
23245
23246 /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
23247 ///
23248 /// # Example
23249 /// ```ignore,no_run
23250 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23251 /// let x = JobRunNotificationEvent::new().set_target_id("example");
23252 /// ```
23253 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23254 self.target_id = v.into();
23255 self
23256 }
23257
23258 /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
23259 ///
23260 /// # Example
23261 /// ```ignore,no_run
23262 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23263 /// use google_cloud_deploy_v1::model::Type;
23264 /// let x0 = JobRunNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23265 /// let x1 = JobRunNotificationEvent::new().set_type(Type::ResourceStateChange);
23266 /// let x2 = JobRunNotificationEvent::new().set_type(Type::ProcessAborted);
23267 /// ```
23268 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23269 self.r#type = v.into();
23270 self
23271 }
23272}
23273
23274impl wkt::message::Message for JobRunNotificationEvent {
23275 fn typename() -> &'static str {
23276 "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
23277 }
23278}
23279
23280/// Payload proto for "clouddeploy.googleapis.com/release_notification"
23281/// Platform Log event that describes the failure to send release status change
23282/// Pub/Sub notification.
23283#[derive(Clone, Default, PartialEq)]
23284#[non_exhaustive]
23285pub struct ReleaseNotificationEvent {
23286 /// Debug message for when a notification fails to send.
23287 pub message: std::string::String,
23288
23289 /// Unique identifier of the `DeliveryPipeline`.
23290 pub pipeline_uid: std::string::String,
23291
23292 /// Unique identifier of the `Release`.
23293 pub release_uid: std::string::String,
23294
23295 /// The name of the `Release`.
23296 pub release: std::string::String,
23297
23298 /// Type of this notification, e.g. for a Pub/Sub failure.
23299 pub r#type: crate::model::Type,
23300
23301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23302}
23303
23304impl ReleaseNotificationEvent {
23305 pub fn new() -> Self {
23306 std::default::Default::default()
23307 }
23308
23309 /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
23310 ///
23311 /// # Example
23312 /// ```ignore,no_run
23313 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23314 /// let x = ReleaseNotificationEvent::new().set_message("example");
23315 /// ```
23316 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23317 self.message = v.into();
23318 self
23319 }
23320
23321 /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
23322 ///
23323 /// # Example
23324 /// ```ignore,no_run
23325 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23326 /// let x = ReleaseNotificationEvent::new().set_pipeline_uid("example");
23327 /// ```
23328 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23329 self.pipeline_uid = v.into();
23330 self
23331 }
23332
23333 /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
23334 ///
23335 /// # Example
23336 /// ```ignore,no_run
23337 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23338 /// let x = ReleaseNotificationEvent::new().set_release_uid("example");
23339 /// ```
23340 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23341 self.release_uid = v.into();
23342 self
23343 }
23344
23345 /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
23346 ///
23347 /// # Example
23348 /// ```ignore,no_run
23349 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23350 /// let x = ReleaseNotificationEvent::new().set_release("example");
23351 /// ```
23352 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23353 self.release = v.into();
23354 self
23355 }
23356
23357 /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
23358 ///
23359 /// # Example
23360 /// ```ignore,no_run
23361 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23362 /// use google_cloud_deploy_v1::model::Type;
23363 /// let x0 = ReleaseNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23364 /// let x1 = ReleaseNotificationEvent::new().set_type(Type::ResourceStateChange);
23365 /// let x2 = ReleaseNotificationEvent::new().set_type(Type::ProcessAborted);
23366 /// ```
23367 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23368 self.r#type = v.into();
23369 self
23370 }
23371}
23372
23373impl wkt::message::Message for ReleaseNotificationEvent {
23374 fn typename() -> &'static str {
23375 "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
23376 }
23377}
23378
23379/// Payload proto for "clouddeploy.googleapis.com/release_render"
23380/// Platform Log event that describes the render status change.
23381#[derive(Clone, Default, PartialEq)]
23382#[non_exhaustive]
23383pub struct ReleaseRenderEvent {
23384 /// Debug message for when a render transition occurs. Provides further
23385 /// details as rendering progresses through render states.
23386 pub message: std::string::String,
23387
23388 /// Unique identifier of the `DeliveryPipeline`.
23389 pub pipeline_uid: std::string::String,
23390
23391 /// The name of the release.
23392 /// release_uid is not in this log message because we write some of these log
23393 /// messages at release creation time, before we've generated the uid.
23394 pub release: std::string::String,
23395
23396 /// Type of this notification, e.g. for a release render state change event.
23397 pub r#type: crate::model::Type,
23398
23399 /// The state of the release render.
23400 pub release_render_state: crate::model::release::RenderState,
23401
23402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23403}
23404
23405impl ReleaseRenderEvent {
23406 pub fn new() -> Self {
23407 std::default::Default::default()
23408 }
23409
23410 /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
23411 ///
23412 /// # Example
23413 /// ```ignore,no_run
23414 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23415 /// let x = ReleaseRenderEvent::new().set_message("example");
23416 /// ```
23417 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23418 self.message = v.into();
23419 self
23420 }
23421
23422 /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
23423 ///
23424 /// # Example
23425 /// ```ignore,no_run
23426 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23427 /// let x = ReleaseRenderEvent::new().set_pipeline_uid("example");
23428 /// ```
23429 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23430 self.pipeline_uid = v.into();
23431 self
23432 }
23433
23434 /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
23435 ///
23436 /// # Example
23437 /// ```ignore,no_run
23438 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23439 /// let x = ReleaseRenderEvent::new().set_release("example");
23440 /// ```
23441 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23442 self.release = v.into();
23443 self
23444 }
23445
23446 /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
23447 ///
23448 /// # Example
23449 /// ```ignore,no_run
23450 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23451 /// use google_cloud_deploy_v1::model::Type;
23452 /// let x0 = ReleaseRenderEvent::new().set_type(Type::PubsubNotificationFailure);
23453 /// let x1 = ReleaseRenderEvent::new().set_type(Type::ResourceStateChange);
23454 /// let x2 = ReleaseRenderEvent::new().set_type(Type::ProcessAborted);
23455 /// ```
23456 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23457 self.r#type = v.into();
23458 self
23459 }
23460
23461 /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
23462 ///
23463 /// # Example
23464 /// ```ignore,no_run
23465 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23466 /// use google_cloud_deploy_v1::model::release::RenderState;
23467 /// let x0 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Succeeded);
23468 /// let x1 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Failed);
23469 /// let x2 = ReleaseRenderEvent::new().set_release_render_state(RenderState::InProgress);
23470 /// ```
23471 pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
23472 mut self,
23473 v: T,
23474 ) -> Self {
23475 self.release_render_state = v.into();
23476 self
23477 }
23478}
23479
23480impl wkt::message::Message for ReleaseRenderEvent {
23481 fn typename() -> &'static str {
23482 "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
23483 }
23484}
23485
23486/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
23487/// Platform Log event that describes the failure to send rollout status change
23488/// Pub/Sub notification.
23489#[derive(Clone, Default, PartialEq)]
23490#[non_exhaustive]
23491pub struct RolloutNotificationEvent {
23492 /// Debug message for when a notification fails to send.
23493 pub message: std::string::String,
23494
23495 /// Unique identifier of the `DeliveryPipeline`.
23496 pub pipeline_uid: std::string::String,
23497
23498 /// Unique identifier of the `Release`.
23499 pub release_uid: std::string::String,
23500
23501 /// The name of the `Release`.
23502 pub release: std::string::String,
23503
23504 /// Unique identifier of the `Rollout`.
23505 pub rollout_uid: std::string::String,
23506
23507 /// The name of the `Rollout`.
23508 pub rollout: std::string::String,
23509
23510 /// ID of the `Target` that the rollout is deployed to.
23511 pub target_id: std::string::String,
23512
23513 /// Type of this notification, e.g. for a Pub/Sub failure.
23514 pub r#type: crate::model::Type,
23515
23516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23517}
23518
23519impl RolloutNotificationEvent {
23520 pub fn new() -> Self {
23521 std::default::Default::default()
23522 }
23523
23524 /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
23525 ///
23526 /// # Example
23527 /// ```ignore,no_run
23528 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23529 /// let x = RolloutNotificationEvent::new().set_message("example");
23530 /// ```
23531 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23532 self.message = v.into();
23533 self
23534 }
23535
23536 /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
23537 ///
23538 /// # Example
23539 /// ```ignore,no_run
23540 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23541 /// let x = RolloutNotificationEvent::new().set_pipeline_uid("example");
23542 /// ```
23543 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23544 self.pipeline_uid = v.into();
23545 self
23546 }
23547
23548 /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
23549 ///
23550 /// # Example
23551 /// ```ignore,no_run
23552 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23553 /// let x = RolloutNotificationEvent::new().set_release_uid("example");
23554 /// ```
23555 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23556 self.release_uid = v.into();
23557 self
23558 }
23559
23560 /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
23561 ///
23562 /// # Example
23563 /// ```ignore,no_run
23564 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23565 /// let x = RolloutNotificationEvent::new().set_release("example");
23566 /// ```
23567 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23568 self.release = v.into();
23569 self
23570 }
23571
23572 /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
23573 ///
23574 /// # Example
23575 /// ```ignore,no_run
23576 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23577 /// let x = RolloutNotificationEvent::new().set_rollout_uid("example");
23578 /// ```
23579 pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23580 self.rollout_uid = v.into();
23581 self
23582 }
23583
23584 /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
23585 ///
23586 /// # Example
23587 /// ```ignore,no_run
23588 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23589 /// let x = RolloutNotificationEvent::new().set_rollout("example");
23590 /// ```
23591 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23592 self.rollout = v.into();
23593 self
23594 }
23595
23596 /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
23597 ///
23598 /// # Example
23599 /// ```ignore,no_run
23600 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23601 /// let x = RolloutNotificationEvent::new().set_target_id("example");
23602 /// ```
23603 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23604 self.target_id = v.into();
23605 self
23606 }
23607
23608 /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
23609 ///
23610 /// # Example
23611 /// ```ignore,no_run
23612 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23613 /// use google_cloud_deploy_v1::model::Type;
23614 /// let x0 = RolloutNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23615 /// let x1 = RolloutNotificationEvent::new().set_type(Type::ResourceStateChange);
23616 /// let x2 = RolloutNotificationEvent::new().set_type(Type::ProcessAborted);
23617 /// ```
23618 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23619 self.r#type = v.into();
23620 self
23621 }
23622}
23623
23624impl wkt::message::Message for RolloutNotificationEvent {
23625 fn typename() -> &'static str {
23626 "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
23627 }
23628}
23629
23630/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
23631/// Platform Log event that describes the rollout update event.
23632#[derive(Clone, Default, PartialEq)]
23633#[non_exhaustive]
23634pub struct RolloutUpdateEvent {
23635 /// Debug message for when a rollout update event occurs.
23636 pub message: std::string::String,
23637
23638 /// Unique identifier of the pipeline.
23639 pub pipeline_uid: std::string::String,
23640
23641 /// Unique identifier of the release.
23642 pub release_uid: std::string::String,
23643
23644 /// The name of the `Release`.
23645 pub release: std::string::String,
23646
23647 /// The name of the rollout.
23648 /// rollout_uid is not in this log message because we write some of these log
23649 /// messages at rollout creation time, before we've generated the uid.
23650 pub rollout: std::string::String,
23651
23652 /// ID of the target.
23653 pub target_id: std::string::String,
23654
23655 /// Type of this notification, e.g. for a rollout update event.
23656 pub r#type: crate::model::Type,
23657
23658 /// The type of the rollout update.
23659 pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
23660
23661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23662}
23663
23664impl RolloutUpdateEvent {
23665 pub fn new() -> Self {
23666 std::default::Default::default()
23667 }
23668
23669 /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
23670 ///
23671 /// # Example
23672 /// ```ignore,no_run
23673 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23674 /// let x = RolloutUpdateEvent::new().set_message("example");
23675 /// ```
23676 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23677 self.message = v.into();
23678 self
23679 }
23680
23681 /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
23682 ///
23683 /// # Example
23684 /// ```ignore,no_run
23685 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23686 /// let x = RolloutUpdateEvent::new().set_pipeline_uid("example");
23687 /// ```
23688 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23689 self.pipeline_uid = v.into();
23690 self
23691 }
23692
23693 /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
23694 ///
23695 /// # Example
23696 /// ```ignore,no_run
23697 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23698 /// let x = RolloutUpdateEvent::new().set_release_uid("example");
23699 /// ```
23700 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23701 self.release_uid = v.into();
23702 self
23703 }
23704
23705 /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
23706 ///
23707 /// # Example
23708 /// ```ignore,no_run
23709 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23710 /// let x = RolloutUpdateEvent::new().set_release("example");
23711 /// ```
23712 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23713 self.release = v.into();
23714 self
23715 }
23716
23717 /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
23718 ///
23719 /// # Example
23720 /// ```ignore,no_run
23721 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23722 /// let x = RolloutUpdateEvent::new().set_rollout("example");
23723 /// ```
23724 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23725 self.rollout = v.into();
23726 self
23727 }
23728
23729 /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
23730 ///
23731 /// # Example
23732 /// ```ignore,no_run
23733 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23734 /// let x = RolloutUpdateEvent::new().set_target_id("example");
23735 /// ```
23736 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23737 self.target_id = v.into();
23738 self
23739 }
23740
23741 /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
23742 ///
23743 /// # Example
23744 /// ```ignore,no_run
23745 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23746 /// use google_cloud_deploy_v1::model::Type;
23747 /// let x0 = RolloutUpdateEvent::new().set_type(Type::PubsubNotificationFailure);
23748 /// let x1 = RolloutUpdateEvent::new().set_type(Type::ResourceStateChange);
23749 /// let x2 = RolloutUpdateEvent::new().set_type(Type::ProcessAborted);
23750 /// ```
23751 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23752 self.r#type = v.into();
23753 self
23754 }
23755
23756 /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
23757 ///
23758 /// # Example
23759 /// ```ignore,no_run
23760 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23761 /// use google_cloud_deploy_v1::model::rollout_update_event::RolloutUpdateType;
23762 /// let x0 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::Pending);
23763 /// let x1 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::PendingRelease);
23764 /// let x2 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::InProgress);
23765 /// ```
23766 pub fn set_rollout_update_type<
23767 T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
23768 >(
23769 mut self,
23770 v: T,
23771 ) -> Self {
23772 self.rollout_update_type = v.into();
23773 self
23774 }
23775}
23776
23777impl wkt::message::Message for RolloutUpdateEvent {
23778 fn typename() -> &'static str {
23779 "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
23780 }
23781}
23782
23783/// Defines additional types related to [RolloutUpdateEvent].
23784pub mod rollout_update_event {
23785 #[allow(unused_imports)]
23786 use super::*;
23787
23788 /// RolloutUpdateType indicates the type of the rollout update.
23789 ///
23790 /// # Working with unknown values
23791 ///
23792 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23793 /// additional enum variants at any time. Adding new variants is not considered
23794 /// a breaking change. Applications should write their code in anticipation of:
23795 ///
23796 /// - New values appearing in future releases of the client library, **and**
23797 /// - New values received dynamically, without application changes.
23798 ///
23799 /// Please consult the [Working with enums] section in the user guide for some
23800 /// guidelines.
23801 ///
23802 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23803 #[derive(Clone, Debug, PartialEq)]
23804 #[non_exhaustive]
23805 pub enum RolloutUpdateType {
23806 /// Rollout update type unspecified.
23807 Unspecified,
23808 /// rollout state updated to pending.
23809 Pending,
23810 /// Rollout state updated to pending release.
23811 PendingRelease,
23812 /// Rollout state updated to in progress.
23813 InProgress,
23814 /// Rollout state updated to cancelling.
23815 Cancelling,
23816 /// Rollout state updated to cancelled.
23817 Cancelled,
23818 /// Rollout state updated to halted.
23819 Halted,
23820 /// Rollout state updated to succeeded.
23821 Succeeded,
23822 /// Rollout state updated to failed.
23823 Failed,
23824 /// Rollout requires approval.
23825 ApprovalRequired,
23826 /// Rollout has been approved.
23827 Approved,
23828 /// Rollout has been rejected.
23829 Rejected,
23830 /// Rollout requires advance to the next phase.
23831 AdvanceRequired,
23832 /// Rollout has been advanced.
23833 Advanced,
23834 /// If set, the enum was initialized with an unknown value.
23835 ///
23836 /// Applications can examine the value using [RolloutUpdateType::value] or
23837 /// [RolloutUpdateType::name].
23838 UnknownValue(rollout_update_type::UnknownValue),
23839 }
23840
23841 #[doc(hidden)]
23842 pub mod rollout_update_type {
23843 #[allow(unused_imports)]
23844 use super::*;
23845 #[derive(Clone, Debug, PartialEq)]
23846 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23847 }
23848
23849 impl RolloutUpdateType {
23850 /// Gets the enum value.
23851 ///
23852 /// Returns `None` if the enum contains an unknown value deserialized from
23853 /// the string representation of enums.
23854 pub fn value(&self) -> std::option::Option<i32> {
23855 match self {
23856 Self::Unspecified => std::option::Option::Some(0),
23857 Self::Pending => std::option::Option::Some(1),
23858 Self::PendingRelease => std::option::Option::Some(2),
23859 Self::InProgress => std::option::Option::Some(3),
23860 Self::Cancelling => std::option::Option::Some(4),
23861 Self::Cancelled => std::option::Option::Some(5),
23862 Self::Halted => std::option::Option::Some(6),
23863 Self::Succeeded => std::option::Option::Some(7),
23864 Self::Failed => std::option::Option::Some(8),
23865 Self::ApprovalRequired => std::option::Option::Some(9),
23866 Self::Approved => std::option::Option::Some(10),
23867 Self::Rejected => std::option::Option::Some(11),
23868 Self::AdvanceRequired => std::option::Option::Some(12),
23869 Self::Advanced => std::option::Option::Some(13),
23870 Self::UnknownValue(u) => u.0.value(),
23871 }
23872 }
23873
23874 /// Gets the enum value as a string.
23875 ///
23876 /// Returns `None` if the enum contains an unknown value deserialized from
23877 /// the integer representation of enums.
23878 pub fn name(&self) -> std::option::Option<&str> {
23879 match self {
23880 Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
23881 Self::Pending => std::option::Option::Some("PENDING"),
23882 Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
23883 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
23884 Self::Cancelling => std::option::Option::Some("CANCELLING"),
23885 Self::Cancelled => std::option::Option::Some("CANCELLED"),
23886 Self::Halted => std::option::Option::Some("HALTED"),
23887 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
23888 Self::Failed => std::option::Option::Some("FAILED"),
23889 Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
23890 Self::Approved => std::option::Option::Some("APPROVED"),
23891 Self::Rejected => std::option::Option::Some("REJECTED"),
23892 Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
23893 Self::Advanced => std::option::Option::Some("ADVANCED"),
23894 Self::UnknownValue(u) => u.0.name(),
23895 }
23896 }
23897 }
23898
23899 impl std::default::Default for RolloutUpdateType {
23900 fn default() -> Self {
23901 use std::convert::From;
23902 Self::from(0)
23903 }
23904 }
23905
23906 impl std::fmt::Display for RolloutUpdateType {
23907 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23908 wkt::internal::display_enum(f, self.name(), self.value())
23909 }
23910 }
23911
23912 impl std::convert::From<i32> for RolloutUpdateType {
23913 fn from(value: i32) -> Self {
23914 match value {
23915 0 => Self::Unspecified,
23916 1 => Self::Pending,
23917 2 => Self::PendingRelease,
23918 3 => Self::InProgress,
23919 4 => Self::Cancelling,
23920 5 => Self::Cancelled,
23921 6 => Self::Halted,
23922 7 => Self::Succeeded,
23923 8 => Self::Failed,
23924 9 => Self::ApprovalRequired,
23925 10 => Self::Approved,
23926 11 => Self::Rejected,
23927 12 => Self::AdvanceRequired,
23928 13 => Self::Advanced,
23929 _ => Self::UnknownValue(rollout_update_type::UnknownValue(
23930 wkt::internal::UnknownEnumValue::Integer(value),
23931 )),
23932 }
23933 }
23934 }
23935
23936 impl std::convert::From<&str> for RolloutUpdateType {
23937 fn from(value: &str) -> Self {
23938 use std::string::ToString;
23939 match value {
23940 "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
23941 "PENDING" => Self::Pending,
23942 "PENDING_RELEASE" => Self::PendingRelease,
23943 "IN_PROGRESS" => Self::InProgress,
23944 "CANCELLING" => Self::Cancelling,
23945 "CANCELLED" => Self::Cancelled,
23946 "HALTED" => Self::Halted,
23947 "SUCCEEDED" => Self::Succeeded,
23948 "FAILED" => Self::Failed,
23949 "APPROVAL_REQUIRED" => Self::ApprovalRequired,
23950 "APPROVED" => Self::Approved,
23951 "REJECTED" => Self::Rejected,
23952 "ADVANCE_REQUIRED" => Self::AdvanceRequired,
23953 "ADVANCED" => Self::Advanced,
23954 _ => Self::UnknownValue(rollout_update_type::UnknownValue(
23955 wkt::internal::UnknownEnumValue::String(value.to_string()),
23956 )),
23957 }
23958 }
23959 }
23960
23961 impl serde::ser::Serialize for RolloutUpdateType {
23962 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23963 where
23964 S: serde::Serializer,
23965 {
23966 match self {
23967 Self::Unspecified => serializer.serialize_i32(0),
23968 Self::Pending => serializer.serialize_i32(1),
23969 Self::PendingRelease => serializer.serialize_i32(2),
23970 Self::InProgress => serializer.serialize_i32(3),
23971 Self::Cancelling => serializer.serialize_i32(4),
23972 Self::Cancelled => serializer.serialize_i32(5),
23973 Self::Halted => serializer.serialize_i32(6),
23974 Self::Succeeded => serializer.serialize_i32(7),
23975 Self::Failed => serializer.serialize_i32(8),
23976 Self::ApprovalRequired => serializer.serialize_i32(9),
23977 Self::Approved => serializer.serialize_i32(10),
23978 Self::Rejected => serializer.serialize_i32(11),
23979 Self::AdvanceRequired => serializer.serialize_i32(12),
23980 Self::Advanced => serializer.serialize_i32(13),
23981 Self::UnknownValue(u) => u.0.serialize(serializer),
23982 }
23983 }
23984 }
23985
23986 impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
23987 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23988 where
23989 D: serde::Deserializer<'de>,
23990 {
23991 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
23992 ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
23993 ))
23994 }
23995 }
23996}
23997
23998/// Payload proto for "clouddeploy.googleapis.com/target_notification"
23999/// Platform Log event that describes the failure to send target status change
24000/// Pub/Sub notification.
24001#[derive(Clone, Default, PartialEq)]
24002#[non_exhaustive]
24003pub struct TargetNotificationEvent {
24004 /// Debug message for when a notification fails to send.
24005 pub message: std::string::String,
24006
24007 /// The name of the `Target`.
24008 pub target: std::string::String,
24009
24010 /// Type of this notification, e.g. for a Pub/Sub failure.
24011 pub r#type: crate::model::Type,
24012
24013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24014}
24015
24016impl TargetNotificationEvent {
24017 pub fn new() -> Self {
24018 std::default::Default::default()
24019 }
24020
24021 /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
24022 ///
24023 /// # Example
24024 /// ```ignore,no_run
24025 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24026 /// let x = TargetNotificationEvent::new().set_message("example");
24027 /// ```
24028 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24029 self.message = v.into();
24030 self
24031 }
24032
24033 /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
24034 ///
24035 /// # Example
24036 /// ```ignore,no_run
24037 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24038 /// let x = TargetNotificationEvent::new().set_target("example");
24039 /// ```
24040 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24041 self.target = v.into();
24042 self
24043 }
24044
24045 /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
24046 ///
24047 /// # Example
24048 /// ```ignore,no_run
24049 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24050 /// use google_cloud_deploy_v1::model::Type;
24051 /// let x0 = TargetNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
24052 /// let x1 = TargetNotificationEvent::new().set_type(Type::ResourceStateChange);
24053 /// let x2 = TargetNotificationEvent::new().set_type(Type::ProcessAborted);
24054 /// ```
24055 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24056 self.r#type = v.into();
24057 self
24058 }
24059}
24060
24061impl wkt::message::Message for TargetNotificationEvent {
24062 fn typename() -> &'static str {
24063 "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
24064 }
24065}
24066
24067/// The support state of a specific Skaffold version.
24068///
24069/// # Working with unknown values
24070///
24071/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24072/// additional enum variants at any time. Adding new variants is not considered
24073/// a breaking change. Applications should write their code in anticipation of:
24074///
24075/// - New values appearing in future releases of the client library, **and**
24076/// - New values received dynamically, without application changes.
24077///
24078/// Please consult the [Working with enums] section in the user guide for some
24079/// guidelines.
24080///
24081/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24082#[derive(Clone, Debug, PartialEq)]
24083#[non_exhaustive]
24084pub enum SkaffoldSupportState {
24085 /// Default value. This value is unused.
24086 Unspecified,
24087 /// This Skaffold version is currently supported.
24088 Supported,
24089 /// This Skaffold version is in maintenance mode.
24090 MaintenanceMode,
24091 /// This Skaffold version is no longer supported.
24092 Unsupported,
24093 /// If set, the enum was initialized with an unknown value.
24094 ///
24095 /// Applications can examine the value using [SkaffoldSupportState::value] or
24096 /// [SkaffoldSupportState::name].
24097 UnknownValue(skaffold_support_state::UnknownValue),
24098}
24099
24100#[doc(hidden)]
24101pub mod skaffold_support_state {
24102 #[allow(unused_imports)]
24103 use super::*;
24104 #[derive(Clone, Debug, PartialEq)]
24105 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24106}
24107
24108impl SkaffoldSupportState {
24109 /// Gets the enum value.
24110 ///
24111 /// Returns `None` if the enum contains an unknown value deserialized from
24112 /// the string representation of enums.
24113 pub fn value(&self) -> std::option::Option<i32> {
24114 match self {
24115 Self::Unspecified => std::option::Option::Some(0),
24116 Self::Supported => std::option::Option::Some(1),
24117 Self::MaintenanceMode => std::option::Option::Some(2),
24118 Self::Unsupported => std::option::Option::Some(3),
24119 Self::UnknownValue(u) => u.0.value(),
24120 }
24121 }
24122
24123 /// Gets the enum value as a string.
24124 ///
24125 /// Returns `None` if the enum contains an unknown value deserialized from
24126 /// the integer representation of enums.
24127 pub fn name(&self) -> std::option::Option<&str> {
24128 match self {
24129 Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
24130 Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
24131 Self::MaintenanceMode => {
24132 std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
24133 }
24134 Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
24135 Self::UnknownValue(u) => u.0.name(),
24136 }
24137 }
24138}
24139
24140impl std::default::Default for SkaffoldSupportState {
24141 fn default() -> Self {
24142 use std::convert::From;
24143 Self::from(0)
24144 }
24145}
24146
24147impl std::fmt::Display for SkaffoldSupportState {
24148 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24149 wkt::internal::display_enum(f, self.name(), self.value())
24150 }
24151}
24152
24153impl std::convert::From<i32> for SkaffoldSupportState {
24154 fn from(value: i32) -> Self {
24155 match value {
24156 0 => Self::Unspecified,
24157 1 => Self::Supported,
24158 2 => Self::MaintenanceMode,
24159 3 => Self::Unsupported,
24160 _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24161 wkt::internal::UnknownEnumValue::Integer(value),
24162 )),
24163 }
24164 }
24165}
24166
24167impl std::convert::From<&str> for SkaffoldSupportState {
24168 fn from(value: &str) -> Self {
24169 use std::string::ToString;
24170 match value {
24171 "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
24172 "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
24173 "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
24174 "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
24175 _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24176 wkt::internal::UnknownEnumValue::String(value.to_string()),
24177 )),
24178 }
24179 }
24180}
24181
24182impl serde::ser::Serialize for SkaffoldSupportState {
24183 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24184 where
24185 S: serde::Serializer,
24186 {
24187 match self {
24188 Self::Unspecified => serializer.serialize_i32(0),
24189 Self::Supported => serializer.serialize_i32(1),
24190 Self::MaintenanceMode => serializer.serialize_i32(2),
24191 Self::Unsupported => serializer.serialize_i32(3),
24192 Self::UnknownValue(u) => u.0.serialize(serializer),
24193 }
24194 }
24195}
24196
24197impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
24198 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24199 where
24200 D: serde::Deserializer<'de>,
24201 {
24202 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
24203 ".google.cloud.deploy.v1.SkaffoldSupportState",
24204 ))
24205 }
24206}
24207
24208/// The pattern of how wait time is increased.
24209///
24210/// # Working with unknown values
24211///
24212/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24213/// additional enum variants at any time. Adding new variants is not considered
24214/// a breaking change. Applications should write their code in anticipation of:
24215///
24216/// - New values appearing in future releases of the client library, **and**
24217/// - New values received dynamically, without application changes.
24218///
24219/// Please consult the [Working with enums] section in the user guide for some
24220/// guidelines.
24221///
24222/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24223#[derive(Clone, Debug, PartialEq)]
24224#[non_exhaustive]
24225pub enum BackoffMode {
24226 /// No WaitMode is specified.
24227 Unspecified,
24228 /// Increases the wait time linearly.
24229 Linear,
24230 /// Increases the wait time exponentially.
24231 Exponential,
24232 /// If set, the enum was initialized with an unknown value.
24233 ///
24234 /// Applications can examine the value using [BackoffMode::value] or
24235 /// [BackoffMode::name].
24236 UnknownValue(backoff_mode::UnknownValue),
24237}
24238
24239#[doc(hidden)]
24240pub mod backoff_mode {
24241 #[allow(unused_imports)]
24242 use super::*;
24243 #[derive(Clone, Debug, PartialEq)]
24244 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24245}
24246
24247impl BackoffMode {
24248 /// Gets the enum value.
24249 ///
24250 /// Returns `None` if the enum contains an unknown value deserialized from
24251 /// the string representation of enums.
24252 pub fn value(&self) -> std::option::Option<i32> {
24253 match self {
24254 Self::Unspecified => std::option::Option::Some(0),
24255 Self::Linear => std::option::Option::Some(1),
24256 Self::Exponential => std::option::Option::Some(2),
24257 Self::UnknownValue(u) => u.0.value(),
24258 }
24259 }
24260
24261 /// Gets the enum value as a string.
24262 ///
24263 /// Returns `None` if the enum contains an unknown value deserialized from
24264 /// the integer representation of enums.
24265 pub fn name(&self) -> std::option::Option<&str> {
24266 match self {
24267 Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
24268 Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
24269 Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
24270 Self::UnknownValue(u) => u.0.name(),
24271 }
24272 }
24273}
24274
24275impl std::default::Default for BackoffMode {
24276 fn default() -> Self {
24277 use std::convert::From;
24278 Self::from(0)
24279 }
24280}
24281
24282impl std::fmt::Display for BackoffMode {
24283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24284 wkt::internal::display_enum(f, self.name(), self.value())
24285 }
24286}
24287
24288impl std::convert::From<i32> for BackoffMode {
24289 fn from(value: i32) -> Self {
24290 match value {
24291 0 => Self::Unspecified,
24292 1 => Self::Linear,
24293 2 => Self::Exponential,
24294 _ => Self::UnknownValue(backoff_mode::UnknownValue(
24295 wkt::internal::UnknownEnumValue::Integer(value),
24296 )),
24297 }
24298 }
24299}
24300
24301impl std::convert::From<&str> for BackoffMode {
24302 fn from(value: &str) -> Self {
24303 use std::string::ToString;
24304 match value {
24305 "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
24306 "BACKOFF_MODE_LINEAR" => Self::Linear,
24307 "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
24308 _ => Self::UnknownValue(backoff_mode::UnknownValue(
24309 wkt::internal::UnknownEnumValue::String(value.to_string()),
24310 )),
24311 }
24312 }
24313}
24314
24315impl serde::ser::Serialize for BackoffMode {
24316 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24317 where
24318 S: serde::Serializer,
24319 {
24320 match self {
24321 Self::Unspecified => serializer.serialize_i32(0),
24322 Self::Linear => serializer.serialize_i32(1),
24323 Self::Exponential => serializer.serialize_i32(2),
24324 Self::UnknownValue(u) => u.0.serialize(serializer),
24325 }
24326 }
24327}
24328
24329impl<'de> serde::de::Deserialize<'de> for BackoffMode {
24330 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24331 where
24332 D: serde::Deserializer<'de>,
24333 {
24334 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
24335 ".google.cloud.deploy.v1.BackoffMode",
24336 ))
24337 }
24338}
24339
24340/// Valid state of a repair attempt.
24341///
24342/// # Working with unknown values
24343///
24344/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24345/// additional enum variants at any time. Adding new variants is not considered
24346/// a breaking change. Applications should write their code in anticipation of:
24347///
24348/// - New values appearing in future releases of the client library, **and**
24349/// - New values received dynamically, without application changes.
24350///
24351/// Please consult the [Working with enums] section in the user guide for some
24352/// guidelines.
24353///
24354/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24355#[derive(Clone, Debug, PartialEq)]
24356#[non_exhaustive]
24357pub enum RepairState {
24358 /// The `repair` has an unspecified state.
24359 Unspecified,
24360 /// The `repair` action has succeeded.
24361 Succeeded,
24362 /// The `repair` action was cancelled.
24363 Cancelled,
24364 /// The `repair` action has failed.
24365 Failed,
24366 /// The `repair` action is in progress.
24367 InProgress,
24368 /// The `repair` action is pending.
24369 Pending,
24370 /// The `repair` action was aborted.
24371 Aborted,
24372 /// If set, the enum was initialized with an unknown value.
24373 ///
24374 /// Applications can examine the value using [RepairState::value] or
24375 /// [RepairState::name].
24376 UnknownValue(repair_state::UnknownValue),
24377}
24378
24379#[doc(hidden)]
24380pub mod repair_state {
24381 #[allow(unused_imports)]
24382 use super::*;
24383 #[derive(Clone, Debug, PartialEq)]
24384 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24385}
24386
24387impl RepairState {
24388 /// Gets the enum value.
24389 ///
24390 /// Returns `None` if the enum contains an unknown value deserialized from
24391 /// the string representation of enums.
24392 pub fn value(&self) -> std::option::Option<i32> {
24393 match self {
24394 Self::Unspecified => std::option::Option::Some(0),
24395 Self::Succeeded => std::option::Option::Some(1),
24396 Self::Cancelled => std::option::Option::Some(2),
24397 Self::Failed => std::option::Option::Some(3),
24398 Self::InProgress => std::option::Option::Some(4),
24399 Self::Pending => std::option::Option::Some(5),
24400 Self::Aborted => std::option::Option::Some(7),
24401 Self::UnknownValue(u) => u.0.value(),
24402 }
24403 }
24404
24405 /// Gets the enum value as a string.
24406 ///
24407 /// Returns `None` if the enum contains an unknown value deserialized from
24408 /// the integer representation of enums.
24409 pub fn name(&self) -> std::option::Option<&str> {
24410 match self {
24411 Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
24412 Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
24413 Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
24414 Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
24415 Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
24416 Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
24417 Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
24418 Self::UnknownValue(u) => u.0.name(),
24419 }
24420 }
24421}
24422
24423impl std::default::Default for RepairState {
24424 fn default() -> Self {
24425 use std::convert::From;
24426 Self::from(0)
24427 }
24428}
24429
24430impl std::fmt::Display for RepairState {
24431 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24432 wkt::internal::display_enum(f, self.name(), self.value())
24433 }
24434}
24435
24436impl std::convert::From<i32> for RepairState {
24437 fn from(value: i32) -> Self {
24438 match value {
24439 0 => Self::Unspecified,
24440 1 => Self::Succeeded,
24441 2 => Self::Cancelled,
24442 3 => Self::Failed,
24443 4 => Self::InProgress,
24444 5 => Self::Pending,
24445 7 => Self::Aborted,
24446 _ => Self::UnknownValue(repair_state::UnknownValue(
24447 wkt::internal::UnknownEnumValue::Integer(value),
24448 )),
24449 }
24450 }
24451}
24452
24453impl std::convert::From<&str> for RepairState {
24454 fn from(value: &str) -> Self {
24455 use std::string::ToString;
24456 match value {
24457 "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
24458 "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
24459 "REPAIR_STATE_CANCELLED" => Self::Cancelled,
24460 "REPAIR_STATE_FAILED" => Self::Failed,
24461 "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
24462 "REPAIR_STATE_PENDING" => Self::Pending,
24463 "REPAIR_STATE_ABORTED" => Self::Aborted,
24464 _ => Self::UnknownValue(repair_state::UnknownValue(
24465 wkt::internal::UnknownEnumValue::String(value.to_string()),
24466 )),
24467 }
24468 }
24469}
24470
24471impl serde::ser::Serialize for RepairState {
24472 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24473 where
24474 S: serde::Serializer,
24475 {
24476 match self {
24477 Self::Unspecified => serializer.serialize_i32(0),
24478 Self::Succeeded => serializer.serialize_i32(1),
24479 Self::Cancelled => serializer.serialize_i32(2),
24480 Self::Failed => serializer.serialize_i32(3),
24481 Self::InProgress => serializer.serialize_i32(4),
24482 Self::Pending => serializer.serialize_i32(5),
24483 Self::Aborted => serializer.serialize_i32(7),
24484 Self::UnknownValue(u) => u.0.serialize(serializer),
24485 }
24486 }
24487}
24488
24489impl<'de> serde::de::Deserialize<'de> for RepairState {
24490 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24491 where
24492 D: serde::Deserializer<'de>,
24493 {
24494 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
24495 ".google.cloud.deploy.v1.RepairState",
24496 ))
24497 }
24498}
24499
24500/// Type indicates the type of the log entry and can be used as a filter.
24501///
24502/// # Working with unknown values
24503///
24504/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24505/// additional enum variants at any time. Adding new variants is not considered
24506/// a breaking change. Applications should write their code in anticipation of:
24507///
24508/// - New values appearing in future releases of the client library, **and**
24509/// - New values received dynamically, without application changes.
24510///
24511/// Please consult the [Working with enums] section in the user guide for some
24512/// guidelines.
24513///
24514/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24515#[derive(Clone, Debug, PartialEq)]
24516#[non_exhaustive]
24517pub enum Type {
24518 /// Type is unspecified.
24519 Unspecified,
24520 /// A Pub/Sub notification failed to be sent.
24521 PubsubNotificationFailure,
24522 /// Resource state changed.
24523 ResourceStateChange,
24524 /// A process aborted.
24525 ProcessAborted,
24526 /// Restriction check failed.
24527 RestrictionViolated,
24528 /// Resource deleted.
24529 ResourceDeleted,
24530 /// Rollout updated.
24531 RolloutUpdate,
24532 /// Deploy Policy evaluation.
24533 DeployPolicyEvaluation,
24534 /// Deprecated: This field is never used. Use release_render log type instead.
24535 #[deprecated]
24536 RenderStatuesChange,
24537 /// If set, the enum was initialized with an unknown value.
24538 ///
24539 /// Applications can examine the value using [Type::value] or
24540 /// [Type::name].
24541 UnknownValue(r#type::UnknownValue),
24542}
24543
24544#[doc(hidden)]
24545pub mod r#type {
24546 #[allow(unused_imports)]
24547 use super::*;
24548 #[derive(Clone, Debug, PartialEq)]
24549 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24550}
24551
24552impl Type {
24553 /// Gets the enum value.
24554 ///
24555 /// Returns `None` if the enum contains an unknown value deserialized from
24556 /// the string representation of enums.
24557 pub fn value(&self) -> std::option::Option<i32> {
24558 match self {
24559 Self::Unspecified => std::option::Option::Some(0),
24560 Self::PubsubNotificationFailure => std::option::Option::Some(1),
24561 Self::ResourceStateChange => std::option::Option::Some(3),
24562 Self::ProcessAborted => std::option::Option::Some(4),
24563 Self::RestrictionViolated => std::option::Option::Some(5),
24564 Self::ResourceDeleted => std::option::Option::Some(6),
24565 Self::RolloutUpdate => std::option::Option::Some(7),
24566 Self::DeployPolicyEvaluation => std::option::Option::Some(8),
24567 Self::RenderStatuesChange => std::option::Option::Some(2),
24568 Self::UnknownValue(u) => u.0.value(),
24569 }
24570 }
24571
24572 /// Gets the enum value as a string.
24573 ///
24574 /// Returns `None` if the enum contains an unknown value deserialized from
24575 /// the integer representation of enums.
24576 pub fn name(&self) -> std::option::Option<&str> {
24577 match self {
24578 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
24579 Self::PubsubNotificationFailure => {
24580 std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
24581 }
24582 Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
24583 Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
24584 Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
24585 Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
24586 Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
24587 Self::DeployPolicyEvaluation => {
24588 std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
24589 }
24590 Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
24591 Self::UnknownValue(u) => u.0.name(),
24592 }
24593 }
24594}
24595
24596impl std::default::Default for Type {
24597 fn default() -> Self {
24598 use std::convert::From;
24599 Self::from(0)
24600 }
24601}
24602
24603impl std::fmt::Display for Type {
24604 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24605 wkt::internal::display_enum(f, self.name(), self.value())
24606 }
24607}
24608
24609impl std::convert::From<i32> for Type {
24610 fn from(value: i32) -> Self {
24611 match value {
24612 0 => Self::Unspecified,
24613 1 => Self::PubsubNotificationFailure,
24614 2 => Self::RenderStatuesChange,
24615 3 => Self::ResourceStateChange,
24616 4 => Self::ProcessAborted,
24617 5 => Self::RestrictionViolated,
24618 6 => Self::ResourceDeleted,
24619 7 => Self::RolloutUpdate,
24620 8 => Self::DeployPolicyEvaluation,
24621 _ => Self::UnknownValue(r#type::UnknownValue(
24622 wkt::internal::UnknownEnumValue::Integer(value),
24623 )),
24624 }
24625 }
24626}
24627
24628impl std::convert::From<&str> for Type {
24629 fn from(value: &str) -> Self {
24630 use std::string::ToString;
24631 match value {
24632 "TYPE_UNSPECIFIED" => Self::Unspecified,
24633 "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
24634 "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
24635 "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
24636 "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
24637 "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
24638 "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
24639 "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
24640 "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
24641 _ => Self::UnknownValue(r#type::UnknownValue(
24642 wkt::internal::UnknownEnumValue::String(value.to_string()),
24643 )),
24644 }
24645 }
24646}
24647
24648impl serde::ser::Serialize for Type {
24649 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24650 where
24651 S: serde::Serializer,
24652 {
24653 match self {
24654 Self::Unspecified => serializer.serialize_i32(0),
24655 Self::PubsubNotificationFailure => serializer.serialize_i32(1),
24656 Self::ResourceStateChange => serializer.serialize_i32(3),
24657 Self::ProcessAborted => serializer.serialize_i32(4),
24658 Self::RestrictionViolated => serializer.serialize_i32(5),
24659 Self::ResourceDeleted => serializer.serialize_i32(6),
24660 Self::RolloutUpdate => serializer.serialize_i32(7),
24661 Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
24662 Self::RenderStatuesChange => serializer.serialize_i32(2),
24663 Self::UnknownValue(u) => u.0.serialize(serializer),
24664 }
24665 }
24666}
24667
24668impl<'de> serde::de::Deserialize<'de> for Type {
24669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24670 where
24671 D: serde::Deserializer<'de>,
24672 {
24673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
24674 ".google.cloud.deploy.v1.Type",
24675 ))
24676 }
24677}